-
Notifications
You must be signed in to change notification settings - Fork 684
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(forknet): Fix fork-network tool backward compatibility #12964
fix(forknet): Fix fork-network tool backward compatibility #12964
Conversation
Tested with
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #12964 +/- ##
==========================================
- Coverage 70.25% 70.23% -0.02%
==========================================
Files 855 855
Lines 176300 176341 +41
Branches 176300 176341 +41
==========================================
- Hits 123860 123856 -4
- Misses 47290 47329 +39
- Partials 5150 5156 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@Trisfald may I ask you for review because you reviewed the original change? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks!
I'm fine with this change just tested manually
tools/fork-network/src/cli.rs
Outdated
store: Store, | ||
epoch_manager: &dyn EpochManagerAdapter, | ||
) -> anyhow::Result<(HashMap<ShardUId, StateRoot>, BlockInfo, EpochId, ShardLayout)> { | ||
let epoch_id = EpochId(store.get_ser(DBCol::Misc, b"FORK_TOOL_EPOCH_ID")?.unwrap()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: These three keys (b"FORK_TOOL_EPOCH_ID"
, etc) now appear multiple times, we could use a constant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
#12938 changed the format of the data we write to the
FORK_TOOL
Misc column keys in theinit
command, but didn't keep backward compatibility. But this should have been done because we need to runfork-network
again when starting a forknet so we can run theset-validators
andfinalize
commands. So this PR reads the values the old way if there's nothing in theFORK_TOOL_FLAT_HEAD
key