diff --git a/api/client/beacon/checkpoint_test.go b/api/client/beacon/checkpoint_test.go index 33e2dea5d..ba3cc7576 100644 --- a/api/client/beacon/checkpoint_test.go +++ b/api/client/beacon/checkpoint_test.go @@ -123,6 +123,8 @@ func TestDownloadBackwardsCompatibleCombined(t *testing.T) { cfg.AltairForkEpoch = 299 cfg.BellatrixForkEpoch = 300 cfg.CapellaForkEpoch = 301 + cfg.DenebForkEpoch = 302 + cfg.AlpacaForkEpoch = 303 cfg.InitializeForkSchedule() params.OverrideBeaconConfig(cfg) diff --git a/beacon-chain/blockchain/receive_block_test.go b/beacon-chain/blockchain/receive_block_test.go index 37f10cc2a..df34e4180 100644 --- a/beacon-chain/blockchain/receive_block_test.go +++ b/beacon-chain/blockchain/receive_block_test.go @@ -27,6 +27,12 @@ import ( ) func TestService_ReceiveBlock(t *testing.T) { + params.SetupTestConfigCleanup(t) + cfg := params.BeaconConfig() + cfg.DenebForkEpoch = 3 + cfg.AlpacaForkEpoch = 5 + params.OverrideBeaconConfig(cfg) + ctx := context.Background() genesis, keys := util.DeterministicGenesisState(t, 64) diff --git a/beacon-chain/core/blocks/exit_test.go b/beacon-chain/core/blocks/exit_test.go index 0954a45f3..c1d70560b 100644 --- a/beacon-chain/core/blocks/exit_test.go +++ b/beacon-chain/core/blocks/exit_test.go @@ -82,6 +82,13 @@ func TestProcessVoluntaryExits_ExitAlreadySubmitted(t *testing.T) { } func TestProcessVoluntaryExits_AppliesCorrectStatus(t *testing.T) { + params.SetupTestConfigCleanup(t) + cfg := params.BeaconConfig() + cfg.CapellaForkEpoch = 300 + cfg.DenebForkEpoch = 301 + cfg.AlpacaForkEpoch = 302 + params.OverrideBeaconConfig(cfg) + exits := []*ethpb.SignedVoluntaryExit{ { Exit: ðpb.VoluntaryExit{ diff --git a/beacon-chain/core/helpers/validators_test.go b/beacon-chain/core/helpers/validators_test.go index b75051a97..37ac8a754 100644 --- a/beacon-chain/core/helpers/validators_test.go +++ b/beacon-chain/core/helpers/validators_test.go @@ -789,6 +789,7 @@ func TestComputeProposerIndex(t *testing.T) { } func TestIsEligibleForActivationQueue(t *testing.T) { + params.SetupForkEpochConfigForTest() tests := []struct { name string validator *ethpb.Validator diff --git a/beacon-chain/core/transition/transition_no_verify_sig_test.go b/beacon-chain/core/transition/transition_no_verify_sig_test.go index 03472fd4a..858b2c856 100644 --- a/beacon-chain/core/transition/transition_no_verify_sig_test.go +++ b/beacon-chain/core/transition/transition_no_verify_sig_test.go @@ -152,6 +152,14 @@ func TestProcessBlockNoVerifyAnySigAltair_OK(t *testing.T) { } func TestProcessBlockNoVerify_SigSetContainsDescriptions(t *testing.T) { + cfg := params.MainnetConfig().Copy() + cfg.AltairForkEpoch = 300 + cfg.BellatrixForkEpoch = 301 + cfg.CapellaForkEpoch = 302 + cfg.DenebForkEpoch = 303 + cfg.AlpacaForkEpoch = 304 + params.OverrideBeaconConfig(cfg) + beaconState, block, _, _, _ := createFullBlockWithOperations(t) wsb, err := blocks.NewSignedBeaconBlock(block) require.NoError(t, err) diff --git a/beacon-chain/operations/attestations/prune_expired_test.go b/beacon-chain/operations/attestations/prune_expired_test.go index 0755eadf3..3b4a6ca12 100644 --- a/beacon-chain/operations/attestations/prune_expired_test.go +++ b/beacon-chain/operations/attestations/prune_expired_test.go @@ -18,6 +18,12 @@ import ( ) func TestPruneExpired_Ticker(t *testing.T) { + params.SetupTestConfigCleanup(t) + cfg := params.BeaconConfig() + cfg.DenebForkEpoch = 3 + cfg.AlpacaForkEpoch = 5 + params.OverrideBeaconConfig(cfg) + ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) defer cancel() @@ -85,6 +91,12 @@ func TestPruneExpired_Ticker(t *testing.T) { } func TestPruneExpired_PruneExpiredAtts(t *testing.T) { + params.SetupTestConfigCleanup(t) + cfg := params.BeaconConfig() + cfg.DenebForkEpoch = 3 + cfg.AlpacaForkEpoch = 5 + params.OverrideBeaconConfig(cfg) + s, err := NewService(context.Background(), &Config{Pool: NewPool()}) require.NoError(t, err) @@ -120,6 +132,11 @@ func TestPruneExpired_PruneExpiredAtts(t *testing.T) { } func TestPruneExpired_Expired(t *testing.T) { + params.SetupTestConfigCleanup(t) + cfg := params.BeaconConfig() + cfg.DenebForkEpoch = 3 + params.OverrideBeaconConfig(cfg) + s, err := NewService(context.Background(), &Config{Pool: NewPool()}) require.NoError(t, err) diff --git a/beacon-chain/operations/voluntaryexits/pool_test.go b/beacon-chain/operations/voluntaryexits/pool_test.go index d6aad6819..06ccb5af2 100644 --- a/beacon-chain/operations/voluntaryexits/pool_test.go +++ b/beacon-chain/operations/voluntaryexits/pool_test.go @@ -44,6 +44,11 @@ func TestPendingExits(t *testing.T) { } func TestExitsForInclusion(t *testing.T) { + cfg := params.BeaconConfig().Copy() + cfg.DenebForkEpoch = 300 + cfg.AlpacaForkEpoch = 350 + params.OverrideBeaconConfig(cfg) + spb := ðpb.BeaconStateCapella{ Fork: ðpb.Fork{ CurrentVersion: params.BeaconConfig().GenesisForkVersion, diff --git a/beacon-chain/rpc/eth/builder/handlers_test.go b/beacon-chain/rpc/eth/builder/handlers_test.go index 67a14b279..2f6b28cd0 100644 --- a/beacon-chain/rpc/eth/builder/handlers_test.go +++ b/beacon-chain/rpc/eth/builder/handlers_test.go @@ -25,6 +25,8 @@ import ( ) func TestExpectedWithdrawals_BadRequest(t *testing.T) { + params.SetupForkEpochConfigForTest() + st, err := util.NewBeaconStateCapella() slotsAhead := 5000 require.NoError(t, err) diff --git a/beacon-chain/state/genesis/mainnet.ssz.snappy b/beacon-chain/state/genesis/mainnet.ssz.snappy index 0aa510418..beb05f2b7 100644 Binary files a/beacon-chain/state/genesis/mainnet.ssz.snappy and b/beacon-chain/state/genesis/mainnet.ssz.snappy differ diff --git a/beacon-chain/sync/backfill/verify_test.go b/beacon-chain/sync/backfill/verify_test.go index 9f7fcf1ca..aca6a31ad 100644 --- a/beacon-chain/sync/backfill/verify_test.go +++ b/beacon-chain/sync/backfill/verify_test.go @@ -24,6 +24,7 @@ func TestDomainCache(t *testing.T) { cfg.BellatrixForkEpoch = 2 cfg.CapellaForkEpoch = 3 cfg.DenebForkEpoch = 4 + cfg.AlpacaForkEpoch = 5 params.OverrideBeaconConfig(cfg) cfg.InitializeForkSchedule() diff --git a/beacon-chain/sync/rpc_beacon_blocks_by_range_test.go b/beacon-chain/sync/rpc_beacon_blocks_by_range_test.go index bd2f8dcf6..3d3c2b27b 100644 --- a/beacon-chain/sync/rpc_beacon_blocks_by_range_test.go +++ b/beacon-chain/sync/rpc_beacon_blocks_by_range_test.go @@ -559,6 +559,8 @@ func TestRPCBeaconBlocksByRange_RPCHandlerRateLimitOverflow(t *testing.T) { } func TestRPCBeaconBlocksByRange_validateRangeRequest(t *testing.T) { + params.SetupForkEpochConfigForTest() + slotsSinceGenesis := primitives.Slot(1000) offset := int64(slotsSinceGenesis.Mul(params.BeaconConfig().SecondsPerSlot)) clock := startup.NewClock(time.Now().Add(time.Second*time.Duration(-1*offset)), [32]byte{}) diff --git a/beacon-chain/sync/validate_aggregate_proof_test.go b/beacon-chain/sync/validate_aggregate_proof_test.go index 6376e3f42..c90f1f036 100644 --- a/beacon-chain/sync/validate_aggregate_proof_test.go +++ b/beacon-chain/sync/validate_aggregate_proof_test.go @@ -345,6 +345,8 @@ func TestValidateAggregateAndProof_ExistedInPool(t *testing.T) { } func TestValidateAggregateAndProof_CanValidate(t *testing.T) { + params.SetupForkEpochConfigForTest() + db := dbtest.SetupDB(t) p := p2ptest.NewTestP2P(t) @@ -449,6 +451,7 @@ func TestValidateAggregateAndProof_CanValidate(t *testing.T) { } func TestVerifyIndexInCommittee_SeenAggregatorEpoch(t *testing.T) { + params.SetupForkEpochConfigForTest() db := dbtest.SetupDB(t) p := p2ptest.NewTestP2P(t) diff --git a/beacon-chain/sync/validate_beacon_attestation_test.go b/beacon-chain/sync/validate_beacon_attestation_test.go index 2451352fb..afea98434 100644 --- a/beacon-chain/sync/validate_beacon_attestation_test.go +++ b/beacon-chain/sync/validate_beacon_attestation_test.go @@ -27,6 +27,8 @@ import ( ) func TestService_validateCommitteeIndexBeaconAttestation(t *testing.T) { + params.SetupForkEpochConfigForTest() + p := p2ptest.NewTestP2P(t) db := dbtest.SetupDB(t) chain := &mockChain.ChainService{ diff --git a/beacon-chain/sync/validate_beacon_blocks_test.go b/beacon-chain/sync/validate_beacon_blocks_test.go index d2df2d39e..c15341285 100644 --- a/beacon-chain/sync/validate_beacon_blocks_test.go +++ b/beacon-chain/sync/validate_beacon_blocks_test.go @@ -704,6 +704,7 @@ func TestValidateBeaconBlockPubSub_RejectBlocksFromThePast(t *testing.T) { } func TestValidateBeaconBlockPubSub_SeenProposerSlot(t *testing.T) { + params.SetupForkEpochConfigForTest() db := dbtest.SetupDB(t) p := p2ptest.NewTestP2P(t) ctx := context.Background() @@ -901,6 +902,7 @@ func TestValidateBeaconBlockPubSub_ParentNotFinalizedDescendant(t *testing.T) { } func TestValidateBeaconBlockPubSub_InvalidParentBlock(t *testing.T) { + params.SetupForkEpochConfigForTest() db := dbtest.SetupDB(t) p := p2ptest.NewTestP2P(t) ctx := context.Background() @@ -1177,6 +1179,7 @@ func TestService_isBlockQueueable(t *testing.T) { } func TestValidateBeaconBlockPubSub_ValidExecutionPayload(t *testing.T) { + params.SetupForkEpochConfigForTest() db := dbtest.SetupDB(t) p := p2ptest.NewTestP2P(t) ctx := context.Background() @@ -1409,6 +1412,7 @@ func Test_validateBellatrixBeaconBlockParentValidation(t *testing.T) { } func Test_validateBeaconBlockProcessingWhenParentIsOptimistic(t *testing.T) { + params.SetupForkEpochConfigForTest() db := dbtest.SetupDB(t) p := p2ptest.NewTestP2P(t) ctx := context.Background() diff --git a/beacon-chain/sync/validate_blob_test.go b/beacon-chain/sync/validate_blob_test.go index 29164df8c..fef3f7b36 100644 --- a/beacon-chain/sync/validate_blob_test.go +++ b/beacon-chain/sync/validate_blob_test.go @@ -144,6 +144,7 @@ func TestValidateBlob_AlreadySeenInCache(t *testing.T) { } func TestValidateBlob_InvalidTopicIndex(t *testing.T) { + params.SetupForkEpochConfigForTest() ctx := context.Background() p := p2ptest.NewTestP2P(t) chainService := &mock.ChainService{Genesis: time.Unix(time.Now().Unix()-int64(params.BeaconConfig().SecondsPerSlot), 0)} diff --git a/config/params/mainnet_config.go b/config/params/mainnet_config.go index 097963991..241d39260 100644 --- a/config/params/mainnet_config.go +++ b/config/params/mainnet_config.go @@ -26,11 +26,11 @@ const ( // Bellatrix Fork Epoch for mainnet config. mainnetBellatrixForkEpoch = 0 // epoch 0 // Capella Fork Epoch for mainnet config. - mainnetCapellaForkEpoch = 10 // epoch 10 + mainnetCapellaForkEpoch = 0 // epoch 0 // Deneb Fork Epoch for mainnet config. - mainnetDenebForkEpoch = math.MaxUint64 // not activated + mainnetDenebForkEpoch = 0 // epoch 0 // Alpaca Fork Epoch for mainnet config - mainnetAlpacaForkEpoch = math.MaxUint64 // Far future / to be defined + mainnetAlpacaForkEpoch = 0 // epoch 0 ) var mainnetNetworkConfig = &NetworkConfig{ @@ -40,8 +40,8 @@ var mainnetNetworkConfig = &NetworkConfig{ ContractDeploymentBlock: 0, // Note: contract was deployed in genesis block. BootstrapNodes: []string{ // Over Mainnet Bootnodes - "enr:-LG4QMDxg9JWyQFDFDmNWYgsTBhH5dFmIW-X8q6g6S-3ZpDcMu6ouv4NnCOvZ9BGsIkWrwtx2iVaUAJn7dgS_TEA_XOGAZGN3idXh2F0dG5ldHOIAAAAAAAAAACCaWSCdjSCaXCEj8Zt-YRvdmVykNBNsU8AAAAY__________-Jc2VjcDI1NmsxoQOuL8NQY7JaHKQ43e9HleHJNX0fBiGnX80b5y0z1fl82oN1ZHCCyyA", // Bootnode1 - "enr:-LG4QCu6n9asLF4GydPqGVMhGvM3QJ4CPdGTmxehYTnYWh17eh26of_NXeeh7f5YxMtR3MOnibbQ_iWo_WjREufzv-SGAZGN3icdh2F0dG5ldHOIAAAAAAAAAACCaWSCdjSCaXCEmCriZYRvdmVykNBNsU8AAAAY__________-Jc2VjcDI1NmsxoQJUB5E3lpebYb4TgRatlNrvOxqhSmeX9ZwWOCEND5cllIN1ZHCCyyA", // Bootnode2 + "enr:-LG4QKpZY1Wji0rB5pvSusDdWWrLM3WuRuuudXTeBZZGlTgQdWgdJX6Yjzn487rhZfAPt7JYddJo4KK3jLZELa6xxNiGAZOdArmMh2F0dG5ldHOIAAAAAAAAAACCaWSCdjSCaXCEnfU0eoRvdmVykNBNsU8AAAAY__________-Jc2VjcDI1NmsxoQMv1vYgI8uEPbb6cSuvryE0T8-BzslN9B8piob2HqNdZYN1ZHCCyyA", // Bootnode1 + "enr:-LG4QFT8l2xOTCGb7aXpaI0y9h2ndO9iMpXUNyFHG19WAmbUGC8zcB-Yx2_CniAexWnDgHA2zoLtX_LPah1kJV4QLYSGAZOdArmUh2F0dG5ldHOIAAAAAAAAAACCaWSCdjSCaXCEnfUwuYRvdmVykNBNsU8AAAAY__________-Jc2VjcDI1NmsxoQPMOuY4Rfww4PkAD-0mlUTsPU-mCAV2FT96IwS9Or3j2YN1ZHCCyyA", // Bootnode2 }, } @@ -162,7 +162,7 @@ var mainnetBeaconConfig = &BeaconChainConfig{ DomainApplicationBuilder: bytesutil.Uint32ToBytes4(0x00000001), // Prysm constants. - GenesisValidatorsRoot: [32]byte{116, 251, 77, 166, 135, 32, 137, 147, 238, 130, 34, 6, 238, 31, 73, 21, 196, 191, 158, 92, 157, 62, 103, 50, 199, 117, 185, 152, 44, 159, 128, 132}, + GenesisValidatorsRoot: [32]byte{226, 76, 93, 178, 184, 48, 49, 145, 55, 48, 26, 117, 222, 207, 221, 94, 121, 63, 127, 122, 205, 104, 23, 114, 121, 150, 248, 36, 133, 108, 200, 221}, GweiPerEth: 1000000000, BLSSecretKeyLength: 32, BLSPubkeyLength: 48, diff --git a/config/params/mainnet_config_test.go b/config/params/mainnet_config_test.go index ec680d6f5..f72f97613 100644 --- a/config/params/mainnet_config_test.go +++ b/config/params/mainnet_config_test.go @@ -12,10 +12,6 @@ func TestMaxRequestBlock(t *testing.T) { expectedMaxBlock uint64 description string }{ - { - epoch: primitives.Epoch(mainnetDenebForkEpoch - 1), // Assuming the fork epoch is not 0 - expectedMaxBlock: mainnetBeaconConfig.MaxRequestBlocks, - }, { epoch: primitives.Epoch(mainnetDenebForkEpoch), expectedMaxBlock: mainnetBeaconConfig.MaxRequestBlocksDeneb, diff --git a/config/params/testutils.go b/config/params/testutils.go index 412f284a7..08c2e9fcb 100644 --- a/config/params/testutils.go +++ b/config/params/testutils.go @@ -47,6 +47,7 @@ func SetupForkEpochConfigForTest() { cfg.BellatrixForkEpoch = 144896 cfg.CapellaForkEpoch = 194048 cfg.DenebForkEpoch = 269568 + cfg.AlpacaForkEpoch = 342308 cfg.InitializeForkSchedule() OverrideBeaconConfig(cfg) } diff --git a/testing/util/block_test.go b/testing/util/block_test.go index 09b1e27c5..bd1298427 100644 --- a/testing/util/block_test.go +++ b/testing/util/block_test.go @@ -171,6 +171,14 @@ func TestGenerateFullBlock_ValidDeposits(t *testing.T) { } func TestGenerateFullBlock_ValidVoluntaryExits(t *testing.T) { + config := params.BeaconConfig() + config.AltairForkEpoch = 301 + config.BellatrixForkEpoch = 302 + config.CapellaForkEpoch = 303 + config.DenebForkEpoch = 304 + config.AlpacaForkEpoch = 305 + params.OverrideBeaconConfig(config) + beaconState, privs := DeterministicGenesisState(t, 256) // Moving the state 2048 epochs forward due to PERSISTENT_COMMITTEE_PERIOD. err := beaconState.SetSlot(params.BeaconConfig().SlotsPerEpoch.Mul(uint64(params.BeaconConfig().ShardCommitteePeriod)).Add(3)) @@ -363,6 +371,8 @@ func TestGenerateVoluntaryExits(t *testing.T) { params.SetupTestConfigCleanup(t) config := params.BeaconConfig() config.ShardCommitteePeriod = 0 + config.DenebForkEpoch = 10 + config.AlpacaForkEpoch = 15 params.OverrideBeaconConfig(config) beaconState, privKeys := DeterministicGenesisState(t, 256) diff --git a/validator/client/aggregate_test.go b/validator/client/aggregate_test.go index 6b45bb130..445f00921 100644 --- a/validator/client/aggregate_test.go +++ b/validator/client/aggregate_test.go @@ -42,6 +42,7 @@ func TestSubmitAggregateAndProof_GetDutiesRequestFailure(t *testing.T) { func TestSubmitAggregateAndProof_SignFails(t *testing.T) { for _, isSlashingProtectionMinimal := range [...]bool{false, true} { t.Run(fmt.Sprintf("SlashingProtectionMinimal:%v", isSlashingProtectionMinimal), func(t *testing.T) { + params.SetupForkEpochConfigForTest() validator, m, validatorKey, finish := setup(t, isSlashingProtectionMinimal) defer finish() var pubKey [fieldparams.BLSPubkeyLength]byte @@ -87,6 +88,7 @@ func TestSubmitAggregateAndProof_SignFails(t *testing.T) { func TestSubmitAggregateAndProof_Ok(t *testing.T) { for _, isSlashingProtectionMinimal := range [...]bool{false, true} { t.Run(fmt.Sprintf("Phase 0 (SlashingProtectionMinimal:%v)", isSlashingProtectionMinimal), func(t *testing.T) { + params.SetupForkEpochConfigForTest() validator, m, validatorKey, finish := setup(t, isSlashingProtectionMinimal) defer finish() var pubKey [fieldparams.BLSPubkeyLength]byte @@ -193,6 +195,7 @@ func TestSubmitAggregateAndProof_Distributed(t *testing.T) { ctx := context.Background() for _, isSlashingProtectionMinimal := range [...]bool{false, true} { t.Run(fmt.Sprintf("SlashingProtectionMinimal:%v", isSlashingProtectionMinimal), func(t *testing.T) { + params.SetupForkEpochConfigForTest() validator, m, validatorKey, finish := setup(t, isSlashingProtectionMinimal) defer finish() diff --git a/validator/client/attest_test.go b/validator/client/attest_test.go index ea632ae85..adbec9965 100644 --- a/validator/client/attest_test.go +++ b/validator/client/attest_test.go @@ -70,6 +70,7 @@ func TestAttestToBlockHead_SubmitAttestation_EmptyCommittee(t *testing.T) { func TestAttestToBlockHead_SubmitAttestation_RequestFailure(t *testing.T) { for _, isSlashingProtectionMinimal := range [...]bool{false, true} { t.Run(fmt.Sprintf("SlashingProtectionMinimal:%v", isSlashingProtectionMinimal), func(t *testing.T) { + params.SetupForkEpochConfigForTest() hook := logTest.NewGlobal() validator, m, validatorKey, finish := setup(t, isSlashingProtectionMinimal) @@ -109,6 +110,8 @@ func TestAttestToBlockHead_SubmitAttestation_RequestFailure(t *testing.T) { func TestAttestToBlockHead_AttestsCorrectly(t *testing.T) { for _, isSlashingProtectionMinimal := range [...]bool{false, true} { t.Run(fmt.Sprintf("Phase 0 (SlashingProtectionMinimal:%v)", isSlashingProtectionMinimal), func(t *testing.T) { + params.SetupTestConfigCleanup(t) + params.SetupForkEpochConfigForTest() validator, m, validatorKey, finish := setup(t, isSlashingProtectionMinimal) defer finish() hook := logTest.NewGlobal() @@ -269,6 +272,7 @@ func TestAttestToBlockHead_AttestsCorrectly(t *testing.T) { func TestAttestToBlockHead_BlocksDoubleAtt(t *testing.T) { for _, isSlashingProtectionMinimal := range [...]bool{false, true} { t.Run(fmt.Sprintf("SlashingProtectionMinimal:%v", isSlashingProtectionMinimal), func(t *testing.T) { + params.SetupForkEpochConfigForTest() hook := logTest.NewGlobal() validator, m, validatorKey, finish := setup(t, isSlashingProtectionMinimal) defer finish() @@ -325,6 +329,7 @@ func TestAttestToBlockHead_BlocksDoubleAtt(t *testing.T) { func TestAttestToBlockHead_BlocksSurroundAtt(t *testing.T) { for _, isSlashingProtectionMinimal := range [...]bool{false, true} { t.Run(fmt.Sprintf("SlashingProtectionMinimal:%v", isSlashingProtectionMinimal), func(t *testing.T) { + params.SetupForkEpochConfigForTest() hook := logTest.NewGlobal() validator, m, validatorKey, finish := setup(t, isSlashingProtectionMinimal) defer finish() @@ -381,6 +386,7 @@ func TestAttestToBlockHead_BlocksSurroundAtt(t *testing.T) { func TestAttestToBlockHead_BlocksSurroundedAtt(t *testing.T) { for _, isSlashingProtectionMinimal := range [...]bool{false, true} { t.Run(fmt.Sprintf("SlashingProtectionMinimal:%v", isSlashingProtectionMinimal), func(t *testing.T) { + params.SetupForkEpochConfigForTest() hook := logTest.NewGlobal() validator, m, validatorKey, finish := setup(t, isSlashingProtectionMinimal) defer finish() @@ -471,6 +477,7 @@ func TestAttestToBlockHead_DoesNotAttestBeforeDelay(t *testing.T) { func TestAttestToBlockHead_DoesAttestAfterDelay(t *testing.T) { for _, isSlashingProtectionMinimal := range [...]bool{false, true} { t.Run(fmt.Sprintf("SlashingProtectionMinimal:%v", isSlashingProtectionMinimal), func(t *testing.T) { + params.SetupForkEpochConfigForTest() validator, m, validatorKey, finish := setup(t, isSlashingProtectionMinimal) defer finish() @@ -520,6 +527,7 @@ func TestAttestToBlockHead_DoesAttestAfterDelay(t *testing.T) { func TestAttestToBlockHead_CorrectBitfieldLength(t *testing.T) { for _, isSlashingProtectionMinimal := range [...]bool{false, true} { t.Run(fmt.Sprintf("SlashingProtectionMinimal:%v", isSlashingProtectionMinimal), func(t *testing.T) { + params.SetupForkEpochConfigForTest() validator, m, validatorKey, finish := setup(t, isSlashingProtectionMinimal) defer finish() validatorIndex := primitives.ValidatorIndex(2) diff --git a/validator/client/beacon-api/domain_data_test.go b/validator/client/beacon-api/domain_data_test.go index 67964feb0..4766829c2 100644 --- a/validator/client/beacon-api/domain_data_test.go +++ b/validator/client/beacon-api/domain_data_test.go @@ -17,8 +17,8 @@ import ( func TestGetDomainData_ValidDomainData(t *testing.T) { const genesisValidatorRoot = "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" - forkVersion := params.BeaconConfig().BellatrixForkVersion - epoch := params.BeaconConfig().BellatrixForkEpoch + forkVersion := params.BeaconConfig().AlpacaForkVersion + epoch := params.BeaconConfig().AlpacaForkEpoch domainType := params.BeaconConfig().DomainBeaconProposer genesisValidatorRootBytes, err := hexutil.Decode(genesisValidatorRoot) diff --git a/validator/client/metrics_test.go b/validator/client/metrics_test.go index f72148e03..028356b93 100644 --- a/validator/client/metrics_test.go +++ b/validator/client/metrics_test.go @@ -14,6 +14,10 @@ import ( ) func TestUpdateLogAggregateStats(t *testing.T) { + cfg := params.BeaconConfig().Copy() + cfg.AltairForkEpoch = 1 + cfg.InitializeForkSchedule() + params.OverrideBeaconConfig(cfg) v := &validator{ logValidatorPerformance: true, startBalances: make(map[[fieldparams.BLSPubkeyLength]byte]uint64), @@ -88,6 +92,10 @@ func TestUpdateLogAggregateStats(t *testing.T) { } func TestUpdateLogAltairAggregateStats(t *testing.T) { + cfg := params.BeaconConfig().Copy() + cfg.AltairForkEpoch = 1 + cfg.InitializeForkSchedule() + params.OverrideBeaconConfig(cfg) v := &validator{ logValidatorPerformance: true, startBalances: make(map[[fieldparams.BLSPubkeyLength]byte]uint64), @@ -158,7 +166,7 @@ func TestUpdateLogAltairAggregateStats(t *testing.T) { } require.LogsContain(t, hook, "msg=\"Previous epoch aggregated voting summary\" attestationInclusionPct=\"67%\" "+ - "averageInactivityScore=0 correctlyVotedHeadPct=\"100%\" correctlyVotedSourcePct=\"100%\" correctlyVotedTargetPct=\"50%\" epoch=2") + "averageInactivityScore=0 correctlyVotedHeadPct=\"100%\" correctlyVotedSourcePct=\"100%\" correctlyVotedTargetPct=\"50%\" epoch=3") require.LogsContain(t, hook, "msg=\"Vote summary since launch\" attestationsInclusionPct=\"78%\" "+ "correctlyVotedHeadPct=\"86%\" correctlyVotedSourcePct=\"100%\" "+ "correctlyVotedTargetPct=\"71%\" numberOfEpochs=3 pctChangeCombinedBalance=\"0.20555%\"") diff --git a/validator/keymanager/remote-web3signer/v1/mock/mocks.go b/validator/keymanager/remote-web3signer/v1/mock/mocks.go index cf206457a..8623ea14a 100644 --- a/validator/keymanager/remote-web3signer/v1/mock/mocks.go +++ b/validator/keymanager/remote-web3signer/v1/mock/mocks.go @@ -525,8 +525,8 @@ func ValidatorRegistrationSignRequest() *v1.ValidatorRegistrationSignRequest { func ForkInfo() *v1.ForkInfo { return &v1.ForkInfo{ Fork: &v1.Fork{ - PreviousVersion: []byte{0x01, 0x00, 0x00, 0x18}, - CurrentVersion: []byte{0x02, 0x00, 0x00, 0x18}, + PreviousVersion: []byte{0x04, 0x00, 0x00, 0x18}, + CurrentVersion: []byte{0x05, 0x00, 0x00, 0x18}, Epoch: "0", }, GenesisValidatorsRoot: make([]byte, fieldparams.RootLength),