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

EIP4844: couple beacon block and blob sidecar for p2p #3046

Merged
merged 7 commits into from
Oct 26, 2022

Conversation

terencechain
Copy link
Contributor

@terencechain terencechain commented Oct 17, 2022

Part of #3043

Here we couple beacon block and blob sidecar under a single gossip topic- beacon_block_and_blob_sidecar. We introduce a new network container SignedBeaconBlockAndBlobsSidecar which consists of SignedBeaconBlock and SignedBlobsSidecar. We also combined the previous gossips beacon_block and blobs_sidecar validations under beacon_block_and_blob_sidecar. I think we can get rid of blob.beacon_block_root and blob.beacon_block_slot, I'm curious to hear more thoughts

cc @protolambda @Inphi

Rationale for coupling: https://notes.ethereum.org/RLOGb1hYQ0aWt3hcVgzhgQ?#Gossip

@hwwhww hwwhww added the Deneb was called: eip-4844 label Oct 18, 2022
@dapplion
Copy link
Collaborator

👍 on coupling

```python
class SignedBeaconBlockAndBlobsSidecar(Container):
beacon_block: SignedBeaconBlock
blobs_sidecar: SignedBlobsSidecar
Copy link
Collaborator

Choose a reason for hiding this comment

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

Verifying the sidecar signature helps ensure the KZG commitments are worth verifying, but would it really result in DoS / performance issues when anyone changes it to invalid data? Technically we compare the sidecar against the KZG commitments in the beacon block already, so we do not have to sign the sidecar.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I don't think we need to sign the side car. This also informs whether or not we send signed or unsigned side cars in blobs by range/root request.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I agree that comparing KZG commitments in the beacon block is sufficient. We don't need the sidecar signature

@realbigsean range/root request will be decoupled and it's unsigned there

Comment on lines 113 to 114
- _[IGNORE]_ The sidecar is the first sidecar with valid signature received for the `(proposer_index, sidecar.beacon_block_slot)` combination,
where `proposer_index` is the validator index of the beacon block proposer of `sidecar.beacon_block_slot`
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can remove this condition now that it's coupled

specs/eip4844/p2p-interface.md Outdated Show resolved Hide resolved
specs/eip4844/p2p-interface.md Outdated Show resolved Hide resolved
Copy link
Contributor

@Inphi Inphi left a comment

Choose a reason for hiding this comment

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

I think we need some clarification on how we want to propagate beacon blocks that don't have sidecars (unlikely but possible). Do we keep using the beacon_block topic in that scenario? Or use the new topic from now one and set the blobs_sidecar to its default ssz value in that case?

terencechain and others added 3 commits October 18, 2022 11:22
Co-authored-by: protolambda <proto@protolambda.com>
Co-authored-by: protolambda <proto@protolambda.com>
@terencechain
Copy link
Contributor Author

I think we need some clarification on how we want to propagate beacon blocks that don't have sidecars

Do we want to support this? It feels like more complexity and takes us back to de-coupling block and blob

@realbigsean
Copy link
Contributor

I think empty lists in the existing structs here should be sufficient

- [The gossip domain: gossipsub](#the-gossip-domain-gossipsub)
- [Topics and messages](#topics-and-messages)
- [Global topics](#global-topics)
- [`beacon_block`](#beacon_block)
- [`blobs_sidecar`](#blobs_sidecar)
- [`beacon_block_and_blob_sidecar`](#beacon_block_and_blob_sidecar)
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems we use "blobs sidecar" everywhere but here where you use "blob sidecar". Is that intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Typo, I will fix. Thanks!

@Inphi
Copy link
Contributor

Inphi commented Oct 19, 2022

I think we need some clarification on how we want to propagate beacon blocks that don't have sidecars

Do we want to support this? It feels like more complexity and takes us back to de-coupling block and blob

Agreed. it isn't clear to me from my reading of the spec that we'll use coupled blocks even when there isn't a sidecar. Let's clarify this in the spec. We can deprecate/remove the old topic used for (decoupled) beacon blocks.

@dgcoffman dgcoffman mentioned this pull request Oct 19, 2022
25 tasks
@hwwhww
Copy link
Contributor

hwwhww commented Oct 20, 2022

should we add the description of how to prepare SignedBeaconBlockAndBlobsSidecar in validator.md?

@terencechain
Copy link
Contributor Author

should we add the description of how to prepare SignedBeaconBlockAndBlobsSidecar in validator.md?

Good point, I'll update that today

Copy link
Contributor

@hwwhww hwwhww left a comment

Choose a reason for hiding this comment

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

lgtm!

Comment on lines -41 to -42
privkey = privkeys[1]
spec.get_signed_blobs_sidecar(state, blobs_sidecar, privkey)
Copy link
Contributor

Choose a reason for hiding this comment

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

ah right, it should have been in another test case + verification 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deneb was called: eip-4844
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants