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

RPC endpoint to request a rewards root at a snapshot height. #37

Open
seanmcgary opened this issue Sep 12, 2024 · 0 comments · May be fixed by #42
Open

RPC endpoint to request a rewards root at a snapshot height. #37

seanmcgary opened this issue Sep 12, 2024 · 0 comments · May be fixed by #42
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@seanmcgary
Copy link
Collaborator

seanmcgary commented Sep 12, 2024

Add a new RPC endpoint to the proto definitions and stub out the handler in the server to generate reward amounts.

In order to reach parity with our current infrastructure, we need to generate rewards based on a snapshot date rather than a block height.

message GenerateRewardAmountsRequest {
    int64 snapshot = 1; // unix timestamp representation of the snapshot
}

message RewardAmount {
    string earner = 1;
    string token = 2;
    int64 snapshot = 3; // unix timestamp representation of the snapshot
    string cumulativeAmount = 4;
}

message GenerateRewardAmountsResponse {
    repeated RewardAmount rewards = 1;
}


rpc GenerateRewardAmounts(GenerateRewardAmountsRequest) returns GenerateRewardAmountsResponse {
    option (google.api.http) = {
      post: "/v1/reward-amounts"
      body: "*"
    };
}
@seanmcgary seanmcgary added this to the Rewards parity milestone Sep 12, 2024
@seanmcgary seanmcgary added enhancement New feature or request good first issue Good for newcomers labels Sep 12, 2024
@seanmcgary seanmcgary linked a pull request Sep 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant