Conversation
WalkthroughAdds AltFeeTx fee-token bytecode collection and introduces system-call tracing hooks; wires OnSystemCallStart/OnSystemCallEnd through the mux, native tracer, and logger, and wraps two EVM token-gas operations with system-call tracing calls. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant TokenGas as core/token_gas
participant TracerMux as rollup/tracing/mux
participant SubTracer as eth/tracers/native/call
participant Logger as StructLogger
participant EVM as EVM operation
Note over TokenGas,TracerMux: Before EVM token system call
TokenGas->>TracerMux: OnSystemCallStartV2(env)
TracerMux->>SubTracer: OnSystemCallStartV2(env) %% new/changed
TracerMux->>Logger: OnSystemCallStart(env)
Note over SubTracer: sets skip = true
TokenGas->>EVM: perform balanceOf / transfer (system call)
EVM-->>TokenGas: result
TokenGas->>TracerMux: OnSystemCallEnd()
TracerMux->>SubTracer: OnSystemCallEnd()
TracerMux->>Logger: OnSystemCallEnd()
Note over SubTracer: sets skip = false
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (1)📓 Common learnings⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (2)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.5.0)Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
rollup/tracing/tracing.go (2)
379-381: Consider expanding the comment to explain L2TokenRegistryAddress collection.The comment explains why token contract bytecode needs manual collection, but it would be helpful to also mention why the L2 token registry bytecode is collected.
Apply this diff to improve the comment:
- // For AltFeeTx, manually collect token contract bytecode - // since direct storage slot operations don't trigger EVM execution + // For AltFeeTx, manually collect token contract and L2 token registry bytecode + // since direct storage slot operations don't trigger EVM execution that would + // normally capture these contracts via tracing
385-404: Consider adding debug logging for observability.While the implementation is correct, adding debug logging when bytecode is collected would improve observability and help with troubleshooting.
Consider adding logging after successful collection:
collectBytecode := func(addr common.Address) { code := statedb.GetCode(addr) keccakCodeHash := statedb.GetKeccakCodeHash(addr) poseidonCodeHash := statedb.GetPoseidonCodeHash(addr) codeSize := statedb.GetCodeSize(addr) if poseidonCodeHash != (common.Hash{}) { if _, exists := env.Codes[poseidonCodeHash]; !exists { env.Codes[poseidonCodeHash] = logger.CodeInfo{ CodeSize: codeSize, KeccakCodeHash: keccakCodeHash, PoseidonCodeHash: poseidonCodeHash, Code: code, } + log.Debug("Collected bytecode for AltFeeTx token-related contract", + "address", addr.Hex(), "codeSize", codeSize, "txHash", tx.Hash().Hex()) } } }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
rollup/tracing/tracing.go(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
rollup/tracing/tracing.go (5)
core/types/transaction.go (1)
AltFeeTxType(58-58)rollup/fees/token_info.go (1)
GetTokenInfo(90-92)eth/tracers/logger/logger.go (1)
CodeInfo(205-210)crypto/codehash/codehash.go (2)
KeccakCodeHash(16-18)PoseidonCodeHash(12-14)rollup/rcfg/config.go (1)
L2TokenRegistryAddress(45-45)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Analyze (go)
🔇 Additional comments (1)
rollup/tracing/tracing.go (1)
379-405: Method signatures verified—no issues found.All type checks are correct:
tx.Type()returnsuint8andtypes.AltFeeTxTypeis0x7F(uint8 constant)tx.FeeTokenID()correctly returnsuint16, matching the parameter type expected byfees.GetTokenInfo(state StateDB, tokenID uint16)The implementation is sound.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.