forked from MystenLabs/sui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
limit object cache and store (MystenLabs#8967)
## Description Limits object runtime internal sizes ## Test Plan Adapter transactional tests --- If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process. ### Type of Change (Check all that apply) - [x] user-visible impact - [ ] breaking change for a client SDKs - [ ] breaking change for FNs (FN binary must upgrade) - [ ] breaking change for validators or node operators (must upgrade binaries) - [ ] breaking change for on-chain data layout - [ ] necessitate either a data wipe or data migration ### Release notes
- Loading branch information
Showing
7 changed files
with
136 additions
and
2 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
crates/sui-adapter-transactional-tests/tests/size_limits/object_runtime_limits.exp
Large diffs are not rendered by default.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
crates/sui-adapter-transactional-tests/tests/size_limits/object_runtime_limits.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,36 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// similar to dynamic_field_tests but over multiple transactions, as this uses a different code path | ||
// test duplicate add | ||
|
||
//# init --addresses a=0x0 --accounts A | ||
|
||
//# publish | ||
module a::m { | ||
|
||
use sui::dynamic_field::add; | ||
use sui::object; | ||
use sui::tx_context::{sender, TxContext}; | ||
|
||
struct Obj has key { | ||
id: object::UID, | ||
} | ||
|
||
public entry fun add_n_items(n: u64, ctx: &mut TxContext) { | ||
let i = 0; | ||
while (i < n) { | ||
let id = object::new(ctx); | ||
add<u64, u64>(&mut id, i, i); | ||
sui::transfer::transfer(Obj { id }, sender(ctx)); | ||
|
||
i = i + 1; | ||
}; | ||
} | ||
} | ||
|
||
//# run a::m::add_n_items --sender A --args 100 | ||
|
||
//# run a::m::add_n_items --sender A --args 1000 | ||
|
||
//# run a::m::add_n_items --sender A --args 1025 |
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