diff --git a/CHANGELOG.md b/CHANGELOG.md index 324470361d00..82baea27ddf4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Log before blob filesystem cache warm-up. - New design for the attestation pool. [PR](https://github.com/prysmaticlabs/prysm/pull/14324) - Add field param placeholder for Electra blob target and max to pass spec tests. +- Add EIP-7691: Blob throughput increase. +- SSZ files generation: Remove the `// Hash: ...` header. ### Changed @@ -35,10 +37,12 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve ### Removed +- Cleanup ProcessSlashings method to remove unnecessary argument. ### Fixed - Added check to prevent nil pointer deference or out of bounds array access when validating the BLSToExecutionChange on an impossibly nil validator. +- EIP-7691: Ensure new blobs subnets are subscribed on epoch in advance. ### Security diff --git a/INTEROP.md b/INTEROP.md index 3c222a9b9c97..33d3dceedcaa 100644 --- a/INTEROP.md +++ b/INTEROP.md @@ -4,7 +4,7 @@ This README details how to setup Prysm for interop testing for usage with other > [!IMPORTANT] > This guide is likely to be outdated. The Prysm team does not have capacity to troubleshoot -> outdated interop guides or instructions. If you experience issues with this guide, please file and +> outdated interop guides or instructions. If you experience issues with this guide, please file an > issue for visibility and propose fixes, if possible. ## Installation & Setup @@ -74,19 +74,19 @@ bazel run //cmd/beacon-chain --config=minimal -- \ This will start the system with 256 validators. The flags used can be explained as such: - `bazel run //cmd/beacon-chain --config=minimal` builds and runs the beacon node in minimal build configuration. -- `--` is a flag divider to distingish between bazel flags and flags that should be passed to the application. All flags and arguments after this divider are passed to the beacon chain. +- `--` is a flag divider to distinguish between bazel flags and flags that should be passed to the application. All flags and arguments after this divider are passed to the beacon chain. - `--minimal-config` tells the beacon node to use minimal network configuration. This is different from the compile time state configuration flag `--config=minimal` and both are required. - `--bootstrap-node=` disables the default bootstrap nodes. This prevents the client from attempting to peer with mainnet nodes. - `--datadir=/tmp/beacon-chain-minimal-devnet` sets the data directory in a temporary location. Change this to your preferred destination. - `--force-clear-db` will delete the beaconchain.db file without confirming with the user. This is helpful for iteratively running local devnets without changing the datadir, but less helpful for one off runs where there was no database in the data directory. -- `--min-sync-peers=0` allows the beacon node to skip initial sync without peers. This is essential because Prysm expects at least a few peers to start start the blockchain. +- `--min-sync-peers=0` allows the beacon node to skip initial sync without peers. This is essential because Prysm expects at least a few peers to start the blockchain. - `--genesis-state=/tmp/genesis.ssz` defines the path to the generated genesis ssz file. The beacon node will use this as the initial genesis state. - `--chain-config-file=/tmp/minimal.yaml` defines the path to the yaml file with the chain configuration. As soon as the beacon node has started, start the validator in the other terminal window. ``` -bazel run //cmd/validator --config=minimal -- --datadir=/tmp/validator --interopt-num-validators=256 --minimal-config --suggested-fee-recipient=0x8A04d14125D0FDCDc742F4A05C051De07232EDa4 +bazel run //cmd/validator --config=minimal -- --datadir=/tmp/validator --interop-num-validators=256 --minimal-config --suggested-fee-recipient=0x8A04d14125D0FDCDc742F4A05C051De07232EDa4 ``` This will launch and kickstart the system with your 256 validators performing their duties accordingly. diff --git a/beacon-chain/core/altair/epoch_spec_test.go b/beacon-chain/core/altair/epoch_spec_test.go index 4b2a4c427898..2f7051d69d34 100644 --- a/beacon-chain/core/altair/epoch_spec_test.go +++ b/beacon-chain/core/altair/epoch_spec_test.go @@ -105,7 +105,7 @@ func TestProcessSlashings_NotSlashed(t *testing.T) { } s, err := state_native.InitializeFromProtoAltair(base) require.NoError(t, err) - newState, err := epoch.ProcessSlashings(s, params.BeaconConfig().ProportionalSlashingMultiplierAltair) + newState, err := epoch.ProcessSlashings(s) require.NoError(t, err) wanted := params.BeaconConfig().MaxEffectiveBalance assert.Equal(t, wanted, newState.Balances()[0], "Unexpected slashed balance") @@ -176,7 +176,7 @@ func TestProcessSlashings_SlashedLess(t *testing.T) { original := proto.Clone(tt.state) s, err := state_native.InitializeFromProtoAltair(tt.state) require.NoError(t, err) - newState, err := epoch.ProcessSlashings(s, params.BeaconConfig().ProportionalSlashingMultiplierAltair) + newState, err := epoch.ProcessSlashings(s) require.NoError(t, err) assert.Equal(t, tt.want, newState.Balances()[0], "ProcessSlashings({%v}) = newState; newState.Balances[0] = %d", original, newState.Balances()[0]) }) @@ -192,6 +192,6 @@ func TestProcessSlashings_BadValue(t *testing.T) { } s, err := state_native.InitializeFromProtoAltair(base) require.NoError(t, err) - _, err = epoch.ProcessSlashings(s, params.BeaconConfig().ProportionalSlashingMultiplierAltair) + _, err = epoch.ProcessSlashings(s) require.ErrorContains(t, "addition overflows", err) } diff --git a/beacon-chain/core/altair/transition.go b/beacon-chain/core/altair/transition.go index a7526e346b8c..67d1661a02bf 100644 --- a/beacon-chain/core/altair/transition.go +++ b/beacon-chain/core/altair/transition.go @@ -69,11 +69,7 @@ func ProcessEpoch(ctx context.Context, state state.BeaconState) error { } // Modified in Altair and Bellatrix. - proportionalSlashingMultiplier, err := state.ProportionalSlashingMultiplier() - if err != nil { - return err - } - state, err = e.ProcessSlashings(state, proportionalSlashingMultiplier) + state, err = e.ProcessSlashings(state) if err != nil { return err } diff --git a/beacon-chain/core/electra/transition.go b/beacon-chain/core/electra/transition.go index 886de1fde0e2..c67d308e45f2 100644 --- a/beacon-chain/core/electra/transition.go +++ b/beacon-chain/core/electra/transition.go @@ -75,16 +75,10 @@ func ProcessEpoch(ctx context.Context, state state.BeaconState) error { if err != nil { return errors.Wrap(err, "could not process rewards and penalties") } - if err := ProcessRegistryUpdates(ctx, state); err != nil { return errors.Wrap(err, "could not process registry updates") } - - proportionalSlashingMultiplier, err := state.ProportionalSlashingMultiplier() - if err != nil { - return err - } - state, err = ProcessSlashings(state, proportionalSlashingMultiplier) + state, err = ProcessSlashings(state) if err != nil { return err } @@ -92,7 +86,6 @@ func ProcessEpoch(ctx context.Context, state state.BeaconState) error { if err != nil { return err } - if err = ProcessPendingDeposits(ctx, state, primitives.Gwei(bp.ActiveCurrentEpoch)); err != nil { return err } @@ -102,7 +95,6 @@ func ProcessEpoch(ctx context.Context, state state.BeaconState) error { if err = ProcessEffectiveBalanceUpdates(state); err != nil { return err } - state, err = ProcessSlashingsReset(state) if err != nil { return err @@ -115,17 +107,14 @@ func ProcessEpoch(ctx context.Context, state state.BeaconState) error { if err != nil { return err } - state, err = ProcessParticipationFlagUpdates(state) if err != nil { return err } - _, err = ProcessSyncCommitteeUpdates(ctx, state) if err != nil { return err } - return nil } diff --git a/beacon-chain/core/epoch/epoch_processing.go b/beacon-chain/core/epoch/epoch_processing.go index 19464abaa91d..67b7e3b53385 100644 --- a/beacon-chain/core/epoch/epoch_processing.go +++ b/beacon-chain/core/epoch/epoch_processing.go @@ -144,22 +144,13 @@ func ProcessRegistryUpdates(ctx context.Context, st state.BeaconState) (state.Be // ProcessSlashings processes the slashed validators during epoch processing, // // def process_slashings(state: BeaconState) -> None: -// epoch = get_current_epoch(state) -// total_balance = get_total_active_balance(state) -// adjusted_total_slashing_balance = min(sum(state.slashings) * PROPORTIONAL_SLASHING_MULTIPLIER, total_balance) -// if state.version == electra: -// increment = EFFECTIVE_BALANCE_INCREMENT # Factored out from total balance to avoid uint64 overflow -// penalty_per_effective_balance_increment = adjusted_total_slashing_balance // (total_balance // increment) -// for index, validator in enumerate(state.validators): -// if validator.slashed and epoch + EPOCHS_PER_SLASHINGS_VECTOR // 2 == validator.withdrawable_epoch: -// increment = EFFECTIVE_BALANCE_INCREMENT # Factored out from penalty numerator to avoid uint64 overflow -// penalty_numerator = validator.effective_balance // increment * adjusted_total_slashing_balance -// penalty = penalty_numerator // total_balance * increment -// if state.version == electra: // effective_balance_increments = validator.effective_balance // increment // penalty = penalty_per_effective_balance_increment * effective_balance_increments -// decrease_balance(state, ValidatorIndex(index), penalty) -func ProcessSlashings(st state.BeaconState, slashingMultiplier uint64) (state.BeaconState, error) { +func ProcessSlashings(st state.BeaconState) (state.BeaconState, error) { + slashingMultiplier, err := st.ProportionalSlashingMultiplier() + if err != nil { + return nil, errors.Wrap(err, "could not get proportional slashing multiplier") + } currentEpoch := time.CurrentEpoch(st) totalBalance, err := helpers.TotalActiveBalance(st) if err != nil { diff --git a/beacon-chain/core/epoch/epoch_processing_test.go b/beacon-chain/core/epoch/epoch_processing_test.go index f9bb3b594923..27394af1cc6b 100644 --- a/beacon-chain/core/epoch/epoch_processing_test.go +++ b/beacon-chain/core/epoch/epoch_processing_test.go @@ -32,7 +32,7 @@ func TestProcessSlashings_NotSlashed(t *testing.T) { } s, err := state_native.InitializeFromProtoPhase0(base) require.NoError(t, err) - newState, err := epoch.ProcessSlashings(s, params.BeaconConfig().ProportionalSlashingMultiplier) + newState, err := epoch.ProcessSlashings(s) require.NoError(t, err) wanted := params.BeaconConfig().MaxEffectiveBalance assert.Equal(t, wanted, newState.Balances()[0], "Unexpected slashed balance") @@ -111,7 +111,7 @@ func TestProcessSlashings_SlashedLess(t *testing.T) { s, err := state_native.InitializeFromProtoPhase0(tt.state) require.NoError(t, err) helpers.ClearCache() - newState, err := epoch.ProcessSlashings(s, params.BeaconConfig().ProportionalSlashingMultiplier) + newState, err := epoch.ProcessSlashings(s) require.NoError(t, err) assert.Equal(t, tt.want, newState.Balances()[0], "ProcessSlashings({%v}) = newState; newState.Balances[0] = %d", original, newState.Balances()[0]) }) @@ -365,7 +365,7 @@ func TestProcessSlashings_BadValue(t *testing.T) { } s, err := state_native.InitializeFromProtoPhase0(base) require.NoError(t, err) - _, err = epoch.ProcessSlashings(s, params.BeaconConfig().ProportionalSlashingMultiplier) + _, err = epoch.ProcessSlashings(s) require.ErrorContains(t, "addition overflows", err) } @@ -514,7 +514,7 @@ func TestProcessSlashings_SlashedElectra(t *testing.T) { s, err := state_native.InitializeFromProtoElectra(tt.state) require.NoError(t, err) helpers.ClearCache() - newState, err := epoch.ProcessSlashings(s, params.BeaconConfig().ProportionalSlashingMultiplierBellatrix) + newState, err := epoch.ProcessSlashings(s) require.NoError(t, err) assert.Equal(t, tt.want, newState.Balances()[0], "ProcessSlashings({%v}) = newState; newState.Balances[0] = %d", original, newState.Balances()[0]) }) diff --git a/beacon-chain/execution/engine_client.go b/beacon-chain/execution/engine_client.go index 002378ad5b0b..dc0a3d8fafec 100644 --- a/beacon-chain/execution/engine_client.go +++ b/beacon-chain/execution/engine_client.go @@ -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) { case *pb.ExecutionPayload: - payloadPb, ok := payload.Proto().(*pb.ExecutionPayload) - if !ok { - return nil, errors.New("execution data must be a Bellatrix or Capella execution payload") - } err := s.rpcClient.CallContext(ctx, result, NewPayloadMethod, payloadPb) if err != nil { return nil, handleRPCError(err) } case *pb.ExecutionPayloadCapella: - payloadPb, ok := payload.Proto().(*pb.ExecutionPayloadCapella) - if !ok { - return nil, errors.New("execution data must be a Capella execution payload") - } err := s.rpcClient.CallContext(ctx, result, NewPayloadMethodV2, payloadPb) if err != nil { return nil, handleRPCError(err) } case *pb.ExecutionPayloadDeneb: - payloadPb, ok := payload.Proto().(*pb.ExecutionPayloadDeneb) - if !ok { - return nil, errors.New("execution data must be a Deneb execution payload") - } if executionRequests == nil { err := s.rpcClient.CallContext(ctx, result, NewPayloadMethodV3, payloadPb, versionedHashes, parentBlockRoot) if err != nil { diff --git a/beacon-chain/p2p/rpc_topic_mappings.go b/beacon-chain/p2p/rpc_topic_mappings.go index 7d9c5ebdff0a..a50555e82edc 100644 --- a/beacon-chain/p2p/rpc_topic_mappings.go +++ b/beacon-chain/p2p/rpc_topic_mappings.go @@ -73,6 +73,9 @@ const ( RPCBlocksByRootTopicV2 = protocolPrefix + BeaconBlocksByRootsMessageName + SchemaVersionV2 // RPCMetaDataTopicV2 defines the v2 topic for the metadata rpc method. RPCMetaDataTopicV2 = protocolPrefix + MetadataMessageName + SchemaVersionV2 + + RPCBlobSidecarsByRangeTopicV2 = protocolPrefix + BlobSidecarsByRangeName + SchemaVersionV2 + RPCBlobSidecarsByRootTopicV2 = protocolPrefix + BlobSidecarsByRootName + SchemaVersionV2 ) // RPC errors for topic parsing. diff --git a/beacon-chain/rpc/eth/config/handlers_test.go b/beacon-chain/rpc/eth/config/handlers_test.go index d81f0c590b4b..c88f5a0a1c73 100644 --- a/beacon-chain/rpc/eth/config/handlers_test.go +++ b/beacon-chain/rpc/eth/config/handlers_test.go @@ -190,7 +190,7 @@ func TestGetSpec(t *testing.T) { data, ok := resp.Data.(map[string]interface{}) require.Equal(t, true, ok) - assert.Equal(t, 159, len(data)) + assert.Equal(t, 160, len(data)) for k, v := range data { t.Run(k, func(t *testing.T) { switch k { @@ -533,6 +533,8 @@ func TestGetSpec(t *testing.T) { assert.Equal(t, "6", v) case "MAX_BLOBS_PER_BLOCK_ELECTRA": assert.Equal(t, "9", v) + case "MAX_REQUEST_BLOB_SIDECARS_ELECTRA": + assert.Equal(t, "1152", v) default: t.Errorf("Incorrect key: %s", k) } diff --git a/beacon-chain/sync/blobs_test.go b/beacon-chain/sync/blobs_test.go index 8415a8c4fec1..0bdabb957b7b 100644 --- a/beacon-chain/sync/blobs_test.go +++ b/beacon-chain/sync/blobs_test.go @@ -220,8 +220,12 @@ func (c *blobsTestCase) setup(t *testing.T) (*Service, []blocks.ROBlob, func()) byRootRate := params.BeaconConfig().MaxRequestBlobSidecars * uint64(params.BeaconConfig().MaxBlobsPerBlock(0)) byRangeRate := params.BeaconConfig().MaxRequestBlobSidecars * uint64(params.BeaconConfig().MaxBlobsPerBlock(0)) + byRootRateElectra := params.BeaconConfig().MaxRequestBlobSidecarsElectra * uint64(params.BeaconConfig().MaxBlobsPerBlock(0)) + byRangeRateElectra := params.BeaconConfig().MaxRequestBlobSidecarsElectra * uint64(params.BeaconConfig().MaxBlobsPerBlock(0)) s.setRateCollector(p2p.RPCBlobSidecarsByRootTopicV1, leakybucket.NewCollector(0.000001, int64(byRootRate), time.Second, false)) s.setRateCollector(p2p.RPCBlobSidecarsByRangeTopicV1, leakybucket.NewCollector(0.000001, int64(byRangeRate), time.Second, false)) + s.setRateCollector(p2p.RPCBlobSidecarsByRootTopicV2, leakybucket.NewCollector(0.000001, int64(byRootRateElectra), time.Second, false)) + s.setRateCollector(p2p.RPCBlobSidecarsByRangeTopicV2, leakybucket.NewCollector(0.000001, int64(byRangeRateElectra), time.Second, false)) return s, sidecars, cleanup } diff --git a/beacon-chain/sync/fork_watcher_test.go b/beacon-chain/sync/fork_watcher_test.go index 643dc8e3b6c1..24ac0ad8db56 100644 --- a/beacon-chain/sync/fork_watcher_test.go +++ b/beacon-chain/sync/fork_watcher_test.go @@ -188,6 +188,50 @@ func TestService_CheckForNextEpochFork(t *testing.T) { assert.Equal(t, true, rpcMap[p2p.RPCBlobSidecarsByRootTopicV1+s.cfg.p2p.Encoding().ProtocolSuffix()], "topic doesn't exist") }, }, + { + name: "electra fork in the next epoch", + svcCreator: func(t *testing.T) *Service { + peer2peer := p2ptest.NewTestP2P(t) + gt := time.Now().Add(-4 * oneEpoch()) + vr := [32]byte{'A'} + chainService := &mockChain.ChainService{ + Genesis: gt, + ValidatorsRoot: vr, + } + bCfg := params.BeaconConfig().Copy() + bCfg.ElectraForkEpoch = 5 + params.OverrideBeaconConfig(bCfg) + params.BeaconConfig().InitializeForkSchedule() + ctx, cancel := context.WithCancel(context.Background()) + r := &Service{ + ctx: ctx, + cancel: cancel, + cfg: &config{ + p2p: peer2peer, + chain: chainService, + clock: startup.NewClock(gt, vr), + initialSync: &mockSync.Sync{IsSyncing: false}, + }, + chainStarted: abool.New(), + subHandler: newSubTopicHandler(), + } + return r + }, + currEpoch: 4, + wantErr: false, + postSvcCheck: func(t *testing.T, s *Service) { + genRoot := s.cfg.clock.GenesisValidatorsRoot() + digest, err := forks.ForkDigestFromEpoch(5, genRoot[:]) + assert.NoError(t, err) + assert.Equal(t, true, s.subHandler.digestExists(digest)) + rpcMap := make(map[string]bool) + for _, p := range s.cfg.p2p.Host().Mux().Protocols() { + rpcMap[string(p)] = true + } + assert.Equal(t, true, rpcMap[p2p.RPCBlobSidecarsByRangeTopicV2+s.cfg.p2p.Encoding().ProtocolSuffix()], "topic doesn't exist") + assert.Equal(t, true, rpcMap[p2p.RPCBlobSidecarsByRootTopicV2+s.cfg.p2p.Encoding().ProtocolSuffix()], "topic doesn't exist") + }, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/beacon-chain/sync/rate_limiter.go b/beacon-chain/sync/rate_limiter.go index 5d088f5002a1..4c1a824dc067 100644 --- a/beacon-chain/sync/rate_limiter.go +++ b/beacon-chain/sync/rate_limiter.go @@ -79,6 +79,8 @@ func newRateLimiter(p2pProvider p2p.P2P) *limiter { topicMap[addEncoding(p2p.RPCBlobSidecarsByRootTopicV1)] = blobCollector // BlobSidecarsByRangeV1 topicMap[addEncoding(p2p.RPCBlobSidecarsByRangeTopicV1)] = blobCollector + topicMap[addEncoding(p2p.RPCBlobSidecarsByRootTopicV2)] = blobCollector + topicMap[addEncoding(p2p.RPCBlobSidecarsByRangeTopicV2)] = blobCollector // General topic for all rpc requests. topicMap[rpcLimiterTopic] = leakybucket.NewCollector(5, defaultBurstLimit*2, leakyBucketPeriod, false /* deleteEmptyBuckets */) diff --git a/beacon-chain/sync/rate_limiter_test.go b/beacon-chain/sync/rate_limiter_test.go index 653581103147..f3f7b85729af 100644 --- a/beacon-chain/sync/rate_limiter_test.go +++ b/beacon-chain/sync/rate_limiter_test.go @@ -18,7 +18,7 @@ import ( func TestNewRateLimiter(t *testing.T) { rlimiter := newRateLimiter(mockp2p.NewTestP2P(t)) - assert.Equal(t, len(rlimiter.limiterMap), 12, "correct number of topics not registered") + assert.Equal(t, len(rlimiter.limiterMap), 14, "correct number of topics not registered") } func TestNewRateLimiter_FreeCorrectly(t *testing.T) { diff --git a/beacon-chain/sync/rpc.go b/beacon-chain/sync/rpc.go index 5c0d73ddbb38..6f0be94e10a2 100644 --- a/beacon-chain/sync/rpc.go +++ b/beacon-chain/sync/rpc.go @@ -65,7 +65,7 @@ func (s *Service) rpcHandlerByTopicFromFork(forkIndex int) (map[string]rpcHandle // Deneb: https://github.com/ethereum/consensus-specs/blob/dev/specs/deneb/p2p-interface.md#messages // Electra: https://github.com/ethereum/consensus-specs/blob/dev/specs/electra/p2p-interface.md#messages - case version.Deneb, version.Electra: + case version.Deneb: return map[string]rpcHandler{ p2p.RPCStatusTopicV1: s.statusRPCHandler, p2p.RPCGoodByeTopicV1: s.goodbyeRPCHandler, @@ -76,7 +76,17 @@ func (s *Service) rpcHandlerByTopicFromFork(forkIndex int) (map[string]rpcHandle p2p.RPCBlobSidecarsByRootTopicV1: s.blobSidecarByRootRPCHandler, // Added in Deneb p2p.RPCBlobSidecarsByRangeTopicV1: s.blobSidecarsByRangeRPCHandler, // Added in Deneb }, nil - + case version.Electra: + 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.RPCBlobSidecarsByRootTopicV2: s.blobSidecarByRootRPCHandler, // Added in Electra + p2p.RPCBlobSidecarsByRangeTopicV2: s.blobSidecarsByRangeRPCHandler, // Added in Electra + }, nil default: return nil, errors.Errorf("RPC handler not found for fork index %d", forkIndex) } diff --git a/beacon-chain/sync/rpc_blob_sidecars_by_range.go b/beacon-chain/sync/rpc_blob_sidecars_by_range.go index a5e179513d65..eadb52e56242 100644 --- a/beacon-chain/sync/rpc_blob_sidecars_by_range.go +++ b/beacon-chain/sync/rpc_blob_sidecars_by_range.go @@ -100,6 +100,9 @@ func (s *Service) blobSidecarsByRangeRPCHandler(ctx context.Context, msg interfa var batch blockBatch wQuota := params.BeaconConfig().MaxRequestBlobSidecars + if slots.ToEpoch(s.cfg.chain.CurrentSlot()) >= params.BeaconConfig().ElectraForkEpoch { + wQuota = params.BeaconConfig().MaxRequestBlobSidecarsElectra + } for batch, ok = batcher.next(ctx, stream); ok; batch, ok = batcher.next(ctx, stream) { batchStart := time.Now() wQuota, err = s.streamBlobBatch(ctx, batch, wQuota, stream) diff --git a/beacon-chain/sync/rpc_blob_sidecars_by_root.go b/beacon-chain/sync/rpc_blob_sidecars_by_root.go index d49040776b32..ab3b5c6bb9a9 100644 --- a/beacon-chain/sync/rpc_blob_sidecars_by_root.go +++ b/beacon-chain/sync/rpc_blob_sidecars_by_root.go @@ -13,9 +13,11 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/types" "github.com/prysmaticlabs/prysm/v5/cmd/beacon-chain/flags" "github.com/prysmaticlabs/prysm/v5/config/params" + "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" "github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace" + "github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/sirupsen/logrus" ) @@ -34,7 +36,8 @@ func (s *Service) blobSidecarByRootRPCHandler(ctx context.Context, msg interface } blobIdents := *ref - if err := validateBlobByRootRequest(blobIdents); err != nil { + cs := s.cfg.clock.CurrentSlot() + if err := validateBlobByRootRequest(blobIdents, cs); err != nil { s.cfg.p2p.Peers().Scorers().BadResponsesScorer().Increment(stream.Conn().RemotePeer()) s.writeErrorResponseToStream(responseCodeInvalidRequest, err.Error(), stream) return err @@ -49,7 +52,6 @@ func (s *Service) blobSidecarByRootRPCHandler(ctx context.Context, msg interface } // Compute the oldest slot we'll allow a peer to request, based on the current slot. - cs := s.cfg.clock.CurrentSlot() minReqSlot, err := BlobRPCMinValidSlot(cs) if err != nil { return errors.Wrapf(err, "unexpected error computing min valid blob request slot, current_slot=%d", cs) @@ -104,9 +106,15 @@ func (s *Service) blobSidecarByRootRPCHandler(ctx context.Context, msg interface return nil } -func validateBlobByRootRequest(blobIdents types.BlobSidecarsByRootReq) error { - if uint64(len(blobIdents)) > params.BeaconConfig().MaxRequestBlobSidecars { - return types.ErrMaxBlobReqExceeded +func validateBlobByRootRequest(blobIdents types.BlobSidecarsByRootReq, slot primitives.Slot) error { + if slots.ToEpoch(slot) >= params.BeaconConfig().ElectraForkEpoch { + if uint64(len(blobIdents)) > params.BeaconConfig().MaxRequestBlobSidecarsElectra { + return types.ErrMaxBlobReqExceeded + } + } else { + if uint64(len(blobIdents)) > params.BeaconConfig().MaxRequestBlobSidecars { + return types.ErrMaxBlobReqExceeded + } } return nil } diff --git a/beacon-chain/sync/rpc_send_request.go b/beacon-chain/sync/rpc_send_request.go index 4180ce06ddb5..8e10f5b2d592 100644 --- a/beacon-chain/sync/rpc_send_request.go +++ b/beacon-chain/sync/rpc_send_request.go @@ -171,6 +171,9 @@ func SendBlobsByRangeRequest(ctx context.Context, tor blockchain.TemporalOracle, maxBlobsPerBlock := uint64(params.BeaconConfig().MaxBlobsPerBlock(req.StartSlot)) max := params.BeaconConfig().MaxRequestBlobSidecars + if slots.ToEpoch(req.StartSlot) >= params.BeaconConfig().ElectraForkEpoch { + max = params.BeaconConfig().MaxRequestBlobSidecarsElectra + } if max > req.Count*maxBlobsPerBlock { max = req.Count * maxBlobsPerBlock } @@ -201,6 +204,9 @@ func SendBlobSidecarByRoot( defer closeStream(stream, log) max := params.BeaconConfig().MaxRequestBlobSidecars + if slots.ToEpoch(slot) >= params.BeaconConfig().ElectraForkEpoch { + max = params.BeaconConfig().MaxRequestBlobSidecarsElectra + } maxBlobCount := params.BeaconConfig().MaxBlobsPerBlock(slot) if max > uint64(len(*req)*maxBlobCount) { max = uint64(len(*req) * maxBlobCount) diff --git a/beacon-chain/sync/subscriber.go b/beacon-chain/sync/subscriber.go index 594d90ec6e03..69afe97eb06c 100644 --- a/beacon-chain/sync/subscriber.go +++ b/beacon-chain/sync/subscriber.go @@ -117,7 +117,7 @@ func (s *Service) registerSubscribers(epoch primitives.Epoch, digest [4]byte) { s.persistentAndAggregatorSubnetIndices, s.attesterSubnetIndices, ) - // Altair Fork Version + // Altair fork version if params.BeaconConfig().AltairForkEpoch <= epoch { s.subscribe( p2p.SyncContributionAndProofSubnetTopicFormat, @@ -135,7 +135,7 @@ func (s *Service) registerSubscribers(epoch primitives.Epoch, digest [4]byte) { ) } - // New Gossip Topic in Capella + // New gossip topic in Capella if params.BeaconConfig().CapellaForkEpoch <= epoch { s.subscribe( p2p.BlsToExecutionChangeSubnetTopicFormat, @@ -145,14 +145,30 @@ func (s *Service) registerSubscribers(epoch primitives.Epoch, digest [4]byte) { ) } - // New Gossip Topic in Deneb - if params.BeaconConfig().DenebForkEpoch <= epoch { + // New gossip topic in Deneb, modified in Electra + if params.BeaconConfig().DenebForkEpoch <= epoch && epoch < params.BeaconConfig().ElectraForkEpoch { s.subscribeWithParameters( p2p.BlobSubnetTopicFormat, s.validateBlob, s.blobSubscriber, digest, - func(primitives.Slot) []uint64 { return sliceFromCount(params.BeaconConfig().BlobsidecarSubnetCount) }, + func(currentSlot primitives.Slot) []uint64 { + return sliceFromCount(params.BeaconConfig().BlobsidecarSubnetCount) + }, + func(currentSlot primitives.Slot) []uint64 { return []uint64{} }, + ) + } + + // Modified gossip topic in Electra + if params.BeaconConfig().ElectraForkEpoch <= epoch { + s.subscribeWithParameters( + p2p.BlobSubnetTopicFormat, + s.validateBlob, + s.blobSubscriber, + digest, + func(currentSlot primitives.Slot) []uint64 { + return sliceFromCount(params.BeaconConfig().BlobsidecarSubnetCountElectra) + }, func(currentSlot primitives.Slot) []uint64 { return []uint64{} }, ) } @@ -429,7 +445,14 @@ func (s *Service) subscribeToSubnets( description = topicFormat[pos+1:] } - log.WithField("digest", fmt.Sprintf("%#x", digest)).Warningf("%s subnets with this digest are no longer valid, unsubscribing from all of them.", description) + if pos := strings.LastIndex(description, "_"); pos != -1 { + description = description[:pos] + } + + log.WithFields(logrus.Fields{ + "digest": fmt.Sprintf("%#x", digest), + "subnets": description, + }).Debug("Subnets with this digest are no longer valid, unsubscribing from all of them") s.reValidateSubscriptions(subscriptions, []uint64{}, topicFormat, digest) return false } diff --git a/beacon-chain/sync/validate_blob.go b/beacon-chain/sync/validate_blob.go index 6fe0f7ee9e11..1f06929b708e 100644 --- a/beacon-chain/sync/validate_blob.go +++ b/beacon-chain/sync/validate_blob.go @@ -58,7 +58,7 @@ func (s *Service) validateBlob(ctx context.Context, pid peer.ID, msg *pubsub.Mes } // [REJECT] The sidecar is for the correct subnet -- i.e. compute_subnet_for_blob_sidecar(sidecar.index) == subnet_id. - want := fmt.Sprintf("blob_sidecar_%d", computeSubnetForBlobSidecar(blob.Index)) + want := fmt.Sprintf("blob_sidecar_%d", computeSubnetForBlobSidecar(blob.Index, blob.Slot())) if !strings.Contains(*msg.Topic, want) { log.WithFields(blobFields(blob)).Debug("Sidecar index does not match topic") return pubsub.ValidationReject, fmt.Errorf("wrong topic name: %s", *msg.Topic) @@ -169,8 +169,12 @@ func blobFields(b blocks.ROBlob) logrus.Fields { } } -func computeSubnetForBlobSidecar(index uint64) uint64 { - return index % params.BeaconConfig().BlobsidecarSubnetCount +func computeSubnetForBlobSidecar(index uint64, slot primitives.Slot) uint64 { + subnetCount := params.BeaconConfig().BlobsidecarSubnetCount + if slots.ToEpoch(slot) >= params.BeaconConfig().ElectraForkEpoch { + subnetCount = params.BeaconConfig().BlobsidecarSubnetCountElectra + } + return index % subnetCount } // saveInvalidBlobToTemp as a block ssz. Writes to temp directory. diff --git a/config/params/config.go b/config/params/config.go index 0522ba7bbfc3..415ebaeeef62 100644 --- a/config/params/config.go +++ b/config/params/config.go @@ -229,12 +229,14 @@ type BeaconChainConfig struct { 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. + BlobsidecarSubnetCount uint64 `yaml:"BLOB_SIDECAR_SUBNET_COUNT"` // BlobsidecarSubnetCount is the number of blobsidecar subnets used in the gossipsub protocol. + BlobsidecarSubnetCountElectra uint64 `yaml:"BLOB_SIDECAR_SUBNET_COUNT_ELECTRA"` // BlobsidecarSubnetCountElectra is the number of blobsidecar subnets used in the gossipsub protocol post Electra hard fork. // Values introduced in Deneb hard fork MaxPerEpochActivationChurnLimit uint64 `yaml:"MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT" spec:"true"` // MaxPerEpochActivationChurnLimit is the maximum amount of churn allotted for validator activation. MinEpochsForBlobsSidecarsRequest primitives.Epoch `yaml:"MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS" spec:"true"` // MinEpochsForBlobsSidecarsRequest is the minimum number of epochs the node will keep the blobs for. MaxRequestBlobSidecars uint64 `yaml:"MAX_REQUEST_BLOB_SIDECARS" spec:"true"` // MaxRequestBlobSidecars is the maximum number of blobs to request in a single request. + MaxRequestBlobSidecarsElectra uint64 `yaml:"MAX_REQUEST_BLOB_SIDECARS_ELECTRA" spec:"true"` // MaxRequestBlobSidecarsElectra is the maximum number of blobs to request in a single request. MaxRequestBlocksDeneb uint64 `yaml:"MAX_REQUEST_BLOCKS_DENEB" spec:"true"` // MaxRequestBlocksDeneb is the maximum number of blocks in a single request after the deneb epoch. // Values introduce in Electra upgrade diff --git a/config/params/loader_test.go b/config/params/loader_test.go index c6639d31f3e0..f2149a3c7a8d 100644 --- a/config/params/loader_test.go +++ b/config/params/loader_test.go @@ -25,7 +25,6 @@ import ( // IMPORTANT: Use one field per line and sort these alphabetically to reduce conflicts. var placeholderFields = []string{ "BLOB_SIDECAR_SUBNET_COUNT_EIP7594", - "BLOB_SIDECAR_SUBNET_COUNT_ELECTRA", "BYTES_PER_LOGS_BLOOM", // Compile time constant on ExecutionPayload.logs_bloom. "EIP6110_FORK_EPOCH", "EIP6110_FORK_VERSION", @@ -44,7 +43,6 @@ var placeholderFields = []string{ "MAX_BYTES_PER_TRANSACTION", // Used for ssz of EL transactions. Unused in Prysm. "MAX_EXTRA_DATA_BYTES", // Compile time constant on ExecutionPayload.extra_data. "MAX_REQUEST_BLOB_SIDECARS_EIP7594", - "MAX_REQUEST_BLOB_SIDECARS_ELECTRA", "MAX_REQUEST_BLOB_SIDECARS_FULU", "MAX_REQUEST_PAYLOADS", // Compile time constant on BeaconBlockBody.ExecutionRequests "MAX_TRANSACTIONS_PER_PAYLOAD", // Compile time constant on ExecutionPayload.transactions. diff --git a/config/params/mainnet_config.go b/config/params/mainnet_config.go index d2afff414953..40428a91fdb8 100644 --- a/config/params/mainnet_config.go +++ b/config/params/mainnet_config.go @@ -268,7 +268,8 @@ var mainnetBeaconConfig = &BeaconChainConfig{ ExecutionEngineTimeoutValue: 8, // 8 seconds default based on: https://github.com/ethereum/execution-apis/blob/main/src/engine/specification.md#core // Subnet value - BlobsidecarSubnetCount: 6, + BlobsidecarSubnetCount: 6, + BlobsidecarSubnetCountElectra: 9, MaxPerEpochActivationChurnLimit: 8, MinEpochsForBlobsSidecarsRequest: 4096, @@ -323,6 +324,7 @@ var mainnetBeaconConfig = &BeaconChainConfig{ DeprecatedMaxBlobsPerBlock: 6, DeprecatedMaxBlobsPerBlockElectra: 9, DeprecatedTargetBlobsPerBlockElectra: 6, + MaxRequestBlobSidecarsElectra: 1152, } // MainnetTestConfig provides a version of the mainnet config that has a different name diff --git a/hack/update-go-ssz.sh b/hack/update-go-ssz.sh index 3e48660f2bce..344cd521f918 100755 --- a/hack/update-go-ssz.sh +++ b/hack/update-go-ssz.sh @@ -20,5 +20,7 @@ for ((i = 0; i < arraylength; i++)); do destination=${file_list[i]#*$searchstring} color "34" "$destination" chmod 644 "$destination" - cp -R -L "${file_list[i]}" "$destination" + + # Copy to destination while removing the `// Hash: ...` line from the file header. + sed '/\/\/ Hash: /d' "${file_list[i]}" > "$destination" done diff --git a/proto/engine/v1/engine.ssz.go b/proto/engine/v1/engine.ssz.go index d84a45a7f321..b298fb0891a0 100644 --- a/proto/engine/v1/engine.ssz.go +++ b/proto/engine/v1/engine.ssz.go @@ -1,5 +1,4 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 78d3fe6d1bab334f38e2169af092f457086963f788a35fd9c6d765c746a6b6e8 package enginev1 import ( diff --git a/proto/eth/v1/gateway.ssz.go b/proto/eth/v1/gateway.ssz.go index d6e37516c67c..d423f91d3ab7 100644 --- a/proto/eth/v1/gateway.ssz.go +++ b/proto/eth/v1/gateway.ssz.go @@ -1,5 +1,4 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: d06a72227c2f5e350916cce3e89f4e855135a2a22f6ea263dedc68fa506c1ba7 package v1 import ( diff --git a/proto/eth/v2/grpc.ssz.go b/proto/eth/v2/grpc.ssz.go index 121782fb1f58..a1f185f6e800 100644 --- a/proto/eth/v2/grpc.ssz.go +++ b/proto/eth/v2/grpc.ssz.go @@ -1,5 +1,4 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: d9f0bc4bc63fed6da5a3070d72cc575e0a5a496a8725d3d6b58e11a5b67acd5f package eth import ( diff --git a/proto/prysm/v1alpha1/altair.ssz.go b/proto/prysm/v1alpha1/altair.ssz.go index 1044e35b15cb..84c8e4b6672c 100644 --- a/proto/prysm/v1alpha1/altair.ssz.go +++ b/proto/prysm/v1alpha1/altair.ssz.go @@ -1,5 +1,4 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 5b4ab4dc45576936fb5674ffd75bcac4513bd176968ccaab1ca0d4f9aad96c87 package eth import ( diff --git a/proto/prysm/v1alpha1/bellatrix.ssz.go b/proto/prysm/v1alpha1/bellatrix.ssz.go index d5fd6770ceda..c7adfed44990 100644 --- a/proto/prysm/v1alpha1/bellatrix.ssz.go +++ b/proto/prysm/v1alpha1/bellatrix.ssz.go @@ -1,5 +1,4 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 19e0d83224f9401368a918fce23953593a463933f46cba5de265ac251cbffe27 package eth import ( diff --git a/proto/prysm/v1alpha1/capella.ssz.go b/proto/prysm/v1alpha1/capella.ssz.go index f08edfd251fb..503f6a720fff 100644 --- a/proto/prysm/v1alpha1/capella.ssz.go +++ b/proto/prysm/v1alpha1/capella.ssz.go @@ -1,5 +1,4 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: fad217ca811f238ede552d6184e1a7fd12830baa505fc0c6f7d1b94f88608b5e package eth import ( diff --git a/proto/prysm/v1alpha1/deneb.ssz.go b/proto/prysm/v1alpha1/deneb.ssz.go index c9645f2036ef..4eeab97e97c8 100644 --- a/proto/prysm/v1alpha1/deneb.ssz.go +++ b/proto/prysm/v1alpha1/deneb.ssz.go @@ -1,5 +1,4 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 4e456db3c9849de6d410f9342c13926561d0b916a1fd7f88dbadd42c2ec5940a package eth import ( diff --git a/proto/prysm/v1alpha1/electra.ssz.go b/proto/prysm/v1alpha1/electra.ssz.go index f2f7385a46e1..2016b77baeeb 100644 --- a/proto/prysm/v1alpha1/electra.ssz.go +++ b/proto/prysm/v1alpha1/electra.ssz.go @@ -1,5 +1,4 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 0701bb1fb953513ce9cb184d5f87201c821023d201d9a78dba68a238dc27bfab package eth import ( diff --git a/proto/prysm/v1alpha1/fulu.ssz.go b/proto/prysm/v1alpha1/fulu.ssz.go index 5d35d079fcb4..1b45f0c409ee 100644 --- a/proto/prysm/v1alpha1/fulu.ssz.go +++ b/proto/prysm/v1alpha1/fulu.ssz.go @@ -1,5 +1,4 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: bb60e4d1a840dfe780ebb396cca8520a4229ce936c032da71bfb8de0d271aa19 package eth import ( diff --git a/proto/prysm/v1alpha1/non-core.ssz.go b/proto/prysm/v1alpha1/non-core.ssz.go index 4492534c6f08..58e5e30d402d 100644 --- a/proto/prysm/v1alpha1/non-core.ssz.go +++ b/proto/prysm/v1alpha1/non-core.ssz.go @@ -1,5 +1,4 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: 5314abedbe58cf5739302b3293a023537060eada88a7f791813ad139adda516c package eth import ( diff --git a/proto/prysm/v1alpha1/phase0.ssz.go b/proto/prysm/v1alpha1/phase0.ssz.go index 6b811844dfca..e95995f0e610 100644 --- a/proto/prysm/v1alpha1/phase0.ssz.go +++ b/proto/prysm/v1alpha1/phase0.ssz.go @@ -1,5 +1,4 @@ // Code generated by fastssz. DO NOT EDIT. -// Hash: cfa400e2b24ddea4df7fed35264c29ace8f6f5eef05dc9725f118f44844e1a75 package eth import ( diff --git a/testing/spectest/shared/altair/epoch_processing/BUILD.bazel b/testing/spectest/shared/altair/epoch_processing/BUILD.bazel index d566fdbd43af..0ac32be75d29 100644 --- a/testing/spectest/shared/altair/epoch_processing/BUILD.bazel +++ b/testing/spectest/shared/altair/epoch_processing/BUILD.bazel @@ -26,7 +26,6 @@ go_library( "//beacon-chain/core/helpers:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/state-native:go_default_library", - "//config/params:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//testing/require:go_default_library", "//testing/spectest/utils:go_default_library", diff --git a/testing/spectest/shared/altair/epoch_processing/slashings.go b/testing/spectest/shared/altair/epoch_processing/slashings.go index c06b7bc172c8..0e43111ebf7a 100644 --- a/testing/spectest/shared/altair/epoch_processing/slashings.go +++ b/testing/spectest/shared/altair/epoch_processing/slashings.go @@ -7,7 +7,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/epoch" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" - "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" ) @@ -30,7 +29,7 @@ func RunSlashingsTests(t *testing.T, config string) { } func processSlashingsWrapper(t *testing.T, st state.BeaconState) (state.BeaconState, error) { - st, err := epoch.ProcessSlashings(st, params.BeaconConfig().ProportionalSlashingMultiplierAltair) + st, err := epoch.ProcessSlashings(st) require.NoError(t, err, "Could not process slashings") return st, nil } diff --git a/testing/spectest/shared/bellatrix/epoch_processing/BUILD.bazel b/testing/spectest/shared/bellatrix/epoch_processing/BUILD.bazel index 03ac47eaec86..569637985d43 100644 --- a/testing/spectest/shared/bellatrix/epoch_processing/BUILD.bazel +++ b/testing/spectest/shared/bellatrix/epoch_processing/BUILD.bazel @@ -26,7 +26,6 @@ go_library( "//beacon-chain/core/helpers:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/state-native:go_default_library", - "//config/params:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//testing/require:go_default_library", "//testing/spectest/utils:go_default_library", diff --git a/testing/spectest/shared/bellatrix/epoch_processing/slashings.go b/testing/spectest/shared/bellatrix/epoch_processing/slashings.go index 09ea116074f4..1950e47ca0e2 100644 --- a/testing/spectest/shared/bellatrix/epoch_processing/slashings.go +++ b/testing/spectest/shared/bellatrix/epoch_processing/slashings.go @@ -7,7 +7,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/epoch" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" - "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" ) @@ -30,7 +29,7 @@ func RunSlashingsTests(t *testing.T, config string) { } func processSlashingsWrapper(t *testing.T, st state.BeaconState) (state.BeaconState, error) { - st, err := epoch.ProcessSlashings(st, params.BeaconConfig().ProportionalSlashingMultiplierBellatrix) + st, err := epoch.ProcessSlashings(st) require.NoError(t, err, "Could not process slashings") return st, nil } diff --git a/testing/spectest/shared/capella/epoch_processing/BUILD.bazel b/testing/spectest/shared/capella/epoch_processing/BUILD.bazel index 9fd12223eb3e..02aca35745dd 100644 --- a/testing/spectest/shared/capella/epoch_processing/BUILD.bazel +++ b/testing/spectest/shared/capella/epoch_processing/BUILD.bazel @@ -26,7 +26,6 @@ go_library( "//beacon-chain/core/helpers:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/state-native:go_default_library", - "//config/params:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//testing/require:go_default_library", "//testing/spectest/utils:go_default_library", diff --git a/testing/spectest/shared/capella/epoch_processing/slashings.go b/testing/spectest/shared/capella/epoch_processing/slashings.go index ca837abc6144..b8e43db9e0b9 100644 --- a/testing/spectest/shared/capella/epoch_processing/slashings.go +++ b/testing/spectest/shared/capella/epoch_processing/slashings.go @@ -7,7 +7,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/epoch" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" - "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" ) @@ -30,7 +29,7 @@ func RunSlashingsTests(t *testing.T, config string) { } func processSlashingsWrapper(t *testing.T, st state.BeaconState) (state.BeaconState, error) { - st, err := epoch.ProcessSlashings(st, params.BeaconConfig().ProportionalSlashingMultiplierBellatrix) + st, err := epoch.ProcessSlashings(st) require.NoError(t, err, "Could not process slashings") return st, nil } diff --git a/testing/spectest/shared/deneb/epoch_processing/BUILD.bazel b/testing/spectest/shared/deneb/epoch_processing/BUILD.bazel index 6a483739c35f..262b87507ccf 100644 --- a/testing/spectest/shared/deneb/epoch_processing/BUILD.bazel +++ b/testing/spectest/shared/deneb/epoch_processing/BUILD.bazel @@ -26,7 +26,6 @@ go_library( "//beacon-chain/core/helpers:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/state-native:go_default_library", - "//config/params:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//testing/require:go_default_library", "//testing/spectest/utils:go_default_library", diff --git a/testing/spectest/shared/deneb/epoch_processing/slashings.go b/testing/spectest/shared/deneb/epoch_processing/slashings.go index ac4cd3baf656..aedc2f934a79 100644 --- a/testing/spectest/shared/deneb/epoch_processing/slashings.go +++ b/testing/spectest/shared/deneb/epoch_processing/slashings.go @@ -7,7 +7,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/epoch" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" - "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" ) @@ -27,7 +26,7 @@ func RunSlashingsTests(t *testing.T, config string) { } func processSlashingsWrapper(t *testing.T, st state.BeaconState) (state.BeaconState, error) { - st, err := epoch.ProcessSlashings(st, params.BeaconConfig().ProportionalSlashingMultiplierBellatrix) + st, err := epoch.ProcessSlashings(st) require.NoError(t, err, "Could not process slashings") return st, nil } diff --git a/testing/spectest/shared/electra/epoch_processing/BUILD.bazel b/testing/spectest/shared/electra/epoch_processing/BUILD.bazel index c65c52dd9f69..ebf5fbc1cfcc 100644 --- a/testing/spectest/shared/electra/epoch_processing/BUILD.bazel +++ b/testing/spectest/shared/electra/epoch_processing/BUILD.bazel @@ -28,7 +28,6 @@ go_library( "//beacon-chain/core/helpers:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/state-native:go_default_library", - "//config/params:go_default_library", "//consensus-types/primitives:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//testing/require:go_default_library", diff --git a/testing/spectest/shared/electra/epoch_processing/slashings.go b/testing/spectest/shared/electra/epoch_processing/slashings.go index f6c9d61e65ec..fe420e9b9ab4 100644 --- a/testing/spectest/shared/electra/epoch_processing/slashings.go +++ b/testing/spectest/shared/electra/epoch_processing/slashings.go @@ -7,7 +7,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/electra" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" - "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" ) @@ -27,7 +26,7 @@ func RunSlashingsTests(t *testing.T, config string) { } func processSlashingsWrapper(t *testing.T, st state.BeaconState) (state.BeaconState, error) { - st, err := electra.ProcessSlashings(st, params.BeaconConfig().ProportionalSlashingMultiplierBellatrix) + st, err := electra.ProcessSlashings(st) require.NoError(t, err, "Could not process slashings") return st, nil } diff --git a/testing/spectest/shared/phase0/epoch_processing/BUILD.bazel b/testing/spectest/shared/phase0/epoch_processing/BUILD.bazel index 68e6a1a95491..84be9a021748 100644 --- a/testing/spectest/shared/phase0/epoch_processing/BUILD.bazel +++ b/testing/spectest/shared/phase0/epoch_processing/BUILD.bazel @@ -24,7 +24,6 @@ go_library( "//beacon-chain/core/helpers:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/state-native:go_default_library", - "//config/params:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//testing/require:go_default_library", "//testing/spectest/utils:go_default_library", diff --git a/testing/spectest/shared/phase0/epoch_processing/slashings.go b/testing/spectest/shared/phase0/epoch_processing/slashings.go index cee89bd62ea1..bcebe694657c 100644 --- a/testing/spectest/shared/phase0/epoch_processing/slashings.go +++ b/testing/spectest/shared/phase0/epoch_processing/slashings.go @@ -9,7 +9,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/epoch/precompute" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" - "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/spectest/utils" ) @@ -33,7 +32,7 @@ func RunSlashingsTests(t *testing.T, config string) { } func processSlashingsWrapper(t *testing.T, s state.BeaconState) (state.BeaconState, error) { - s, err := epoch.ProcessSlashings(s, params.BeaconConfig().ProportionalSlashingMultiplier) + s, err := epoch.ProcessSlashings(s) require.NoError(t, err, "Could not process slashings") return s, nil }