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: cherry pick rollback fix #20

Merged
merged 3 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 8 additions & 17 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,7 @@ defaults:
assignees:
- "{{ author }}"

queue_rules:
- name: default
conditions:
- "#approved-reviews-by>=1"

pull_request_rules:
- name: Automerge to main
conditions:
- "#approved-reviews-by>=1"
- base=osmo/v0.37.4
- label=S:automerge
actions:
queue:
method: squash
name: default
commit_message_template: |
{{ title }} (#{{ number }})
{{ body }}
- name: backport patches to v23 branch
conditions:
- base=osmo/v0.37.4
Expand All @@ -30,3 +13,11 @@ pull_request_rules:
backport:
branches:
- osmo-v23/v0.37.4
- name: backport patches to v24 branch
conditions:
- base=osmo/v0.37.4
- label=S:backport/v24
actions:
backport:
branches:
- osmo-v24/v0.37.4
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:
push:
branches:
- v0.37.x
- osmo/v0.37.4

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-generated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: Check generated code
on:
pull_request:
branches:
- v0.37.x
- osmo/v0.37.4

permissions:
contents: read
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs-toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
push:
branches:
- v0.37.x
- osmo/v0.37.4

jobs:
check:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:
push:
branches:
- v0.37.x
- osmo/v0.37.4

jobs:
e2e-test:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/govulncheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
pull_request:
push:
branches:
- v0.37.x
- osmo/v0.37.4

jobs:
govulncheck:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
pull_request:
push:
branches:
- v0.37.x
- osmo/v0.37.4

jobs:
golangci:
Expand All @@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.21'
go-version: "1.21"
- uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
paths:
- "**.go"
branches:
- v0.37.x
- osmo/v0.37.4

jobs:
tests:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Unreleased

## v0.37.4-v24-osmo-2

* [#20](https://github.com/osmosis-labs/cometbft/pull/20) Fix the rollback command

## v0.37.4-v24-osmo-1

* [#5](https://github.com/osmosis-labs/cometbft/pull/5) Batch verification
* [#11](https://github.com/osmosis-labs/cometbft/pull/11) Skip verification of commit sigs
* [#13](https://github.com/osmosis-labs/cometbft/pull/13) Avoid double-saving ABCI responses
Expand Down
5 changes: 3 additions & 2 deletions state/rollback.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ func Rollback(bs BlockStore, ss Store, removeBlock bool) (int64, []byte, error)
return -1, nil, err
}

nextHeight := rollbackHeight + 1
valChangeHeight := invalidState.LastHeightValidatorsChanged
// this can only happen if the validator set changed since the last block
if valChangeHeight > rollbackHeight {
valChangeHeight = rollbackHeight + 1
if valChangeHeight > nextHeight+1 {
valChangeHeight = nextHeight + 1
}

paramsChangeHeight := invalidState.LastHeightConsensusParamsChanged
Expand Down
2 changes: 1 addition & 1 deletion state/rollback_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ func setupStateStore(t *testing.T, height int64) state.Store {
LastValidators: valSet,
Validators: valSet.CopyIncrementProposerPriority(1),
NextValidators: valSet.CopyIncrementProposerPriority(2),
LastHeightValidatorsChanged: height + 1,
LastHeightValidatorsChanged: height + 1 + 1,
ConsensusParams: *params,
LastHeightConsensusParamsChanged: height + 1,
}
Expand Down
Loading