Skip to content

Commit 1e34ffe

Browse files
committed
feat: remove isRewardClaimable
1 parent 1d42c35 commit 1e34ffe

12 files changed

Lines changed: 11 additions & 227 deletions

File tree

docs/docs-operate/operators/sequencer-management/claiming-rewards.md

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@ Rewards are not automatically sent to your coinbase address. You must explicitly
3737

3838
Before claiming, verify these conditions:
3939

40-
1. **Rewards must be claimable**: A governance vote must pass to enable the claiming of rewards (only possible after a minimum configured timestamp) and governance must have called `setRewardsClaimable(true)` on the rollup contract.
41-
2. **Rewards have accumulated**: Query your pending rewards before attempting to claim.
42-
3. **Sufficient gas**: Ensure you have ETH to pay transaction gas costs.
40+
1. **Rewards have accumulated**: Query your pending rewards before attempting to claim.
41+
2. **Sufficient gas**: Ensure you have ETH to pay transaction gas costs.
4342

4443
## Checking Reward Status
4544

@@ -54,26 +53,6 @@ export ROLLUP_ADDRESS="[YOUR_ROLLUP_CONTRACT_ADDRESS]"
5453

5554
Replace `[YOUR_ROLLUP_CONTRACT_ADDRESS]` with your actual Rollup contract address.
5655

57-
### Check if Rewards Are Claimable
58-
59-
Verify reward claiming is enabled before attempting to claim:
60-
61-
```bash
62-
cast call $ROLLUP_ADDRESS "isRewardsClaimable()" --rpc-url $RPC_URL
63-
```
64-
65-
**Expected output:**
66-
- `0x0000000000000000000000000000000000000000000000000000000000000001` - Rewards are claimable (true)
67-
- `0x0000000000000000000000000000000000000000000000000000000000000000` - Rewards are not yet claimable (false)
68-
69-
If rewards are not claimable, check when they will become claimable:
70-
71-
```bash
72-
cast call $ROLLUP_ADDRESS "getEarliestRewardsClaimableTimestamp()" --rpc-url $RPC_URL
73-
```
74-
75-
This returns a Unix timestamp indicating the earliest time when governance can enable reward claiming.
76-
7756
### Query Your Pending Rewards
7857

7958
Check accumulated rewards:
@@ -161,15 +140,6 @@ cast call $ROLLUP_ADDRESS "getSequencerRewards(address)" [COINBASE_ADDRESS] --rp
161140

162141
## Troubleshooting
163142

164-
### "Rewards not claimable" Error
165-
166-
**Symptom**: Transaction reverts with "Rewards not claimable" error.
167-
168-
**Solution**:
169-
1. Check if rewards are claimable using `isRewardsClaimable()`
170-
2. If `false`, wait until governance enables claiming via `setRewardsClaimable(true)`
171-
3. Check the earliest claimable timestamp using `getEarliestRewardsClaimableTimestamp()`
172-
173143
### No Pending Rewards
174144

175145
**Symptom**: `getSequencerRewards()` returns zero.

l1-contracts/script/deploy/RollupConfiguration.sol

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {IBoosterCore} from "@aztec/core/reward-boost/RewardBooster.sol";
1111
import {SlasherFlavor} from "@aztec/core/interfaces/ISlasher.sol";
1212
import {EthValue, EthPerFeeAssetE12} from "@aztec/core/libraries/rollup/FeeLib.sol";
1313
import {GenesisState, RollupConfigInput} from "@aztec/core/interfaces/IRollup.sol";
14-
import {Timestamp} from "@aztec/core/libraries/TimeLib.sol";
1514
import {RewardBoostConfig} from "@aztec/core/reward-boost/RewardBooster.sol";
1615
import {StakingQueueConfig} from "@aztec/core/libraries/compressed-data/StakingQueueConfig.sol";
1716
import {RewardConfig, Bps} from "@aztec/core/libraries/rollup/RewardLib.sol";
@@ -20,7 +19,6 @@ interface IRollupConfiguration {
2019
function loadConfig() external;
2120
function useRealVerifier() external view returns (bool);
2221
function getFeeJuicePortalInitialBalance() external view returns (uint256);
23-
function getEarliestRewardsClaimableTimestamp() external view returns (Timestamp);
2422
function getGenesisState() external view returns (GenesisState memory);
2523
function getRewardConfiguration(IRewardDistributor rewardDistributor) external view returns (RewardConfig memory);
2624
function getRewardBoostConfiguration() external pure returns (RewardBoostConfig memory);
@@ -49,16 +47,6 @@ contract RollupConfiguration is IRollupConfiguration, Test {
4947
return vm.envOr("FEE_JUICE_PORTAL_INITIAL_BALANCE", uint256(0));
5048
}
5149

52-
function getEarliestRewardsClaimableTimestamp() public view returns (Timestamp) {
53-
// We only set a delay on mainnet.
54-
// Since we don't plan to redeploy on mainnet (knock on wood), this is mostly documentation in code form.
55-
if (block.chainid == 1) {
56-
return Timestamp.wrap(block.timestamp + 90 days);
57-
} else {
58-
return Timestamp.wrap(0);
59-
}
60-
}
61-
6250
function getGenesisState() external view returns (GenesisState memory) {
6351
return GenesisState({
6452
vkTreeRoot: bytes32(vm.envOr("VK_TREE_ROOT", uint256(0))),
@@ -106,7 +94,6 @@ contract RollupConfiguration is IRollupConfiguration, Test {
10694
config.rewardConfig = this.getRewardConfiguration(_rewardDistributor);
10795
config.rewardBoostConfig = this.getRewardBoostConfiguration();
10896
config.stakingQueueConfig = this.getStakingQueueConfiguration();
109-
config.earliestRewardsClaimableTimestamp = getEarliestRewardsClaimableTimestamp();
11097

11198
// Compute version as first 4 bytes of hash(abi.encode(config, genesisState))
11299
config.version = _computeConfigVersion(config, this.getGenesisState());

l1-contracts/src/core/Rollup.sol

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -570,14 +570,6 @@ contract Rollup is IStaking, IValidatorSelection, IRollup, RollupCore {
570570
return RewardExtLib.getCheckpointReward();
571571
}
572572

573-
function isRewardsClaimable() external view override(IRollup) returns (bool) {
574-
return RewardExtLib.isRewardsClaimable();
575-
}
576-
577-
function getEarliestRewardsClaimableTimestamp() external view override(IRollup) returns (Timestamp) {
578-
return RewardExtLib.getEarliestRewardsClaimableTimestamp();
579-
}
580-
581573
function getAvailableValidatorFlushes() external view override(IStaking) returns (uint256) {
582574
return ValidatorOperationsExtLib.getAvailableValidatorFlushes();
583575
}

l1-contracts/src/core/RollupCore.sol

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -282,17 +282,6 @@ contract RollupCore is EIP712("Aztec Rollup", "1"), Ownable, IStakingCore, IVali
282282
emit IRollupCore.ManaTargetUpdated(_manaTarget);
283283
}
284284

285-
/**
286-
* @notice Enables or disables reward claiming
287-
* @dev Only callable by owner. This is a safety mechanism to control when rewards can be withdrawn.
288-
* Cannot set rewards as claimable before the earliest reward claimable timestamp.
289-
* @param _isRewardsClaimable True to enable reward claims, false to disable
290-
*/
291-
function setRewardsClaimable(bool _isRewardsClaimable) external override(IRollupCore) onlyOwner {
292-
RewardExtLib.setIsRewardsClaimable(_isRewardsClaimable);
293-
emit RewardsClaimableUpdated(_isRewardsClaimable);
294-
}
295-
296285
/**
297286
* @notice Updates the slasher contract address
298287
* @dev Only callable by owner. The slasher handles punishment for validator misbehavior.
@@ -343,7 +332,7 @@ contract RollupCore is EIP712("Aztec Rollup", "1"), Ownable, IStakingCore, IVali
343332

344333
/**
345334
* @notice Claims accumulated rewards for a sequencer (checkpoint proposer)
346-
* @dev Rewards must be enabled via isRewardsClaimable. Transfers all accumulated rewards to the recipient.
335+
* @dev Transfers all accumulated rewards to the recipient.
347336
* @param _coinbase The address that has accumulated the rewards - rewards are sent to this address
348337
* @return The amount of rewards claimed
349338
*/
@@ -353,8 +342,8 @@ contract RollupCore is EIP712("Aztec Rollup", "1"), Ownable, IStakingCore, IVali
353342

354343
/**
355344
* @notice Claims prover rewards for specified epochs
356-
* @dev Rewards must be enabled. Provers earn rewards for successfully proving epoch transitions.
357-
* Each epoch can only be claimed once per prover.
345+
* @dev Provers earn rewards for successfully proving epoch transitions. Each epoch can only be claimed once per
346+
* prover.
358347
* @param _coinbase The address that has accumulated the rewards - rewards are sent to this address
359348
* @param _epochs Array of epochs to claim rewards for
360349
* @return The total amount of rewards claimed
@@ -607,7 +596,6 @@ contract RollupCore is EIP712("Aztec Rollup", "1"), Ownable, IStakingCore, IVali
607596
rewardConfig.booster = RewardExtLib.deployRewardBooster(_config.rewardBoostConfig);
608597
}
609598

610-
RewardExtLib.initialize(_config.earliestRewardsClaimableTimestamp);
611599
RewardExtLib.setConfig(rewardConfig);
612600
}
613601

l1-contracts/src/core/interfaces/IRollup.sol

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ struct RollupConfigInput {
8080
RewardBoostConfig rewardBoostConfig;
8181
StakingQueueConfig stakingQueueConfig;
8282
uint256 localEjectionThreshold;
83-
Timestamp earliestRewardsClaimableTimestamp;
8483
uint256 inboxLag;
8584
}
8685

@@ -116,9 +115,7 @@ interface IRollupCore {
116115
event RewardConfigUpdated(RewardConfig rewardConfig);
117116
event ManaTargetUpdated(uint256 indexed manaTarget);
118117
event PrunedPending(uint256 provenCheckpointNumber, uint256 pendingCheckpointNumber);
119-
event RewardsClaimableUpdated(bool isRewardsClaimable);
120118

121-
function setRewardsClaimable(bool _isRewardsClaimable) external;
122119
function claimSequencerRewards(address _recipient) external returns (uint256);
123120
function claimProverRewards(address _recipient, Epoch[] memory _epochs) external returns (uint256);
124121

@@ -238,6 +235,4 @@ interface IRollup is IRollupCore, IHaveVersion {
238235

239236
function getRewardConfig() external view returns (RewardConfig memory);
240237
function getCheckpointReward() external view returns (uint256);
241-
function getEarliestRewardsClaimableTimestamp() external view returns (Timestamp);
242-
function isRewardsClaimable() external view returns (bool);
243238
}

l1-contracts/src/core/libraries/Errors.sol

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ library Errors {
8787
error Rollup__ProverHaveAlreadySubmitted(address prover, Epoch epoch);
8888
error Rollup__InvalidManaTarget(uint256 minimum, uint256 provided);
8989
error Rollup__ManaLimitExceeded();
90-
error Rollup__RewardsNotClaimable();
91-
error Rollup__TooSoonToSetRewardsClaimable(uint256 earliestRewardsClaimableTimestamp, uint256 currentTimestamp);
9290
error Rollup__InvalidFirstEpochProof();
9391
error Rollup__InvalidCoinbase();
9492
error Rollup__UnavailableTempCheckpointLog(

l1-contracts/src/core/libraries/rollup/RewardExtLib.sol

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,10 @@ import {
2222
import {IRewardDistributor} from "@aztec/governance/interfaces/IRewardDistributor.sol";
2323

2424
library RewardExtLib {
25-
function initialize(Timestamp _earliestRewardsClaimableTimestamp) external {
26-
RewardLib.initialize(_earliestRewardsClaimableTimestamp);
27-
}
28-
2925
function setConfig(RewardConfig memory _config) external {
3026
RewardLib.setConfig(_config);
3127
}
3228

33-
function setIsRewardsClaimable(bool _isRewardsClaimable) external {
34-
RewardLib.setIsRewardsClaimable(_isRewardsClaimable);
35-
}
36-
3729
function claimSequencerRewards(address _sequencer) external returns (uint256) {
3830
return RewardLib.claimSequencerRewards(_sequencer);
3931
}
@@ -77,14 +69,6 @@ library RewardExtLib {
7769
return RewardLib.getCheckpointReward();
7870
}
7971

80-
function isRewardsClaimable() external view returns (bool) {
81-
return RewardLib.isRewardsClaimable();
82-
}
83-
84-
function getEarliestRewardsClaimableTimestamp() external view returns (Timestamp) {
85-
return RewardLib.getEarliestRewardsClaimableTimestamp();
86-
}
87-
8872
function getRewardConfig() external view returns (RewardConfig memory) {
8973
return RewardLib.getStorage().config;
9074
}

l1-contracts/src/core/libraries/rollup/RewardLib.sol

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {STFLib} from "@aztec/core/libraries/rollup/STFLib.sol";
99
import {Epoch, Timestamp, TimeLib} from "@aztec/core/libraries/TimeLib.sol";
1010
import {IBoosterCore} from "@aztec/core/reward-boost/RewardBooster.sol";
1111
import {IRewardDistributor} from "@aztec/governance/interfaces/IRewardDistributor.sol";
12-
import {CompressedTimeMath, CompressedTimestamp} from "@aztec/shared/libraries/CompressedTimeMath.sol";
1312
import {IERC20} from "@oz/token/ERC20/IERC20.sol";
1413
import {SafeERC20} from "@oz/token/ERC20/utils/SafeERC20.sol";
1514
import {Math} from "@oz/utils/math/Math.sol";
@@ -47,8 +46,6 @@ struct RewardStorage {
4746
mapping(Epoch => EpochRewards) epochRewards;
4847
mapping(address prover => BitMaps.BitMap claimed) proverClaimed;
4948
RewardConfig config;
50-
CompressedTimestamp earliestRewardsClaimableTimestamp;
51-
bool isRewardsClaimable;
5249
}
5350

5451
struct Values {
@@ -67,8 +64,6 @@ struct Totals {
6764
library RewardLib {
6865
using SafeERC20 for IERC20;
6966
using BitMaps for BitMaps.BitMap;
70-
using CompressedTimeMath for CompressedTimestamp;
71-
using CompressedTimeMath for Timestamp;
7267
using TimeLib for Timestamp;
7368
using TimeLib for Epoch;
7469
using FeeHeaderLib for CompressedFeeHeader;
@@ -81,34 +76,14 @@ library RewardLib {
8176
// such as sacrificial hearts, during rituals performed within temples.
8277
address public constant BURN_ADDRESS = address(bytes20("CUAUHXICALLI"));
8378

84-
function initialize(Timestamp _earliestRewardsClaimableTimestamp) internal {
85-
RewardStorage storage rewardStorage = getStorage();
86-
rewardStorage.earliestRewardsClaimableTimestamp = _earliestRewardsClaimableTimestamp.compress();
87-
rewardStorage.isRewardsClaimable = false;
88-
}
89-
9079
function setConfig(RewardConfig memory _config) internal {
9180
require(Bps.unwrap(_config.sequencerBps) <= 10_000, Errors.RewardLib__InvalidSequencerBps());
9281
RewardStorage storage rewardStorage = getStorage();
9382
rewardStorage.config = _config;
9483
}
9584

96-
function setIsRewardsClaimable(bool _isRewardsClaimable) internal {
97-
RewardStorage storage rewardStorage = getStorage();
98-
uint256 earliestRewardsClaimableTimestamp =
99-
Timestamp.unwrap(rewardStorage.earliestRewardsClaimableTimestamp.decompress());
100-
require(
101-
block.timestamp >= earliestRewardsClaimableTimestamp,
102-
Errors.Rollup__TooSoonToSetRewardsClaimable(earliestRewardsClaimableTimestamp, block.timestamp)
103-
);
104-
105-
rewardStorage.isRewardsClaimable = _isRewardsClaimable;
106-
}
107-
10885
function claimSequencerRewards(address _sequencer) internal returns (uint256) {
10986
RewardStorage storage rewardStorage = getStorage();
110-
require(rewardStorage.isRewardsClaimable, Errors.Rollup__RewardsNotClaimable());
111-
11287
RollupStore storage rollupStore = STFLib.getStorage();
11388
uint256 amount = rewardStorage.sequencerRewards[_sequencer];
11489

@@ -126,8 +101,6 @@ library RewardLib {
126101

127102
RewardStorage storage rewardStorage = getStorage();
128103

129-
require(rewardStorage.isRewardsClaimable, Errors.Rollup__RewardsNotClaimable());
130-
131104
uint256 accumulatedRewards = 0;
132105
for (uint256 i = 0; i < _epochs.length; i++) {
133106
require(
@@ -296,14 +269,6 @@ library RewardLib {
296269
return (se.shares[_prover] * er.rewards / se.summedShares);
297270
}
298271

299-
function isRewardsClaimable() internal view returns (bool) {
300-
return getStorage().isRewardsClaimable;
301-
}
302-
303-
function getEarliestRewardsClaimableTimestamp() internal view returns (Timestamp) {
304-
return getStorage().earliestRewardsClaimableTimestamp.decompress();
305-
}
306-
307272
function getStorage() internal pure returns (RewardStorage storage storageStruct) {
308273
bytes32 position = REWARD_STORAGE_POSITION;
309274
assembly {

l1-contracts/src/periphery/FlushRewarder.sol

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
pragma solidity >=0.8.27;
44

55
import {IInstance} from "@aztec/core/interfaces/IInstance.sol";
6-
import {Errors} from "@aztec/core/libraries/Errors.sol";
76
import {Ownable} from "@oz/access/Ownable.sol";
87
import {IERC20} from "@oz/token/ERC20/IERC20.sol";
98
import {SafeERC20} from "@oz/token/ERC20/utils/SafeERC20.sol";
@@ -47,8 +46,6 @@ contract FlushRewarder is Ownable, IFlushRewarder {
4746
}
4847

4948
function claimRewards() external override(IFlushRewarder) {
50-
require(ROLLUP.isRewardsClaimable(), Errors.Rollup__RewardsNotClaimable());
51-
5249
uint256 rewardsToClaim = rewardsOf[msg.sender];
5350
if (rewardsToClaim > 0) {
5451
rewardsOf[msg.sender] = 0;

l1-contracts/test/MultiProof.t.sol

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ pragma solidity >=0.8.27;
44

55
import {DecoderBase} from "./base/DecoderBase.sol";
66

7-
import {Registry} from "@aztec/governance/Registry.sol";
87
import {FeeJuicePortal} from "@aztec/core/messagebridge/FeeJuicePortal.sol";
98
import {TestERC20} from "@aztec/mock/TestERC20.sol";
109
import {TestConstants} from "./harnesses/TestConstants.sol";
11-
import {RewardDistributor} from "@aztec/governance/RewardDistributor.sol";
1210
import {ProposeArgs, ProposeLib} from "@aztec/core/libraries/rollup/ProposeLib.sol";
1311

1412
import {Timestamp, Slot, Epoch, TimeLib} from "@aztec/core/libraries/TimeLib.sol";
@@ -18,7 +16,6 @@ import {Errors} from "@aztec/core/libraries/Errors.sol";
1816

1917
import {RollupBase, IInstance} from "./base/RollupBase.sol";
2018
import {RollupBuilder} from "./builder/RollupBuilder.sol";
21-
import {Ownable} from "@oz/access/Ownable.sol";
2219
import {stdStorage, StdStorage} from "forge-std/StdStorage.sol";
2320
import {RewardBooster, ActivityScore} from "@aztec/core/reward-boost/RewardBooster.sol";
2421
import {BoostedHelper} from "./boosted_rewards/BoostRewardHelper.sol";
@@ -36,10 +33,8 @@ contract MultiProofTest is RollupBase {
3633
using TimeLib for Slot;
3734
using TimeLib for Epoch;
3835

39-
Registry internal registry;
4036
TestERC20 internal testERC20;
4137
FeeJuicePortal internal feeJuicePortal;
42-
RewardDistributor internal rewardDistributor;
4338
RewardBooster internal rewardBooster;
4439

4540
uint256 internal SLOT_DURATION;
@@ -145,18 +140,6 @@ contract MultiProofTest is RollupBase {
145140

146141
assertEq(rollup.getProvenCheckpointNumber(), 2, "Checkpoint not proven");
147142

148-
{
149-
// Ensure that we cannot claim rewards when not toggled yet
150-
vm.expectRevert(abi.encodeWithSelector(Errors.Rollup__RewardsNotClaimable.selector));
151-
rollup.claimSequencerRewards(sequencer);
152-
153-
vm.expectRevert(abi.encodeWithSelector(Errors.Rollup__RewardsNotClaimable.selector));
154-
rollup.claimProverRewards(alice, new Epoch[](1));
155-
156-
vm.prank(Ownable(address(rollup)).owner());
157-
rollup.setRewardsClaimable(true);
158-
}
159-
160143
{
161144
uint256 sequencerRewards = rollup.getSequencerRewards(sequencer);
162145
assertGt(sequencerRewards, 0, "Sequencer rewards is zero");

0 commit comments

Comments
 (0)