feat(tracer): Implement txGasDimensionLogger and txGasDimensionByOpcode custom tracers#554
Merged
AnkushinDaniil merged 8 commits intomainfrom Jan 19, 2026
Merged
Conversation
e36e8df to
95e1792
Compare
txGasDimensionLogger and txGasDimensionByOpcode custom tracers
This was referenced Jan 14, 2026
feat(tracing): enable external tracer registration and VM inheritance
NethermindEth/nethermind#10228
Merged
Closed
There was a problem hiding this comment.
Pull request overview
This PR implements two custom tracers for multi-dimensional gas analysis in Arbitrum: txGasDimensionLogger for per-opcode gas dimension breakdown and txGasDimensionByOpcode for aggregated gas analysis by opcode type. These tracers enable detailed tracking of gas consumption across different resource dimensions (computation, storage access, storage growth, and history growth).
Changes:
- Added
TxGasDimensionLoggerTracerandTxGasDimensionByOpcodeTracerfor multi-dimensional gas tracking - Enhanced
IArbitrumTxTracerinterface with gas dimension capture methods - Modified
ArbitrumVirtualMachineto capture gas dimensions during bytecode execution - Updated
ArbitrumTransactionProcessorto track intrinsic and poster gas for dimension tracers
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Nethermind.Arbitrum/Tracing/TxGasDimensionLoggerTracer.cs | Implements per-opcode gas dimension logger tracer with detailed breakdown |
| src/Nethermind.Arbitrum/Tracing/TxGasDimensionByOpcodeTracer.cs | Implements aggregated gas dimension tracer grouped by opcode type |
| src/Nethermind.Arbitrum/Tracing/IArbitrumTxTracer.cs | Adds gas dimension tracing interface methods |
| src/Nethermind.Arbitrum/Properties/scripts/generate-system-test-config.sh | Fixes file paths for accounts and chainspec template |
| src/Nethermind.Arbitrum/Execution/ArbitrumTransactionProcessor.cs | Captures intrinsic and poster gas for dimension tracers |
| src/Nethermind.Arbitrum/Evm/ArbitrumVirtualMachine.cs | Implements gas dimension capture during bytecode execution |
| src/Nethermind.Arbitrum/ArbitrumPlugin.cs | Registers the new tracers with the factory |
| src/Nethermind.Arbitrum.Test/Tracing/TxGasDimensionLoggerTracerTests.cs | Unit tests for the dimension logger tracer |
| src/Nethermind.Arbitrum.Test/Tracing/TxGasDimensionByOpcodeTracerTests.cs | Unit tests for the by-opcode dimension tracer |
| src/Nethermind.Arbitrum.Test/Tracing/GasDimensionTracerIntegrationTests.cs | Integration tests for both tracers |
| src/Nethermind.Arbitrum.Test/Tracing/GasDimensionSerializationTests.cs | Tests for JSON serialization of gas dimension data |
| src/Nethermind | Submodule update to support new functionality |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
wurdum
approved these changes
Jan 15, 2026
src/Nethermind.Arbitrum.Test/Tracing/GasDimensionSerializationTests.cs
Outdated
Show resolved
Hide resolved
src/Nethermind.Arbitrum.Test/Tracing/GasDimensionSerializationTests.cs
Outdated
Show resolved
Hide resolved
src/Nethermind.Arbitrum.Test/Tracing/TxGasDimensionByOpcodeTracerTests.cs
Outdated
Show resolved
Hide resolved
src/Nethermind.Arbitrum.Test/Tracing/TxGasDimensionLoggerTracerTests.cs
Outdated
Show resolved
Hide resolved
…ode tracers Add Arbitrum-specific gas dimension tracers matching Nitro's implementation: - txGasDimensionLogger: Per-opcode gas dimension breakdown (pc, op, depth, cost, cpu, rw, growth, hist) - txGasDimensionByOpcode: Aggregated gas dimensions by opcode type Implementation details: - Extend IArbitrumTxTracer with gas dimension capture interface - Add RunByteCodeWithGasDimensionCapture to ArbitrumVirtualMachine for before/after MultiGas snapshots - Capture intrinsic gas and poster gas in ArbitrumTransactionProcessor - Register tracers in ArbitrumPlugin initialization - Fix tracer unwrapping to use GetTracer<T>() for proper wrapper handling
PR #550 introduced naming mismatches between the script defaults and actual file names: - Template path: chainspec.template → system-test-chainspec.template - Accounts default: default.json → defaults.json These mismatches caused the script to fail when invoked via `make generate-system-test-config` or directly.
c87705b to
895d040
Compare
wurdum
reviewed
Jan 19, 2026
Contributor
svlachakis
approved these changes
Jan 19, 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.
Fixes #556
Implement
txGasDimensionLoggerandtxGasDimensionByOpcodecustom tracers for multi-dimensional gas analysisDependencies