-
Notifications
You must be signed in to change notification settings - Fork 168
Switch from per block to per epoch reward distribution ( V6 Upgrade) #3879
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
base: main
Are you sure you want to change the base?
Conversation
cdbcce2 to
97a2584
Compare
9c7021e to
74d7737
Compare
* checkpoint * reconstruct reward merkle tree
bdd2790 to
fb10f82
Compare
types/src/v0/impls/header.rs
Outdated
| reward_calculator.spawn_background_task( | ||
| prev_epoch, | ||
| epoch_height, | ||
| validated_state.reward_merkle_tree_v2.clone(), |
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.
Do we know for sure this is the correct merkle tree to pass in here, I feel it could be arbitrarily old. Maybe we can check the header.reward_merkle_tree_root == validated_state.reward_merkle_tree_v2.root and if false just pass in the empty tree with the root from the prev_epoch_header
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.
made that change in this commit bcbc39d
* use new merkle tree if our root doesn't match the header * get full tree from correct header * make sure we have the full randomized stake table for the epoch * order the validators before indexing * bail if reward root doesn't equal header --------- Co-authored-by: imabdulbasit <[email protected]>
No description provided.