@@ -116,8 +116,19 @@ contract ValidatorSelectionTest is ValidatorSelectionTestBase {
116116 bytes4 NO_REVERT = bytes4 (0 );
117117 bytes4 ANY_REVERT = bytes4 (0xFFFFFFFF );
118118
119+ function getAttesters () internal view returns (address [] memory ) {
120+ GSE gse = rollup.getGSE ();
121+ uint256 count = rollup.getActiveAttesterCount ();
122+ address [] memory attesters = new address [](count);
123+ for (uint256 i = 0 ; i < count; i++ ) {
124+ attesters[i] = gse.getAttesterFromIndexAtTime (address (rollup), i, Timestamp.wrap (block .timestamp ));
125+ }
126+
127+ return attesters;
128+ }
129+
119130 function testInitialCommitteeMatch () public setup (4 , 4 ) progressEpochs (2 ) {
120- address [] memory attesters = rollup. getAttesters ();
131+ address [] memory attesters = getAttesters ();
121132 address [] memory committee = rollup.getCurrentEpochCommittee ();
122133 assertEq (rollup.getCurrentEpoch (), 2 );
123134 assertEq (attesters.length , 4 , "Invalid validator set size " );
@@ -165,7 +176,7 @@ contract ValidatorSelectionTest is ValidatorSelectionTestBase {
165176
166177 Epoch post = rollup.getCurrentEpoch ();
167178
168- uint256 validatorSetSize = rollup.getAttesters (). length ;
179+ uint256 validatorSetSize = rollup.getActiveAttesterCount () ;
169180 uint256 targetCommitteeSize = rollup.getTargetCommitteeSize ();
170181 uint256 expectedSize = validatorSetSize > targetCommitteeSize ? targetCommitteeSize : validatorSetSize;
171182
@@ -220,7 +231,7 @@ contract ValidatorSelectionTest is ValidatorSelectionTestBase {
220231 function testValidatorSetLargerThanCommittee (bool _insufficientSigs ) public setup (100 , 48 ) progressEpochs (2 ) {
221232 uint256 committeeSize = rollup.getTargetCommitteeSize ();
222233 uint256 signatureCount = committeeSize * 2 / 3 + (_insufficientSigs ? 0 : 1 );
223- assertGt (rollup.getAttesters (). length , committeeSize, "Not enough validators " );
234+ assertGt (rollup.getActiveAttesterCount () , committeeSize, "Not enough validators " );
224235
225236 ProposeTestData memory ree =
226237 _testBlock ("mixed_block_1 " , NO_REVERT, signatureCount, committeeSize, TestFlagsLib.empty ());
@@ -280,7 +291,7 @@ contract ValidatorSelectionTest is ValidatorSelectionTestBase {
280291 _testBlock ("mixed_block_1 " , NO_REVERT, 3 , 4 , TestFlagsLib.empty ());
281292 _testBlock ("mixed_block_2 " , NO_REVERT, 3 , 4 , TestFlagsLib.empty ());
282293
283- address [] memory attesters = rollup. getAttesters ();
294+ address [] memory attesters = getAttesters ();
284295 uint256 [] memory stakes = new uint256 [](attesters.length );
285296 uint128 [][] memory offenses = new uint128 [][](attesters.length );
286297 uint96 [] memory amounts = new uint96 [](attesters.length );
0 commit comments