Repository navigation
fix(internal/ethapi): skip CALLCODE transfers and release reverted log indices #35248 #35841 - #2911
Merged
gzliudan merged 1 commit intoNov 2, 2026
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
gzliudan
requested review from
AnilChinchawale,
anunay-xin,
benjamin202410,
liam-lai and
wanwiset25
October 27, 2026 11:52
gzliudan
force-pushed
the
fix-simulate-tracer-upstream-parity
branch
2 times, most recently
from
October 28, 2026 23:11
396c2d2 to
7a54d4c
Compare
wanwiset25
approved these changes
Oct 29, 2026
gzliudan
force-pushed
the
fix-simulate-tracer-upstream-parity
branch
2 times, most recently
from
October 30, 2026 07:39
c1c7a60 to
dd1d93e
Compare
anunay-xin
approved these changes
Oct 30, 2026
gzliudan
force-pushed
the
fix-simulate-tracer-upstream-parity
branch
from
October 30, 2026 10:29
dd1d93e to
eabf45c
Compare
…g indices ethereum#35248 ethereum#35841 The simulate log tracer synthesized a transfer log for every call frame with a non-zero value, but CALLCODE moves no value: the frame was reported as a transfer that never happened. The tracer also gave an index to every log, including the ones it later dropped because their call or an inner call frame failed, so the returned logIndex did not match the numbering in receipts. Skip the synthesis for CALLCODE next to DELEGATECALL (geth ethereum#35248) and release the indices of dropped logs (geth ethereum#35841). The dropped logs are always the most recent ones, so the counter is rolled back for a reverted inner frame and for a reverted top-level call. TestSimulateV1LogIndex pins the index continuity across failed calls, with a reverter that emits two logs so a rollback of a single index cannot pass. The tracer tests pin the CALLCODE skip against a plain CALL to a different recipient, and the reverted frame in the index test holds a synthesized transfer plus a plain log, so both the rollback count and the transfer's slot are covered. Ref: ethereum#35248 Ref: ethereum#35841
gzliudan
force-pushed
the
fix-simulate-tracer-upstream-parity
branch
from
November 1, 2026 09:06
eabf45c to
314915e
Compare
benjamin202410
approved these changes
Nov 2, 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
The
eth_simulateV1log tracer reports ether transfers as synthetic logs and numbers every log it creates. Two upstream fixes are missing in this tree:onEnterskipped DELEGATECALL only, but CALLCODE moves no value either, sotraceTransfersreported a transfer that never happened. Ported from go-ethereum internal/ethapi: skip transfer capture for callcode in log tracer ethereum/go-ethereum#35248.logIndexdid not match the numbering in receipts. Ported from go-ethereum internal/ethapi: number eth_simulateV1 logs like receipts ethereum/go-ethereum#35841.Both fixes live in
internal/ethapi/logtracer.goand are taken verbatim from upstream. execution-apis#881, which specifies thislogIndexrule, is merged.Changes
internal/ethapi/logtracer.go:onEnterskips CALLCODE next to DELEGATECALL;onExit/onEndrelease the indices of the logs they drop.internal/ethapi/api_test.go:TestSimulateV1LogIndex(end-to-end, index continuity across failed calls),TestTransferTracerSkipsCallCodeandTestTransferTracerReleasesRevertedIndexes(tracer level).Verification
make allclean;gofmt/goimportsclean.golangci-lint --new-from-rev=74abda0482 ./internal/ethapi/...: 0 issues.go test ./internal/ethapi/passes, including-race -count=2on the new and updated tests.TestTransferTracerSkipsCallCode(2 logs instead of 1);TestTransferTracerSkipsCallCode(recipient topic is the CALLCODE one);TestTransferTracerReleasesRevertedIndexes(index 3 instead of 1) andTestSimulateV1LogIndex/reverted_inner_frame(0x2instead of0x1);TestTransferTracerReleasesRevertedIndexes(index 2 instead of 1) for the inner frame andTestSimulateV1LogIndex(0x1instead of0x0) for the top-level call;TestSimulateV1LogIndex(all three affected sub-tests);TestTransferTracerReleasesRevertedIndexes(3 logs instead of 2).Related
Found while reviewing #2842 (EIP-7708). Its post-Amsterdam de-duplication turns the synthesis off (
traceTransfers && !IsAmsterdam), so the CALLCODE phantom only affected the pre-Amsterdam synthesis path; both defects predate that work.Ref: ethereum#35248
Ref: ethereum#35841