Skip to content

5067 compliance - #10601

Closed
tbenr wants to merge 3 commits into
Consensys-Incorporated:masterfrom
tbenr:5067compliance
Closed

5067 compliance#10601
tbenr wants to merge 3 commits into
Consensys-Incorporated:masterfrom
tbenr:5067compliance

Conversation

@tbenr

@tbenr tbenr commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

https://github.com/ethereum/consensus-specs/blob/f6d34a1c9a2c7e3fba8a267395050c68e152ec9f/tests/core/pyspec/eth_consensus_specs/test/helpers/genesis.py#L213

with additional tests

Let's follow ethereum/consensus-specs#5149 in this pr

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

Note

Medium Risk
Changes Gloas genesis execution state initialization, which can affect first post-genesis block/fork-choice behavior; coverage is improved with new targeted tests but any mismatch could impact network startup behavior for Gloas.

Overview
Adjusts Gloas genesis initialization so latestBlockHash remains 0x00…00 (treating genesis as having an EMPTY execution parent) while the genesis latestExecutionPayloadBid.blockHash is set to the Eth1 block hash.

Adds/extends Gloas-focused tests to lock in genesis semantics across genesis generation, block processing (processParentExecutionPayload not updating latestBlockHash at genesis), fork choice parent payload status when the parent’s bid blockHash is zero, and withdrawals processing not advancing indices at genesis.

Reviewed by Cursor Bugbot for commit 3e53a8f. Bugbot is set up for automated code reviews on this repo. Configure here.

Bytes32.ZERO,
Bytes32.ZERO,
Bytes32.ZERO,
eth1BlockHash,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Genesis detection broken in block processor after bid change

High Severity

Changing the genesis bid's blockHash from Bytes32.ZERO to eth1BlockHash breaks the isGenesisBlock check in BlockProcessorGloas.processParentExecutionPayload (line 141), which still uses parentBid.getBlockHash().equals(Bytes32.ZERO). After this change, that check evaluates to false at genesis. The sibling check in WithdrawalsHelpersGloas correctly uses stateGloas.getLatestBlockHash() instead. The new test masks this by constructing a parentBid with blockHash = Bytes32.ZERO, which no longer reflects the actual genesis state.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e3c30cc. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 3e53a8f. Configure here.

throws BlockProcessingException {
final ExecutionPayloadBid parentBid =
dataStructureUtil.randomExecutionPayloadBid(
UInt64.ZERO, UInt64.ZERO, Bytes32.ZERO, dataStructureUtil.randomBytes32());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test uses wrong genesis bid blockHash, exercises wrong path

Medium Severity

The test creates a parentBid with blockHash = Bytes32.ZERO, but the genesis generator now sets blockHash = eth1BlockHash (non-zero). This causes the test to exercise the isGenesisBlock path in processParentExecutionPayload (via parentBid.getBlockHash().equals(Bytes32.ZERO)), which is not the path that actually executes for genesis blocks in production. In reality, isGenesisBlock would be false and the isParentBlockEmpty path would handle the genesis case instead. The test passes but doesn't validate the actual production code path, masking potential regressions in the isParentBlockEmpty logic.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3e53a8f. Configure here.

@tbenr tbenr added the blocked by another PR/issue 💔 This issue or pull request is blocked by another label Apr 23, 2026
@StefanBratanov

Copy link
Copy Markdown
Contributor

Closing this, will implement ethereum/consensus-specs#5172

@github-actions github-actions Bot locked and limited conversation to collaborators Apr 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

blocked by another PR/issue 💔 This issue or pull request is blocked by another

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants