-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Conversation
517b3ac
to
e6cf113
Compare
@@ -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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh nice code cleanup
beacon-chain/sync/rpc.go
Outdated
}, nil | ||
case version.Electra: | ||
return map[string]rpcHandler{ | ||
p2p.RPCBlobSidecarsByRootTopicV2: s.blobSidecarByRootRPCHandler, |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
had the same question
There was a problem hiding this comment.
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
beacon-chain/sync/subscriber.go
Outdated
@@ -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 { |
There was a problem hiding this comment.
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.)
There was a problem hiding this comment.
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
beacon-chain/sync/validate_blob.go
Outdated
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)) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
e6cf113
to
f928dc8
Compare
f928dc8
to
4e62a24
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR implements EIP-7691