Repository navigation
fix: keep requestsHash in Block.toRpc - #692
Open
gomesalexandre wants to merge 1 commit into
Open
gomesalexandre wants to merge 1 commit into
gomesalexandre wants to merge 1 commit into
Conversation
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>
|
@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
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.
Every block since Prague carries the EIP-7685
requestsHash, and execution-apis lists it onBlock(src/schemas/block.yaml:requestsHash, "EIP-7685 requests hash",hash32).Block.Blockdidn't have it.Block.fromRpconly kept it through its...blockspread, without a type.Block.toRpcbuilds the RPC object field by field, soBlock.toRpc(Block.fromRpc(block))dropped it from every mainnet block. The zodBlockschemas arez.objects, so they stripped it on decode and on encode.This adds
requestsHash?: Hex.Hex | undefinedtoBlock.Block, passes it through inBlock.toRpc, and addsrequestsHash: 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
latestblocks from publicnode, comparing therequestsHashin the RPC response with the one afterBlock.toRpc(Block.fromRpc(block)):0x06e55d35…3df59undefined0x06e55d35…3df590xe3b0c442…b855undefined0xe3b0c442…b855The new core test round-trips the header of mainnet block 26428234, trimmed to one transaction and one withdrawal. It fails on
mainand 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) andslotNumber(EIP-7843). They're in the same schema but not live on mainnet yet, andslotNumberwould need a bigint conversion. I'm happy to add them here if you'd rather have all three.🤖 Generated with Claude Code