[SharovBot] fix: add 0x prefix to structLogs storage keys/values in debug_traceCall#20647
[SharovBot] fix: add 0x prefix to structLogs storage keys/values in debug_traceCall#20647erigon-copilot[bot] wants to merge 2 commits intorelease/3.4from
Conversation
…ebug_traceCall
FormatLogs() was formatting storage map keys and values using
fmt.Sprintf("%x", ...) which produces bare hex without the 0x prefix.
The reference implementation returns storage keys/values with 0x prefix
(e.g. "0x2fa8c5322c..."), but Erigon was returning "2fa8c5322c...".
Fix: use common.Hash.Hex() which internally calls hexutil.Encode()
and properly produces 0x-prefixed hex strings for both keys and values.
This affects both rpc/ethapi/api.go (FormatLogs used by debug_traceCall,
debug_traceTransaction, etc.) and the duplicate copy in
execution/tracing/tracers/logger/logger.go.
Fixes mainnet-rpc-integ-tests-latest CI failure consistently seen across
all 10 recent release/3.4 commits (debug_traceCall/test_43.json).
Refs: https://github.com/erigontech/erigon/actions/runs/24602505567/job/71943405095
Co-authored-by: Giulio Rebuffo <[email protected]>
|
[SharovBot] The Failing job: https://github.com/erigontech/erigon/actions/runs/24602883581/job/71944385182 This suggests that the Before merging, the fix needs to either:
The |
[SharovBot]
Problem
mainnet-rpc-integ-tests-latestCI has been failing on every commit torelease/3.4branch (10/10 commits) due to a mismatch indebug_traceCall/test_43.json.The diff shows:
The reference implementation returns storage keys/values with
0xprefix, but Erigon was returning bare hex.Root Cause
FormatLogs()in bothrpc/ethapi/api.goandexecution/tracing/tracers/logger/logger.goformats storage map keys and values using:%xformat verb produces bare hex without the0xprefix.Fix
Use
common.Hash.Hex()which callshexutil.Encode()and produces properly0x-prefixed output:Impact
Affects
debug_traceCall,debug_traceTransaction,debug_traceBlock,debug_traceBlockByNumber, and any other endpoint that usesFormatLogs()for structLog output.Testing
go build ./rpc/... ./execution/tracing/...release/3.4commits confirms this is a regression, not flaky