From 440cf32966a255ea2c398eb30b81883bfdb60e4e Mon Sep 17 00:00:00 2001 From: terencechain Date: Fri, 8 Sep 2023 08:37:53 -0700 Subject: [PATCH] fix: correct blob sidecar count (#12865) * fix: update blob sidecar count * fix: use beacon config instead of network config --------- Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com> --- beacon-chain/sync/subscriber.go | 2 +- config/params/config.go | 3 +++ config/params/loader_test.go | 1 - config/params/mainnet_config.go | 4 +++- config/params/network_config.go | 1 - 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/beacon-chain/sync/subscriber.go b/beacon-chain/sync/subscriber.go index 573564c2bc..4c061c7b99 100644 --- a/beacon-chain/sync/subscriber.go +++ b/beacon-chain/sync/subscriber.go @@ -142,7 +142,7 @@ func (s *Service) registerSubscribers(epoch primitives.Epoch, digest [4]byte) { s.validateBlob, /* validator */ s.blobSubscriber, /* message handler */ digest, - params.BeaconNetworkConfig().BlobsidecarSubnetCount, + params.BeaconConfig().BlobsidecarSubnetCount, ) } } diff --git a/config/params/config.go b/config/params/config.go index 5ae27531e2..6efeed7e16 100644 --- a/config/params/config.go +++ b/config/params/config.go @@ -218,6 +218,9 @@ type BeaconChainConfig struct { // Execution engine timeout value ExecutionEngineTimeoutValue uint64 // ExecutionEngineTimeoutValue defines the seconds to wait before timing out engine endpoints with execution payload execution semantics (newPayload, forkchoiceUpdated). + + // Subnet value + BlobsidecarSubnetCount uint64 `yaml:"BLOB_SIDECAR_SUBNET_COUNT"` // BlobsidecarSubnetCount is the number of blobsidecar subnets used in the gossipsub protocol. } // InitializeForkSchedule initializes the schedules forks baked into the config. diff --git a/config/params/loader_test.go b/config/params/loader_test.go index 4b7aa7155d..1258c040d3 100644 --- a/config/params/loader_test.go +++ b/config/params/loader_test.go @@ -27,7 +27,6 @@ var placeholderFields = []string{ "ATTESTATION_SUBNET_COUNT", "ATTESTATION_SUBNET_EXTRA_BITS", "ATTESTATION_SUBNET_PREFIX_BITS", - "BLOB_SIDECAR_SUBNET_COUNT", "EIP6110_FORK_EPOCH", "EIP6110_FORK_VERSION", "EIP7002_FORK_EPOCH", diff --git a/config/params/mainnet_config.go b/config/params/mainnet_config.go index 94cbdbdcdc..269ef8dd67 100644 --- a/config/params/mainnet_config.go +++ b/config/params/mainnet_config.go @@ -31,7 +31,6 @@ var mainnetNetworkConfig = &NetworkConfig{ MaxChunkSize: 1 << 20, // 1 MiB MaxChunkSizeBellatrix: 10 * 1 << 20, // 10 MiB AttestationSubnetCount: 64, - BlobsidecarSubnetCount: 4, AttestationPropagationSlotRange: 32, MaxRequestBlocks: 1 << 10, // 1024 TtfbTimeout: 5 * time.Second, @@ -268,6 +267,9 @@ var mainnetBeaconConfig = &BeaconChainConfig{ MaxBuilderEpochMissedSlots: 5, // Execution engine timeout value ExecutionEngineTimeoutValue: 8, // 8 seconds default based on: https://github.com/ethereum/execution-apis/blob/main/src/engine/specification.md#core + + // Subnet value + BlobsidecarSubnetCount: 6, } // MainnetTestConfig provides a version of the mainnet config that has a different name diff --git a/config/params/network_config.go b/config/params/network_config.go index aaa3e171f2..ca26d1d926 100644 --- a/config/params/network_config.go +++ b/config/params/network_config.go @@ -14,7 +14,6 @@ type NetworkConfig struct { MaxChunkSize uint64 `yaml:"MAX_CHUNK_SIZE"` // MaxChunkSize is the maximum allowed size of uncompressed req/resp chunked responses. MaxChunkSizeBellatrix uint64 `yaml:"MAX_CHUNK_SIZE_BELLATRIX"` // MaxChunkSizeBellatrix is the maximum allowed size of uncompressed req/resp chunked responses after the bellatrix epoch. AttestationSubnetCount uint64 `yaml:"ATTESTATION_SUBNET_COUNT"` // AttestationSubnetCount is the number of attestation subnets used in the gossipsub protocol. - BlobsidecarSubnetCount uint64 `yaml:"BLOBSIDECAR_SUBNET_COUNT"` // BlobsidecarSubnetCount is the number of blobsidecar subnets used in the gossipsub protocol. AttestationPropagationSlotRange primitives.Slot `yaml:"ATTESTATION_PROPAGATION_SLOT_RANGE"` // AttestationPropagationSlotRange is the maximum number of slots during which an attestation can be propagated. MaxRequestBlocks uint64 `yaml:"MAX_REQUEST_BLOCKS"` // MaxRequestBlocks is the maximum number of blocks in a single request. TtfbTimeout time.Duration `yaml:"TTFB_TIMEOUT"` // TtfbTimeout is the maximum time to wait for first byte of request response (time-to-first-byte).