Skip to content

Commit

Permalink
[move-vm] Make bytecode version v7 the default (#14876)
Browse files Browse the repository at this point in the history
We could not do that before because mainnet did not support v7 yet, but that has changed now.
  • Loading branch information
wrwg authored Oct 6, 2024
1 parent cc50aaa commit 4bed99d
Show file tree
Hide file tree
Showing 34 changed files with 131 additions and 134 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"bytecode": "0xa11ceb0b060000000c010002020208030a2805322307557b08d0012006f0010a10fa019a010a94030d0ca1037e0d9f04060fa504040002000306000004070000050001000006020300000704050000080406000009070800000a040300000b090500000c0906000205070301080002050301080101060800010301050206080006080101010106080100076163636f756e74066f626a6563740467756964044755494402494406637265617465096372656174655f69640c6372656174696f6e5f6e756d0f63726561746f725f616464726573730565715f69640269640f69645f6372656174696f6e5f6e756d1269645f63726561746f725f616464726573730461646472000000000000000000000000000000000000000000000000000000000000000103080000000000000000126170746f733a3a6d657461646174615f763185010100000000000000001d45475549445f47454e455241544f525f4e4f545f5055424c49534845445b475549442067656e657261746f72206d757374206265207075626c6973686564206168656164206f66206669727374207573616765206f6620606372656174655f776974685f6361706162696c697479602066756e6374696f6e2e00000002010a080101020207030d0500030000050d0a01140c020a02060100000000000000160b01150b020b001201120002010100000a040b010b00120102020100000a050b00100010011402030100000a050b00100010021402040100000a050b0010000b012102050100000a040b0010001402060100000a040b0010011402070100000a040b00100214020000010001010000000100",
"bytecode": "0xa11ceb0b0700000a0c010002020208030a30053a23075d7b08d8012006f8010a1082029a010a9c030d0ca9037e0da704060fad040400020003060000040700000500010001000602030001000704050001000804060001000907080001000a04030001000b09050001000c090600010205070301080002050301080101060800010301050206080006080101010106080100076163636f756e74066f626a6563740467756964044755494402494406637265617465096372656174655f69640c6372656174696f6e5f6e756d0f63726561746f725f616464726573730565715f69640269640f69645f6372656174696f6e5f6e756d1269645f63726561746f725f616464726573730461646472000000000000000000000000000000000000000000000000000000000000000103080000000000000000126170746f733a3a6d657461646174615f763185010100000000000000001d45475549445f47454e455241544f525f4e4f545f5055424c49534845445b475549442067656e657261746f72206d757374206265207075626c6973686564206168656164206f66206669727374207573616765206f6620606372656174655f776974685f6361706162696c697479602066756e6374696f6e2e00000002010a080101020207030d0500030000050d0a01140c020a02060100000000000000160b01150b020b001201120002010100000a040b010b00120102020100000a050b00100010011402030100000a050b00100010021402040100000a050b0010000b012102050100000a040b0010001402060100000a040b0010011402070100000a040b00100214020000010001010000000100",
"abi": {
"address": "0x1",
"name": "guid",
Expand Down
22 changes: 11 additions & 11 deletions testsuite/single_node_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ class RunGroupConfig:
# transaction_type module_working_set_size executor_type block_size expected_tps tps
# )
CALIBRATION = """
no-op 1 VM 0.822 1.047 38275.3
no-op 1000 VM 0.775 1.033 22763.8
apt-fa-transfer 1 VM 0.770 1.059 27699.5
account-generation 1 VM 0.735 1.026 22763.8
no-op 1 VM 0.822 1.047 37975.3
no-op 1000 VM 0.775 1.033 22963.8
apt-fa-transfer 1 VM 0.770 1.059 27299.5
account-generation 1 VM 0.735 1.026 22663.8
account-resource32-b 1 VM 0.718 1.049 33440.0
modify-global-resource 1 VM 0.868 1.019 2819.9
modify-global-resource 10 VM 0.877 1.018 17562.1
Expand All @@ -164,7 +164,7 @@ class RunGroupConfig:
vector-picture30k 20 VM 0.835 1.020 1140.7
smart-table-picture30-k-with200-change 1 VM 0.955 1.051 21.8
smart-table-picture30-k-with200-change 20 VM 0.926 1.065 185.9
modify-global-resource-agg-v2 1 VM 0.792 1.060 33440.0
modify-global-resource-agg-v2 1 VM 0.792 1.060 32740.0
modify-global-flag-agg-v2 1 VM 0.921 1.014 5199.3
modify-global-bounded-agg-v2 1 VM 0.906 1.103 8866.4
modify-global-milestone-agg-v2 1 VM 0.804 1.033 27699.5
Expand All @@ -177,11 +177,11 @@ class RunGroupConfig:
token-v1nft-mint-and-transfer-sequential 1 VM 0.923 1.025 798.6
token-v1nft-mint-and-transfer-sequential 20 VM 0.873 1.024 7732.8
coin-init-and-mint 1 VM 0.779 1.055 29251.9
coin-init-and-mint 20 VM 0.827 1.077 24885.0
fungible-asset-mint 1 VM 0.773 1.023 23174.5
coin-init-and-mint 20 VM 0.827 1.077 24185.0
fungible-asset-mint 1 VM 0.773 1.023 23274.5
fungible-asset-mint 20 VM 0.803 1.047 21567.9
no-op5-signers 1 VM 0.854 1.078 37561.3
token-v2-ambassador-mint 1 VM 0.848 1.022 16553.6
token-v2-ambassador-mint 1 VM 0.848 1.022 15753.6
token-v2-ambassador-mint 20 VM 0.811 1.044 16228.8
liquidity-pool-swap 1 VM 0.922 1.027 975.7
liquidity-pool-swap 20 VM 0.881 1.014 8359.6
Expand Down Expand Up @@ -238,7 +238,7 @@ class RunGroupConfig:
RunGroupConfig(expected_tps=8000, key=RunGroupKey("resource-groups-sender-write-tag1-kb", module_working_set_size=20), included_in=Flow.RESOURCE_GROUPS, waived=True),
RunGroupConfig(key=RunGroupKey("resource-groups-sender-multi-change1-kb"), included_in=LAND_BLOCKING_AND_C | Flow.RESOURCE_GROUPS),
RunGroupConfig(expected_tps=8000, key=RunGroupKey("resource-groups-sender-multi-change1-kb", module_working_set_size=20), included_in=Flow.RESOURCE_GROUPS, waived=True),

RunGroupConfig(key=RunGroupKey("token-v1ft-mint-and-transfer"), included_in=Flow.CONTINUOUS),
RunGroupConfig(key=RunGroupKey("token-v1ft-mint-and-transfer", module_working_set_size=20), included_in=Flow.CONTINUOUS),
RunGroupConfig(key=RunGroupKey("token-v1nft-mint-and-transfer-sequential"), included_in=Flow.CONTINUOUS),
Expand All @@ -256,7 +256,7 @@ class RunGroupConfig:
# RunGroupConfig(expected_tps=1000, key=RunGroupKey("token-v1nft-mint-and-transfer-parallel"), included_in=Flow(0)),

RunGroupConfig(key=RunGroupKey("no-op5-signers"), included_in=Flow.CONTINUOUS),

RunGroupConfig(key=RunGroupKey("token-v2-ambassador-mint"), included_in=LAND_BLOCKING_AND_C | Flow.REPRESENTATIVE),
RunGroupConfig(key=RunGroupKey("token-v2-ambassador-mint", module_working_set_size=20), included_in=Flow.CONTINUOUS),

Expand All @@ -267,7 +267,7 @@ class RunGroupConfig:
RunGroupConfig(key=RunGroupKey("liquidity-pool-swap-stable", module_working_set_size=20), included_in=Flow.CONTINUOUS),

RunGroupConfig(key=RunGroupKey("deserialize-u256"), included_in=Flow.CONTINUOUS),

# fee payer sequentializes transactions today. in these tests module publisher is the fee payer, so larger number of modules tests throughput with multiple fee payers
RunGroupConfig(key=RunGroupKey("no-op-fee-payer"), included_in=LAND_BLOCKING_AND_C),
RunGroupConfig(key=RunGroupKey("no-op-fee-payer", module_working_set_size=50), included_in=Flow.CONTINUOUS),
Expand Down
4 changes: 2 additions & 2 deletions third_party/move/move-binary-format/src/file_format_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,9 +518,9 @@ pub const VERSION_8: u32 = 8;
pub const VERSION_MAX: u32 = VERSION_7;

/// Mark which version is the default version. This is the version used by default by tools like
/// the compiler. Notice that this version might be different than the one supported on nodes.
/// the compiler. Notice that this version might be different from the one supported on nodes.
/// The node's max version is determined by the on-chain config for that node.
pub const VERSION_DEFAULT: u32 = VERSION_6;
pub const VERSION_DEFAULT: u32 = VERSION_7;

/// Mark which version is the default version if compiling Move 2.
pub const VERSION_DEFAULT_LANG_V2: u32 = VERSION_7;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ comparison between v1 and v2 failed:
= processed 1 task
=
= task 0 'print-bytecode'. lines 2-14:
- // Move bytecode v6
+ // Move bytecode v7
= // Move bytecode v7
= module c0ffee.m {
=
=
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
comparison between v1 and v2 failed:
= processed 1 task
=
= task 0 'print-bytecode'. lines 2-14:
- // Move bytecode v6
+ // Move bytecode v7
= module c0ffee.m {
=
=
= id_mut<Ty0>(Arg0: &mut Ty0): &mut Ty0 /* def_idx: 0 */ {
= B0:
= 0: MoveLoc[0](Arg0: &mut Ty0)
= 1: Ret
= }
= t0() /* def_idx: 1 */ {
= L0: loc0: u64
= L1: loc1: &mut u64
= B0:
= 0: LdU64(0)
= 1: StLoc[0](loc0: u64)
= 2: MutBorrowLoc[0](loc0: u64)
= 3: StLoc[1](loc1: &mut u64)
= 4: CopyLoc[1](loc1: &mut u64)
= 5: Call id_mut<u64>(&mut u64): &mut u64
= 6: ReadRef
= 7: Pop
= 8: MoveLoc[1](loc1: &mut u64)
= 9: ReadRef
= 10: Pop
= 11: Ret
= }
= }
=
processed 1 task

task 0 'print-bytecode'. lines 2-14:
// Move bytecode v7
module c0ffee.m {


id_mut<Ty0>(Arg0: &mut Ty0): &mut Ty0 /* def_idx: 0 */ {
B0:
0: MoveLoc[0](Arg0: &mut Ty0)
1: Ret
}
t0() /* def_idx: 1 */ {
L0: loc0: u64
L1: loc1: &mut u64
B0:
0: LdU64(0)
1: StLoc[0](loc0: u64)
2: MutBorrowLoc[0](loc0: u64)
3: StLoc[1](loc1: &mut u64)
4: CopyLoc[1](loc1: &mut u64)
5: Call id_mut<u64>(&mut u64): &mut u64
6: ReadRef
7: Pop
8: MoveLoc[1](loc1: &mut u64)
9: ReadRef
10: Pop
11: Ret
}
}

==> Compiler v2 delivered same results!
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
comparison between v1 and v2 failed:
= processed 1 task
=
= task 0 'print-bytecode'. lines 2-14:
- // Move bytecode v6
+ // Move bytecode v7
= module c0ffee.m {
=
=
= id_mut<Ty0>(Arg0: &mut Ty0): &mut Ty0 /* def_idx: 0 */ {
= B0:
= 0: MoveLoc[0](Arg0: &mut Ty0)
= 1: Ret
= }
= t0() /* def_idx: 1 */ {
= L0: loc0: u64
= L1: loc1: &mut u64
= B0:
= 0: LdU64(0)
= 1: StLoc[0](loc0: u64)
= 2: MutBorrowLoc[0](loc0: u64)
= 3: StLoc[1](loc1: &mut u64)
= 4: CopyLoc[1](loc1: &mut u64)
= 5: Call id_mut<u64>(&mut u64): &mut u64
= 6: ReadRef
= 7: Pop
= 8: MoveLoc[1](loc1: &mut u64)
= 9: ReadRef
= 10: Pop
= 11: Ret
= }
= }
=
processed 1 task

task 0 'print-bytecode'. lines 2-14:
// Move bytecode v7
module c0ffee.m {


id_mut<Ty0>(Arg0: &mut Ty0): &mut Ty0 /* def_idx: 0 */ {
B0:
0: MoveLoc[0](Arg0: &mut Ty0)
1: Ret
}
t0() /* def_idx: 1 */ {
L0: loc0: u64
L1: loc1: &mut u64
B0:
0: LdU64(0)
1: StLoc[0](loc0: u64)
2: MutBorrowLoc[0](loc0: u64)
3: StLoc[1](loc1: &mut u64)
4: CopyLoc[1](loc1: &mut u64)
5: Call id_mut<u64>(&mut u64): &mut u64
6: ReadRef
7: Pop
8: MoveLoc[1](loc1: &mut u64)
9: ReadRef
10: Pop
11: Ret
}
}

==> Compiler v2 delivered same results!
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ task 0 'publish'. lines 1-11:

>>> V1 Compiler {
== BEGIN Bytecode ==
// Move bytecode v6
// Move bytecode v7
module cafe.vectors {


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ return values: 11

>>> V1 Compiler {
== BEGIN Bytecode ==
// Move bytecode v6
// Move bytecode v7
module 8675.M {
struct S has copy, drop {
f: u64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ task 0 'publish'. lines 1-8:

>>> V1 Compiler {
== BEGIN Bytecode ==
// Move bytecode v6
// Move bytecode v7
module cafe.Ristretto {


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
processed 2 tasks

task 0 'print-bytecode'. lines 1-31:
// Move bytecode v6
// Move bytecode v7
module 3d10.Example {
struct Coin {
value: u64
Expand Down Expand Up @@ -51,7 +51,7 @@ B0:
}

task 1 'print-bytecode'. lines 33-46:
// Move bytecode v6
// Move bytecode v7
module 4d10.M {


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
processed 2 tasks

task 0 'print-bytecode'. lines 1-7:
// Move bytecode v6
// Move bytecode v7
script {


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
processed 1 task

task 0 'print-bytecode'. lines 1-13:
// Move bytecode v6
// Move bytecode v7
module e.Expressions {


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
processed 9 tasks

task 0 'print-bytecode'. lines 1-11:
// Move bytecode v6
// Move bytecode v7
script {


Expand All @@ -20,7 +20,7 @@ B0:
}

task 1 'print-bytecode'. lines 13-24:
// Move bytecode v6
// Move bytecode v7
script {


Expand All @@ -40,7 +40,7 @@ B0:
}

task 2 'print-bytecode'. lines 26-59:
// Move bytecode v6
// Move bytecode v7
module 1d4.M {
struct T {
u: u64
Expand Down Expand Up @@ -79,7 +79,7 @@ B0:
}

task 3 'print-bytecode'. lines 61-80:
// Move bytecode v6
// Move bytecode v7
module 2d4.M {
struct T<Ty0> {
u: Ty0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
processed 3 tasks

task 0 'print-bytecode'. lines 1-10:
// Move bytecode v6
// Move bytecode v7
script {


Expand All @@ -21,7 +21,7 @@ B0:
}

task 1 'print-bytecode'. lines 12-23:
// Move bytecode v6
// Move bytecode v7
module 3d.Foobar {
struct FooCoin {
value: u64
Expand All @@ -40,7 +40,7 @@ B0:
}

task 2 'print-bytecode'. lines 25-36:
// Move bytecode v6
// Move bytecode v7
module 4d.Foobar {
struct FooCoin<Ty0> {
value: u64
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
processed 4 tasks

task 0 'print-bytecode'. lines 1-14:
// Move bytecode v6
// Move bytecode v7
module 1d6.M {
use 0000000000000000000000000000000000000000000000000000000000000001::signer;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
processed 4 tasks

task 0 'print-bytecode'. lines 1-14:
// Move bytecode v6
// Move bytecode v7
module 1d6.M {
use 0000000000000000000000000000000000000000000000000000000000000001::signer;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
processed 4 tasks

task 0 'print-bytecode'. lines 1-11:
// Move bytecode v6
// Move bytecode v7
module 5d5.M {
struct T has key {
b: bool
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
processed 4 tasks

task 0 'print-bytecode'. lines 1-16:
// Move bytecode v6
// Move bytecode v7
module 2d6.M {
struct T has key {
b: bool
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
processed 1 task

task 0 'print-bytecode'. lines 1-31:
// Move bytecode v6
// Move bytecode v7
script {


Expand Down
Loading

0 comments on commit 4bed99d

Please sign in to comment.