fix: harden range sync hashBlocks() - #9686
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the hashBlocks utility to uniquely identify a batch attempt by hashing both blocks and payload envelopes (including their signatures) into a single fixed-size buffer using SHA-256, and adds corresponding unit tests. The review feedback suggests two key improvements: replacing Buffer.allocUnsafe with Buffer.alloc to guarantee deterministic hashing and prevent potential uninitialized memory leaks, and passing ChainForkConfig to dynamically resolve fork-specific SSZ types instead of hardcoding ssz.gloas.ExecutionPayloadEnvelope.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Performance Report🚀🚀 Significant benchmark improvement detected
Full benchmark results
|
| for (const [, envelope] of envelopes) { | ||
| const signedEnvelope = envelope.getPayloadEnvelope(); |
There was a problem hiding this comment.
should the payload envelope hash be added to IPayloadInput? Instead of using cachePermanentRootStruct?
There was a problem hiding this comment.
we already have to compute signing root while verifying signature for all payload envelopes here
so using
cachePermanentRootStruct ensures we compute it onceit's not convenient to add a rootHex to
PayloadEnvelopeInput (of beacon-node) because computeSigningRoot() stays on state-transitionso it's different to IBlockInput
Motivation
Description
ExecutionPayloadEnveloperoots for cheaper attempt hashingpart of #9667
AI Assistance Disclosure