Scripts for patching swapped balances #8611
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Two scripts to help patching swapped fee transfer balances in the archive db.
find-swapped-balances.awk
is an AWK script that isolates the replayer log entries with the information needed to patch pairs of swapped balances. You run the script on the replayer log, and you get relevant logs with the block state hash and sequence number, plus the logs showing the balance mismatch. (Funny enough, this script revealed that one pair of swapped balances had identical amounts.)fix-swapped-balances.sh
patches all swapped balances an archive db through the first canonical block on April 7, 2021. We announced v1.1.5 later that day. Anyone who upgraded soon after the release should have few remaining invalid balances, after running this script.Tested by: