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

test: update block proposer in testing #7430

Merged
merged 3 commits into from
Oct 14, 2024

Conversation

sainoe
Copy link
Contributor

@sainoe sainoe commented Oct 9, 2024

Description

Currently, test chains carry the same block proposer for every block. This can lead to a situation where the block proposer isn't part of the validator set, such as after being jailed. This can cause the validation of validator sets to fail in CometBFT v0.38.12, see ValidateBasic.

This PR addresses the issue by incrementing the validator proposer priority in test chains, ensuring that the block proposer is updated in line with changes to the validator set.

closes: #XXXX


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against the correct branch (see CONTRIBUTING.md).
  • Linked to GitHub issue with discussion and accepted design, OR link to spec that describes this work.
  • Code follows the module structure standards and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/).
  • Added relevant godoc comments.
  • Provide a conventional commit message to follow the repository standards.
  • Include a descriptive changelog entry when appropriate. This may be left to the discretion of the PR reviewers. (e.g. chores should be omitted from changelog)
  • Re-reviewed Files changed in the GitHub PR explorer.
  • Review SonarCloud Report in the comment section below once CI passes.

Copy link
Member

@damiannolan damiannolan left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the PR @sainoe! Really appreciate the test case too, looks great.

Do you think you could target this to the main branch and add a changelog?
Would be happy to handle backporting this to v8.5.x for you!

* increment the proposer priority of validators
* update the proposer address in the current header
@sainoe sainoe requested a review from srdtrk as a code owner October 10, 2024 07:30
@sainoe sainoe changed the base branch from release/v8.5.x to main October 10, 2024 07:30
Copy link
Member

@damiannolan damiannolan left a comment

Choose a reason for hiding this comment

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

Thank you @sainoe! Much appreciated

@sainoe
Copy link
Contributor Author

sainoe commented Oct 10, 2024

Do you think you could target this to the main branch and add a changelog?

Absolutely, I was kind of confused by the versioning, my bad.

Would be happy to handle backporting this to v8.5.x for you

Thanks a lot! This shouldn't be much work.

Copy link
Contributor

@DimitrisJim DimitrisJim left a comment

Choose a reason for hiding this comment

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

looks clean to me, thanks for the clear description!

@damiannolan
Copy link
Member

Trying to diagnose CI not running. Looks mergify related.

@damiannolan
Copy link
Member

Could try sync the branch with cosmos/main @sainoe? Sorry about this!

@sainoe
Copy link
Contributor Author

sainoe commented Oct 14, 2024

@damiannolan Looks like it's good to go now!

Copy link
Contributor

@colin-axner colin-axner left a comment

Choose a reason for hiding this comment

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

Thank you @sainoe!

@colin-axner colin-axner added this pull request to the merge queue Oct 14, 2024
Merged via the queue into cosmos:main with commit 64f33e0 Oct 14, 2024
82 checks passed
mergify bot pushed a commit that referenced this pull request Oct 14, 2024
* Introduce two following changes to the `commitBlock` method in testing:
* increment the proposer priority of validators
* update the proposer address in the current header

* fix linter

(cherry picked from commit 64f33e0)
mergify bot pushed a commit that referenced this pull request Oct 14, 2024
* Introduce two following changes to the `commitBlock` method in testing:
* increment the proposer priority of validators
* update the proposer address in the current header

* fix linter

(cherry picked from commit 64f33e0)

# Conflicts:
#	testing/chain.go
colin-axner pushed a commit that referenced this pull request Oct 14, 2024
* Introduce two following changes to the `commitBlock` method in testing:
* increment the proposer priority of validators
* update the proposer address in the current header

* fix linter

(cherry picked from commit 64f33e0)

Co-authored-by: Simon Noetzlin <[email protected]>
damiannolan pushed a commit that referenced this pull request Oct 14, 2024
* test: update block proposer in testing (#7430)

* Introduce two following changes to the `commitBlock` method in testing:
* increment the proposer priority of validators
* update the proposer address in the current header

* fix linter

(cherry picked from commit 64f33e0)

# Conflicts:
#	testing/chain.go

* why did you fail us here, mergify my boy

---------

Co-authored-by: Simon Noetzlin <[email protected]>
Co-authored-by: DimitrisJim <[email protected]>
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.

4 participants