@@ -311,14 +311,12 @@ contract EigenPod is
311
311
ConsolidationRequest[] calldata requests
312
312
) external payable onlyWhenNotPaused (PAUSED_CONSOLIDATIONS) onlyOwnerOrProofSubmitter {
313
313
uint256 fee = getConsolidationRequestFee ();
314
- require (msg .value >= fee * requests.length , InsufficientFunds ());
315
- uint256 remainder = msg .value - (fee * requests.length );
314
+ uint256 totalFee = fee * requests.length ;
315
+ require (msg .value >= totalFee, InsufficientFunds ());
316
+ uint256 remainder = msg .value - totalFee;
316
317
317
318
for (uint256 i = 0 ; i < requests.length ; i++ ) {
318
319
ConsolidationRequest calldata request = requests[i];
319
- // Validate pubkeys are well-formed
320
- require (request.srcPubkey.length == 48 , InvalidPubKeyLength ());
321
- require (request.targetPubkey.length == 48 , InvalidPubKeyLength ());
322
320
323
321
// Ensure target has verified withdrawal credentials pointed at this pod
324
322
bytes32 sourcePubkeyHash = _calcPubkeyHash (request.srcPubkey);
@@ -347,24 +345,20 @@ contract EigenPod is
347
345
WithdrawalRequest[] calldata requests
348
346
) external payable onlyWhenNotPaused (PAUSED_WITHDRAWAL_REQUESTS) onlyOwnerOrProofSubmitter {
349
347
uint256 fee = getWithdrawalRequestFee ();
350
- require (msg .value >= fee * requests.length , InsufficientFunds ());
351
- uint256 remainder = msg .value - (fee * requests.length );
348
+ uint256 totalFee = fee * requests.length ;
349
+ require (msg .value >= totalFee, InsufficientFunds ());
350
+ uint256 remainder = msg .value - totalFee;
352
351
353
352
for (uint256 i = 0 ; i < requests.length ; i++ ) {
354
353
WithdrawalRequest calldata request = requests[i];
355
- // Validate pubkey is well-formed.
356
- //
357
- // It's not necessary to perform any additional validation; the worst-case
358
- // scenario is just that the consensus layer skips an invalid request.
359
- require (request.pubkey.length == 48 , InvalidPubKeyLength ());
354
+ bytes32 pubkeyHash = _calcPubkeyHash (request.pubkey);
360
355
361
356
// Call the predeploy
362
357
bytes memory callData = abi.encodePacked (request.pubkey, request.amountGwei);
363
358
(bool ok ,) = WITHDRAWAL_REQUEST_ADDRESS.call {value: fee}(callData);
364
359
require (ok, PredeployFailed ());
365
360
366
361
// Emit event depending on whether the request is a full exit or a partial withdrawal
367
- bytes32 pubkeyHash = _calcPubkeyHash (request.pubkey);
368
362
if (request.amountGwei == 0 ) emit ExitRequested (pubkeyHash);
369
363
else emit WithdrawalRequested (pubkeyHash, request.amountGwei);
370
364
}
0 commit comments