Skip to content

feat: make rewards claimable#11975

Merged
LHerskind merged 2 commits intomasterfrom
lh/11949
Feb 18, 2025
Merged

feat: make rewards claimable#11975
LHerskind merged 2 commits intomasterfrom
lh/11949

Conversation

@LHerskind
Copy link
Contributor

@LHerskind LHerskind commented Feb 13, 2025

Fixes #11949.

Copy link
Contributor Author

LHerskind commented Feb 13, 2025

Base automatically changed from lh/11873 to master February 13, 2025 14:40
@LHerskind LHerskind marked this pull request as ready for review February 13, 2025 14:59
@LHerskind LHerskind requested a review from just-mitch February 13, 2025 15:52
uint256 sequencerRewards = rollup.getSequencerRewards(sequencer);
vm.prank(sequencer);
uint256 sequencerRewardsClaimed = rollup.claimSequencerRewards(sequencer);
assertEq(sequencerRewardsClaimed, sequencerRewards, "Sequencer rewards not claimed");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also assert the value? Or at least assert greater than 0?

assertGt(bobRewards, 0, "Bob rewards is zero");

vm.expectRevert(
abi.encodeWithSelector(Errors.Rollup__NotPastDeadline.selector, EPOCH_DURATION * 2, 2)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
abi.encodeWithSelector(Errors.Rollup__NotPastDeadline.selector, EPOCH_DURATION * 2, 2)
abi.encodeWithSelector(Errors.Rollup__NotPastDeadline.selector, TestConstants.AZTEC_PROOF_SUBMISSION_WINDOW, 2)

vm.prank(bob);
rollup.claimProverRewards(bob, epochs);

vm.warp(Timestamp.unwrap(rollup.getTimestampForSlot(Slot.wrap(EPOCH_DURATION * 2 + 1))));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

@LHerskind
Copy link
Contributor Author

Updated the aztec_proof_submission_window in the solidity tests and defaults because it also included the first block in the epoch + 2.

For example, with epochs of size 32, the window was 64, meaning that the deadline would be at 64 for blocks in the first epoch meaning that it could happen in slot 64 which is in the third epoch, [0, ..., 31], [32, ..., 63], [64, ..., 95]. Instead we will use 2*epoch-1, to indicate that we must have the full epoch that the block is within and then epoch-1 slots to indicate every slot in the next epoch.

@LHerskind LHerskind merged commit 8aee21d into master Feb 18, 2025
13 checks passed
@LHerskind LHerskind deleted the lh/11949 branch February 18, 2025 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: make rewards claimable

2 participants