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

Do not assert the finalized_view while restoring #1871

Merged
merged 1 commit into from
Nov 19, 2019

Conversation

majecty
Copy link
Contributor

@majecty majecty commented Nov 18, 2019

In the Tendermint restoring process, if the step variable is backed up by the Commit value, CodeChain sets the step to the Precommit step and handles the votes. The purpose of this behavior is to call functions that are called when the node enters the Commit state.

Changing the "step" in the restoring process is fragile. It is easy to miss setting some variables. The finalized_view_of_current_block variable should be changed when the step is changed. Until now, it was forgotten due to human error.

This commit fixes the problem by ignoring the assertion check in the restore process. Although it is not a perfect solution, it is consistent. There is some code already that does different things in the restore process, depending on whether the code is called or not.

In the Tendermint restoring process, if the backup state is the Commit
step, CodeChain set the step to the Precommit step and handles the
votes. The purpose of the behavior is that calling functions that are
called when enters the Commit state.

Changing the "step" in the restoring process is fragile. It is easy to
miss to set some variables. The `finalized_view_of_current_block`
variable should be changed when the step is changed. It was lost
before.

This commit fixes the problem by ignoring the assertion check in the
restore process. Although it is not a perfect solution, it is
consistent. There is some code already do differently in the restore
process.
@majecty majecty changed the title Do not assert the finalized_view while restoring. Do not assert the finalized_view while restoring Nov 18, 2019
@foriequal0
Copy link
Contributor

I'll merge this manually.

@foriequal0 foriequal0 merged commit ce85bf6 into CodeChain-io:master Nov 19, 2019
@foriequal0 foriequal0 mentioned this pull request Nov 19, 2019
@majecty majecty deleted the f/tendermint-restore-again branch August 4, 2020 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants