Skip to content

Conversation

@shane-moore
Copy link

@shane-moore shane-moore commented Oct 24, 2025

Changes per spec

  • Added:
    • process_payload_attestation
      • get_indexed_payload_attestation
      • is_valid_indexed_payload_attestation
    • get_ptc
      • compute_balance_weighted_selection
      • compute_balance_weighted_acceptance
  • Modified:
    • compute_proposer_indices
    • get_next_sync_committee_indices
    • process_operations

How This Works

CL blocks will now contain payload attestations that are collected from PTC members from the previous slot. The payload attestations indicate whether the payload envelope and blobs arrived by the PTC deadline. During block processing, we will now check over the payload attestations to ensure they're valid. Hence, this PR introduces process_payload_attestation to do just that.

Since a payload attestation to validate includes a Bitvector of size PTC_SIZE, we need to map each 1 bit to the ptc committee member from the previous slot in order to validate their signatures. This is accomplished via introducing or modifying the helpers listed above.

@ethDreamer

@shane-moore shane-moore changed the title gloas process payload attestation gloas process_payload_attestation Oct 24, 2025
@shane-moore shane-moore changed the title gloas process_payload_attestation gloas process payload attestation Oct 24, 2025
@shane-moore shane-moore changed the title gloas process payload attestation gloas process_payload_attestation Oct 24, 2025
@shane-moore shane-moore changed the title gloas process_payload_attestation gloas add process_payload_attestation Oct 24, 2025
@eserilev eserilev added the gloas label Oct 24, 2025
@shane-moore shane-moore force-pushed the epbs-process-payload-attestation branch 2 times, most recently from ead409c to c13e42e Compare October 25, 2025 15:44
@shane-moore shane-moore changed the title gloas add process_payload_attestation Gloas add process_payload_attestation Oct 27, 2025
iteration: usize,
spec: &ChainSpec,
) -> Result<bool, Error> {
let effective_balance = self.get_effective_balance(index)?;
Copy link
Member

Choose a reason for hiding this comment

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

Since this is called in a loop, I wonder if it would be worth while to get the effective balance from the epoch cache rather than fetching it each time? To do that, you'd have to ensure the epoch cache is initialized. You could look into this or you could leave a TODO here for later.

Copy link
Author

@shane-moore shane-moore Nov 3, 2025

Choose a reason for hiding this comment

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

Analysis:
The epoch cache is a singleton per each BeaconState instance. It gets initialized anytime we have a state transition as to ensure we're always getting fresh validator balances. A few places it's initialized:

  • start of every per block processing
  • start of every per epoch processing
  • build_all_caches when loading state from disk
  • during block production's produce_partial_beacon_block

compute_balance_weighted_acceptance is nested in compute_balance_weighted_selection, which will be called post-gloas by:

  • compute_proposer_indices (11 call sites)
  • get_next_sync_committee_indices (4 call sites)
  • get_ptc (1 so far)

since cargo nextest run isn't applicable to gloas yet, we can't simply try to use epoch cache to get validator balances during compute_balance_weighted_acceptance and see what fails, so I think a TODO is the right approach for now. I'm open to other ideas as well. From investigating a few call sites of compute_proposer_indices, it seems there's a few places we'd need to initialize the epoch cache for this optimization to work.

add todo in fab18e7. lmk if is all good!

Copy link
Member

Choose a reason for hiding this comment

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

looks good to me!

@ethDreamer
Copy link
Member

you may need to rebase this against the latest gloas-envelope-processing branch @shane-moore

@shane-moore shane-moore force-pushed the epbs-process-payload-attestation branch from fab18e7 to 7573ba9 Compare November 6, 2025 23:28
@shane-moore
Copy link
Author

@ethDreamer, rebased! should be all set

@shane-moore shane-moore force-pushed the epbs-process-payload-attestation branch from 7573ba9 to 6f8f6fc Compare November 7, 2025 21:12
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.

3 participants