diff --git a/src/BLSSignatureChecker.sol b/src/BLSSignatureChecker.sol index 39391e15..035a68e8 100644 --- a/src/BLSSignatureChecker.sol +++ b/src/BLSSignatureChecker.sol @@ -190,7 +190,7 @@ contract BLSSignatureChecker is IBLSSignatureChecker { // is within withdrawalDelayBlocks if (_staleStakesForbidden) { require( - registryCoordinator.quorumUpdateBlockNumber(uint8(quorumNumbers[i])) + withdrawalDelayBlocks >= referenceBlockNumber, + registryCoordinator.quorumUpdateBlockNumber(uint8(quorumNumbers[i])) + withdrawalDelayBlocks > referenceBlockNumber, "BLSSignatureChecker.checkSignatures: StakeRegistry updates must be within withdrawalDelayBlocks window" ); } diff --git a/test/unit/BLSSignatureCheckerUnit.t.sol b/test/unit/BLSSignatureCheckerUnit.t.sol index e9d50769..607926d2 100644 --- a/test/unit/BLSSignatureCheckerUnit.t.sol +++ b/test/unit/BLSSignatureCheckerUnit.t.sol @@ -314,9 +314,10 @@ contract BLSSignatureCheckerUnitTests is BLSMockAVSDeployer { } // move referenceBlockNumber forward to a block number the last block number where the stakes will be considered "not stale" - referenceBlockNumber = uint32(stalestUpdateBlock + delegationMock.minWithdrawalDelayBlocks()); + referenceBlockNumber = uint32(stalestUpdateBlock + delegationMock.minWithdrawalDelayBlocks()) - 1; // roll forward to make the reference block number valid // we roll to referenceBlockNumber + 1 because the current block number is not a valid reference block + cheats.roll(referenceBlockNumber + 1); blsSignatureChecker.checkSignatures( msgHash,