Skip to content

Various checkpoint sync centric fixes - #661

Open
Subhasish-Behera wants to merge 12 commits into
grandinetech:epbs-devnet-0from
Subhasish-Behera:Subh/sync_fix
Open

Various checkpoint sync centric fixes#661
Subhasish-Behera wants to merge 12 commits into
grandinetech:epbs-devnet-0from
Subhasish-Behera:Subh/sync_fix

Conversation

@Subhasish-Behera

Copy link
Copy Markdown

No description provided.

…icate the purpose

- Rename supports_empty_variant -> block_uses_empty_full_variant
- Use .is_some_and() instead of .map().unwrap_or(false)
- Remove voted_block_phase_and_slot intermediate variable

after effects of ethereum/consensus-specs#4918

(though the code and analysis was in right direct and more accurate.
these changes woudnt just stop here. it will then further be complicatated
by maintainging applied vs intent of vote and also would introduce a new pattern
of of delay based request mechanisms to be handled at forkchoice layer
instead of just newtork/rpc i.e let the attestation impact forkchoice still
request envelopes through by root requests. so this PR was intoduced to
simplify)

- Simplify old vote subtraction (envelope guaranteed by delay-until-envelope)
- Clean up vote weight comments
… p2p rule)

When an attestation has index=1 (payload_present) but the execution payload
envelope hasn't been seen locally, delay the attestation, request the
envelope by root and then retry
Add PersistExecutionPayloadEnvelopesTask spawn on finalization,
prune_delayed_until_envelope() call in finalization pruning,
and the prune method itself.
Validate that envelope range requests don't ask for slots before
MIN_EPOCHS_FOR_BLOCK_REQUESTS. Follows same pattern as blob and
data column range handlers.

spec ref: ethereum/consensus-specs@171caac
Anchor state is always pre-execution (block_state). If checks
are required do that in checkpoint_sync.rs.
…t_node_full_for_block

- Finalized pre-Gloas parents return FULL (payload intrinsic to block).
  Gloas finalized parents fall through to bid comparison.
- Genesis/default block_hash is zero — no envelope concept, return false.
- validate_block: remove parent_is_finalized guard from
  DelayUntilParentEnvelope. Finalized parents are now correctly handled
  by is_parent_node_full_for_block (phase-aware), so the extra finalized
  check is redundant and was skipping the delay for Gloas finalized
  parents that genuinely lack an envelope.

- insert_payload: refactor to a if else pattern.
  Unfinalized FULL placeholders are filled as before. Finalized blocks
  (checkpoint-sync anchors and already-finalized Gloas blocks) now also
  accept envelope state via finalized_indices lookup instead of bailing.

- insert_blocks: add !parent_is_finalized guard before
  extend_empty_segment. Finalized parents have no unfinalized segment to
  extend. Route finalized parents through the
  FULL/else path where a new segment is created rooted at the finalized
  checkpoint.
- Use phase_at_slot on the block itself instead of self.phase()
- Check unfinalized FULL location first, then finalized blocks via
  finalized_indices. Finalized Gloas blocks (e.g. checkpoint sync
  anchor) must check execution_payload_state.
Use P::SlotsPerEpoch::U64 instead of self.store_config.max_empty_slots.
Proper fix requires adapting max_empty_slots to work with
minimal preset as well as with CLI(--max-empty-slots).
previous code was at default 32
Forward sync uses saturating_sub(1) so the envelope range starts one
slot earlier to cover the anchor block's payload envelope.

plus boundary cases of requests
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.

1 participant