Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sidecar inclusion updates #4941

Merged

Conversation

realbigsean
Copy link
Member

Issue Addressed

There are a few gossip rules we needed to add/update, they're included here:

  • signature verify the header in each blob - this can/should maybe be extended to use a cache? so we aren't verifying the same signature up to 7 times. But I'll leave that for a follow up PR
  • The gossip duplicate rule has been updated:
    before:
- _[IGNORE]_ The sidecar is the only sidecar with valid signature received for the tuple `(sidecar.block_root, sidecar.index)`.

after:

- _[IGNORE]_ The sidecar is the first sidecar for the tuple (block_header.slot, block_header.proposer_index, blob_sidecar.index) with valid header signature, sidecar inclusion proof, and kzg proof.
  • a check has been added to verify the block header is a descendant of the finalized checkpoint

Future Improvements

There's more and more overlap between gossip blob and block gossip verification, it'd be nice if we could unify all overlapping logic

@realbigsean realbigsean merged commit 8697583 into sigp:sidecar-inclusion-proof Nov 21, 2023
23 of 24 checks passed
@realbigsean realbigsean deleted the sidecar-inclusion-cleanup branch November 21, 2023 16:16
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.

Nice catch on the updated gossip rules.
I had some clarifications on the descended from finalized rules

if !fork_choice.is_finalized_checkpoint_or_descendant(block_parent_root) {
if chain
.store
.block_exists(&block_parent_root)
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 this condition should be after the proposer signature verification.
Else it would be possible for an attacker to spam us with useless blobs with bogus non-canonical parent roots and make us do a bunch of database reads.

Copy link
Member Author

Choose a reason for hiding this comment

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

So this one I just copied from block_verification.rs. It's also before the proposer signature check, although I'm not sure why. I was thinking It might be nice to consolidate the blob_verifcation and block_verifcation code because we can do a lot of the same checks over SignedBlockHeader.

{
return Err(GossipBlobError::NotFinalizedDescendant { block_parent_root });
} else {
return Err(GossipBlobError::BlobParentUnknown(blob_sidecar));
Copy link
Member

Choose a reason for hiding this comment

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

I'm not completely sure I understand requesting the parent in this case.

Copy link
Member Author

Choose a reason for hiding this comment

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

Similar to the other comment, I was following the lead of block_verification, I think here it's because we're checking if the parent root exists, not the block root related to the current message

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.

2 participants