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

Fix the trimming of the record of the first block height of each epoch #1898

Closed
wants to merge 5 commits into from

Conversation

brentstone
Copy link
Collaborator

@brentstone brentstone commented Sep 15, 2023

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

  • I have added a changelog
  • Git history is in acceptable state

@brentstone brentstone force-pushed the brent/fix-epoch-trimming branch 2 times, most recently from f7698db to 7c8dfb0 Compare September 16, 2023 01:22
@brentstone brentstone force-pushed the brent/fix-epoch-trimming branch from 7c8dfb0 to 7113b8b Compare September 19, 2023 22:04
@brentstone brentstone marked this pull request as ready for review September 19, 2023 22:10
@brentstone
Copy link
Collaborator Author

pls update wasm

@brentstone brentstone mentioned this pull request Sep 20, 2023
Fraccaman
Fraccaman previously approved these changes Sep 20, 2023
/// 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)
Copy link
Member

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

Copy link
Member

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

Copy link
Collaborator Author

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

tzemanovic
tzemanovic previously approved these changes Sep 21, 2023
@brentstone brentstone dismissed stale reviews from tzemanovic and Fraccaman via 4a83bbe September 21, 2023 19:07
brentstone added a commit that referenced this pull request Sep 21, 2023
* brent/fix-epoch-trimming:
  fixup! remove unnecessary `Epochs` methods
  changelog: #1898
  remove unnecessary `Epochs` methods
  fix tests
  remove trimming of `pred_epochs`
Fraccaman added a commit that referenced this pull request Sep 25, 2023
* origin/brent/fix-epoch-trimming:
  fixup! remove unnecessary `Epochs` methods
  changelog: #1898
  remove unnecessary `Epochs` methods
  fix tests
  remove trimming of `pred_epochs`
Fraccaman pushed a commit that referenced this pull request Sep 25, 2023
Fraccaman added a commit that referenced this pull request Sep 25, 2023
* origin/brent/fix-epoch-trimming:
  fixup! remove unnecessary `Epochs` methods
  changelog: #1898
  remove unnecessary `Epochs` methods
  fix tests
  remove trimming of `pred_epochs`
@brentstone
Copy link
Collaborator Author

Merged into v0.23.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants