-
Notifications
You must be signed in to change notification settings - Fork 605
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
fix(state-viewer): fix balance overflow in state-dump command #9546
Conversation
The state-dump command changes the amounts of validator accounts to match the epoch we're dumping state in, in case a validator stakes during that epoch, and the locked amount is different than the stake. The new locked amount computation is correct if a validator staked more, but overflows if the locked amount is smaller than the stake plus amount, which actually does occur on mainnet
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.
Would you please add a unit test?
will do, but will take me a bit. I think to write a good test in the style of the other ones in this file, I need to understand how it is even possible that the stake for a validator is greater than the amount + locked on its account. no idea how that actually happened at the moment... |
@nikurt going to just merge this now, after discussion here: https://near.zulipchat.com/#narrow/stream/297873-pagoda.2Fnode/topic/view-state.20dump-state.20crashing/near/393663390 but will try to figure out how it happened so I can add a test later |
The state-dump command changes the amounts of validator accounts to match the epoch we're dumping state in, in case a validator stakes during that epoch, and the locked amount is different than the stake. The new locked amount computation is correct if a validator staked more, but overflows if the locked amount is smaller than the stake plus amount, which actually does occur on mainnet
The state-dump command changes the amounts of validator accounts to match the epoch we're dumping state in, in case a validator stakes during that epoch, and the locked amount is different than the stake. The new locked amount computation is correct if a validator staked more, but overflows if the locked amount is smaller than the stake plus amount, which actually does occur on mainnet
The state-dump command changes the amounts of validator accounts to match the epoch we're dumping state in, in case a validator stakes during that epoch, and the locked amount is different than the stake. The new locked amount computation is correct if a validator staked more, but overflows if the locked amount is smaller than the stake plus amount, which actually does occur on mainnet