Skip to content

Commit

Permalink
[cleanup] Split move-stdlib natives into their own crate (#17164)
Browse files Browse the repository at this point in the history
## Description 

- Made move-stdlib its own crate to future proof execution cut 

## Test plan 

- CI

---

## 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.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
  • Loading branch information
tnowacki authored Apr 17, 2024
1 parent ebbdee7 commit 96de7fd
Show file tree
Hide file tree
Showing 75 changed files with 162 additions and 202 deletions.
50 changes: 25 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ exclude = [
"external-crates/move/crates/move-stackless-bytecode",
"external-crates/move/crates/move-stackless-bytecode-interpreter",
"external-crates/move/crates/move-stdlib",
"external-crates/move/crates/move-stdlib-natives",
"external-crates/move/crates/move-symbol-pool",
"external-crates/move/crates/move-transactional-test-runner",
"external-crates/move/crates/move-unit-test",
Expand All @@ -57,13 +58,13 @@ exclude = [
"external-crates/move/crates/serializer-tests",
"external-crates/move/crates/test-generation",
"external-crates/move/move-execution/v0/crates/move-bytecode-verifier",
"external-crates/move/move-execution/v0/crates/move-stdlib",
"external-crates/move/move-execution/v0/crates/move-stdlib-natives",
"external-crates/move/move-execution/v0/crates/move-vm-runtime",
"external-crates/move/move-execution/v1/crates/move-bytecode-verifier",
"external-crates/move/move-execution/v1/crates/move-stdlib",
"external-crates/move/move-execution/v1/crates/move-stdlib-natives",
"external-crates/move/move-execution/v1/crates/move-vm-runtime",
"external-crates/move/move-execution/v2/crates/move-bytecode-verifier",
"external-crates/move/move-execution/v2/crates/move-stdlib",
"external-crates/move/move-execution/v2/crates/move-stdlib-natives",
"external-crates/move/move-execution/v2/crates/move-vm-runtime",
"sdk/move-bytecode-template",
]
Expand Down
63 changes: 24 additions & 39 deletions external-crates/move/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions external-crates/move/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ members = [
"move-execution/v1/crates/move-vm-runtime",
"move-execution/v2/crates/move-vm-runtime",
# "move-execution/$CUT/crates/move-vm-runtime",
"move-execution/v0/crates/move-stdlib",
"move-execution/v1/crates/move-stdlib",
"move-execution/v2/crates/move-stdlib",
# "move-execution/$CUT/crates/move-stdlib",
"move-execution/v0/crates/move-stdlib-natives",
"move-execution/v1/crates/move-stdlib-natives",
"move-execution/v2/crates/move-stdlib-natives",
# "move-execution/$CUT/crates/move-stdlib-natives",
]

# Dependencies that should be kept in sync through the whole workspace
Expand Down Expand Up @@ -165,6 +165,7 @@ move-read-write-set-types = { path = "crates/move-read-write-set-types" }
move-stackless-bytecode = { path = "crates/move-stackless-bytecode" }
move-stackless-bytecode-interpreter = { path = "crates/move-stackless-bytecode-interpreter" }
move-stdlib = { path = "crates/move-stdlib" }
move-stdlib-natives = { path = "crates/move-stdlib-natives" }
move-symbol-pool = { path = "crates/move-symbol-pool" }
move-transactional-test-runner = { path = "crates/move-transactional-test-runner" }
move-unit-test = { path = "crates/move-unit-test" }
Expand Down
1 change: 1 addition & 0 deletions external-crates/move/crates/language-benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ move-vm-test-utils.workspace = true
move-vm-types.workspace = true
move-binary-format.workspace = true
move-stdlib.workspace = true
move-stdlib-natives.workspace = true

[[bench]]
name = "vm_benches"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ static MOVE_BENCH_SRC_PATH: Lazy<PathBuf> = Lazy::new(|| {
/// Entry point for the bench, provide a function name to invoke in Module Bench in bench.move.
pub fn bench<M: Measurement + 'static>(c: &mut Criterion<M>, fun: &str) {
let modules = compile_modules();
let move_vm = MoveVM::new(move_stdlib::natives::all_natives(
let move_vm = MoveVM::new(move_stdlib_natives::all_natives(
AccountAddress::from_hex_literal("0x1").unwrap(),
move_stdlib::natives::GasParameters::zeros(),
move_stdlib_natives::GasParameters::zeros(),
))
.unwrap();
execute(c, &move_vm, modules, fun);
Expand Down
1 change: 1 addition & 0 deletions external-crates/move/crates/move-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ move-core-types.workspace = true
move-ir-types.workspace = true
move-compiler.workspace = true
move-stdlib.workspace = true
move-stdlib-natives.workspace = true
move-vm-types.workspace = true
move-vm-runtime.workspace = true
move-vm-profiler.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion external-crates/move/crates/move-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use anyhow::Result;
use move_core_types::{account_address::AccountAddress, errmap::ErrorMapping};
use move_stdlib::natives::{all_natives, nursery_natives, GasParameters, NurseryGasParameters};
use move_stdlib_natives::{all_natives, nursery_natives, GasParameters, NurseryGasParameters};

fn main() -> Result<()> {
let error_descriptions: ErrorMapping = bcs::from_bytes(move_stdlib::error_descriptions())?;
Expand Down
Loading

0 comments on commit 96de7fd

Please sign in to comment.