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

feat: reset tally after quorum has reached #2882

Merged
merged 4 commits into from
Dec 4, 2023
Merged

Conversation

cmwaters
Copy link
Contributor

Closes: #2877

@celestia-bot celestia-bot requested a review from a team November 30, 2023 17:34
rootulp
rootulp previously approved these changes Nov 30, 2023
staheri14
staheri14 previously approved these changes Nov 30, 2023
Base automatically changed from cal/msg-try-upgrade to main December 1, 2023 09:47
@cmwaters cmwaters dismissed stale reviews from staheri14 and rootulp December 1, 2023 09:47

The base branch was changed.

Copy link
Contributor

coderabbitai bot commented Dec 1, 2023

Walkthrough

Walkthrough

The changes involve an optimization of the upgrade signaling mechanism within a blockchain application. The upgrade keeper now includes a ResetTally method that is called from the EndBlocker function when a new version is detected, clearing votes for versions that are no longer relevant. Additionally, the order of validation checks in the SignalVersion method has been adjusted for efficiency.

Changes

File Path Change Summary
app/app.go Added a call to app.UpgradeKeeper.ResetTally in the EndBlocker function to reset the tally when a new version is detected.
x/upgrade/keeper.go Modified the SignalVersion method order of checks and added ResetTally method to reset the tally after a version change.
x/upgrade/tally_test.go Added tests for the new ResetTally logic to ensure it clears votes and resets values correctly.

Assessment against linked issues

Objective Addressed Explanation
#2877: Improve computational efficiency of the upgrade signalling mechanism by deleting votes after an upgrade and tallying periodically. The addition of the ResetTally method addresses the objective of deleting votes after an upgrade to improve computational efficiency. The change summary does not mention tallying periodically, but the reset mechanism could be part of such an optimization.
#2877: Ensure that the validator exists before setting its version in the SignalVersion method. The change in the order of validation checks in the SignalVersion method ensures that the existence of a validator is confirmed before setting its version, which aligns with the objective.

Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

@celestia-bot celestia-bot requested a review from a team December 1, 2023 09:49
@cmwaters cmwaters self-assigned this Dec 4, 2023
@cmwaters cmwaters merged commit f3148a8 into main Dec 4, 2023
30 checks passed
@cmwaters cmwaters deleted the cal/clean-up-votes branch December 4, 2023 10:50
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.

Improve computational efficiency of the upgrade signalling mechanism
4 participants