refactor(log): replace withLogNameSuffix with actor-based AsyncLocalStorage#19959
Merged
PhilWindle merged 1 commit intonextfrom Jan 28, 2026
Merged
Conversation
03ba496 to
d7c36dd
Compare
Collaborator
Flakey Tests🤖 says: This CI run detected 2 tests that failed, but were tolerated due to a .test_patterns.yml entry. |
d7c36dd to
c81735f
Compare
spalladino
commented
Jan 28, 2026
| @@ -33,7 +33,7 @@ export async function startAnvil( | |||
| const anvil = createAnvil({ | |||
| anvilBinary, | |||
| host: '127.0.0.1', | |||
| port: opts.port ?? 8545, | |||
| port: opts.port ?? (process.env.ANVIL_PORT ? parseInt(process.env.ANVIL_PORT) : 8545), | |||
Contributor
Author
There was a problem hiding this comment.
Unrelated to this PR, but helps in running multiple e2e tests locally without docker isolation
spalladino
commented
Jan 28, 2026
Comment on lines
+10
to
+12
| if (!parseBooleanEnv(process.env.LOG_JSON)) { | ||
| overwriteLoggingStream(pretty(pinoPrettyOpts)); | ||
| } |
Contributor
Author
There was a problem hiding this comment.
Otherwise there was no way to have jest log as structured JSON
…torage
Introduces a new actor system using AsyncLocalStorage for cleaner log output.
Components created within a withBindings() callback automatically inherit the
actor label in their logs, displayed as a separate field rather than appended
to the module name.
Key changes:
- Add LoggerBindings type with actor and instanceId fields
- Create pino-logger-server.ts with withBindings/getBindings using AsyncLocalStorage
- Export server utilities from @aztec/foundation/log/server (not main export)
- Keep pino-logger.ts browser-safe (no node:async_hooks import)
- Update createLogger() to accept optional bindings
- Update pretty print format to show: {actor} {module} {instanceId} {msg}
- Deprecate withLogNameSuffix() in favor of withBindings()
- Add actor option to PXECreationOptions (deprecate useLogSuffix)
- Move module-level loggers to class instances in checkpoint_builder.ts
- Add instanceId to epoch-proving-job logger using job UUID
- Wrap main node/PXE creation with withBindings({ actor: 'MAIN' }) in e2e setup
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
c81735f to
7f82caf
Compare
PhilWindle
approved these changes
Jan 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AsyncLocalStoragefor cleaner log outputwithLoggerBindings()callback automatically inherit the labelsactor(egnode-0,prover-1), only set in tests, andinstanceId(egepoch-1)Expected log format:
validator-1 checkpoint-builder checkpoint-5 Building block 1...Old format:
checkpoint-builder:validator-1 Building block 1...API
🤖 Generated with Claude Code