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: always reset the state for Prepare and Process Proposal #15487

Merged
merged 11 commits into from
Mar 21, 2023

Conversation

facundomedica
Copy link
Member

Description

Closes: #XXXX


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 or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • 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
  • manually tested (if applicable)

Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

This was always the correct approach and ironically, this is simpler and cleaner 😆

Let's be sure to get a test for this and a changelog entry. We need to get this into v0.47.1 ASAP

Comment on lines +329 to +333
// CometBFT must never call ProcessProposal with a height of 0.
// Ref: https://github.com/cometbft/cometbft/blob/059798a4f5b0c9f52aa8655fa619054a0154088c/spec/core/state.md?plain=1#L37-L38
if req.Height < 1 {
panic("ProcessProposal called with invalid height")
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Adding this check to be consistent with what we are doing on PrepareProposal

@facundomedica facundomedica marked this pull request as ready for review March 20, 2023 19:16
@facundomedica facundomedica requested a review from a team as a code owner March 20, 2023 19:16
@facundomedica facundomedica added C:ABCI backport/v0.47.x PR scheduled for inclusion in the v0.47's next stable release labels Mar 20, 2023
@tac0turtle tac0turtle enabled auto-merge (squash) March 21, 2023 11:24
CHANGELOG.md Outdated Show resolved Hide resolved
@tac0turtle tac0turtle merged commit 3a7a264 into main Mar 21, 2023
@tac0turtle tac0turtle deleted the facu/fix-state-prepprocprop branch March 21, 2023 19:42
mergify bot pushed a commit that referenced this pull request Mar 21, 2023
Co-authored-by: Marko <marbar3778@yahoo.com>
(cherry picked from commit 3a7a264)

# Conflicts:
#	CHANGELOG.md
#	baseapp/abci.go
facundomedica added a commit that referenced this pull request Mar 22, 2023
…#15487) (#15503)

Co-authored-by: Facundo Medica <14063057+facundomedica@users.noreply.github.com>
Co-authored-by: Facundo Medica <facundomedica@gmail.com>
Co-authored-by: Marko <marbar3778@yahoo.com>
BrandonWeng added a commit to sei-protocol/sei-cosmos that referenced this pull request Jun 14, 2023
## Describe your changes and provide context
Similar changes to here:
cosmos/cosmos-sdk#15487

Our fork of cosmos-sdk has a custom integration to get ABCI++ working so
I'd like @codchen to take a second look
## Testing performed to validate your change
Unit tests
BrandonWeng added a commit to sei-protocol/sei-cosmos that referenced this pull request Jun 15, 2023
## Describe your changes and provide context
Similar changes to here:
cosmos/cosmos-sdk#15487

Our fork of cosmos-sdk has a custom integration to get ABCI++ working so
I'd like @codchen to take a second look
## Testing performed to validate your change
Unit tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/v0.47.x PR scheduled for inclusion in the v0.47's next stable release C:ABCI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants