This repository was archived by the owner on Jan 27, 2025. It is now read-only.
Fix vm-genesis fn recovery_owners_operator() #1210
Closed
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.
Fixing panic (Move error) caused by "Set validator operator for each validator owner" section of
fn recovery_owners_operatorhttps://github.com/OLSF/libra/blob/e042010ac22caba6cc9fc70c745b17f1bf7d666a/language/tools/vm-genesis/src/lib.rs#L839
In short, this is the fix:
https://github.com/OLSF/libra/pull/1210/files#diff-0d5e9369eb26d02a79b4c768f68da66d258aee03b4f19409b5f7b3dc26d440d6L809-R814
tested and verified by cmd:
$ cargo run -p ol-genesis-tools -- --fork --output-path /opt/genesis_from_snapshot.blob --snapshot-path /opt/state_ver*where
/opt/state_verhaving these files:https://github.com/OLSF/epoch-archive/tree/main/359/state_ver_76353076.a0ff
Details:
The panic
is caused by our code
encode_set_validator_operator_with_nonce_admin_script_functionThis tx is not being used anywhere in original Diem code.
This is how Diem code set the validator operator for each validator owner:
https://github.com/OLSF/libra/blob/e042010ac22caba6cc9fc70c745b17f1bf7d666a/language/tools/vm-genesis/src/lib.rs#L644
and this is the tx being used:
encode_set_validator_operator_script_functionhttps://github.com/OLSF/libra/blob/a116e3e75fd4f455b1ab9f5935b9f188c0baafff/language/tools/vm-genesis/src/lib.rs#L578