Skip to content

fix(rpc-types-trace): add 0x prefix to storage keys and values in StructLog#3891

Merged
mattsse merged 1 commit intoalloy-rs:mainfrom
figtracer:fix/storage-0x-prefix
Apr 15, 2026
Merged

fix(rpc-types-trace): add 0x prefix to storage keys and values in StructLog#3891
mattsse merged 1 commit intoalloy-rs:mainfrom
figtracer:fix/storage-0x-prefix

Conversation

@figtracer
Copy link
Copy Markdown
Contributor

The opcode tracer spec requires storage keys and values to be 0x-prefixed bytes32.

serialize_string_storage_map_opt was explicitly stripping the 0x prefix with &key.as_str()[2..]. This produces bare hex like ef7498a2... instead of the spec-required 0xef7498a2....

Verified on a live reth archive node — storage now serializes as "0xef7498a2...": "0x00000000...".

…uctLog

The opcode tracer spec (ethereum/execution-apis#762) requires storage
keys and values to be 0x-prefixed bytes32. The serializer was
explicitly stripping the prefix with [2..].
@figtracer figtracer changed the title fix(rpc-types-trace): add 0x prefix to storage keys and values in StructLog fix(rpc-types-trace): add 0x prefix to storage keys and values in StructLog Apr 15, 2026
@figtracer figtracer marked this pull request as ready for review April 15, 2026 07:33
@github-project-automation github-project-automation bot moved this to Reviewed in Alloy Apr 15, 2026
@mattsse mattsse merged commit 9d16e3b into alloy-rs:main Apr 15, 2026
30 checks passed
@github-project-automation github-project-automation bot moved this from Reviewed to Done in Alloy Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants