@@ -726,9 +726,31 @@ func TestTransitionHittingValidatorsCap_ExtraSmall(t *testing.T) {
726726 blk = moveToEndOfEpoch (t , blk , cs , sp , st , ctx , depRoot )
727727
728728 // finally the block turning epoch. extra validator deposits
729- // will be withdrawn asap (#Validator / MaxValidatorsPerWithdrawalsSweep)
729+ // will be withdrawn within 3 blocks (#Validator / MaxValidatorsPerWithdrawalsSweep)
730730 extraValAddr , err := extraValCreds .ToExecutionAddress ()
731731 require .NoError (t , err )
732+ blk = buildNextBlock (
733+ t ,
734+ st ,
735+ types .NewEth1Data (depRoot ),
736+ blk .GetTimestamp ()+ 1 ,
737+ []* types.Deposit {},
738+ st .EVMInflationWithdrawal (blk .GetTimestamp ()+ 1 ),
739+ )
740+ _ , err = sp .Transition (ctx , st , blk )
741+ require .NoError (t , err )
742+
743+ blk = buildNextBlock (
744+ t ,
745+ st ,
746+ types .NewEth1Data (depRoot ),
747+ blk .GetTimestamp ()+ 1 ,
748+ []* types.Deposit {},
749+ st .EVMInflationWithdrawal (blk .GetTimestamp ()+ 1 ),
750+ )
751+ _ , err = sp .Transition (ctx , st , blk )
752+ require .NoError (t , err )
753+
732754 withdrawals := []* engineprimitives.Withdrawal {
733755 st .EVMInflationWithdrawal (blk .GetTimestamp () + 1 ),
734756 {
@@ -738,7 +760,6 @@ func TestTransitionHittingValidatorsCap_ExtraSmall(t *testing.T) {
738760 Amount : extraValDeposit .Amount ,
739761 },
740762 }
741-
742763 blk = buildNextBlock (
743764 t ,
744765 st ,
@@ -755,7 +776,7 @@ func TestTransitionHittingValidatorsCap_ExtraSmall(t *testing.T) {
755776// validator added when validators set is at cap improves amount staked
756777// an existing validator is removed at the beginning of next epoch.
757778//
758- //nolint:paralleltest // uses envars
779+ //nolint:paralleltest,maintidx // uses envars
759780func TestTransitionHittingValidatorsCap_ExtraBig (t * testing.T ) {
760781 cs := setupChain (t )
761782 sp , st , ds , ctx , _ , _ := statetransition .SetupTestState (t , cs )
@@ -979,13 +1000,37 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) {
9791000 require .Equal (t , constants .GenesisEpoch + 3 , smallestVal .WithdrawableEpoch )
9801001
9811002 // STEP 4: move the chain to the next epoch and show withdrawal
982- // for rejected validator is enqueued asap
1003+ // for rejected validator is enqueued within 3 blocks
9831004 // (#Validator / MaxValidatorsPerWithdrawalsSweep)
9841005 _ = moveToEndOfEpoch (t , blk , cs , sp , st , ctx , depRoot )
9851006
9861007 valToEvict := genDeposits [0 ]
9871008 valToEvictAddr , err := valToEvict .Credentials .ToExecutionAddress ()
9881009 require .NoError (t , err )
1010+
1011+ // finally the block turning epoch
1012+ blk = buildNextBlock (
1013+ t ,
1014+ st ,
1015+ types .NewEth1Data (depRoot ),
1016+ blk .GetTimestamp ()+ 1 ,
1017+ []* types.Deposit {},
1018+ st .EVMInflationWithdrawal (blk .GetTimestamp ()+ 1 ),
1019+ )
1020+ _ , err = sp .Transition (ctx , st , blk )
1021+ require .NoError (t , err )
1022+
1023+ blk = buildNextBlock (
1024+ t ,
1025+ st ,
1026+ types .NewEth1Data (depRoot ),
1027+ blk .GetTimestamp ()+ 1 ,
1028+ []* types.Deposit {},
1029+ st .EVMInflationWithdrawal (blk .GetTimestamp ()+ 1 ),
1030+ )
1031+ _ , err = sp .Transition (ctx , st , blk )
1032+ require .NoError (t , err )
1033+
9891034 withdrawals := []* engineprimitives.Withdrawal {
9901035 st .EVMInflationWithdrawal (blk .GetTimestamp () + 1 ),
9911036 {
0 commit comments