Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
stdlib v12 gas schedule refactor (#3960)
* add stdlib upgrade init_script test * add stdlib v12 files * add stdlib v12 files * refactor stdlib 12 vm execution * update compiled files * fix GasSchedule diff * update test_package_init_function * update test_package_init_function * comment concurrency level * add dev cmd concurrency_level * reset halley genesis and comment master pr deploy halley * add halley genesis * update BARNARD_HARD_FORK_HEIGHT and BARNARD_HARD_FORK_HASH * update stdlib v12 repo * revert docker_build.yml
- Loading branch information
Showing
214 changed files
with
214 additions
and
192 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Binary file not shown.
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-454 Bytes
vm/stdlib/compiled/12/11-12/stdlib/056_GenesisSignerCapability.mv
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file renamed
BIN
+8.31 KB
...compiled/latest/stdlib/061_GasSchedule.mv → ...mpiled/12/11-12/stdlib/062_GasSchedule.mv
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
Binary file renamed
BIN
+8.31 KB
...mpiled/12/11-12/stdlib/061_GasSchedule.mv → ...lib/compiled/12/stdlib/062_GasSchedule.mv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file renamed
BIN
+8.31 KB
...lib/compiled/12/stdlib/061_GasSchedule.mv → ...compiled/latest/stdlib/062_GasSchedule.mv
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
use anyhow::{format_err, Result}; | ||
use starcoin_vm_types::transaction::Package; | ||
use stdlib::COMPILED_MOVE_CODE_DIR; | ||
|
||
#[test] | ||
fn test_package_init_function() -> Result<()> { | ||
let _path_list = [ | ||
"./compiled/2/1-2/stdlib.blob", | ||
"./compiled/3/2-3/stdlib.blob", | ||
"./compiled/4/3-4/stdlib.blob", | ||
"./compiled/5/4-5/stdlib.blob", | ||
"./compiled/6/5-6/stdlib.blob", | ||
"./compiled/7/6-7/stdlib.blob", | ||
"./compiled/8/7-8/stdlib.blob", | ||
"./compiled/9/8-9/stdlib.blob", | ||
"./compiled/10/9-10/stdlib.blob", | ||
"./compiled/11/10-11/stdlib.blob", | ||
"./compiled/12/11-12/stdlib.blob", | ||
]; | ||
|
||
let init_strs = [ | ||
"0x00000000000000000000000000000001::PackageTxnManager::convert_TwoPhaseUpgrade_to_TwoPhaseUpgradeV2", | ||
"0x00000000000000000000000000000001::StdlibUpgradeScripts::upgrade_from_v2_to_v3", | ||
"", | ||
"", | ||
"0x00000000000000000000000000000001::StdlibUpgradeScripts::upgrade_from_v5_to_v6", | ||
"0x00000000000000000000000000000001::StdlibUpgradeScripts::upgrade_from_v6_to_v7", | ||
"0x00000000000000000000000000000001::StdlibUpgradeScripts::upgrade_from_v7_to_v8", | ||
"", | ||
"", | ||
"", | ||
"0x00000000000000000000000000000001::StdlibUpgradeScripts::upgrade_from_v11_to_v12", | ||
]; | ||
for (i, version) in (2..=12).collect::<Vec<usize>>().into_iter().enumerate() { | ||
let package_file = format!("{}/{}-{}/stdlib.blob", version, version - 1, version); | ||
let package = COMPILED_MOVE_CODE_DIR | ||
.get_file(package_file) | ||
.map(|file| { | ||
bcs_ext::from_bytes::<Package>(file.contents()) | ||
.expect("Decode package should success") | ||
}) | ||
.ok_or_else(|| { | ||
format_err!( | ||
"Can not find upgrade package between version {} and {}", | ||
version - 1, | ||
version | ||
) | ||
})?; | ||
let init_fun = if let Some(init_script) = package.init_script() { | ||
format!("{}::{}", init_script.module(), init_script.function()) | ||
} else { | ||
"".to_owned() | ||
}; | ||
assert_eq!(init_fun, init_strs[i]); | ||
} | ||
Ok(()) | ||
} |
Oops, something went wrong.