From ab3f1963e21a215233e5b34deebdc414eb372c84 Mon Sep 17 00:00:00 2001 From: terence Date: Wed, 6 Nov 2024 07:09:20 -0800 Subject: [PATCH] Return early blob constructor if not deneb (#14605) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Return early blob constructor if not deneb * Update CHANGELOG.md Co-authored-by: Radosław Kapka * Remove test * Remove space --------- Co-authored-by: Radosław Kapka --- CHANGELOG.md | 1 + beacon-chain/sync/subscriber_beacon_blocks.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1cfc8ebe4c..91bc8dfb584 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Only Build the Protobuf state once during serialization. - Capella blocks are execution. - Fixed panic when http request to subscribe to event stream fails. +- Return early for blob reconstructor during capella fork ### Deprecated diff --git a/beacon-chain/sync/subscriber_beacon_blocks.go b/beacon-chain/sync/subscriber_beacon_blocks.go index 45e8608449c..488549e65f3 100644 --- a/beacon-chain/sync/subscriber_beacon_blocks.go +++ b/beacon-chain/sync/subscriber_beacon_blocks.go @@ -12,6 +12,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/io/file" + "github.com/prysmaticlabs/prysm/v5/runtime/version" "github.com/prysmaticlabs/prysm/v5/time/slots" "google.golang.org/protobuf/proto" ) @@ -62,6 +63,10 @@ func (s *Service) beaconBlockSubscriber(ctx context.Context, msg proto.Message) // This function reconstructs the blob sidecars from the EL using the block's KZG commitments, // broadcasts the reconstructed blobs over P2P, and saves them into the blob storage. func (s *Service) reconstructAndBroadcastBlobs(ctx context.Context, block interfaces.ReadOnlySignedBeaconBlock) { + if block.Version() < version.Deneb { + return + } + startTime, err := slots.ToTime(uint64(s.cfg.chain.GenesisTime().Unix()), block.Block().Slot()) if err != nil { log.WithError(err).Error("Failed to convert slot to time")