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

Implement EIP7691: Blob throughput increase #14750

Merged
merged 3 commits into from
Dec 30, 2024

Conversation

terencechain
Copy link
Member

@terencechain terencechain commented Dec 23, 2024

This PR implements EIP-7691

@terencechain terencechain requested a review from a team as a code owner December 23, 2024 21:31
@terencechain terencechain force-pushed the blob-target-max-increase branch 8 times, most recently from 517b3ac to e6cf113 Compare December 30, 2024 15:34
@@ -136,30 +136,18 @@ func (s *Service) NewPayload(ctx context.Context, payload interfaces.ExecutionDa
defer cancel()
result := &pb.PayloadStatus{}

switch payload.Proto().(type) {
switch payloadPb := payload.Proto().(type) {
Copy link
Contributor

Choose a reason for hiding this comment

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

oh nice code cleanup

}, nil
case version.Electra:
return map[string]rpcHandler{
p2p.RPCBlobSidecarsByRootTopicV2: s.blobSidecarByRootRPCHandler,
Copy link
Contributor

Choose a reason for hiding this comment

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

in electra we no longer need those other RPC topics?

return map[string]rpcHandler{
p2p.RPCStatusTopicV1: s.statusRPCHandler,
p2p.RPCGoodByeTopicV1: s.goodbyeRPCHandler,
p2p.RPCBlocksByRangeTopicV2: s.beaconBlocksByRangeRPCHandler,
p2p.RPCBlocksByRootTopicV2: s.beaconBlocksRootRPCHandler,
p2p.RPCPingTopicV1: s.pingHandler,
p2p.RPCMetaDataTopicV2: s.metaDataHandler,
p2p.RPCBlobSidecarsByRootTopicV1: s.blobSidecarByRootRPCHandler, // Added in Deneb
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the // Added in Deneb comment removed?

return map[string]rpcHandler{
p2p.RPCStatusTopicV1: s.statusRPCHandler,
p2p.RPCGoodByeTopicV1: s.goodbyeRPCHandler,
p2p.RPCBlocksByRangeTopicV2: s.beaconBlocksByRangeRPCHandler,
p2p.RPCBlocksByRootTopicV2: s.beaconBlocksRootRPCHandler,
p2p.RPCPingTopicV1: s.pingHandler,
p2p.RPCMetaDataTopicV2: s.metaDataHandler,
p2p.RPCBlobSidecarsByRootTopicV1: s.blobSidecarByRootRPCHandler, // Added in Deneb
p2p.RPCBlobSidecarsByRangeTopicV1: s.blobSidecarsByRangeRPCHandler, // Added in Deneb
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here.

p2p.RPCBlobSidecarsByRootTopicV1: s.blobSidecarByRootRPCHandler,
p2p.RPCBlobSidecarsByRangeTopicV1: s.blobSidecarsByRangeRPCHandler,
}, nil
case version.Electra:
Copy link
Contributor

Choose a reason for hiding this comment

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

Are all the other handlers removed? (RPCStatusTopicV1, RPCGoodByeTopicV1, ...)
This list is an absolute list, not a relative (to the previous fork) one.

If I am not wrong, is it possible to add // Added in Electra comments for the new topics?

Copy link
Contributor

Choose a reason for hiding this comment

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

had the same question

Copy link
Member Author

Choose a reason for hiding this comment

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

My lack of understanding, thanks guys

@@ -156,6 +156,19 @@ func (s *Service) registerSubscribers(epoch primitives.Epoch, digest [4]byte) {
func(currentSlot primitives.Slot) []uint64 { return []uint64{} },
)
}

if params.BeaconConfig().ElectraForkEpoch <= epoch {
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of writing this entire new section,

func(primitives.Slot) []uint64 { return sliceFromCount(params.BeaconConfig().BlobsidecarSubnetCount) },

can be modified by a slight more complex function, that checks the epoch from the input slot, and returns either

sliceFromCount(params.BeaconConfig().BlobsidecarSubnetCount)

if we are in Deneb, or

sliceFromCount(params.BeaconConfig().BlobsidecarSubnetCountElectra)

if we are in Electra.

(This function is executed at each 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.

I think this is what you meant, please correct if Im missunderstanding: 4e62a24

func computeSubnetForBlobSidecar(index uint64) uint64 {
return index % params.BeaconConfig().BlobsidecarSubnetCount
func computeSubnetForBlobSidecar(index uint64, slot primitives.Slot) uint64 {
return index % uint64(params.BeaconConfig().MaxBlobsPerBlock(slot))
Copy link
Contributor

@james-prysm james-prysm Dec 30, 2024

Choose a reason for hiding this comment

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

I see a params.BeaconConfig().BlobsidecarSubnetCountElectra why isn't that used instead? from subscriber.go

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought checking against max blobs per block is cleaner but you are right I should use that instead: 4e62a24

@terencechain terencechain force-pushed the blob-target-max-increase branch from e6cf113 to f928dc8 Compare December 30, 2024 16:40
@terencechain terencechain force-pushed the blob-target-max-increase branch from f928dc8 to 4e62a24 Compare December 30, 2024 16:41
Copy link
Contributor

@james-prysm james-prysm left a comment

Choose a reason for hiding this comment

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

LGTM

@terencechain terencechain added this pull request to the merge queue Dec 30, 2024
Merged via the queue into develop with commit ead08d5 Dec 30, 2024
15 checks passed
@terencechain terencechain deleted the blob-target-max-increase branch December 30, 2024 19:31
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.

3 participants