Skip to content

fix: keep requestsHash in Block.toRpc - #692

Open
gomesalexandre wants to merge 1 commit into
wevm:mainfrom
gomesalexandre:fix_block_requests_hash
Open

gomesalexandre wants to merge 1 commit into
wevm:mainfrom
gomesalexandre:fix_block_requests_hash

Conversation

@gomesalexandre

Copy link
Copy Markdown
Contributor

Every block since Prague carries the EIP-7685 requestsHash, and execution-apis lists it on Block (src/schemas/block.yaml: requestsHash, "EIP-7685 requests hash", hash32). Block.Block didn't have it. Block.fromRpc only kept it through its ...block spread, without a type. Block.toRpc builds the RPC object field by field, so Block.toRpc(Block.fromRpc(block)) dropped it from every mainnet block. The zod Block schemas are z.objects, so they stripped it on decode and on encode.

This adds requestsHash?: Hex.Hex | undefined to Block.Block, passes it through in Block.toRpc, and adds requestsHash: z.optional(z_Hex.Hex) to the zod block fields. It's optional, so pre-Prague blocks and chains that don't send it are unaffected.

Live latest blocks from publicnode, comparing the requestsHash in the RPC response with the one after Block.toRpc(Block.fromRpc(block)):

chain rpc before after
Ethereum 0x06e55d35…3df59 undefined 0x06e55d35…3df59
Base 0xe3b0c442…b855 undefined 0xe3b0c442…b855

The new core test round-trips the header of mainnet block 26428234, trimmed to one transaction and one withdrawal. It fails on main and passes with this change. The zod fixture now includes the field, and there's a type test for both schema directions.

I left out blockAccessListHash (EIP-7928) and slotNumber (EIP-7843). They're in the same schema but not live on mainnet yet, and slotNumber would need a bigint conversion. I'm happy to add them here if you'd rather have all three.

🤖 Generated with Claude Code

Every block since Prague carries the EIP-7685 `requestsHash`, and
execution-apis lists it on `Block`. `Block.fromRpc` kept it only through
its untyped spread, and `Block.toRpc` builds the RPC object field by
field, so `toRpc(fromRpc(block))` dropped it from every mainnet block. The
zod `Block` schemas stripped it too. Adds it to the type, `toRpc` and the
schemas.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 16, 2026

Copy link
Copy Markdown

@gomesalexandre is attempting to deploy a commit to the Wevm Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant