Skip to content

Commit bf58a50

Browse files
committed
fix: remove repeated storage read from loop
1 parent cefab14 commit bf58a50

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/BLSSignatureChecker.sol

+2-1
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,12 @@ contract BLSSignatureChecker is IBLSSignatureChecker {
178178
*/
179179
{
180180
uint256 withdrawalDelayBlocks = delegation.withdrawalDelayBlocks();
181+
bool _staleStakesForbidden = staleStakesForbidden;
181182

182183
for (uint256 i = 0; i < quorumNumbers.length; i++) {
183184
// If we're disallowing stale stake updates, check that each quorum's last update block
184185
// is within withdrawalDelayBlocks
185-
if (staleStakesForbidden) {
186+
if (_staleStakesForbidden) {
186187
require(
187188
registryCoordinator.quorumUpdateBlockNumber(uint8(quorumNumbers[i])) + withdrawalDelayBlocks >= referenceBlockNumber,
188189
"BLSSignatureChecker.checkSignatures: StakeRegistry updates must be within withdrawalDelayBlocks window"

0 commit comments

Comments
 (0)