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 2.1 calculation #215

Merged
merged 8 commits into from
Feb 4, 2025

Conversation

0xrajath
Copy link
Contributor

@0xrajath 0xrajath commented Jan 30, 2025

Motivation

We need to support Rewards v2.1 calculation.

This PR builds on top of #197 which supported the Eigen state models for OperatorDirectedOperatorSetRewardSubmissions, OperatorSetSplits, OperatorSetOperatorRegistrations, OperatorSetStrategyRegistrations.

Modifications

  • Snapshot generation for: OperatorDirectedOperatorSetRewardSubmissions, OperatorSetSplits, OperatorSetOperatorRegistrations, OperatorSetStrategyRegistrations.
  • Refactoring Staging and Final numbering from 11 and 12 to 15 and 16.
  • Mississippi hard fork for Rewards v2.1.
  • New Operator Directed Operator Set rewards calculation to be triggered after Mississippi hard fork.
  • Updated Rewards For All Earners (Programmatic Incentives) calculation to include operators registered to operator sets after Mississippi hard fork.
  • Staker-operator calculation for Rewards v2.1.

Results

Rewards v2.1 calculation.

Tests

Existing Rewards tests passing.

Screenshot 2025-01-31 at 1 33 38 PM

@0xrajath 0xrajath self-assigned this Jan 30, 2025
@0xrajath 0xrajath marked this pull request as ready for review January 31, 2025 18:36
@0xrajath 0xrajath requested a review from a team as a code owner January 31, 2025 18:36
@0xrajath 0xrajath force-pushed the rajath/rewards-v2.1-snapshots branch from f1c652c to 79bad9a Compare January 31, 2025 20:49
Copy link
Member

@seanmcgary seanmcgary left a comment

Choose a reason for hiding this comment

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

Looks pretty good overall, just a handful of comments.

@0xrajath can you also add the corresponding inserts for the staker-operator table for rewards v2.1 as well? You should be able to follow what I did for the regular rewards v2 queries.

Copy link
Contributor

@ypatil12 ypatil12 left a comment

Choose a reason for hiding this comment

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

Generally looks good, main comment is the 2 day log on strategy<>opSet relationship. We don't do the same for the current avs<>strat relationship (see operatorAvsStrategySnapshots.go - we can do something much simpler than this).

@0xrajath
Copy link
Contributor Author

0xrajath commented Feb 4, 2025

@seanmcgary I've added the staker-operator calculation in 089c94a

@0xrajath 0xrajath merged commit 5b9d766 into release/rewards-v2.1 Feb 4, 2025
10 checks passed
@0xrajath 0xrajath deleted the rajath/rewards-v2.1-snapshots branch February 4, 2025 15:33
seanmcgary pushed a commit that referenced this pull request Feb 5, 2025
# Motivation
We need to support Rewards v2.1 calculation. 

This PR builds on top of #197
which supported the Eigen state models for
`OperatorDirectedOperatorSetRewardSubmissions`, `OperatorSetSplits`,
`OperatorSetOperatorRegistrations`, `OperatorSetStrategyRegistrations`.

# Modifications
* Snapshot generation for:
`OperatorDirectedOperatorSetRewardSubmissions`, `OperatorSetSplits`,
`OperatorSetOperatorRegistrations`, `OperatorSetStrategyRegistrations`.
* Refactoring Staging and Final numbering from 11 and 12 to 15 and 16.
* Mississippi hard fork for Rewards v2.1.
* New Operator Directed Operator Set rewards calculation to be triggered
after Mississippi hard fork.
* Updated Rewards For All Earners (Programmatic Incentives) calculation
to include operators registered to operator sets after Mississippi hard
fork.
* Staker-operator calculation for Rewards v2.1. 

# Results
Rewards v2.1 calculation.

# Tests
Existing Rewards tests passing.

<img width="660" alt="Screenshot 2025-01-31 at 1 33 38 PM"
src="https://github.com/user-attachments/assets/876c2d7c-be22-48b6-a046-55ead8a12530"
/>
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.

3 participants