@@ -17,7 +17,6 @@ import {CommitteeAttestations} from "@aztec/core/libraries/rollup/AttestationLib
1717import {Errors} from "@aztec/core/libraries/Errors.sol " ;
1818import {RollupOperationsExtLib} from "@aztec/core/libraries/rollup/RollupOperationsExtLib.sol " ;
1919import {ValidatorOperationsExtLib} from "@aztec/core/libraries/rollup/ValidatorOperationsExtLib.sol " ;
20- import {RewardDeploymentExtLib} from "@aztec/core/libraries/rollup/RewardDeploymentExtLib.sol " ;
2120import {TallySlasherDeploymentExtLib} from "@aztec/core/libraries/rollup/TallySlasherDeploymentExtLib.sol " ;
2221import {EmpireSlasherDeploymentExtLib} from "@aztec/core/libraries/rollup/EmpireSlasherDeploymentExtLib.sol " ;
2322import {SlasherFlavor} from "@aztec/core/interfaces/ISlasher.sol " ;
@@ -33,7 +32,7 @@ import {GSE} from "@aztec/governance/GSE.sol";
3332import {Ownable} from "@oz/access/Ownable.sol " ;
3433import {IERC20 } from "@oz/token/ERC20/IERC20.sol " ;
3534import {EIP712} from "@oz/utils/cryptography/EIP712.sol " ;
36- import {RewardLib , RewardConfig} from "@aztec/core/libraries/rollup/RewardLib .sol " ;
35+ import {RewardExtLib , RewardConfig} from "@aztec/core/libraries/rollup/RewardExtLib .sol " ;
3736import {StakingQueueConfig} from "@aztec/core/libraries/compressed-data/StakingQueueConfig.sol " ;
3837import {FeeConfigLib, CompressedFeeConfig} from "@aztec/core/libraries/compressed-data/fees/FeeConfig.sol " ;
3938import {G1Point, G2Point} from "@aztec/shared/libraries/BN254Lib.sol " ;
@@ -198,11 +197,6 @@ contract RollupCore is EIP712("Aztec Rollup", "1"), Ownable, IStakingCore, IVali
198197 */
199198 bool public checkBlob = true ;
200199
201- /**
202- * @notice Flag controlling whether rewards can be claimed
203- */
204- bool public isRewardsClaimable = false ;
205-
206200 /**
207201 * @notice Initializes the Aztec rollup with all required configurations
208202 * @dev Sets up time parameters, deploys auxiliary contracts (slasher, reward booster),
@@ -212,8 +206,9 @@ contract RollupCore is EIP712("Aztec Rollup", "1"), Ownable, IStakingCore, IVali
212206 * @param _gse The Governance Staking Escrow contract
213207 * @param _epochProofVerifier The honk verifier contract for root epoch proofs
214208 * @param _governance The address with owner privileges
215- * @param _genesisState Initial state containing VK tree root, protocol contract tree root, and genesis archive
216- * @param _config Comprehensive configuration including timing, staking, slashing, and reward parameters
209+ * @param _genesisState Initial state containing VK tree root, protocol contracts hash, and genesis archive
210+ * @param _config Comprehensive configuration including timing, staking, slashing, reward parameters, and unlock
211+ * timestamp
217212 */
218213 constructor (
219214 IERC20 _feeAsset ,
@@ -279,10 +274,11 @@ contract RollupCore is EIP712("Aztec Rollup", "1"), Ownable, IStakingCore, IVali
279274
280275 // If no booster is specifically provided, deploy one.
281276 if (address (_config.rewardConfig.booster) == address (0 )) {
282- _config.rewardConfig.booster = RewardDeploymentExtLib .deployRewardBooster (_config.rewardBoostConfig);
277+ _config.rewardConfig.booster = RewardExtLib .deployRewardBooster (_config.rewardBoostConfig);
283278 }
284279
285- RewardLib.setConfig (_config.rewardConfig);
280+ RewardExtLib.initialize (_config.earliestRewardsClaimableTimestamp);
281+ RewardExtLib.setConfig (_config.rewardConfig);
286282
287283 L1_BLOCK_AT_GENESIS = block .number ;
288284
@@ -312,7 +308,7 @@ contract RollupCore is EIP712("Aztec Rollup", "1"), Ownable, IStakingCore, IVali
312308 * @param _config The new reward configuration including rates and booster settings
313309 */
314310 function setRewardConfig (RewardConfig memory _config ) external override (IRollupCore) onlyOwner {
315- RewardLib .setConfig (_config);
311+ RewardExtLib .setConfig (_config);
316312 emit RewardConfigUpdated (_config);
317313 }
318314
@@ -340,10 +336,11 @@ contract RollupCore is EIP712("Aztec Rollup", "1"), Ownable, IStakingCore, IVali
340336 /**
341337 * @notice Enables or disables reward claiming
342338 * @dev Only callable by owner. This is a safety mechanism to control when rewards can be withdrawn.
339+ * Cannot set rewards as claimable before the earliest reward claimable timestamp.
343340 * @param _isRewardsClaimable True to enable reward claims, false to disable
344341 */
345342 function setRewardsClaimable (bool _isRewardsClaimable ) external override (IRollupCore) onlyOwner {
346- isRewardsClaimable = _isRewardsClaimable;
343+ RewardExtLib. setIsRewardsClaimable ( _isRewardsClaimable) ;
347344 emit RewardsClaimableUpdated (_isRewardsClaimable);
348345 }
349346
@@ -391,8 +388,7 @@ contract RollupCore is EIP712("Aztec Rollup", "1"), Ownable, IStakingCore, IVali
391388 * @return The amount of rewards claimed
392389 */
393390 function claimSequencerRewards (address _coinbase ) external override (IRollupCore) returns (uint256 ) {
394- require (isRewardsClaimable, Errors.Rollup__RewardsNotClaimable ());
395- return RewardLib.claimSequencerRewards (_coinbase);
391+ return RewardExtLib.claimSequencerRewards (_coinbase);
396392 }
397393
398394 /**
@@ -408,8 +404,7 @@ contract RollupCore is EIP712("Aztec Rollup", "1"), Ownable, IStakingCore, IVali
408404 override (IRollupCore)
409405 returns (uint256 )
410406 {
411- require (isRewardsClaimable, Errors.Rollup__RewardsNotClaimable ());
412- return RewardLib.claimProverRewards (_coinbase, _epochs);
407+ return RewardExtLib.claimProverRewards (_coinbase, _epochs);
413408 }
414409
415410 /**
0 commit comments