Skip to content

Conversation

@Subhasish-Behera
Copy link

@Subhasish-Behera Subhasish-Behera commented Dec 1, 2025

Major changes:
The whole logic is based on the idea that it doesn't matter how you reach the segment-level identifiers. i.e though ePBS introduces a separate envelope object, but the same segment structure can be followed. So the difference between a envelope(full block)/ empty block is which state is read from that block. One of the ways to do that is by following the existing pattern of keeping a chunk of the Store fields inside Chainlink

  1. ChainLink dual statefield
  block_state: Option<Arc<BeaconState<P>>>,           // Pre-execution (after beacon block STF)
  execution_payload_state: Option<Arc<BeaconState<P>>>, // Post-execution (after payload STF)

The changed structure of empty/full block pretty much behave as siblings if it is looked from view of part of forkchoice calculation which depends on reading parent information.

  • with epbs, to get correct forchoice results, its important to know both which variant the block itself is + which block will it be effecting(for eg: not just the insertion of envelope/empty block have a type but also what it is inserted into has a type i.e the parent block can be full as well as empty)
    so the the most common structure that is going to happen is:
 Segment 0:                ──► [Parent X]
                                │
                                ├──► Segment 1: [Empty A] ──► [Empty B]
                                │                  ▲
                                │                  │
                                │    unfinalized_locations_empty["A"] = (seg:1, pos:0)
                                │
                                └──► Segment 2: [Full A]
                                                 ▲
                                                 │
                                     unfinalized_locations_full["A"] = (seg:2, pos:0)
  • both weight propagation purposes as well as the insertion purpose of full/empty block of arrival, the choice of introducing dual maps is much easier than differentiation at unfinalized_block level or using chain_link fields.

  • the key currently for both the map is block_root. A previous approach was made to keep unfinalized_locations_full maps key as execution_hash and unfinalized_locations_empty through block_root. But there was significant overhead in terms of number of conversion calla/reverse lookup for hash to root and viceversa. plus as only one variant of full/empty per blockroot can reach till forkchoice, there is ideally no problem with having the same keys.

  • a way to move forward with the changes is to look at in which scenarios(insertion into segment, calculation supporting vote, tiebraker , weight propagtion/childern filter/setting ForkChoicePayloadStatus) empty vs full is preferred across spec and current code.

Implement fork choice support for ePBS in Gloas fork with separate
tracking of empty (bid-only) and full (payload) block variants.

- Dual location maps (unfinalized_locations_empty, unfinalized_locations_full)
  both keyed by block root
- Variant-aware attestation balance propagation
- ePBS head selection and validation
- Added apply_execution_payload_envelope to store.rs
- Added accept_execution_payload_envelope to mutator.rs
- Enabled gloas fork choice mainnet spec tests
…ization

Add cached fields to Segment struct:
- parent_location: cached parent segment location
- parent_root: H256 - parent block root
- first_block_root: H256 - first block in segment

These caches reduce repeated lookups in fork choice hot paths like
find_segment_by_block_root and get_ancestor. Cache set on new segment
creation when parent is known.

also invalidate cached parent_location after segment removal
(wip): working on a alternative to get the changes out of struct
avoid recalcuation. use sement structures set parent cachign during
insertion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants