Skip to content

Comments

Gloas payload envelope processing [WIP]#8806

Open
eserilev wants to merge 16 commits intosigp:unstablefrom
eserilev:gloas-payload-processing
Open

Gloas payload envelope processing [WIP]#8806
eserilev wants to merge 16 commits intosigp:unstablefrom
eserilev:gloas-payload-processing

Conversation

@eserilev
Copy link
Member

@eserilev eserilev commented Feb 12, 2026

Implement payload envelope gossip verification and processing

@jimmygchen jimmygchen mentioned this pull request Feb 15, 2026
24 tasks
@jimmygchen jimmygchen changed the title Gloas payload processing [WIP] Gloas payload envelope processing [WIP] Feb 15, 2026
Comment on lines +163 to +167
// TODO(gloas) are these other logs important?
root = ?beacon_block_root,
// graffiti = block.body().graffiti().as_utf8_lossy(),
// proposer_index = block.proposer_index(),
// slot = %block.slot(),
Copy link
Member Author

Choose a reason for hiding this comment

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

we wont have this info post gloas, I'd like to delete these fields if thats okay

Copy link
Member

Choose a reason for hiding this comment

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

slot might be useful too, otherwise i agree

Comment on lines +209 to +213
// TODO(gloas) are these other logs important?
root = ?beacon_block_root,
// graffiti = block.body().graffiti().as_utf8_lossy(),
// proposer_index = block.proposer_index(),
// slot = %block.slot(),
Copy link
Member Author

Choose a reason for hiding this comment

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

would like to delete these as well

@eserilev eserilev marked this pull request as ready for review February 23, 2026 00:08
@eserilev eserilev requested a review from jxs as a code owner February 23, 2026 00:08
@eserilev eserilev added the ready-for-review The code is ready for review label Feb 23, 2026
@eserilev
Copy link
Member Author

This one should be ready for a first pass

@eserilev
Copy link
Member Author

eserilev commented Feb 23, 2026

I tried looking at removing the beacon chain dependency from the gossip path. It didn't seem to make unit testing that much easier, the dependency on CachedHead adds complexity. I think we can take a look at making these codepaths more unit-testable later on down the line

@mergify
Copy link

mergify bot commented Feb 23, 2026

Some required checks have failed. Could you please take a look @eserilev? 🙏

@mergify mergify bot added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Feb 23, 2026
@pawanjay176
Copy link
Member

I'll take a look today

@pawanjay176 pawanjay176 self-assigned this Feb 23, 2026
Copy link
Member

@pawanjay176 pawanjay176 left a comment

Choose a reason for hiding this comment

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

Some early comments, still going through post gossip verification

block_root: &Hash256,
) -> Result<Option<SignedBeaconBlock<T::EthSpec>>, Error> {
match self.store.try_get_full_block(block_root)? {
Some(DatabaseBlock::Full(block)) => Ok(Some(block)),
Copy link
Member

@pawanjay176 pawanjay176 Feb 23, 2026

Choose a reason for hiding this comment

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

We could potentially look up a block status table here to figure out if we have processed the block and it turned out to be invalid

let beacon_block_root = envelope.beacon_block_root;

// Check that we've seen the beacon block for this envelope and that it passes validation.
// TODO(EIP-7732): We might need some type of status table in order to differentiate between:
Copy link
Member

Choose a reason for hiding this comment

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

This is a great point in favour of having some sort of a block status table because invalid blocks aren't kept in fork choice.
So for a payload referencing an invalid block, we have no way of knowing if we have already processed and rejected the block without keeping that info around.

});
};

let latest_finalized_slot = fork_choice_read_lock
Copy link
Member

Choose a reason for hiding this comment

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

Should we be using the canonical_head for this like we do for blocks? Also, we should probably get this post making sure the block is available in fork choice


// Verify the envelope signature.
//
// For self-build envelopes, we can use the proposer cache for the fork and the
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// For self-build envelopes, we can use the proposer cache for the fork and the
// For self-built envelopes, we can use the proposer cache for the fork and the

// 2. Blocks we've seen that are invalid (REJECT).
//
// Presently these two cases are conflated.
let fork_choice_read_lock = chain.canonical_head.fork_choice_read_lock();
Copy link
Member

Choose a reason for hiding this comment

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

If we have a block_processing_table, we could have a Processed(Bid, bool) state that is only entered post adding to fork choice. That way, we could potentially need only a single call to make sure the block is valid and to do all consequent checks with the bid

%beacon_block_root,
"Proposer shuffling cache miss for envelope verification"
);
let snapshot = load_snapshot(envelope_ref, chain)?;
Copy link
Member

Choose a reason for hiding this comment

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

just noting that load_snapshot again acquires the fork_choice lock which it uses to basically get what we have as proto_block in the current scope. Maybe we can pass an optional proto_block to the function as well?

Copy link
Member

Choose a reason for hiding this comment

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

actually this is just a read_lock so maybe not that big a deal

Ok((snapshot.state_root, snapshot.pre_state))
},
)?;
let fork = proposer.fork;
Copy link
Member

Choose a reason for hiding this comment

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

Just wondering if the fork used here v/s in the non self build case below would be identical. We had issues in the past wrt the state not being advanced to the new fork and that causing signature verification errors.

I think this is safe, but would be good if @michaelsproul can confirm

Copy link
Member

Choose a reason for hiding this comment

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

maybe we can name this file envelope_verification given that we do more than gossip verification here?

match notify_execution_layer {
NotifyExecutionLayer::No if chain.config.optimistic_finalized_sync => {
let new_payload_request = Self::build_new_payload_request(&envelope, &block)?;
if let Err(e) = new_payload_request.perform_optimistic_sync_verifications() {
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 we should add a todo here to reassess if optimistic syncing works similarly to pre-gloas.

Comment on lines +163 to +167
// TODO(gloas) are these other logs important?
root = ?beacon_block_root,
// graffiti = block.body().graffiti().as_utf8_lossy(),
// proposer_index = block.proposer_index(),
// slot = %block.slot(),
Copy link
Member

Choose a reason for hiding this comment

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

slot might be useful too, otherwise i agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gloas waiting-on-author The reviewer has suggested changes and awaits thier implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants