feat: update to consensus-specs v1.7.0-alpha.3#6
feat: update to consensus-specs v1.7.0-alpha.3#6lodekeeper wants to merge 8 commits intounstablefrom
Conversation
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
| "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, |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
why was this updated? this specifically mentions .1
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
no need to add the spec reference, please align with existing gossip checks
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
we shouldn't update these spec references unless the function changes in the spec from .1 to .3
There was a problem hiding this comment.
Reverted all spec refs back to alpha.1 — these functions didn't change between .1 and .3.
specrefs/.ethspecify.yml
Outdated
| - PAYLOAD_STATUS_FULL#gloas | ||
| - PAYLOAD_STATUS_PENDING#gloas | ||
| - PTC_TIMELINESS_INDEX#gloas | ||
| # heze (not yet implemented in this branch) |
There was a problem hiding this comment.
this comments aren't needed, remove them, it obvious that we haven't implemented heze rgiht now
There was a problem hiding this comment.
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
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)
PayloadStatusenum:EMPTY=0, FULL=1, PENDING=2(wasPENDING=0, EMPTY=1, FULL=2)GloasVariantIndicestype to[number, number | undefined, number](fixed-length tuple)PayloadStatus.*enum valuesPayload data availability votes (spec PR ethereum/consensus-specs#4884)
payloadDataAvailabilityVotesBitArray map alongside existingpayloadTimelinessVotesDATA_AVAILABILITY_TIMELY_THRESHOLDconstant (=PTC_SIZE / 2 = 256)notifyPtcMessagesto accept 4 args:(blockRoot, ptcIndices, payloadPresent, blobDataAvailable)isPayloadDataAvailable()method to proto-arrayshouldExtendPayload: condition 1 =isPayloadTimely AND isPayloadDataAvailableRenamed ptcVotes → payloadTimelinessVotes (spec PR ethereum/consensus-specs#4930)
isPendingValidator helper (spec PRs ethereum/consensus-specs#4897, ethereum/consensus-specs#4916)
isPendingValidator()instate-transition/src/util/gloas.tsprocessDepositRequestbuilder routing to check!isPendingValidator(...)Attestation validation for index=1 (spec PR ethereum/consensus-specs#4918)
index=1requires FULL variant to exist (UNKNOWN_PAYLOAD_STATUSerror)Block gossip validation for parent payload (spec PR ethereum/consensus-specs#4923)
PARENT_PAYLOAD_UNKNOWN)hasExecutionPayload()method (linear scan, TODO for secondary index)Anchor block initialization fix
payloadTimelinessVotesandpayloadDataAvailabilityVotesto all-True for anchor block perget_forkchoice_storespecSpec test vector bug
builder_voluntary_exit__successtest: missingvoluntary_exit.ssz_snappyinput in alpha.3 vectors (spec PR Add voluntary exit tests for builders ethereum/consensus-specs#4908 bug)Spec PRs verified no-change needed
parent_block_rootto bid filtering key ethereum/consensus-specs#5001, Make wordings clearer for self build payload signature verification ethereum/consensus-specs#5002 (bid pool 3-tuple indexing — already implemented)SECONDS_PER_SLOTwithSLOT_DURATION_MSin specs/tests ethereum/consensus-specs#4926, Add helpers for simple config derivations ethereum/consensus-specs#4814, Extend by_root reqresp serve range to match by_range ethereum/consensus-specs#4950 (cross-fork — no Lodestar impact)proposer_preferencestopic ethereum/consensus-specs#4947 (Gloas — cosmetic/naming only, no code impact)Test Results
Known Issue
builder_voluntary_exit__successspec test vector (alpha.3) is missingvoluntary_exit.ssz_snappyinput file — skipped with comment. All invalid builder exit cases pass. Will report upstream.