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: Fix v5 upgrade VE handler #1468

Merged
merged 3 commits into from
May 6, 2024

Conversation

Eric-Warehime
Copy link
Contributor

Changelist

Add protections around nil VE ABCI Params

Test Plan

Send to a single validator first on testnet.

Author/Reviewer Checklist

  • If this PR has changes that result in a different app state given the same prior state and transaction list, manually add the state-breaking label.
  • If the PR has breaking postgres changes to the indexer add the indexer-postgres-breaking label.
  • If this PR isn't state-breaking but has changes that modify behavior in PrepareProposal or ProcessProposal, manually add the label proposal-breaking.
  • If this PR is one of many that implement a specific feature, manually label them all feature:[feature-name].
  • If you wish to for mergify-bot to automatically create a PR to backport your change to a release branch, manually add the label backport/[branch-name].
  • Manually add any of the following labels: refactor, chore, bug.

Copy link
Contributor

@nivasan1 nivasan1 left a comment

Choose a reason for hiding this comment

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

Lgtm

panic(fmt.Sprintf("failed to retrieve existing consensus params in VE upgrade handler: %s", err))
}
if currentParams.Params.Abci.VoteExtensionsEnableHeight != 0 {
if currentParams.Params.Abci != nil && currentParams.Params.Abci.VoteExtensionsEnableHeight != 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like currentParams.Params.Abci is never read and we just initialize it below. Should we just remove this code block?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason I initially put it in there is because if you've already set a VE enable height that's nonzero it's unknown (to me at least) what happens if you update that again.

Happy to remove it since we assume this will be run once ever.

@teddyding teddyding merged commit 5e002ee into dydxprotocol:main May 6, 2024
16 checks passed
@teddyding
Copy link
Contributor

@mergify backport release/protocol/v5.x

@Eric-Warehime Eric-Warehime deleted the eric/fix-ve-handler branch May 6, 2024 18:06
Copy link
Contributor

mergify bot commented May 6, 2024

backport release/protocol/v5.x

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request May 6, 2024
* Add nil protections on upgrade handler

* Fix import name

* Address comment

(cherry picked from commit 5e002ee)
teddyding pushed a commit that referenced this pull request May 6, 2024
* Add nil protections on upgrade handler

* Fix import name

* Address comment

(cherry picked from commit 5e002ee)

Co-authored-by: Eric Warehime <eric.warehime@gmail.com>
jonfung-dydx pushed a commit that referenced this pull request May 6, 2024
* Add nil protections on upgrade handler

* Fix import name

* Address comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

6 participants