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(ve-validation): account for BlockID flag in vote-extensions #17394

Merged
merged 5 commits into from
Aug 15, 2023

Conversation

nivasan1
Copy link
Contributor

Description

Closes: #17393

In This PR

  • I check that the only votes validated in ValidateVoteExtensions are votes that have BlockIDCommit, in other words, vote-extensions that accompanied pre-commits for the previous block. In this case, the block must have come w/ > super-majority of such votes
  • I also add an extensive test-suite of the ValidateVoteExtensions method, covering the cases leading to the above issue.

Files Changed

  • baseapp/abci_utils.go (changed)
  • baseapp/abci_utils_test.go (added)

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...

  • [ x] included the correct type prefix in the PR title
  • [NA ] added ! to the type prefix if API or client breaking change
  • [ x] targeted the correct branch (see PR Targeting)
  • [x ] provided a link to the relevant issue or specification
  • [ x] followed the guidelines for building modules
  • [x ] included the necessary unit and integration tests
  • [x ] added a changelog entry to CHANGELOG.md
  • [x ] included comments for documenting Go code
  • [x ] updated the relevant documentation or specification
  • [ x] reviewed "Files changed" and left comments if necessary
  • [x ] run make lint and make test
  • [ x] 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)

@nivasan1 nivasan1 requested a review from a team as a code owner August 15, 2023 16:18
@julienrbrt julienrbrt added the backport/v0.50.x PR scheduled for inclusion in the v0.50's next stable release label Aug 15, 2023
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.

Thanks for the tests too!

baseapp/abci_utils.go Outdated Show resolved Hide resolved
@julienrbrt
Copy link
Member

It seems you need to run make lint-fix to get CI happy.

auto-merge was automatically disabled August 15, 2023 17:54

Head branch was pushed to by a user without write access

@nivasan1
Copy link
Contributor Author

Wondering specifically what the issue is w/ the linter? I'm attempting to run locally, and make lint-fix / make lint fail in execution locally (+ attempt to change files that were not involved in PR), when setting the LINT_DIFF env, the affected files in PR are unchanged?

@alexanderbez
Copy link
Contributor

Mhhh weird.

abci_utils_test.go:286: File is not `gci`-ed with --skip-generated -s standard -s default -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) --custom-order (gci)

This should be addressed with a simple make lint-fix and pushing the changes.

auto-merge was automatically disabled August 15, 2023 18:46

Head branch was pushed to by a user without write access

@nivasan1
Copy link
Contributor Author

pushing

Mhhh weird.

abci_utils_test.go:286: File is not `gci`-ed with --skip-generated -s standard -s default -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) --custom-order (gci)

This should be addressed with a simple make lint-fix and pushing the changes.

Perhaps a misconfig locally, I was able to find manually 🚢

@nivasan1
Copy link
Contributor Author

@alexanderbez looks like linting + test-cases passed, but final stage in pushing to sonarcloud failed for repo-analysis? Is there any way I can inspect the logs from the failure?

@julienrbrt
Copy link
Member

@alexanderbez looks like linting + test-cases passed, but final stage in pushing to sonarcloud failed for repo-analysis? Is there any way I can inspect the logs from the failure?

Sonarcloud does not work for external contributors, so it is fine 👍🏾

@nivasan1
Copy link
Contributor Author

@alexanderbez looks like linting + test-cases passed, but final stage in pushing to sonarcloud failed for repo-analysis? Is there any way I can inspect the logs from the failure?

Sonarcloud does not work for external contributors, so it is fine 👍🏾

Sg, anything left before merge?

@alexanderbez alexanderbez added this pull request to the merge queue Aug 15, 2023
Merged via the queue into cosmos:main with commit 104ebe6 Aug 15, 2023
44 of 45 checks passed
mergify bot pushed a commit that referenced this pull request Aug 15, 2023
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
(cherry picked from commit 104ebe6)
alexanderbez pushed a commit that referenced this pull request Aug 15, 2023
…port #17394) (#17396)

Co-authored-by: Nikhil Vasan <97126437+nivasan1@users.noreply.github.com>
@faddat faddat mentioned this pull request Nov 8, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/v0.50.x PR scheduled for inclusion in the v0.50's next stable release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: BlockID flag must be considered in Vote Extension Validation
3 participants