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

[Bug]: halt-height handling behavior changed on v0.50 #21226

Closed
1 task done
MSalopek opened this issue Aug 8, 2024 · 0 comments · Fixed by #21256
Closed
1 task done

[Bug]: halt-height handling behavior changed on v0.50 #21226

MSalopek opened this issue Aug 8, 2024 · 0 comments · Fixed by #21256
Assignees
Labels

Comments

@MSalopek
Copy link
Contributor

MSalopek commented Aug 8, 2024

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

In previous versions (< v0.50.x) the nodes would stop at halt-height, whereas in v0.50 the chain produces one more block after the specified halt height causing confusion among developers and operators.

There seems to be off-by-one error in cosmos-sdk v0.50 resulting in unexpected behavior.
This PR refactored the halt-height handling for some of the cosmos-sdk releases.

It can be seen that the following lines use >= when comparing halt-height and halt-time:

The latest changes use > which leads to incorrect and unexpected behavior:

This behavior can lead to weird network forks in case of a co-ordinated upgrade that does not go through governance (e.g. when fixing state issues or handling security concerns).

Cosmos SDK Version

0.50.x

How to reproduce?

Start a local node (using simd) and specify a halt-height. It can be observed that the node progresses and halts one block after the specified halt-hight.

e.g.

#  cosmos-sdk v0.47
halt-height = 100 # chain does not produce block 100 and halts

# cosmos-sdk v0.50
halt-height = 100 # chain produces block 100 and halts

cc @stana-miric @dasanchez

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🥳 Done
Development

Successfully merging a pull request may close this issue.

2 participants