Skip to content
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 #837

Merged
merged 60 commits into from
Nov 14, 2024
Merged

feat: Rewards v2 #837

merged 60 commits into from
Nov 14, 2024

Conversation

0xrajath
Copy link
Contributor

@0xrajath 0xrajath commented Oct 16, 2024

Motivation

As part of the Rewards v2 release, we need to support the following:

  1. Refactoring existing commission terminology to split, and global terminology to default.
  2. Operator-Directed Rewards submission by AVSs.
  3. Batching claiming by users to be more gas efficient.
  4. Variable Operator split per AVS (Settable by the operator with a 7-day delay. Default of 10%)
  5. Variable Operator split for Programmatic Incentives (Settable by the operator with a 7-day delay. Default of 10%)

Modifications

  • Refactoring existing commission terminology to split, and global terminology to default for RewardsCoordinator in src, script and test.

  • RewardsCoordinator and IRewardsCoordinator:

    • createOperatorDirectedAVSRewardsSubmission external function and related changes that allows AVSs to submit operator-directed rewards.
    • setOperatorAVSSplit external function and related changes that allows operators to set their split per AVS.
    • setOperatorPISplit external function and related changes that allows operators to set their split for Programmatic Incentives.
    • Refactored code in processClaim into an internal function called _processClaim
    • processClaims external function and related changes that iterates over _processClaim to allow batch claiming of rewards for earners.
    • Renamed operatorCommissionBips() view function to getOperatorAVSSplit() and added logic to handle default value and operator<>avs split.
    • getOperatorPISplit() view function with logic to handle default value and operator PI split.
  • RewardsCoordinatorStorage :

    • Added 3 new storage variables.
    • Updated storage gap from 40 to 37 slots to accomodate new storage variables.
  • Updated Test Cases

  • Updated Storage Report

  • Updated Bindings

Result

Rewards v2 release.

@0xrajath 0xrajath added the enhancement New feature or request label Oct 16, 2024
@0xrajath 0xrajath self-assigned this Oct 16, 2024
lib/forge-std Outdated Show resolved Hide resolved
@ypatil12 ypatil12 self-requested a review October 17, 2024 02:34
@0xrajath 0xrajath changed the title feat: Rewards V2 feat: Rewards v2 Oct 17, 2024
src/contracts/core/RewardsCoordinator.sol Show resolved Hide resolved
src/contracts/core/RewardsCoordinator.sol Outdated Show resolved Hide resolved
src/contracts/interfaces/IRewardsCoordinator.sol Outdated Show resolved Hide resolved
src/contracts/core/RewardsCoordinator.sol Show resolved Hide resolved
src/contracts/interfaces/IRewardsCoordinator.sol Outdated Show resolved Hide resolved
Copy link
Contributor

@gpsanant gpsanant left a comment

Choose a reason for hiding this comment

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

LGTM, will wait for @ypatil12 @nadir-akhtar review to merge

@0xrajath 0xrajath merged commit ac57bc1 into dev Nov 14, 2024
15 of 18 checks passed
@0xrajath 0xrajath deleted the feat/rewards-v2 branch November 14, 2024 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants