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(cometbft) Prevent panic on non-nil proposal without vote extensions #3270

Merged
merged 3 commits into from
Aug 19, 2024

Conversation

chillyvee
Copy link
Contributor

@chillyvee chillyvee commented Aug 12, 2024

Description

We saw that gaiad has adoped cometbft v0.38 "HEAD" but we are aware of a panic bug affecting validator nodes.

We first experienced daemon panics on seda chain due to cometbft v0.38.6 calling panic when a non-nil proposal vote has vote extensions disabled.

The panic is a mistake and cometbft v0.38.11 includes our fix.

This panic is likely to affect gaiad regardless of vote extensions being enabled or not since the bug is:

extSignature = len([]byte{}) > 0 = false
precommit = true
isNil = false

if extSignature == (!precommit || isNil) => if faise == (!true || false) => if false == (false || false) => if false == false {
 panic()
}

Link to cometbft PR and discussion:
cometbft/cometbft#3565

This fix can reduce gaiad panics on upcoming mainnet v19


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • Included the correct type prefix in the PR title
  • Added ! to the type prefix if API, client, or state breaking change (i.e., requires minor or major version bump)
  • Targeted the correct branch (see PR Targeting)
  • Provided a link to the relevant issue or specification
  • Followed the guidelines for building SDK modules
  • Included the necessary unit and integration tests
  • Added a changelog entry in .changelog (for details, see contributing guidelines)
  • Included comments for documenting Go code
  • Updated the relevant documentation or specification
  • Reviewed "Files changed" and left comments if necessary
  • Confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage

Copy link
Contributor

@mpoke mpoke left a comment

Choose a reason for hiding this comment

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

@chillyvee Thanks for opening the PR. See my comments below. Also, is this change state-breaking? If so, please add the changelog entry also to the .changelog/unreleased/state-breaking folder.

.changelog/unreleased/bug-fixes/3270-no-panic-voteext.md Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename the file to 3270-bump-cometbft and move it to .changelog/unreleased/dependencies/.

@chillyvee
Copy link
Contributor Author

Also, is this change state-breaking?

From what we know, this is not state breaking. We mixed this fix into seda without updating other nodes and remain in consensus without panics. The bug fix only removes an accidental panic preventing normal program flow.

Updated changelog as you suggest

mpoke
mpoke previously approved these changes Aug 14, 2024
Copy link
Contributor

@mpoke mpoke left a comment

Choose a reason for hiding this comment

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

@chillyvee could you please rebase on main? I added the v19.x backport label so it will be automatically backported to release/v19.x

@mpoke mpoke changed the base branch from release/v19.x to main August 14, 2024 19:41
@mpoke mpoke changed the base branch from main to release/v19.x August 14, 2024 19:41
@mpoke mpoke self-requested a review August 14, 2024 19:41
@mpoke mpoke dismissed their stale review August 14, 2024 19:44

The PR needs to be rebased on main

@chillyvee chillyvee changed the base branch from release/v19.x to main August 15, 2024 12:47
@chillyvee
Copy link
Contributor Author

@chillyvee could you please rebase on main? I added the v19.x backport label so it will be automatically backported to release/v19.x

PR rebased on main.

@sainoe
Copy link
Contributor

sainoe commented Aug 19, 2024

LGTM. Thanks @chillyvee!

@sainoe sainoe self-requested a review August 19, 2024 13:48
@mpoke mpoke merged commit c5ff8d2 into cosmos:main Aug 19, 2024
14 checks passed
mergify bot pushed a commit that referenced this pull request Aug 19, 2024
…ns (#3270)

* fix(cometbft) Prevent panic on non-nil proposal without vote extensions

* Update changelog files for PR 3270 feedback

Co-authored-by: Marius Poke <[email protected]>

---------

Co-authored-by: Marius Poke <[email protected]>
(cherry picked from commit c5ff8d2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants