From e4f39f61b962319578e8d8e4c0ef4582084833c7 Mon Sep 17 00:00:00 2001 From: 8sunyuan Date: Tue, 21 Nov 2023 09:59:12 -0500 Subject: [PATCH] feat: Delegation.withdrawalDelayBlocks in sigcheck --- src/BLSSignatureChecker.sol | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/BLSSignatureChecker.sol b/src/BLSSignatureChecker.sol index 9fbbf659..fdd2d823 100644 --- a/src/BLSSignatureChecker.sol +++ b/src/BLSSignatureChecker.sol @@ -29,11 +29,13 @@ contract BLSSignatureChecker is IBLSSignatureChecker { IRegistryCoordinator public immutable registryCoordinator; IStakeRegistry public immutable stakeRegistry; IBLSPubkeyRegistry public immutable blsPubkeyRegistry; + IDelegationManager public immutable delegation; constructor(IBLSRegistryCoordinatorWithIndices _registryCoordinator) { registryCoordinator = IRegistryCoordinator(_registryCoordinator); stakeRegistry = _registryCoordinator.stakeRegistry(); blsPubkeyRegistry = _registryCoordinator.blsPubkeyRegistry(); + delegation = stakeRegistry.delegation(); } /** @@ -76,7 +78,7 @@ contract BLSSignatureChecker is IBLSSignatureChecker { BN254.G1Point memory apk = BN254.G1Point(0, 0); for (uint i = 0; i < quorumNumbers.length; i++) { require( - registryCoordinator.quorumUpdateTimestamp(uint8(quorumNumbers[i])) + QUORUM_STAKES_UPDATE_WINDOW <= block.timestamp, + registryCoordinator.quorumUpdateTimestamp(uint8(quorumNumbers[i])) + delegation.withdrawalDelayBlocks() <= block.timestamp, "BLSSignatureChecker.checkSignatures: StakeRegistry updates must be within QUORUM_STAKES_UPDATE_WINDOW" ); require(