-
Notifications
You must be signed in to change notification settings - Fork 465
feat: rewards v2.2 #1682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: rewards v2.2 #1682
Conversation
**Motivation:** We need to support Rewards v2.2 : - Rewards that are linear to allocated unique stake (Needs to be both retroactive and future-looking). - Rewards that are linear to total stake (Needs to be both retroactive and future-looking). TDD: https://www.notion.so/eigen-labs/PRD-Rewards-v2-2-Operator-Set-Rewards-with-Unique-Total-Stake-28513c11c3e080cbb856e41ddc6362f5 **Modifications:** Updates in `RewardsCoordinator`: - New `createUniqueStakeRewardsSubmission` function with `UniqueStakeRewardsSubmissionCreated` event emission - New `PAUSED_UNIQUE_STAKE_REWARDS_SUBMISSION` constant - New `isUniqueStakeRewardsSubmissionHash` mapping - New `createTotalStakeRewardsSubmission` function with `TotalStakeRewardsSubmissionCreated` event emission - New `PAUSED_TOTAL_STAKE_REWARDS_SUBMISSION` constant - New `isTotalStakeRewardsSubmissionHash` mapping - Updated storage gap to 33 slots (from 35 slots) Updated Bindings **Result:** Support for Rewards v2.2
9e0aee8 to
bd57ecb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces Rewards v2.2, implementing two new reward submission types for the RewardsCoordinator contract: rewards linear to allocated unique stake and rewards linear to total stake. Both types support retroactive and future-looking submissions.
Changes:
- Added two new functions
createUniqueStakeRewardsSubmissionandcreateTotalStakeRewardsSubmissionto enable new reward distribution models - Added new pause flags (indices 10 and 11) for the new submission functions
- Updated storage with new mapping variables and reduced storage gap accordingly
- Generated Go bindings for the updated contract interfaces
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/contracts/core/RewardsCoordinator.sol | Implements the two new reward submission functions with operator set validation |
| src/contracts/interfaces/IRewardsCoordinator.sol | Defines interfaces, events, and documentation for new submission types |
| src/contracts/core/storage/RewardsCoordinatorStorage.sol | Adds new pause flags, storage mappings, and adjusts storage gap |
| src/test/unit/RewardsCoordinatorUnit.t.sol | Comprehensive test coverage for both new functions including edge cases and UAM scenarios |
| pkg/bindings/RewardsCoordinatorStorage/binding.go | Updated Go bindings for storage contract |
| pkg/bindings/IRewardsCoordinator/binding.go | Updated Go bindings for interface |
Comments suppressed due to low confidence (1)
src/test/unit/RewardsCoordinatorUnit.t.sol:1860
- Corrected spelling of 'realisticly' to 'realistically'.
// Set the timestamp to when Rewards v2 will realisticly go out (i.e 6 months)
cheats.warp(GENESIS_REWARDS_TIMESTAMP + 168 days);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
**Motivation:** Rewards v2.2 upgrade scripts (v1.10.0) **Modifications:** - `v1.10.0-rewards-v2.2` release script that includes 3 steps (Collectively it upgrades the RewardsCoordinator to include Rewards v2.2 functionality and also updates `MAX_REWARDS_DURATION` from 70 days to 2 years): 1. `1-deployRewardsCoordinatorImpl.s.sol` 2. `2-queueRewardsCoordinatorUpgrade.s.sol` 3. `3-executeRewardsCoordinatorUpgrade.s.sol` - Updated `v1.9.0-slashing-ux` and `v1.9.0-slashing-ux-destination` release scripts to have a version check for `v1.8.1`. **Result:** Rewards v2.2 upgrade.
Certora Run Started (Verified Rules)
Certora Run Summary
|
v1.10.0 Rewards v2.2
Release Manager
@0xrajath
Overview
Rewards v2.2 releases 2 new reward types:
The below release notes cover Core Contracts.
Highlights
🚀 New Features
RewardsCoordinatorincludes 2 new reward functions:createUniqueStakeRewardsSubmission(Rewards linear to allocated unique stake) andcreateTotalStakeRewardsSubmission(Rewards linear to total stake)Changelog