-
Notifications
You must be signed in to change notification settings - Fork 992
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 the trimming of the record of the first block height of each epoch #1898
Conversation
f7698db
to
7c8dfb0
Compare
7c8dfb0
to
7113b8b
Compare
pls update wasm |
core/src/types/storage.rs
Outdated
/// Look-up the epoch of a given block height. | ||
/// Look up the epoch of a given block height. | ||
/// TODO: handle passing of a future block height? (only valid for current | ||
/// or past) |
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.
We can't determine future epochs because epoch progression depends on 2 params - min. num of blocks and min duration. I think if the given block_height > current_height
we can return None
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.
ah, nvm, we don't have enough context here to check current height. The current behavior is that we return the current epoch, which is probably fine
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.
Yeah, I put this here because it doesn't rly make sense to pass a future block height into this, but figured if this function were to eventually also take in the current block height, we could return None
perhaps
4a83bbe
* brent/fix-epoch-trimming: fixup! remove unnecessary `Epochs` methods changelog: #1898 remove unnecessary `Epochs` methods fix tests remove trimming of `pred_epochs`
* origin/brent/fix-epoch-trimming: fixup! remove unnecessary `Epochs` methods changelog: #1898 remove unnecessary `Epochs` methods fix tests remove trimming of `pred_epochs`
* origin/brent/fix-epoch-trimming: fixup! remove unnecessary `Epochs` methods changelog: #1898 remove unnecessary `Epochs` methods fix tests remove trimming of `pred_epochs`
Merged into v0.23.0 |
Describe your changes
Closes #1897. To resolve the issue, we no longer trim this data and now keep the first block height of every past epoch in storage.
Indicate on which release or other PRs this topic is based on
Based on v0.22.0
Checklist before merging to
draft