@@ -142,21 +142,19 @@ contract EigenPod_PodManager_UnitTests_EigenPodPausing is EigenPod_PodManager_Un
142
142
uint8 internal constant PAUSED_EIGENPODS_VERIFY_WITHDRAWAL = 4 ;
143
143
144
144
function test_verifyBalanceUpdates_revert_pausedEigenVerifyBalanceUpdate () public {
145
- bytes32 [][] memory validatorFieldsArray = new bytes32 [][]( 1 ) ;
145
+ BeaconChainProofs.StateRootProof memory stateRootProofStruct ;
146
146
147
+ bytes32 [][] memory validatorFieldsArray = new bytes32 [][](1 );
148
+ bytes [] memory proofsArray = new bytes [](1 );
147
149
uint40 [] memory validatorIndices = new uint40 [](1 );
148
150
149
- BeaconChainProofs.BalanceUpdateProof[] memory proofs = new BeaconChainProofs.BalanceUpdateProof [](1 );
150
-
151
- BeaconChainProofs.StateRootProof memory stateRootProofStruct;
152
-
153
151
// pause the contract
154
152
cheats.prank (address (pauser));
155
153
eigenPodManager.pause (2 ** PAUSED_EIGENPODS_VERIFY_BALANCE_UPDATE);
156
154
157
155
cheats.prank (address (podOwner));
158
156
cheats.expectRevert (bytes ("EigenPod.onlyWhenNotPaused: index is paused in EigenPodManager " ));
159
- eigenPod.verifyBalanceUpdates (0 , validatorIndices, stateRootProofStruct, proofs , validatorFieldsArray);
157
+ eigenPod.verifyBalanceUpdates (0 , validatorIndices, stateRootProofStruct, proofsArray , validatorFieldsArray);
160
158
}
161
159
162
160
function test_verifyAndProcessWithdrawals_revert_pausedEigenVerifyWithdrawal () public {
@@ -268,7 +266,7 @@ contract EigenPod_PodManager_UnitTests_EigenPodManager is EigenPod_PodManager_Un
268
266
uint40 [] validatorIndices;
269
267
bytes [] validatorFieldsProofs;
270
268
bytes32 [][] validatorFields;
271
- BeaconChainProofs.BalanceUpdateProof[] balanceUpdateProof;
269
+ // BeaconChainProofs.BalanceUpdateProof[] balanceUpdateProof;
272
270
BeaconChainProofs.WithdrawalProof[] withdrawalProofs;
273
271
bytes32 [][] withdrawalFields;
274
272
@@ -318,14 +316,14 @@ contract EigenPod_PodManager_UnitTests_EigenPodManager is EigenPod_PodManager_Un
318
316
319
317
// Save state for checks
320
318
int256 initialShares = eigenPodManager.podOwnerShares (podOwner);
321
- uint64 newValidatorBalance = balanceUpdateProof [0 ].balanceRoot. getBalanceAtIndex (validatorIndices[ 0 ] );
319
+ uint64 newValidatorBalance = validatorFields [0 ].getEffectiveBalanceGwei ( );
322
320
323
321
// Verify balance update
324
322
eigenPod.verifyBalanceUpdates (
325
323
oracleTimestamp,
326
324
validatorIndices,
327
325
stateRootProofStruct,
328
- balanceUpdateProof ,
326
+ validatorFieldsProofs ,
329
327
validatorFields
330
328
);
331
329
@@ -344,7 +342,7 @@ contract EigenPod_PodManager_UnitTests_EigenPodManager is EigenPod_PodManager_Un
344
342
_verifyWithdrawalCredentials ();
345
343
346
344
// Set JSON
347
- setJSON ("src/test/test-data/balanceUpdateProof_overCommitted_302913 .json " );
345
+ setJSON ("src/test/test-data/balanceUpdateProof_notOverCommitted_302913 .json " );
348
346
bytes32 validatorPubkeyHash = validatorFields[0 ].getPubkeyHash ();
349
347
350
348
// Set proof params, oracle block root, and warp time
@@ -355,14 +353,14 @@ contract EigenPod_PodManager_UnitTests_EigenPodManager is EigenPod_PodManager_Un
355
353
356
354
// Save state for checks
357
355
int256 initialShares = eigenPodManager.podOwnerShares (podOwner);
358
- uint64 newValidatorBalance = balanceUpdateProof [0 ].balanceRoot. getBalanceAtIndex (validatorIndices[ 0 ] );
356
+ uint64 newValidatorBalance = validatorFields [0 ].getEffectiveBalanceGwei ( );
359
357
360
358
// Verify balance update
361
359
eigenPod.verifyBalanceUpdates (
362
360
oracleTimestamp,
363
361
validatorIndices,
364
362
stateRootProofStruct,
365
- balanceUpdateProof ,
363
+ validatorFieldsProofs ,
366
364
validatorFields
367
365
);
368
366
@@ -575,20 +573,20 @@ contract EigenPod_PodManager_UnitTests_EigenPodManager is EigenPod_PodManager_Un
575
573
// Reset arrays
576
574
delete validatorIndices;
577
575
delete validatorFields;
578
- delete balanceUpdateProof ;
576
+ delete validatorFieldsProofs ;
579
577
580
578
// Set state proof struct
581
579
stateRootProofStruct = _getStateRootProof ();
582
-
583
- // Set validator index, beacon state root, balance update proof, and validator fields
580
+
581
+ // Set validator indices
584
582
uint40 validatorIndex = uint40 (getValidatorIndex ());
585
583
validatorIndices.push (validatorIndex);
586
584
587
- // Set validatorFields array
585
+ // Set validatorFieldsArray
588
586
validatorFields.push (getValidatorFields ());
589
587
590
- // Set balance update proof
591
- balanceUpdateProof .push (_getBalanceUpdateProof ());
588
+ // Set validator fields proof
589
+ validatorFieldsProofs .push (abi.encodePacked ( getBalanceUpdateProof ())); // Validator fields are proven here
592
590
}
593
591
594
592
function _setWithdrawalProofParams () internal {
@@ -614,15 +612,15 @@ contract EigenPod_PodManager_UnitTests_EigenPodManager is EigenPod_PodManager_Un
614
612
withdrawalProofs.push (_getWithdrawalProof ());
615
613
}
616
614
617
- function _getBalanceUpdateProof () internal returns (BeaconChainProofs.BalanceUpdateProof memory ) {
618
- bytes32 balanceRoot = getBalanceRoot ();
619
- BeaconChainProofs.BalanceUpdateProof memory proofs = BeaconChainProofs.BalanceUpdateProof (
620
- abi.encodePacked (getValidatorBalanceProof ()),
621
- abi.encodePacked (getWithdrawalCredentialProof ()), //technically this is to verify validator pubkey in the validator fields, but the WC proof is effectively the same so we use it here again.
622
- balanceRoot
623
- );
624
- return proofs;
625
- }
615
+ // function _getBalanceUpdateProof() internal returns (BeaconChainProofs.BalanceUpdateProof memory) {
616
+ // bytes32 balanceRoot = getBalanceRoot();
617
+ // BeaconChainProofs.BalanceUpdateProof memory proofs = BeaconChainProofs.BalanceUpdateProof(
618
+ // abi.encodePacked(getValidatorBalanceProof()),
619
+ // abi.encodePacked(getWithdrawalCredentialProof()), //technically this is to verify validator pubkey in the validator fields, but the WC proof is effectively the same so we use it here again.
620
+ // balanceRoot
621
+ // );
622
+ // return proofs;
623
+ // }
626
624
627
625
/// @notice this function just generates a valid proof so that we can test other functionalities of the withdrawal flow
628
626
function _getWithdrawalProof () internal returns (BeaconChainProofs.WithdrawalProof memory ) {
0 commit comments