Skip to content

Commit

Permalink
chore: re-implement stack-too-deep fix
Browse files Browse the repository at this point in the history
I previously implemented this fix, then reverted it as not needed.
Now upon merging with m2-mainnet, `registerOperatorWithChurn` has an additional input.
This is reintroducing the same stack-too-deep error
so I am reintroducing the same fix (one less local var)
  • Loading branch information
ChaoticWalrus committed Dec 13, 2023
1 parent a47ee2b commit 0db5eb5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/RegistryCoordinator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -252,16 +252,16 @@ contract RegistryCoordinator is
});

for (uint256 i = 0; i < quorumNumbers.length; i++) {
uint8 quorumNumber = uint8(quorumNumbers[i]);
OperatorSetParam memory operatorSetParams = _quorumParams[quorumNumber];
// reference: uint8 quorumNumber = uint8(quorumNumbers[i]);
OperatorSetParam memory operatorSetParams = _quorumParams[uint8(quorumNumbers[i])];

/**
* If the new operator count for any quorum exceeds the maximum, validate
* that churn can be performed, then deregister the specified operator
*/
if (results.numOperatorsPerQuorum[i] > operatorSetParams.maxOperatorCount) {
_validateChurn({
quorumNumber: quorumNumber,
quorumNumber: uint8(quorumNumbers[i]),
totalQuorumStake: results.totalStakes[i],
newOperator: msg.sender,
newOperatorStake: results.operatorStakes[i],
Expand Down

0 comments on commit 0db5eb5

Please sign in to comment.