From f3a4168a0eb5e4a625932100b72d19843a668c61 Mon Sep 17 00:00:00 2001 From: Cal Bera Date: Fri, 29 Nov 2024 16:29:30 -0500 Subject: [PATCH 1/5] chore(forks): Handle MaxValidatorsPerWithdrawalsSweep based on planned fork upgrades --- mod/chain-spec/pkg/chain/chain_spec.go | 17 +++++-- mod/chain-spec/pkg/chain/data.go | 14 ++++-- mod/config/pkg/spec/base.go | 22 +++++++--- mod/config/pkg/spec/boonet.go | 14 +++--- .../pkg/core/state/statedb.go | 4 +- .../pkg/core/state/upgrade.go | 44 +++++++++++++++++++ .../pkg/core/state_processor_withdrawals.go | 14 +++++- 7 files changed, 106 insertions(+), 23 deletions(-) create mode 100644 mod/state-transition/pkg/core/state/upgrade.go diff --git a/mod/chain-spec/pkg/chain/chain_spec.go b/mod/chain-spec/pkg/chain/chain_spec.go index 27197b979b..8c9c6a1d0c 100644 --- a/mod/chain-spec/pkg/chain/chain_spec.go +++ b/mod/chain-spec/pkg/chain/chain_spec.go @@ -155,7 +155,11 @@ type Spec[ // MaxValidatorsPerWithdrawalsSweep returns the maximum number of validators // per withdrawal sweep. - MaxValidatorsPerWithdrawalsSweep() uint64 + MaxValidatorsPerWithdrawalsSweep( + isPostUpgrade func(uint64, SlotT) bool, + chainID uint64, + slot SlotT, + ) uint64 // Deneb Values @@ -485,8 +489,15 @@ func (c chainSpec[ // withdrawals sweep. func (c chainSpec[ DomainTypeT, EpochT, ExecutionAddressT, SlotT, CometBFTConfigT, -]) MaxValidatorsPerWithdrawalsSweep() uint64 { - return c.Data.MaxValidatorsPerWithdrawalsSweep +]) MaxValidatorsPerWithdrawalsSweep( + isPostUpgrade func(uint64, SlotT) bool, + chainID uint64, slot SlotT, +) uint64 { + if isPostUpgrade(chainID, slot) { + return c.Data.MaxValidatorsPerWithdrawalsSweepPostUpgrade + } else { + return c.Data.MaxValidatorsPerWithdrawalsSweepPreUpgrade + } } // MinEpochsForBlobsSidecarsRequest returns the minimum number of epochs for diff --git a/mod/chain-spec/pkg/chain/data.go b/mod/chain-spec/pkg/chain/data.go index abee0fd764..4ca3c4fc19 100644 --- a/mod/chain-spec/pkg/chain/data.go +++ b/mod/chain-spec/pkg/chain/data.go @@ -49,6 +49,7 @@ type SpecData[ HysteresisDownwardMultiplier uint64 `mapstructure:"hysteresis-downward-multiplier"` // HysteresisUpwardMultiplier is the multiplier for upward balance adjustments. HysteresisUpwardMultiplier uint64 `mapstructure:"hysteresis-upward-multiplier"` + // Time parameters constants. // // SlotsPerEpoch is the number of slots per epoch. @@ -128,10 +129,15 @@ type SpecData[ // MaxWithdrawalsPerPayload indicates the maximum number of withdrawal // operations allowed in a single payload. MaxWithdrawalsPerPayload uint64 `mapstructure:"max-withdrawals-per-payload"` - // MaxValidatorsPerWithdrawalsSweep specifies the maximum number of - // validator - // withdrawals allowed per sweep. - MaxValidatorsPerWithdrawalsSweep uint64 `mapstructure:"max-validators-per-withdrawals-sweep"` + // MaxValidatorsPerWithdrawalsSweepPreUpgrade specifies the maximum number + // of validator withdrawals allowed per sweep. Before the upgrade, this + // value is consistent with ETH2.0 spec, set to 2^14. + MaxValidatorsPerWithdrawalsSweepPreUpgrade uint64 `mapstructure:"max-validators-per-withdrawals-sweep-pre-upgrade"` + // MaxValidatorsPerWithdrawalsSweepPostUpgrade specifies the maximum number + // of validator withdrawals allowed per sweep. After the upgrade, this value + // is set to the largest prime number smaller than the minimum possible + // amount of total validators. + MaxValidatorsPerWithdrawalsSweepPostUpgrade uint64 `mapstructure:"max-validators-per-withdrawals-sweep-post-upgrade"` // Deneb Values // diff --git a/mod/config/pkg/spec/base.go b/mod/config/pkg/spec/base.go index 3be843e0b5..33e9778ea3 100644 --- a/mod/config/pkg/spec/base.go +++ b/mod/config/pkg/spec/base.go @@ -55,10 +55,11 @@ func BaseSpec() chain.SpecData[ any, ]{ // Gwei value constants. - MinDepositAmount: 1e9, - MaxEffectiveBalance: 32e9, - EjectionBalance: 16e9, - EffectiveBalanceIncrement: 1e9, + MinDepositAmount: 1e9, + MaxEffectiveBalance: 32e9, + EjectionBalance: 16e9, + EffectiveBalanceIncrement: 1e9, + HysteresisQuotient: 4, HysteresisDownwardMultiplier: 1, HysteresisUpwardMultiplier: 5, @@ -67,6 +68,7 @@ func BaseSpec() chain.SpecData[ SlotsPerEpoch: 32, MinEpochsToInactivityPenalty: 4, SlotsPerHistoricalRoot: 8, + // Signature domains. DomainTypeProposer: common.DomainType{ 0x00, 0x00, 0x00, 0x00, @@ -92,6 +94,7 @@ func BaseSpec() chain.SpecData[ DomainTypeApplicationMask: common.DomainType{ 0x00, 0x00, 0x00, 0x01, }, + // Eth1-related values. DepositContractAddress: common.NewExecutionAddressFromHex( DefaultDepositContractAddress, @@ -99,21 +102,27 @@ func BaseSpec() chain.SpecData[ DepositEth1ChainID: 1, Eth1FollowDistance: 1, TargetSecondsPerEth1Block: 3, + // Fork-related values. DenebPlusForkEpoch: 9999999999999998, ElectraForkEpoch: 9999999999999999, + // State list length constants. EpochsPerHistoricalVector: 8, EpochsPerSlashingsVector: 8, HistoricalRootsLimit: 8, ValidatorRegistryLimit: 1099511627776, + // Max operations per block constants. MaxDepositsPerBlock: 16, + // Slashing ProportionalSlashingMultiplier: 1, + // Capella values. - MaxWithdrawalsPerPayload: 16, - MaxValidatorsPerWithdrawalsSweep: 1 << 14, + MaxWithdrawalsPerPayload: 16, + MaxValidatorsPerWithdrawalsSweepPreUpgrade: 1 << 14, + // Deneb values. MinEpochsForBlobsSidecarsRequest: 4096, MaxBlobCommitmentsPerBlock: 16, @@ -121,6 +130,7 @@ func BaseSpec() chain.SpecData[ FieldElementsPerBlob: 4096, BytesPerBlob: 131072, KZGCommitmentInclusionProofDepth: 17, + // Comet values. CometValues: cmtConsensusParams, } diff --git a/mod/config/pkg/spec/boonet.go b/mod/config/pkg/spec/boonet.go index 95976f79fa..ce4513e5dc 100644 --- a/mod/config/pkg/spec/boonet.go +++ b/mod/config/pkg/spec/boonet.go @@ -34,27 +34,27 @@ func BoonetChainSpec() (chain.Spec[ math.Slot, any, ], error) { - testnetSpec := BaseSpec() + boonetSpec := BaseSpec() // Chain ID is 80000. - testnetSpec.DepositEth1ChainID = BoonetEth1ChainID + boonetSpec.DepositEth1ChainID = BoonetEth1ChainID // BGT contract address. - testnetSpec.EVMInflationAddress = common.NewExecutionAddressFromHex( + boonetSpec.EVMInflationAddress = common.NewExecutionAddressFromHex( "0x289274787bAF083C15A45a174b7a8e44F0720660", ) - // 2.5 BERA per block minting. + // BERA per block minting. // // TODO: determine correct value for boonet upgrade. - testnetSpec.EVMInflationPerBlock = 2.5e9 + boonetSpec.EVMInflationPerBlock = 2.5e9 // MaxValidatorsPerWithdrawalsSweep is 43 because we expect at least 46 // validators in the total validators set. We choose a prime number smaller // than the minimum amount of total validators possible. // // TODO: Determine correct value for boonet upgrade. - testnetSpec.MaxValidatorsPerWithdrawalsSweep = 43 + boonetSpec.MaxValidatorsPerWithdrawalsSweepPostUpgrade = 43 - return chain.NewChainSpec(testnetSpec) + return chain.NewChainSpec(boonetSpec) } diff --git a/mod/state-transition/pkg/core/state/statedb.go b/mod/state-transition/pkg/core/state/statedb.go index 8a2d925fa3..8d681ea494 100644 --- a/mod/state-transition/pkg/core/state/statedb.go +++ b/mod/state-transition/pkg/core/state/statedb.go @@ -251,7 +251,9 @@ func (s *StateDB[ } bound := min( - totalValidators, s.cs.MaxValidatorsPerWithdrawalsSweep(), + totalValidators, s.cs.MaxValidatorsPerWithdrawalsSweep( + IsPostUpgrade, s.cs.DepositEth1ChainID(), slot, + ), ) // Iterate through indices to find the next validators to withdraw. diff --git a/mod/state-transition/pkg/core/state/upgrade.go b/mod/state-transition/pkg/core/state/upgrade.go new file mode 100644 index 0000000000..9555d085a1 --- /dev/null +++ b/mod/state-transition/pkg/core/state/upgrade.go @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: BUSL-1.1 +// +// Copyright (C) 2024, Berachain Foundation. All rights reserved. +// Use of this software is governed by the Business Source License included +// in the LICENSE file of this repository and at www.mariadb.com/bsl11. +// +// ANY USE OF THE LICENSED WORK IN VIOLATION OF THIS LICENSE WILL AUTOMATICALLY +// TERMINATE YOUR RIGHTS UNDER THIS LICENSE FOR THE CURRENT AND ALL OTHER +// VERSIONS OF THE LICENSED WORK. +// +// THIS LICENSE DOES NOT GRANT YOU ANY RIGHT IN ANY TRADEMARK OR LOGO OF +// LICENSOR OR ITS AFFILIATES (PROVIDED THAT YOU MAY USE A TRADEMARK OR LOGO OF +// LICENSOR AS EXPRESSLY REQUIRED BY THIS LICENSE). +// +// TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON +// AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, +// EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND +// TITLE. + +package state + +import ( + "github.com/berachain/beacon-kit/mod/config/pkg/spec" + "github.com/berachain/beacon-kit/mod/primitives/pkg/math" +) + +// IsPostUpgrade returns true if the chain is post-upgrade (Fork2 on Boonet). +// +// TODO: Jank. Refactor into better fork version management. +func IsPostUpgrade(chainID uint64, slot math.Slot) bool { + switch chainID { + case spec.BartioChainID: + return false + case spec.BoonetEth1ChainID: + if slot < math.U64(spec.BoonetFork2Height) { + return false + } + + return true + default: + return true + } +} diff --git a/mod/state-transition/pkg/core/state_processor_withdrawals.go b/mod/state-transition/pkg/core/state_processor_withdrawals.go index a3e096b2ba..afd285bfa0 100644 --- a/mod/state-transition/pkg/core/state_processor_withdrawals.go +++ b/mod/state-transition/pkg/core/state_processor_withdrawals.go @@ -26,6 +26,7 @@ import ( "github.com/berachain/beacon-kit/mod/config/pkg/spec" "github.com/berachain/beacon-kit/mod/errors" "github.com/berachain/beacon-kit/mod/primitives/pkg/math" + "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/state" "github.com/davecgh/go-spew/spew" ) @@ -93,6 +94,7 @@ func (sp *StateProcessor[ st, expectedWithdrawals, payloadWithdrawals, + slot, ) case sp.cs.DepositEth1ChainID() == spec.BoonetEth1ChainID && @@ -116,6 +118,7 @@ func (sp *StateProcessor[ st, expectedWithdrawals, payloadWithdrawals, + slot, ) default: @@ -123,6 +126,7 @@ func (sp *StateProcessor[ st, expectedWithdrawals, payloadWithdrawals, + slot, ) } } @@ -134,6 +138,7 @@ func (sp *StateProcessor[ st BeaconStateT, expectedWithdrawals []WithdrawalT, payloadWithdrawals []WithdrawalT, + slot math.Slot, ) error { for i, wd := range expectedWithdrawals { // Ensure the withdrawals match the local state. @@ -185,7 +190,9 @@ func (sp *StateProcessor[ return err } nextValidatorIndex += math.ValidatorIndex( - sp.cs.MaxValidatorsPerWithdrawalsSweep()) + sp.cs.MaxValidatorsPerWithdrawalsSweep( + state.IsPostUpgrade, spec.BartioChainID, slot, + )) nextValidatorIndex %= math.ValidatorIndex(totalValidators) } @@ -199,6 +206,7 @@ func (sp *StateProcessor[ st BeaconStateT, expectedWithdrawals []WithdrawalT, payloadWithdrawals []WithdrawalT, + slot math.Slot, ) error { // Enforce that first withdrawal is EVM inflation if len(payloadWithdrawals) == 0 { @@ -259,7 +267,9 @@ func (sp *StateProcessor[ return err } nextValidatorIndex += math.ValidatorIndex( - sp.cs.MaxValidatorsPerWithdrawalsSweep()) + sp.cs.MaxValidatorsPerWithdrawalsSweep( + state.IsPostUpgrade, sp.cs.DepositEth1ChainID(), slot, + )) nextValidatorIndex %= math.ValidatorIndex(totalValidators) } From 0718b577492c77fa4b0f3d39f96159f5830eff54 Mon Sep 17 00:00:00 2001 From: Cal Bera Date: Sat, 30 Nov 2024 16:43:01 -0500 Subject: [PATCH 2/5] fix unit --- .../pkg/core/state_processor_staking_test.go | 1 + .../pkg/core/state_processor_withdrawals.go | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/mod/state-transition/pkg/core/state_processor_staking_test.go b/mod/state-transition/pkg/core/state_processor_staking_test.go index 599510cec7..9d0c39658f 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -434,6 +434,7 @@ func TestTransitionMaxWithdrawals(t *testing.T) { csData := spec.BaseSpec() csData.DepositEth1ChainID = spec.BoonetEth1ChainID csData.MaxWithdrawalsPerPayload = 2 + csData.MaxValidatorsPerWithdrawalsSweepPostUpgrade = 2 cs, err := chain.NewChainSpec(csData) require.NoError(t, err) diff --git a/mod/state-transition/pkg/core/state_processor_withdrawals.go b/mod/state-transition/pkg/core/state_processor_withdrawals.go index afd285bfa0..c8f1825e57 100644 --- a/mod/state-transition/pkg/core/state_processor_withdrawals.go +++ b/mod/state-transition/pkg/core/state_processor_withdrawals.go @@ -80,6 +80,13 @@ func (sp *StateProcessor[ // Common validations if len(expectedWithdrawals) != len(payloadWithdrawals) { + for i, wd := range expectedWithdrawals { + fmt.Printf("expectedWithdrawal %d: %s\n", i, spew.Sdump(wd)) + } + for i, wd := range payloadWithdrawals { + fmt.Printf("payloadWithdrawal %d: %s\n", i, spew.Sdump(wd)) + } + return errors.Wrapf( ErrNumWithdrawalsMismatch, "withdrawals do not match expected length %d, got %d", From 3dfd160f130e16c8ea26577bbf35bb00540cad9c Mon Sep 17 00:00:00 2001 From: Cal Bera Date: Sat, 30 Nov 2024 17:05:40 -0500 Subject: [PATCH 3/5] format --- mod/chain-spec/pkg/chain/chain_spec.go | 4 ++-- mod/chain-spec/pkg/chain/data.go | 14 ++++++++------ mod/node-core/pkg/services/version/version.go | 8 ++++++-- mod/state-transition/pkg/core/state_processor.go | 8 ++++++-- .../pkg/core/state_processor_withdrawals.go | 7 ------- 5 files changed, 22 insertions(+), 19 deletions(-) diff --git a/mod/chain-spec/pkg/chain/chain_spec.go b/mod/chain-spec/pkg/chain/chain_spec.go index 8c9c6a1d0c..f0f7459ed6 100644 --- a/mod/chain-spec/pkg/chain/chain_spec.go +++ b/mod/chain-spec/pkg/chain/chain_spec.go @@ -495,9 +495,9 @@ func (c chainSpec[ ) uint64 { if isPostUpgrade(chainID, slot) { return c.Data.MaxValidatorsPerWithdrawalsSweepPostUpgrade - } else { - return c.Data.MaxValidatorsPerWithdrawalsSweepPreUpgrade } + + return c.Data.MaxValidatorsPerWithdrawalsSweepPreUpgrade } // MinEpochsForBlobsSidecarsRequest returns the minimum number of epochs for diff --git a/mod/chain-spec/pkg/chain/data.go b/mod/chain-spec/pkg/chain/data.go index 4ca3c4fc19..4c60846e1c 100644 --- a/mod/chain-spec/pkg/chain/data.go +++ b/mod/chain-spec/pkg/chain/data.go @@ -45,9 +45,11 @@ type SpecData[ // HysteresisQuotient is the quotient used in effective balance calculations HysteresisQuotient uint64 `mapstructure:"hysteresis-quotient"` - // HysteresisDownwardMultiplier is the multiplier for downward balance adjustments. + // HysteresisDownwardMultiplier is the multiplier for downward balance + // adjustments. HysteresisDownwardMultiplier uint64 `mapstructure:"hysteresis-downward-multiplier"` - // HysteresisUpwardMultiplier is the multiplier for upward balance adjustments. + // HysteresisUpwardMultiplier is the multiplier for upward balance + // adjustments. HysteresisUpwardMultiplier uint64 `mapstructure:"hysteresis-upward-multiplier"` // Time parameters constants. @@ -129,13 +131,13 @@ type SpecData[ // MaxWithdrawalsPerPayload indicates the maximum number of withdrawal // operations allowed in a single payload. MaxWithdrawalsPerPayload uint64 `mapstructure:"max-withdrawals-per-payload"` - // MaxValidatorsPerWithdrawalsSweepPreUpgrade specifies the maximum number - // of validator withdrawals allowed per sweep. Before the upgrade, this + // MaxValidatorsPerWithdrawalsSweepPreUpgrade specifies the maximum number + // of validator withdrawals allowed per sweep. Before the upgrade, this // value is consistent with ETH2.0 spec, set to 2^14. MaxValidatorsPerWithdrawalsSweepPreUpgrade uint64 `mapstructure:"max-validators-per-withdrawals-sweep-pre-upgrade"` - // MaxValidatorsPerWithdrawalsSweepPostUpgrade specifies the maximum number + // MaxValidatorsPerWithdrawalsSweepPostUpgrade specifies the maximum number // of validator withdrawals allowed per sweep. After the upgrade, this value - // is set to the largest prime number smaller than the minimum possible + // is set to the largest prime number smaller than the minimum possible // amount of total validators. MaxValidatorsPerWithdrawalsSweepPostUpgrade uint64 `mapstructure:"max-validators-per-withdrawals-sweep-post-upgrade"` diff --git a/mod/node-core/pkg/services/version/version.go b/mod/node-core/pkg/services/version/version.go index 863070d8f0..6c15e97167 100644 --- a/mod/node-core/pkg/services/version/version.go +++ b/mod/node-core/pkg/services/version/version.go @@ -122,7 +122,8 @@ func (rs *ReportingService[_, _]) Start(ctx context.Context) error { for { select { case <-ticker.C: - // since the eth client can be updated separately for beacon node + // since the eth client can be updated separately for beacon + // node // we need to fetch the version every time ethVersion, err = rs.GetEthVersion(ctx) if err != nil { @@ -175,7 +176,10 @@ func (rs *ReportingService[_, _]) GetEthVersion( // Get the client version from the execution layer. info, err := rs.client.GetClientVersionV1(ctx) if err != nil { - return ethVersion, fmt.Errorf("failed to get client version: %w", err) + return ethVersion, fmt.Errorf( + "failed to get client version: %w", + err, + ) } // the spec says we should have at least one client version diff --git a/mod/state-transition/pkg/core/state_processor.go b/mod/state-transition/pkg/core/state_processor.go index eef56f5aa9..e0072301ca 100644 --- a/mod/state-transition/pkg/core/state_processor.go +++ b/mod/state-transition/pkg/core/state_processor.go @@ -563,8 +563,12 @@ func (sp *StateProcessor[ var ( hysteresisIncrement = sp.cs.EffectiveBalanceIncrement() / sp.cs.HysteresisQuotient() - downwardThreshold = math.Gwei(hysteresisIncrement * sp.cs.HysteresisDownwardMultiplier()) - upwardThreshold = math.Gwei(hysteresisIncrement * sp.cs.HysteresisUpwardMultiplier()) + downwardThreshold = math.Gwei( + hysteresisIncrement * sp.cs.HysteresisDownwardMultiplier(), + ) + upwardThreshold = math.Gwei( + hysteresisIncrement * sp.cs.HysteresisUpwardMultiplier(), + ) idx math.U64 balance math.Gwei diff --git a/mod/state-transition/pkg/core/state_processor_withdrawals.go b/mod/state-transition/pkg/core/state_processor_withdrawals.go index c8f1825e57..afd285bfa0 100644 --- a/mod/state-transition/pkg/core/state_processor_withdrawals.go +++ b/mod/state-transition/pkg/core/state_processor_withdrawals.go @@ -80,13 +80,6 @@ func (sp *StateProcessor[ // Common validations if len(expectedWithdrawals) != len(payloadWithdrawals) { - for i, wd := range expectedWithdrawals { - fmt.Printf("expectedWithdrawal %d: %s\n", i, spew.Sdump(wd)) - } - for i, wd := range payloadWithdrawals { - fmt.Printf("payloadWithdrawal %d: %s\n", i, spew.Sdump(wd)) - } - return errors.Wrapf( ErrNumWithdrawalsMismatch, "withdrawals do not match expected length %d, got %d", From 8313a41152404f7f8d316fc57a0b15863bf827cd Mon Sep 17 00:00:00 2001 From: aBear Date: Mon, 2 Dec 2024 11:16:52 -0500 Subject: [PATCH 4/5] nit --- mod/config/pkg/spec/base.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mod/config/pkg/spec/base.go b/mod/config/pkg/spec/base.go index 33e9778ea3..052f0fe877 100644 --- a/mod/config/pkg/spec/base.go +++ b/mod/config/pkg/spec/base.go @@ -120,8 +120,9 @@ func BaseSpec() chain.SpecData[ ProportionalSlashingMultiplier: 1, // Capella values. - MaxWithdrawalsPerPayload: 16, - MaxValidatorsPerWithdrawalsSweepPreUpgrade: 1 << 14, + MaxWithdrawalsPerPayload: 16, + MaxValidatorsPerWithdrawalsSweepPreUpgrade: 1 << 14, + MaxValidatorsPerWithdrawalsSweepPostUpgrade: 1 << 14, // Deneb values. MinEpochsForBlobsSidecarsRequest: 4096, From a8eaf7c0d4631c40b8978ec1ae316d42c164cf6b Mon Sep 17 00:00:00 2001 From: aBear Date: Mon, 2 Dec 2024 11:21:32 -0500 Subject: [PATCH 5/5] minor fork fix --- mod/state-transition/pkg/core/state_processor_withdrawals.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/state-transition/pkg/core/state_processor_withdrawals.go b/mod/state-transition/pkg/core/state_processor_withdrawals.go index afd285bfa0..53ea4051ee 100644 --- a/mod/state-transition/pkg/core/state_processor_withdrawals.go +++ b/mod/state-transition/pkg/core/state_processor_withdrawals.go @@ -191,7 +191,7 @@ func (sp *StateProcessor[ } nextValidatorIndex += math.ValidatorIndex( sp.cs.MaxValidatorsPerWithdrawalsSweep( - state.IsPostUpgrade, spec.BartioChainID, slot, + state.IsPostUpgrade, sp.cs.DepositEth1ChainID(), slot, )) nextValidatorIndex %= math.ValidatorIndex(totalValidators) }