-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pd: use
commit_in_place
to write app safeguard (#4954)
**Describe your changes** This PR: - fixes a bug in the app version safeguard logic that would cause discrepancies between JMT state versions and block height - refactors some of the inner logic to avoid writing any state unless it is necessary (i.e, no safeguard was found) **Testing this:** To observe the state discrepancy and test remediation: 1. Checkout the commit that only contains the extra tracing statement: `git checkout a8c51f0` 2. Create a local devnet 3. Restart the devnet N times 4. Observe that the state version and block height have offset=N To test that this fixes it: 1. Run this patch 2. Restart the node 3. Observe that the state version stays stable. ## Checklist before requesting a review - [x] I have added guiding text to explain how a reviewer should test these changes. - [x] If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason: > Not consensus breaking.
- Loading branch information
Showing
4 changed files
with
39 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters