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

Optim denunciation pool cache cleanup #4139

Merged
merged 4 commits into from
Jun 22, 2023

Conversation

sydhds
Copy link
Contributor

@sydhds sydhds commented Jun 22, 2023

  • document all added functions
  • try in sandbox /simulation/labnet
  • unit tests on the added/changed features
    • make tests compile
    • make tests pass
  • add logs allowing easy debugging in case the changes caused problems
  • if the API has changed, update the API specification

@sydhds sydhds requested a review from damip June 22, 2023 13:01
slot_period: &u64,
denunciation_expire_periods: &u64,
) {
// Find the first key which is not expired
Copy link
Member

@damip damip Jun 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about directly doing:

let earliest_allowed_period = slot_period.saturating_sub(denunciation_expire_periods.saturating_sub(1));
*cache = cache.split_off(
    &DenunciationIndex::Endorsmeent{ slot: Slot::new(earliest_allowed_period, 0), index: 0 }
);

?

@sydhds sydhds requested a review from damip June 22, 2023 14:39
Copy link
Member

@damip damip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work !

@sydhds sydhds merged commit 5d1dbd2 into testnet_24 Jun 22, 2023
@sydhds sydhds deleted the feature/denunciation_pool_cleanup_optim_1 branch June 22, 2023 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants