Skip to content

Conversation

@shane-moore
Copy link

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

Changes per spec

  • process_attestations modified
    • is_attestation_same_slot added
    • get_attestation_participation_flag_indices modified

How This Works

The fast path for converting a slot's builder_pending_payment to a builder_pending_withdrawal triggers when the execution payload envelope for that slot is received and verified. In that case, we immediately queue the withdrawal corresponding to the CL block that carried the bid.

However, the envelope may never be released. As a fallback, we want to convert the builder_pending_payment if enough validators attested on time to the block of that slot.

What this PR Changes

Therefore, the builder_pending_payment has a weight field. During block processing, this PR modifies process_attestation to updates this weight only for same slot attestations, adding the attester’s balance once per validator. (Note that same slot means that the attestation.data.beacon_block_root corresponds to the state.get_block_root(data.slot)).

In a future PR

Later, during epoch processing, we'll check if the weight is above quorum and if so, convert the builder_pending_payment to a builder_pending_withdrawal, which will have a withdrawable_epoch.

@ethDreamer

@shane-moore shane-moore force-pushed the epbs-process-attestation branch from 2611ffc to def8e8e Compare October 24, 2025 14:27
@chong-he chong-he added the gloas label Oct 24, 2025
@shane-moore shane-moore force-pushed the epbs-process-attestation branch from def8e8e to 9d93170 Compare October 24, 2025 14:49
Copy link
Member

@eserilev eserilev left a comment

Choose a reason for hiding this comment

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

I haven't done a review against the spec yet, just some nits to hopefully make this PR a little bit easier to review

@@ -0,0 +1,322 @@
use super::*;
Copy link
Member

Choose a reason for hiding this comment

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

could we keep this stuff in process_operations? Makes the PR a bit easier to review if the diff here is minimized. The changes here are a bit sensitive and I don't want to miss anything

Copy link
Author

Choose a reason for hiding this comment

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

@eserilev, I feel you on that! moved the logic over to process_operations

let is_matching_payload = if is_attestation_same_slot(state, data)? {
// For same-slot attestations, data.index must be 0
if data.index != 0 {
// TODO(EIP7732): consider if we want to use a different error type, since this is more of an overloaded data index scenario as opposed to the InvalidCommitteeIndex previous error. It's more like `AttestationInvalid::BadOverloadedDataIndex`
Copy link
Member

Choose a reason for hiding this comment

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

I think it'd be nice to introduce a new error variant

Copy link
Author

Choose a reason for hiding this comment

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

for sure, I updated to the following but am happy to name it something else if another preference

  if data.index != 0 {
                return Err(Error::BadOverloadedDataIndex(data.index));
   }

if state.fork_name_unchecked().altair_enabled() {
initialize_progressive_balances_cache(state, spec)?;
altair_deneb::process_attestation(
altair_gloas::altair::process_attestation(
Copy link
Member

Choose a reason for hiding this comment

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

we'll write a test case for the gloas case in a subequent PR I assume?

Copy link
Author

Choose a reason for hiding this comment

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

yep! added a TODO to write some test cases for this. we'll be able to write tests for gloas features once we can properly produce gloas blocks and payloads.

// TODO(EIP-7732): add test cases to `consensus/state_processing/src/per_block_processing/tests.rs` to handle gloas.
// The tests will require being able to build gloas blocks, which currently fails due to errors as mentioned here.
// https://github.com/sigp/lighthouse/pull/8273

probably within the next couple weeks I would think. At that point, I'll go back and create tests for this and my other recent PR's, which also have TODO's for testing

@shane-moore shane-moore force-pushed the epbs-process-attestation branch from 2893a57 to d08908b Compare October 24, 2025 22:43
@shane-moore shane-moore force-pushed the epbs-process-attestation branch from d08908b to 72fec1d Compare October 25, 2025 12:22
@shane-moore shane-moore changed the title gloas modify process_attestations Gloas modify process_attestations Oct 27, 2025
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