Skip to content

feat: update to consensus-specs v1.7.0-alpha.3#6

Open
lodekeeper wants to merge 8 commits intounstablefrom
feat/spec-alpha3-upgrade
Open

feat: update to consensus-specs v1.7.0-alpha.3#6
lodekeeper wants to merge 8 commits intounstablefrom
feat/spec-alpha3-upgrade

Conversation

@lodekeeper
Copy link
Owner

@lodekeeper lodekeeper commented Mar 14, 2026

Motivation

Update Lodestar to consensus-specs v1.7.0-alpha.3 from v1.7.0-alpha.2.

Reference PR: ChainSafe#8881 (alpha.2 update)

Changes

PayloadStatus enum reorder (spec PR ethereum/consensus-specs#4948)

  • Reordered PayloadStatus enum: EMPTY=0, FULL=1, PENDING=2 (was PENDING=0, EMPTY=1, FULL=2)
  • Updated GloasVariantIndices type to [number, number | undefined, number] (fixed-length tuple)
  • All variant array accesses now use explicit PayloadStatus.* enum values

Payload data availability votes (spec PR ethereum/consensus-specs#4884)

  • Added payloadDataAvailabilityVotes BitArray map alongside existing payloadTimelinessVotes
  • Added DATA_AVAILABILITY_TIMELY_THRESHOLD constant (= PTC_SIZE / 2 = 256)
  • Updated notifyPtcMessages to accept 4 args: (blockRoot, ptcIndices, payloadPresent, blobDataAvailable)
  • Added isPayloadDataAvailable() method to proto-array
  • Updated shouldExtendPayload: condition 1 = isPayloadTimely AND isPayloadDataAvailable

Renamed ptcVotes → payloadTimelinessVotes (spec PR ethereum/consensus-specs#4930)

  • Renamed the existing PTC vote tracking map to match spec naming

isPendingValidator helper (spec PRs ethereum/consensus-specs#4897, ethereum/consensus-specs#4916)

  • Added isPendingValidator() in state-transition/src/util/gloas.ts
  • Updated processDepositRequest builder routing to check !isPendingValidator(...)
  • Note: naive implementation without caching (TODO tracked for optimization)

Attestation validation for index=1 (spec PR ethereum/consensus-specs#4918)

  • Attestation with index=1 requires FULL variant to exist (UNKNOWN_PAYLOAD_STATUS error)

Block gossip validation for parent payload (spec PR ethereum/consensus-specs#4923)

  • IGNORE block if parent execution payload has not been seen (PARENT_PAYLOAD_UNKNOWN)
  • Added hasExecutionPayload() method (linear scan, TODO for secondary index)

Anchor block initialization fix

  • Initialize payloadTimelinessVotes and payloadDataAvailabilityVotes to all-True for anchor block per get_forkchoice_store spec

Spec test vector bug

Spec PRs verified no-change needed

Test Results

Known Issue

  • builder_voluntary_exit__success spec test vector (alpha.3) is missing voluntary_exit.ssz_snappy input file — skipped with comment. All invalid builder exit cases pass. Will report upstream.

Implements all Gloas changes from consensus-specs v1.7.0-alpha.3:

- Reorder PayloadStatus constants: EMPTY=0, FULL=1, PENDING=2 (ChainSafe#4948)
- Add payload_data_availability_vote to fork choice store (ChainSafe#4884)
- Add is_payload_data_available check to should_extend_payload (ChainSafe#4884)
- Rename ptc_vote to payload_timeliness_vote (ChainSafe#4930)
- Add is_pending_validator helper for deposit routing (ChainSafe#4897)
- Update process_deposit_request to check pending validators (ChainSafe#4916)
- Add attestation validation: index=1 requires known payload (ChainSafe#4918)
- Add IGNORE for blocks with unknown parent payload (ChainSafe#4923)
- Add hasExecutionPayload to fork choice for gossip validation
- Update spec version references to v1.7.0-alpha.3
- Update spec-tests-version.json to v1.7.0-alpha.3

Cross-fork changes verified:
- ChainSafe#5001 (parent_block_root bid filter): already implemented
- ChainSafe#4926 (SECONDS_PER_SLOT deprecation): already handled
- ChainSafe#4814 (config derivation helpers): spec-internal, no change needed
- ChainSafe#4950 (ByRoot serve range): already compliant
The builder_voluntary_exit__success test case in v1.7.0-alpha.3 is missing
the voluntary_exit.ssz_snappy input file. This is a bug in the spec test
generator — the test function doesn't yield the voluntary_exit input.

All other builder voluntary exit tests (invalid cases) correctly include
the input file.

See: ethereum/consensus-specs#4908
Remove config vars converted to computed functions in alpha.3:
- ATTESTATION_SUBNET_PREFIX_BITS → compute_attestation_subnet_prefix_bits()
- MIN_EPOCHS_FOR_BLOCK_REQUESTS → compute_min_epochs_for_block_requests()
- MAX_REQUEST_BLOB_SIDECARS → compute_max_request_blob_sidecars()
- MAX_REQUEST_BLOB_SIDECARS_ELECTRA → (fork-specific override)
- MAX_REQUEST_DATA_COLUMN_SIDECARS → compute_max_request_data_column_sidecars()
- SECONDS_PER_SLOT → removed (SLOT_DURATION_MS replaces it)

Update function hashes for spec body changes (compute_subscribed_subnet,
compute_time_at_slot). Add new heze fork entries auto-detected by ethspecify.
Add HEZE, EIP-7928, EIP-8025 fork epoch and version to ignored
remote config fields (not yet implemented in Lodestar).
Remove stale ATTESTATION_SUBNET_PREFIX_BITS ignore (no longer
a config variable in alpha.3).
- Initialize payloadTimelinessVotes and payloadDataAvailabilityVotes to
  all-True for anchor block per get_forkchoice_store spec
- Replace raw [0] variant accesses with explicit PayloadStatus.EMPTY
- Add TODO comments for isPendingValidator caching and
  hasExecutionPayload secondary index optimization
- Add heze fork exceptions to .ethspecify.yml (heze not yet
  implemented in this branch; scope is Gloas + cross-fork only)
- Add source search directives for Gloas functions:
  - is_payload_data_available#gloas → protoArray.ts
  - is_pending_validator#gloas → gloas.ts
- Add source search directives for computed-constant functions
  promoted to functions in alpha.3:
  - compute_attestation_subnet_prefix_bits#phase0 → params/index.ts
  - compute_max_request_blob_sidecars#deneb/electra → chainConfig
  - compute_max_request_data_column_sidecars#fulu → chainConfig
  - compute_min_epochs_for_block_requests#phase0 → chainConfig
Comment on lines +31 to +36
"EIP7928_FORK_EPOCH" as keyof ChainConfig,
"EIP7928_FORK_VERSION" as keyof ChainConfig,
"EIP8025_FORK_EPOCH" as keyof ChainConfig,
"EIP8025_FORK_VERSION" as keyof ChainConfig,
// Heze fork config
"HEZE_FORK_VERSION" as keyof ChainConfig,
Copy link

Choose a reason for hiding this comment

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

these should be removed

Copy link
Owner Author

Choose a reason for hiding this comment

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

Reverted — file is back to unstable. These were added during development to make the e2e test pass locally but shouldn't be part of this PR.

shouldSkip: (_testcase, name, _index) =>
name.includes("invalid_incorrect_proof") ||
// TODO GLOAS: Proposer boost specs have been changed retroactively in v1.7.0-alpha.1,
// TODO GLOAS: Proposer boost specs have been changed retroactively in v1.7.0-alpha.3,
Copy link

Choose a reason for hiding this comment

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

why was this updated? this specifically mentions .1

Copy link
Owner Author

Choose a reason for hiding this comment

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

Reverted back to .1 — the comment specifically describes the retroactive change in alpha.1, not alpha.3.

// [IGNORE] The block's parent execution payload (defined by bid.parent_block_hash) has been seen
// (via gossip or non-gossip sources) (a client MAY queue blocks for processing once the parent
// payload is retrieved).
// Spec: https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.3/specs/gloas/p2p-interface.md
Copy link

Choose a reason for hiding this comment

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

no need to add the spec reference, please align with existing gossip checks

Copy link
Owner Author

Choose a reason for hiding this comment

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

Removed the spec URL. Kept the inline [IGNORE] comment to match the pattern of other gossip checks.

/**
* Convert a flagged validator index back to a builder index.
* Spec: https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.1/specs/gloas/beacon-chain.md#new-convert_validator_index_to_builder_index
* Spec: https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.3/specs/gloas/beacon-chain.md#new-convert_validator_index_to_builder_index
Copy link

Choose a reason for hiding this comment

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

we shouldn't update these spec references unless the function changes in the spec from .1 to .3

Copy link
Owner Author

Choose a reason for hiding this comment

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

Reverted all spec refs back to alpha.1 — these functions didn't change between .1 and .3.

- PAYLOAD_STATUS_FULL#gloas
- PAYLOAD_STATUS_PENDING#gloas
- PTC_TIMELINESS_INDEX#gloas
# heze (not yet implemented in this branch)
Copy link

Choose a reason for hiding this comment

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

this comments aren't needed, remove them, it obvious that we haven't implemented heze rgiht now

Copy link
Owner Author

Choose a reason for hiding this comment

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

Removed all the "not yet implemented" comments. Entries speak for themselves.

- Revert config sync test changes (unnecessary ignores)
- Revert fork_choice comment back to .1 (comment refers to .1 retroactive change)
- Remove spec URL from block gossip validation (align with existing checks)
- Revert spec reference bumps in gloas.ts (functions unchanged from .1)
- Remove 'not yet implemented' comments from specrefs
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.

2 participants