Skip to content
This repository was archived by the owner on Jan 27, 2025. It is now read-only.

Conversation

@simsekgokhan
Copy link
Contributor

@simsekgokhan simsekgokhan commented Nov 9, 2022

Fixing panic (Move error) caused by "Set validator operator for each validator owner" section of fn recovery_owners_operator

https://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_ver having these files:
https://github.com/OLSF/epoch-archive/tree/main/359/state_ver_76353076.a0ff

Details:

The panic

VMError { 
    major_status: NUMBER_OF_SIGNER_ARGUMENTS_MISMATCH, 
    sub_status: None, message: Some("Expected 2 signer args got 1"), 
    location: Undefined, indices: [], offsets: [] 
}, 

is caused by our code
encode_set_validator_operator_with_nonce_admin_script_function
This 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_function
https://github.com/OLSF/libra/blob/a116e3e75fd4f455b1ab9f5935b9f188c0baafff/language/tools/vm-genesis/src/lib.rs#L578

@simsekgokhan simsekgokhan changed the title Fix "Set the validator operator for each validator owner" in fn recov… Fix vm-genesis fn recovery_owners_operator() Nov 9, 2022
@simsekgokhan
Copy link
Contributor Author

simsekgokhan commented Nov 11, 2022

Correction: Reproduced and fix verified both on macOS and Ubuntu.

@0o-de-lally
Copy link
Collaborator

@simsekgokhan Is this still an issue with the current V6 head? Just please confirm it's needed since we merged the #1212

@simsekgokhan
Copy link
Contributor Author

simsekgokhan commented Jan 31, 2023

@simsekgokhan Is this still an issue with the current V6 head? Just please confirm it's needed since we merged the #1212

Just tested both on macOS and Ubuntu, the issue is not reproducible anymore, closing. thx.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants