-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Move] Box type layout vectors (#19310)
## Description Boxes fields in the `MoveTypeLayout` to make the enum size smaller for type layouts. ## Test plan Added test to check size of the enums + make sure existing tests pass. --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [X] Protocol: Increase the maximum type layout size in the VM. Most users should not notice this change. - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API:
- Loading branch information
Showing
41 changed files
with
335 additions
and
206 deletions.
There are no files selected for viewing
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
22 changes: 22 additions & 0 deletions
22
crates/sui-adapter-transactional-tests/tests/entry_points/large_enum_v58.exp
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,22 @@ | ||
processed 4 tasks | ||
|
||
init: | ||
A: object(0,0) | ||
|
||
task 1, lines 8-35: | ||
//# publish | ||
created: object(1,0) | ||
mutated: object(0,1) | ||
gas summary: computation_cost: 1000000, storage_cost: 6452400, storage_rebate: 0, non_refundable_storage_fee: 0 | ||
|
||
task 2, lines 37-38: | ||
//# programmable --sender A | ||
//> test::m::x1() | ||
mutated: object(0,0) | ||
gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 0, non_refundable_storage_fee: 0 | ||
|
||
task 3, lines 40-41: | ||
//# programmable --sender A | ||
//> test::m::x3() | ||
Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. | ||
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: TOO_MANY_TYPE_NODES, sub_status: None, message: None, exec_state: None, location: Undefined, indices: [], offsets: [] }), command: Some(0) } } |
41 changes: 41 additions & 0 deletions
41
crates/sui-adapter-transactional-tests/tests/entry_points/large_enum_v58.move
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,41 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// tests error after serializing a large enum return value | ||
|
||
//# init --addresses test=0x0 --accounts A --protocol-version 58 | ||
|
||
//# publish | ||
|
||
module test::m { | ||
|
||
public enum X1 has drop { | ||
Big1(u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8), | ||
} | ||
|
||
public enum X2 has drop { | ||
V1(X1, X1, X1), | ||
V2(X1, X1, X1), | ||
V3(X1, X1, X1), | ||
} | ||
|
||
public enum X3 has drop { | ||
X2(X2, X2, X2), | ||
U64(u64), | ||
} | ||
|
||
entry fun x1(): X1 { | ||
X1::Big1(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) | ||
} | ||
|
||
entry fun x3(): X3 { | ||
X3::U64(0) | ||
} | ||
|
||
} | ||
|
||
//# programmable --sender A | ||
//> test::m::x1() | ||
|
||
//# programmable --sender A | ||
//> test::m::x3() |
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
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
Oops, something went wrong.