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

Error when quering for staking rewards in epoch 0 #4014

Open
mateuszjasiuk opened this issue Nov 12, 2024 · 3 comments · May be fixed by #4021
Open

Error when quering for staking rewards in epoch 0 #4014

mateuszjasiuk opened this issue Nov 12, 2024 · 3 comments · May be fixed by #4021
Labels
bug Something isn't working PoS

Comments

@mateuszjasiuk
Copy link
Contributor

When we query the staking rewards in epoch 0 we get this msg:

Querying staking rewards rates...
Error in the query: Query("RPC error: Failure in: est_inflation_rate  》/《  last_staked_ratio", 1)

I did not debug this, but I assume this happens because last_staked_ratio is 0

@mateuszjasiuk mateuszjasiuk added the bug Something isn't working label Nov 12, 2024
@tzemanovic tzemanovic added the PoS label Nov 12, 2024
@tzemanovic
Copy link
Member

Ah yes, the last_staked_ratio is initialized to 0 at genesis and it won't be set the right value until the start of epoch 1. We can fix this by setting it the correct value after we apply genesis bonds, but it is unfortunately a consensus breaking change at this point.

@brentstone any thoughts?

@tzemanovic
Copy link
Member

on a second thought, we could fix this in a slightly hacky way but without a breaking change - in the query for first epoch only we could calculate the locked ratio adhoc

@brentstone
Copy link
Collaborator

I think it is best that if rewards are not turned on, we should return a message noting as such. If rewards are turned on, then I think in principle we will never have this issue, since the last_staked_ratio will be set.

@brentstone brentstone linked a pull request Nov 13, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PoS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants