-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Description
The Problem
EtherFiAdmin's Batching Logic (Naive):
function _enqueueValidatorApprovalTask(bytes32 _reportHash, uint256[] calldata _validators) internal {
uint256 numBatches = (_validators.length + validatorTaskBatchSize - 1) / validatorTaskBatchSize;
for (uint256 i = 0; i < numBatches; i++) {
uint256 start = i * validatorTaskBatchSize;
uint256 end = (i + 1) * validatorTaskBatchSize > _validators.length ? _validators.length : (i + 1) * validatorTaskBatchSize;
uint256[] memory batchValidators = new uint256[](end - start);
for (uint256 j = start; j < end; j++) {
batchValidators[j - start] = _validators[j]; // Just takes consecutive validators!
}
// Creates task without considering pod assignment
}
}
LiquidityPool's Same-Pod Constraint (Strict):
function batchApproveRegistration(uint256[] memory _validatorIds, ...) external {
// all validators provided should belong to same node
IEtherFiNode etherFiNode = IEtherFiNode(nodesManager.etherfiNodeAddress(_validatorIds[0]));
for (uint256 i = 0; i < _validatorIds.length; i++) {
// enforce that all validators are part of same node
if (address(etherFiNode) != address(nodesManager.etherfiNodeAddress(_validatorIds[i]))) revert InvalidEtherFiNode();
}
}
The Core Issue
- EtherFiAdmin batches validators sequentially (every 100 validators) without considering which pod/node they belong to
- LiquidityPool expects all validators in a batch to belong to the same pod/node
- When Shyam registers validators from different nodes, they get mixed into the same batch, causing
InvalidEtherFiNode()
reverts
Solutions
Option 1: Remove the Same-Pod Constraint
- Modify
batchApproveRegistration
to handle validators from different pods
Option 2: Smart Batching in EtherFiAdmin
- Modify
_enqueueValidatorApprovalTask
to group validators by pod before batching - More complex logic but maintains current gas efficiency
Option 3: Use confirmAndFundBeaconValidators
- this function doesn't have the same-pod constraint
- Would require updating EtherFiAdmin to use this method instead
Metadata
Metadata
Assignees
Labels
No labels