From b36f12549bf185d79a19222949f523236f9a79c1 Mon Sep 17 00:00:00 2001 From: Liam Makena Monninger Date: Thu, 12 Jun 2025 12:39:48 +0800 Subject: [PATCH 1/7] chore: restructure environments; remove node and migrator distinction for now. --- Cargo.lock | 121 +++++++++++++++ Cargo.toml | 11 +- environments/core/box/Cargo.toml | 40 +++++ environments/core/box/README.md | 2 + environments/core/box/src/lib.rs | 2 + environments/core/box/src/migrate.rs | 7 + environments/core/box/src/migrate/config.rs | 103 +++++++++++++ environments/core/box/src/migrate/migrate.rs | 84 +++++++++++ environments/core/provisioner/Cargo.toml | 40 +++++ environments/core/provisioner/README.md | 2 + environments/core/provisioner/src/lib.rs | 2 + environments/core/provisioner/src/migrate.rs | 7 + .../core/provisioner/src/migrate/config.rs | 103 +++++++++++++ .../core/provisioner/src/migrate/migrate.rs | 84 +++++++++++ environments/core/testing/Cargo.toml | 40 +++++ environments/core/testing/README.md | 2 + environments/core/testing/src/lib.rs | 2 + environments/core/testing/src/migrate.rs | 7 + .../core/testing/src/migrate/config.rs | 103 +++++++++++++ .../core/testing/src/migrate/migrate.rs | 84 +++++++++++ .../util/environment-types/Cargo.toml | 33 +++++ environments/util/environment-types/README.md | 2 + .../util/environment-types/src/lib.rs | 2 + .../util/environment-types/src/migration.rs | 75 ++++++++++ .../util/environment-types/src/migrator.rs | 5 + .../src/migrator/movement_aptos_migrator.rs | 138 ++++++++++++++++++ .../src/migrator/movement_migrator.rs | 106 ++++++++++++++ 27 files changed, 1205 insertions(+), 2 deletions(-) create mode 100644 environments/core/box/Cargo.toml create mode 100644 environments/core/box/README.md create mode 100644 environments/core/box/src/lib.rs create mode 100644 environments/core/box/src/migrate.rs create mode 100644 environments/core/box/src/migrate/config.rs create mode 100644 environments/core/box/src/migrate/migrate.rs create mode 100644 environments/core/provisioner/Cargo.toml create mode 100644 environments/core/provisioner/README.md create mode 100644 environments/core/provisioner/src/lib.rs create mode 100644 environments/core/provisioner/src/migrate.rs create mode 100644 environments/core/provisioner/src/migrate/config.rs create mode 100644 environments/core/provisioner/src/migrate/migrate.rs create mode 100644 environments/core/testing/Cargo.toml create mode 100644 environments/core/testing/README.md create mode 100644 environments/core/testing/src/lib.rs create mode 100644 environments/core/testing/src/migrate.rs create mode 100644 environments/core/testing/src/migrate/config.rs create mode 100644 environments/core/testing/src/migrate/migrate.rs create mode 100644 environments/util/environment-types/Cargo.toml create mode 100644 environments/util/environment-types/README.md create mode 100644 environments/util/environment-types/src/lib.rs create mode 100644 environments/util/environment-types/src/migration.rs create mode 100644 environments/util/environment-types/src/migrator.rs create mode 100644 environments/util/environment-types/src/migrator/movement_aptos_migrator.rs create mode 100644 environments/util/environment-types/src/migrator/movement_migrator.rs diff --git a/Cargo.lock b/Cargo.lock index 595d0cf..842dd84 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -15464,6 +15464,38 @@ dependencies = [ "tracing-subscriber 0.3.19", ] +[[package]] +name = "mtma-box-environment" +version = "0.0.1" +dependencies = [ + "anyhow", + "aptos-config 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", + "aptos-db 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", + "aptos-executor 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", + "aptos-framework-pre-l1-merge-release", + "aptos-storage-interface 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", + "aptos-vm 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", + "chrono", + "clap 4.5.36", + "clap-markdown-ext", + "dotenv", + "hex", + "movement-core", + "movement-signer", + "movement-signer-loader", + "mtma-migrator-types", + "mtma-node-null-core", + "mtma-node-types", + "mtma-types", + "orfile", + "serde", + "thiserror 1.0.69", + "tokio", + "tracing", + "uuid", + "walkdir", +] + [[package]] name = "mtma-check" version = "0.0.1" @@ -15571,6 +15603,31 @@ dependencies = [ "tracing-subscriber 0.3.19", ] +[[package]] +name = "mtma-environment-types" +version = "0.0.1" +dependencies = [ + "anyhow", + "aptos-config 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", + "aptos-executor 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", + "aptos-rest-client 0.0.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", + "aptos-storage-interface 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", + "aptos-types 0.0.3 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", + "aptos-vm 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", + "either", + "hex", + "kestrel", + "maptos-opt-executor", + "movement-aptos-core", + "movement-client", + "movement-core", + "mtma-node-types", + "mtma-types", + "serde", + "thiserror 1.0.69", + "tracing", +] + [[package]] name = "mtma-migrate" version = "0.0.1" @@ -16192,6 +16249,70 @@ dependencies = [ "walkdir", ] +[[package]] +name = "mtma-provisioner-environment" +version = "0.0.1" +dependencies = [ + "anyhow", + "aptos-config 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", + "aptos-db 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", + "aptos-executor 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", + "aptos-framework-pre-l1-merge-release", + "aptos-storage-interface 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", + "aptos-vm 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", + "chrono", + "clap 4.5.36", + "clap-markdown-ext", + "dotenv", + "hex", + "movement-core", + "movement-signer", + "movement-signer-loader", + "mtma-migrator-types", + "mtma-node-null-core", + "mtma-node-types", + "mtma-types", + "orfile", + "serde", + "thiserror 1.0.69", + "tokio", + "tracing", + "uuid", + "walkdir", +] + +[[package]] +name = "mtma-testing-environment" +version = "0.0.1" +dependencies = [ + "anyhow", + "aptos-config 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", + "aptos-db 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", + "aptos-executor 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", + "aptos-framework-pre-l1-merge-release", + "aptos-storage-interface 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", + "aptos-vm 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", + "chrono", + "clap 4.5.36", + "clap-markdown-ext", + "dotenv", + "hex", + "movement-core", + "movement-signer", + "movement-signer-loader", + "mtma-migrator-types", + "mtma-node-null-core", + "mtma-node-types", + "mtma-types", + "orfile", + "serde", + "thiserror 1.0.69", + "tokio", + "tracing", + "uuid", + "walkdir", +] + [[package]] name = "mtma-track" version = "0.0.1" diff --git a/Cargo.toml b/Cargo.toml index b30e246..243303c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,15 +10,22 @@ members = [ "migration/core/node/*", "migration/core/migrator/*", "migration/util/*", - # executor + + # environments + "environments/core/*", + "environments/util/*", + + # checks + ## node "checks/node/util/*", "checks/node/citeria/*", "checks/node/checks/*", "checks/node/preludes", - # e2e + ## migrator "checks/migrator/util/*", "checks/migrator/citeria/*", "checks/migrator/checks/*", + # util "util/bcs-ext", "util/movement/*", diff --git a/environments/core/box/Cargo.toml b/environments/core/box/Cargo.toml new file mode 100644 index 0000000..edb5aef --- /dev/null +++ b/environments/core/box/Cargo.toml @@ -0,0 +1,40 @@ +[package] +name = "mtma-box-environment" +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +authors = { workspace = true } +homepage = { workspace = true } +publish = { workspace = true } +rust-version = { workspace = true } + +[dependencies] +tokio = { workspace = true } +serde = { workspace = true, features = ["derive"] } +clap = { workspace = true, features = ["derive"] } +dotenv = { workspace = true } +anyhow = { workspace = true } +clap-markdown-ext = { workspace = true } +thiserror = { workspace = true } +orfile = { workspace = true } +mtma-node-types = { workspace = true } +mtma-migrator-types = { workspace = true } +mtma-node-null-core = { workspace = true } +aptos-db = { workspace = true } +aptos-storage-interface = { workspace = true } +aptos-config = { workspace = true } +aptos-executor = { workspace = true } +aptos-vm = { workspace = true } +chrono = { workspace = true } +walkdir = { workspace = true } +uuid = { workspace = true } +tracing = { workspace = true } +aptos-framework-pre-l1-merge-release = { workspace = true } +movement-signer = { workspace = true } +movement-signer-loader = { workspace = true } +hex = { workspace = true } +mtma-types = { workspace = true } +movement-core = { workspace = true } + +[lints] +workspace = true diff --git a/environments/core/box/README.md b/environments/core/box/README.md new file mode 100644 index 0000000..134aab7 --- /dev/null +++ b/environments/core/box/README.md @@ -0,0 +1,2 @@ +# `mtma-box-environment` +The environment which provides a [Migrator](/README.md#migrator) constructed via access to state on the current node. \ No newline at end of file diff --git a/environments/core/box/src/lib.rs b/environments/core/box/src/lib.rs new file mode 100644 index 0000000..302fca8 --- /dev/null +++ b/environments/core/box/src/lib.rs @@ -0,0 +1,2 @@ +pub mod migrate; +pub use migrate::*; diff --git a/environments/core/box/src/migrate.rs b/environments/core/box/src/migrate.rs new file mode 100644 index 0000000..2ca301e --- /dev/null +++ b/environments/core/box/src/migrate.rs @@ -0,0 +1,7 @@ +/// Contains the configuration structs and logic for the migration. +pub mod config; +/// Contains the logic for the migration. +pub mod migrate; + +pub use config::*; +pub use migrate::*; diff --git a/environments/core/box/src/migrate/config.rs b/environments/core/box/src/migrate/config.rs new file mode 100644 index 0000000..1b24597 --- /dev/null +++ b/environments/core/box/src/migrate/config.rs @@ -0,0 +1,103 @@ +use crate::Migrate; +use anyhow::Context; +use aptos_framework_pre_l1_merge_release::maptos_framework_release_util::{ + LocalAccountReleaseSigner, OverrideAccountAddressReleaseSigner, +}; +use clap::Parser; +use movement_core::{ + movement::{Celestia, Eth}, + Config as MovementCoreConfig, +}; +use mtma_node_null_core::Config as MtmaNodeNullConfig; +use mtma_types::movement::aptos_sdk::types::{ + account_address::AccountAddress, account_config::aptos_test_root_address, LocalAccount, +}; +use mtma_types::movement::movement_config::Config as MovementConfig; +use serde::{Deserialize, Serialize}; +use std::fmt::Debug; + +/// Errors thrown when working with the [Config]. +#[derive(Debug, thiserror::Error)] +pub enum MigrateConfigError { + #[error("failed to build from config: {0}")] + Build(#[source] Box), +} + +/// The config for the migration. +/// +/// All fields should be easily statically encodable to a CLI argument. +/// This is the frontend for the core API. +#[derive(Parser, Debug, Serialize, Deserialize, Clone)] +#[clap(help_expected = true)] +pub struct Config { + /// The config for the mtma-node-null. + #[clap(flatten)] + mtma_node_null: MtmaNodeNullConfig, + /// The movement config. + #[clap(flatten)] + movement_core: MovementCoreConfig, + /// The account address override for the release signer. + #[clap(long)] + pub account_address: Option, +} + +impl Default for Config { + fn default() -> Self { + let mut movement_core = MovementCoreConfig { + movement_config_string: None, + setup: false, + celestia: Celestia::Local, + eth: Eth::Local, + biarritz_rc1_to_pre_l1_merge: false, + ping_rest_api: false, + ping_faucet: false, + }; + + // Create a default MovementConfig + let movement_config = MovementConfig::default(); + + // Hard-code the core resources address + let account_address = Some(aptos_test_root_address()); + + // Set the movement config + movement_core.set_movement_config(movement_config); + + Self { mtma_node_null: MtmaNodeNullConfig::default(), movement_core, account_address } + } +} + +impl Config { + /// Builds the release signer from the config. + pub fn build_release_signer(&self) -> Result { + // load the signer + let raw_private_key = self + .movement_core + .try_movement_signer_identifier() + .map_err(|e| MigrateConfigError::Build(e.into()))? + .try_raw_private_key() + .context("failed to load raw private key") + .map_err(|e| MigrateConfigError::Build(e.into()))?; + + // get the raw private key + let private_key_hex = hex::encode(raw_private_key); + let root_account = LocalAccount::from_private_key(private_key_hex.as_str(), 0) + .context("failed to build root account") + .map_err(|e| MigrateConfigError::Build(e.into()))?; // sequence number 0 is fine because the release API loads sequence numbers + + Ok(LocalAccountReleaseSigner::new(root_account, None)) + } + + /// Builds the [Migrate] struct from the config. + pub fn build( + &self, + ) -> Result< + Migrate>, + MigrateConfigError, + > { + let mtma_node_null = + self.mtma_node_null.build().map_err(|e| MigrateConfigError::Build(e.into()))?; + let local_signer = self.build_release_signer()?; + let signer = OverrideAccountAddressReleaseSigner::core_resource_account(local_signer); + Ok(Migrate { release_signer: signer, mtma_node_null }) + } +} diff --git a/environments/core/box/src/migrate/migrate.rs b/environments/core/box/src/migrate/migrate.rs new file mode 100644 index 0000000..e701d3c --- /dev/null +++ b/environments/core/box/src/migrate/migrate.rs @@ -0,0 +1,84 @@ +use aptos_framework_pre_l1_merge_release::{ + cached::full::feature_upgrade::PreL1Merge, + maptos_framework_release_util::{Release, ReleaseSigner}, +}; +use mtma_migrator_types::migration::{MigrationError, Migrationish}; +use mtma_migrator_types::migrator::{ + movement_aptos_migrator::MovementAptosMigrator, movement_migrator::MovementMigrator, +}; +use mtma_node_null_core::Migrate as MtmaNodeNullMigrate; + +use anyhow::Context; +use std::fmt::Debug; + +/// Errors thrown during the migration. +#[derive(Debug, thiserror::Error)] +pub enum MigrateError { + #[error("failed to migrate with pre-l1-merge: {0}")] + Migrate(#[source] Box), +} + +/// The migration struct will be use to run a migration from Movement +pub struct Migrate +where + S: ReleaseSigner + Send + Sync + 'static, +{ + pub(crate) release_signer: S, + pub(crate) mtma_node_null: MtmaNodeNullMigrate, +} + +impl Migrate +where + S: ReleaseSigner + Send + Sync + 'static, +{ + pub fn new(release_signer: S, mtma_node_null: MtmaNodeNullMigrate) -> Self { + Self { release_signer, mtma_node_null } + } + + pub fn release_signer(&self) -> &S { + &self.release_signer + } + + pub fn mtma_node_null(&self) -> &MtmaNodeNullMigrate { + &self.mtma_node_null + } +} + +impl Migrationish for Migrate +where + S: ReleaseSigner + Send + Sync + 'static, +{ + async fn migrate( + &self, + movement_migrator: &MovementMigrator, + ) -> Result { + // wait for the rest client to be ready + let rest_client = movement_migrator + .wait_for_rest_client_ready(tokio::time::Duration::from_secs(300)) + .await + .context("failed to wait for rest client to be ready") + .map_err(|e| MigrationError::Internal(e.into()))?; + + // build the pre-l1-merge + let pre_l1_merge = PreL1Merge::new(); + + // Run the release + pre_l1_merge + .release(self.release_signer(), 2_000_000, 100, 60, &rest_client) + .await + .context("failed to release with pre-l1-merge") + .map_err(|e| MigrationError::Internal(e.into()))?; + + // migrate with `mtma-node-null` + // NOTE: we're using the blanket implementation to upcast from a node migration to a migrator migration + let movement_aptos_migrator = self + .mtma_node_null + .migrate(movement_migrator) + .await + .context("failed to migrate node with mtma-node-null") + .map_err(|e| MigrationError::Internal(e.into()))?; + + // return the movement aptos migrator + Ok(movement_aptos_migrator) + } +} diff --git a/environments/core/provisioner/Cargo.toml b/environments/core/provisioner/Cargo.toml new file mode 100644 index 0000000..8c6e902 --- /dev/null +++ b/environments/core/provisioner/Cargo.toml @@ -0,0 +1,40 @@ +[package] +name = "mtma-provisioner-environment" +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +authors = { workspace = true } +homepage = { workspace = true } +publish = { workspace = true } +rust-version = { workspace = true } + +[dependencies] +tokio = { workspace = true } +serde = { workspace = true, features = ["derive"] } +clap = { workspace = true, features = ["derive"] } +dotenv = { workspace = true } +anyhow = { workspace = true } +clap-markdown-ext = { workspace = true } +thiserror = { workspace = true } +orfile = { workspace = true } +mtma-node-types = { workspace = true } +mtma-migrator-types = { workspace = true } +mtma-node-null-core = { workspace = true } +aptos-db = { workspace = true } +aptos-storage-interface = { workspace = true } +aptos-config = { workspace = true } +aptos-executor = { workspace = true } +aptos-vm = { workspace = true } +chrono = { workspace = true } +walkdir = { workspace = true } +uuid = { workspace = true } +tracing = { workspace = true } +aptos-framework-pre-l1-merge-release = { workspace = true } +movement-signer = { workspace = true } +movement-signer-loader = { workspace = true } +hex = { workspace = true } +mtma-types = { workspace = true } +movement-core = { workspace = true } + +[lints] +workspace = true diff --git a/environments/core/provisioner/README.md b/environments/core/provisioner/README.md new file mode 100644 index 0000000..6d1689a --- /dev/null +++ b/environments/core/provisioner/README.md @@ -0,0 +1,2 @@ +# `mtma-provisioner-environment` +The environment which provides a [Migrator](/README.md#migrator) constructed via a provisioner node. \ No newline at end of file diff --git a/environments/core/provisioner/src/lib.rs b/environments/core/provisioner/src/lib.rs new file mode 100644 index 0000000..302fca8 --- /dev/null +++ b/environments/core/provisioner/src/lib.rs @@ -0,0 +1,2 @@ +pub mod migrate; +pub use migrate::*; diff --git a/environments/core/provisioner/src/migrate.rs b/environments/core/provisioner/src/migrate.rs new file mode 100644 index 0000000..2ca301e --- /dev/null +++ b/environments/core/provisioner/src/migrate.rs @@ -0,0 +1,7 @@ +/// Contains the configuration structs and logic for the migration. +pub mod config; +/// Contains the logic for the migration. +pub mod migrate; + +pub use config::*; +pub use migrate::*; diff --git a/environments/core/provisioner/src/migrate/config.rs b/environments/core/provisioner/src/migrate/config.rs new file mode 100644 index 0000000..1b24597 --- /dev/null +++ b/environments/core/provisioner/src/migrate/config.rs @@ -0,0 +1,103 @@ +use crate::Migrate; +use anyhow::Context; +use aptos_framework_pre_l1_merge_release::maptos_framework_release_util::{ + LocalAccountReleaseSigner, OverrideAccountAddressReleaseSigner, +}; +use clap::Parser; +use movement_core::{ + movement::{Celestia, Eth}, + Config as MovementCoreConfig, +}; +use mtma_node_null_core::Config as MtmaNodeNullConfig; +use mtma_types::movement::aptos_sdk::types::{ + account_address::AccountAddress, account_config::aptos_test_root_address, LocalAccount, +}; +use mtma_types::movement::movement_config::Config as MovementConfig; +use serde::{Deserialize, Serialize}; +use std::fmt::Debug; + +/// Errors thrown when working with the [Config]. +#[derive(Debug, thiserror::Error)] +pub enum MigrateConfigError { + #[error("failed to build from config: {0}")] + Build(#[source] Box), +} + +/// The config for the migration. +/// +/// All fields should be easily statically encodable to a CLI argument. +/// This is the frontend for the core API. +#[derive(Parser, Debug, Serialize, Deserialize, Clone)] +#[clap(help_expected = true)] +pub struct Config { + /// The config for the mtma-node-null. + #[clap(flatten)] + mtma_node_null: MtmaNodeNullConfig, + /// The movement config. + #[clap(flatten)] + movement_core: MovementCoreConfig, + /// The account address override for the release signer. + #[clap(long)] + pub account_address: Option, +} + +impl Default for Config { + fn default() -> Self { + let mut movement_core = MovementCoreConfig { + movement_config_string: None, + setup: false, + celestia: Celestia::Local, + eth: Eth::Local, + biarritz_rc1_to_pre_l1_merge: false, + ping_rest_api: false, + ping_faucet: false, + }; + + // Create a default MovementConfig + let movement_config = MovementConfig::default(); + + // Hard-code the core resources address + let account_address = Some(aptos_test_root_address()); + + // Set the movement config + movement_core.set_movement_config(movement_config); + + Self { mtma_node_null: MtmaNodeNullConfig::default(), movement_core, account_address } + } +} + +impl Config { + /// Builds the release signer from the config. + pub fn build_release_signer(&self) -> Result { + // load the signer + let raw_private_key = self + .movement_core + .try_movement_signer_identifier() + .map_err(|e| MigrateConfigError::Build(e.into()))? + .try_raw_private_key() + .context("failed to load raw private key") + .map_err(|e| MigrateConfigError::Build(e.into()))?; + + // get the raw private key + let private_key_hex = hex::encode(raw_private_key); + let root_account = LocalAccount::from_private_key(private_key_hex.as_str(), 0) + .context("failed to build root account") + .map_err(|e| MigrateConfigError::Build(e.into()))?; // sequence number 0 is fine because the release API loads sequence numbers + + Ok(LocalAccountReleaseSigner::new(root_account, None)) + } + + /// Builds the [Migrate] struct from the config. + pub fn build( + &self, + ) -> Result< + Migrate>, + MigrateConfigError, + > { + let mtma_node_null = + self.mtma_node_null.build().map_err(|e| MigrateConfigError::Build(e.into()))?; + let local_signer = self.build_release_signer()?; + let signer = OverrideAccountAddressReleaseSigner::core_resource_account(local_signer); + Ok(Migrate { release_signer: signer, mtma_node_null }) + } +} diff --git a/environments/core/provisioner/src/migrate/migrate.rs b/environments/core/provisioner/src/migrate/migrate.rs new file mode 100644 index 0000000..e701d3c --- /dev/null +++ b/environments/core/provisioner/src/migrate/migrate.rs @@ -0,0 +1,84 @@ +use aptos_framework_pre_l1_merge_release::{ + cached::full::feature_upgrade::PreL1Merge, + maptos_framework_release_util::{Release, ReleaseSigner}, +}; +use mtma_migrator_types::migration::{MigrationError, Migrationish}; +use mtma_migrator_types::migrator::{ + movement_aptos_migrator::MovementAptosMigrator, movement_migrator::MovementMigrator, +}; +use mtma_node_null_core::Migrate as MtmaNodeNullMigrate; + +use anyhow::Context; +use std::fmt::Debug; + +/// Errors thrown during the migration. +#[derive(Debug, thiserror::Error)] +pub enum MigrateError { + #[error("failed to migrate with pre-l1-merge: {0}")] + Migrate(#[source] Box), +} + +/// The migration struct will be use to run a migration from Movement +pub struct Migrate +where + S: ReleaseSigner + Send + Sync + 'static, +{ + pub(crate) release_signer: S, + pub(crate) mtma_node_null: MtmaNodeNullMigrate, +} + +impl Migrate +where + S: ReleaseSigner + Send + Sync + 'static, +{ + pub fn new(release_signer: S, mtma_node_null: MtmaNodeNullMigrate) -> Self { + Self { release_signer, mtma_node_null } + } + + pub fn release_signer(&self) -> &S { + &self.release_signer + } + + pub fn mtma_node_null(&self) -> &MtmaNodeNullMigrate { + &self.mtma_node_null + } +} + +impl Migrationish for Migrate +where + S: ReleaseSigner + Send + Sync + 'static, +{ + async fn migrate( + &self, + movement_migrator: &MovementMigrator, + ) -> Result { + // wait for the rest client to be ready + let rest_client = movement_migrator + .wait_for_rest_client_ready(tokio::time::Duration::from_secs(300)) + .await + .context("failed to wait for rest client to be ready") + .map_err(|e| MigrationError::Internal(e.into()))?; + + // build the pre-l1-merge + let pre_l1_merge = PreL1Merge::new(); + + // Run the release + pre_l1_merge + .release(self.release_signer(), 2_000_000, 100, 60, &rest_client) + .await + .context("failed to release with pre-l1-merge") + .map_err(|e| MigrationError::Internal(e.into()))?; + + // migrate with `mtma-node-null` + // NOTE: we're using the blanket implementation to upcast from a node migration to a migrator migration + let movement_aptos_migrator = self + .mtma_node_null + .migrate(movement_migrator) + .await + .context("failed to migrate node with mtma-node-null") + .map_err(|e| MigrationError::Internal(e.into()))?; + + // return the movement aptos migrator + Ok(movement_aptos_migrator) + } +} diff --git a/environments/core/testing/Cargo.toml b/environments/core/testing/Cargo.toml new file mode 100644 index 0000000..331cc5c --- /dev/null +++ b/environments/core/testing/Cargo.toml @@ -0,0 +1,40 @@ +[package] +name = "mtma-testing-environment" +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +authors = { workspace = true } +homepage = { workspace = true } +publish = { workspace = true } +rust-version = { workspace = true } + +[dependencies] +tokio = { workspace = true } +serde = { workspace = true, features = ["derive"] } +clap = { workspace = true, features = ["derive"] } +dotenv = { workspace = true } +anyhow = { workspace = true } +clap-markdown-ext = { workspace = true } +thiserror = { workspace = true } +orfile = { workspace = true } +mtma-node-types = { workspace = true } +mtma-migrator-types = { workspace = true } +mtma-node-null-core = { workspace = true } +aptos-db = { workspace = true } +aptos-storage-interface = { workspace = true } +aptos-config = { workspace = true } +aptos-executor = { workspace = true } +aptos-vm = { workspace = true } +chrono = { workspace = true } +walkdir = { workspace = true } +uuid = { workspace = true } +tracing = { workspace = true } +aptos-framework-pre-l1-merge-release = { workspace = true } +movement-signer = { workspace = true } +movement-signer-loader = { workspace = true } +hex = { workspace = true } +mtma-types = { workspace = true } +movement-core = { workspace = true } + +[lints] +workspace = true diff --git a/environments/core/testing/README.md b/environments/core/testing/README.md new file mode 100644 index 0000000..0f78f19 --- /dev/null +++ b/environments/core/testing/README.md @@ -0,0 +1,2 @@ +# `mtma-testing-environment` +The environment which provides a [Migrator](/README.md#migrator) representing a local, single-instance testing environment. \ No newline at end of file diff --git a/environments/core/testing/src/lib.rs b/environments/core/testing/src/lib.rs new file mode 100644 index 0000000..302fca8 --- /dev/null +++ b/environments/core/testing/src/lib.rs @@ -0,0 +1,2 @@ +pub mod migrate; +pub use migrate::*; diff --git a/environments/core/testing/src/migrate.rs b/environments/core/testing/src/migrate.rs new file mode 100644 index 0000000..2ca301e --- /dev/null +++ b/environments/core/testing/src/migrate.rs @@ -0,0 +1,7 @@ +/// Contains the configuration structs and logic for the migration. +pub mod config; +/// Contains the logic for the migration. +pub mod migrate; + +pub use config::*; +pub use migrate::*; diff --git a/environments/core/testing/src/migrate/config.rs b/environments/core/testing/src/migrate/config.rs new file mode 100644 index 0000000..1b24597 --- /dev/null +++ b/environments/core/testing/src/migrate/config.rs @@ -0,0 +1,103 @@ +use crate::Migrate; +use anyhow::Context; +use aptos_framework_pre_l1_merge_release::maptos_framework_release_util::{ + LocalAccountReleaseSigner, OverrideAccountAddressReleaseSigner, +}; +use clap::Parser; +use movement_core::{ + movement::{Celestia, Eth}, + Config as MovementCoreConfig, +}; +use mtma_node_null_core::Config as MtmaNodeNullConfig; +use mtma_types::movement::aptos_sdk::types::{ + account_address::AccountAddress, account_config::aptos_test_root_address, LocalAccount, +}; +use mtma_types::movement::movement_config::Config as MovementConfig; +use serde::{Deserialize, Serialize}; +use std::fmt::Debug; + +/// Errors thrown when working with the [Config]. +#[derive(Debug, thiserror::Error)] +pub enum MigrateConfigError { + #[error("failed to build from config: {0}")] + Build(#[source] Box), +} + +/// The config for the migration. +/// +/// All fields should be easily statically encodable to a CLI argument. +/// This is the frontend for the core API. +#[derive(Parser, Debug, Serialize, Deserialize, Clone)] +#[clap(help_expected = true)] +pub struct Config { + /// The config for the mtma-node-null. + #[clap(flatten)] + mtma_node_null: MtmaNodeNullConfig, + /// The movement config. + #[clap(flatten)] + movement_core: MovementCoreConfig, + /// The account address override for the release signer. + #[clap(long)] + pub account_address: Option, +} + +impl Default for Config { + fn default() -> Self { + let mut movement_core = MovementCoreConfig { + movement_config_string: None, + setup: false, + celestia: Celestia::Local, + eth: Eth::Local, + biarritz_rc1_to_pre_l1_merge: false, + ping_rest_api: false, + ping_faucet: false, + }; + + // Create a default MovementConfig + let movement_config = MovementConfig::default(); + + // Hard-code the core resources address + let account_address = Some(aptos_test_root_address()); + + // Set the movement config + movement_core.set_movement_config(movement_config); + + Self { mtma_node_null: MtmaNodeNullConfig::default(), movement_core, account_address } + } +} + +impl Config { + /// Builds the release signer from the config. + pub fn build_release_signer(&self) -> Result { + // load the signer + let raw_private_key = self + .movement_core + .try_movement_signer_identifier() + .map_err(|e| MigrateConfigError::Build(e.into()))? + .try_raw_private_key() + .context("failed to load raw private key") + .map_err(|e| MigrateConfigError::Build(e.into()))?; + + // get the raw private key + let private_key_hex = hex::encode(raw_private_key); + let root_account = LocalAccount::from_private_key(private_key_hex.as_str(), 0) + .context("failed to build root account") + .map_err(|e| MigrateConfigError::Build(e.into()))?; // sequence number 0 is fine because the release API loads sequence numbers + + Ok(LocalAccountReleaseSigner::new(root_account, None)) + } + + /// Builds the [Migrate] struct from the config. + pub fn build( + &self, + ) -> Result< + Migrate>, + MigrateConfigError, + > { + let mtma_node_null = + self.mtma_node_null.build().map_err(|e| MigrateConfigError::Build(e.into()))?; + let local_signer = self.build_release_signer()?; + let signer = OverrideAccountAddressReleaseSigner::core_resource_account(local_signer); + Ok(Migrate { release_signer: signer, mtma_node_null }) + } +} diff --git a/environments/core/testing/src/migrate/migrate.rs b/environments/core/testing/src/migrate/migrate.rs new file mode 100644 index 0000000..e701d3c --- /dev/null +++ b/environments/core/testing/src/migrate/migrate.rs @@ -0,0 +1,84 @@ +use aptos_framework_pre_l1_merge_release::{ + cached::full::feature_upgrade::PreL1Merge, + maptos_framework_release_util::{Release, ReleaseSigner}, +}; +use mtma_migrator_types::migration::{MigrationError, Migrationish}; +use mtma_migrator_types::migrator::{ + movement_aptos_migrator::MovementAptosMigrator, movement_migrator::MovementMigrator, +}; +use mtma_node_null_core::Migrate as MtmaNodeNullMigrate; + +use anyhow::Context; +use std::fmt::Debug; + +/// Errors thrown during the migration. +#[derive(Debug, thiserror::Error)] +pub enum MigrateError { + #[error("failed to migrate with pre-l1-merge: {0}")] + Migrate(#[source] Box), +} + +/// The migration struct will be use to run a migration from Movement +pub struct Migrate +where + S: ReleaseSigner + Send + Sync + 'static, +{ + pub(crate) release_signer: S, + pub(crate) mtma_node_null: MtmaNodeNullMigrate, +} + +impl Migrate +where + S: ReleaseSigner + Send + Sync + 'static, +{ + pub fn new(release_signer: S, mtma_node_null: MtmaNodeNullMigrate) -> Self { + Self { release_signer, mtma_node_null } + } + + pub fn release_signer(&self) -> &S { + &self.release_signer + } + + pub fn mtma_node_null(&self) -> &MtmaNodeNullMigrate { + &self.mtma_node_null + } +} + +impl Migrationish for Migrate +where + S: ReleaseSigner + Send + Sync + 'static, +{ + async fn migrate( + &self, + movement_migrator: &MovementMigrator, + ) -> Result { + // wait for the rest client to be ready + let rest_client = movement_migrator + .wait_for_rest_client_ready(tokio::time::Duration::from_secs(300)) + .await + .context("failed to wait for rest client to be ready") + .map_err(|e| MigrationError::Internal(e.into()))?; + + // build the pre-l1-merge + let pre_l1_merge = PreL1Merge::new(); + + // Run the release + pre_l1_merge + .release(self.release_signer(), 2_000_000, 100, 60, &rest_client) + .await + .context("failed to release with pre-l1-merge") + .map_err(|e| MigrationError::Internal(e.into()))?; + + // migrate with `mtma-node-null` + // NOTE: we're using the blanket implementation to upcast from a node migration to a migrator migration + let movement_aptos_migrator = self + .mtma_node_null + .migrate(movement_migrator) + .await + .context("failed to migrate node with mtma-node-null") + .map_err(|e| MigrationError::Internal(e.into()))?; + + // return the movement aptos migrator + Ok(movement_aptos_migrator) + } +} diff --git a/environments/util/environment-types/Cargo.toml b/environments/util/environment-types/Cargo.toml new file mode 100644 index 0000000..b8bca6e --- /dev/null +++ b/environments/util/environment-types/Cargo.toml @@ -0,0 +1,33 @@ +[package] +name = "mtma-environment-types" +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +authors = { workspace = true } +homepage = { workspace = true } +publish = { workspace = true } +rust-version = { workspace = true } + +[dependencies] +mtma-node-types = { workspace = true } +serde = { workspace = true } +anyhow = { workspace = true } +hex = { workspace = true } +maptos-opt-executor = { workspace = true } +aptos-executor = { workspace = true } +aptos-vm = { workspace = true } +aptos-types = { workspace = true } +thiserror = { workspace = true } +aptos-storage-interface = { workspace = true } +either = { workspace = true } +tracing = { workspace = true } +movement-core = { workspace = true } +movement-aptos-core = { workspace = true } +kestrel = { workspace = true } +movement-client = { workspace = true } +aptos-rest-client = { workspace = true } +aptos-config = { workspace = true } +mtma-types = { workspace = true } + +[lints] +workspace = true diff --git a/environments/util/environment-types/README.md b/environments/util/environment-types/README.md new file mode 100644 index 0000000..7ef34d7 --- /dev/null +++ b/environments/util/environment-types/README.md @@ -0,0 +1,2 @@ +# `mtma-environment-types` +Types defining and for working with differennt `mtma` [Environments](/README.md#environments). \ No newline at end of file diff --git a/environments/util/environment-types/src/lib.rs b/environments/util/environment-types/src/lib.rs new file mode 100644 index 0000000..f4ab07b --- /dev/null +++ b/environments/util/environment-types/src/lib.rs @@ -0,0 +1,2 @@ +pub mod migration; +pub mod migrator; diff --git a/environments/util/environment-types/src/migration.rs b/environments/util/environment-types/src/migration.rs new file mode 100644 index 0000000..b32d83f --- /dev/null +++ b/environments/util/environment-types/src/migration.rs @@ -0,0 +1,75 @@ +pub use crate::migrator::movement_aptos_migrator; +pub use crate::migrator::movement_migrator; + +pub use crate::migrator::movement_aptos_migrator::{ + MovementAptosMigrator, Runner as MovementAptosRunner, +}; +pub use crate::migrator::movement_migrator::MovementMigrator; +use std::future::Future; + +use mtma_node_types::migration::Migrationish as NodeMigrationish; + +/// Errors thrown when working with the [Config]. +#[derive(Debug, thiserror::Error)] +pub enum MigrationError { + #[error("failed to build from config: {0}")] + Unsatisfied(#[source] Box), + #[error("internal error: {0}")] + Internal(#[source] Box), +} + +pub trait Migrationish { + /// Whether the criterion is satisfied by the given movement and movement_aptos executors. + fn migrate( + &self, + movement_migrator: &MovementMigrator, + ) -> impl Future>; +} + +/// The criterion type simply +pub struct Migration(T) +where + T: Migrationish; + +impl Migration +where + T: Migrationish, +{ + pub fn new(t: T) -> Self { + Self(t) + } + + /// Runs the migration. + pub async fn migrate( + &self, + movement_executor: &MovementMigrator, + ) -> Result { + self.0.migrate(movement_executor).await + } +} + +impl Migrationish for T +where + T: NodeMigrationish, +{ + async fn migrate( + &self, + movement_executor: &MovementMigrator, + ) -> Result { + let executor = + movement_executor.node().await.map_err(|e| MigrationError::Internal(e.into()))?; + let movement_aptos_executor = NodeMigrationish::migrate(self, &executor) + .await + .map_err(|e| MigrationError::Internal(e.into()))?; + let movement_aptos = movement_aptos_executor + .test_movement_aptos_config() + .map_err(|e| MigrationError::Internal(e.into()))? + .build() + .map_err(|e| MigrationError::Internal(e.into()))?; + + let movement_aptos_migrator = + MovementAptosMigrator::new(MovementAptosRunner::MovementAptos(movement_aptos)); + + Ok(movement_aptos_migrator) + } +} diff --git a/environments/util/environment-types/src/migrator.rs b/environments/util/environment-types/src/migrator.rs new file mode 100644 index 0000000..cf31069 --- /dev/null +++ b/environments/util/environment-types/src/migrator.rs @@ -0,0 +1,5 @@ +pub mod movement_aptos_migrator; +pub mod movement_migrator; + +pub use movement_aptos_migrator::MovementAptosMigrator; +pub use movement_migrator::MovementMigrator; diff --git a/environments/util/environment-types/src/migrator/movement_aptos_migrator.rs b/environments/util/environment-types/src/migrator/movement_aptos_migrator.rs new file mode 100644 index 0000000..ef96e1f --- /dev/null +++ b/environments/util/environment-types/src/migrator/movement_aptos_migrator.rs @@ -0,0 +1,138 @@ +use anyhow::Context; +use kestrel::WaitCondition; +use movement_aptos_core::{runtime, MovementAptos}; +use mtma_node_types::executor::MovementAptosNode; +use mtma_types::movement_aptos::aptos_config::config::NodeConfig; +use mtma_types::movement_aptos::aptos_rest_client::Client as MovementAptosRestClient; +use mtma_types::movement_aptos::aptos_rest_client::FaucetClient as MovementAptosFaucetClient; + +/// An enum supporting different types of runners. +/// +/// NOTE: we're starting with just the core runner that has to be embedded. +/// This would expand to include tracking an existing runner. But, in that case, the state files must still be accessible to use derive the executor. +#[derive(Clone)] +pub enum Runner { + /// [MovementAptos] runner. + MovementAptos(MovementAptos), +} + +/// The [MovementAptos] migration struct as would be presented in the criterion. +/// +/// This has all of the controls that the a migration implementer should expect to have access to. +#[derive(Clone)] +pub struct MovementAptosMigrator { + runner: Runner, +} + +impl MovementAptosMigrator { + pub fn new(runner: Runner) -> Self { + Self { runner } + } + + /// Runs the migrator. + pub async fn run(&self) -> Result<(), anyhow::Error> { + match &self.runner { + Runner::MovementAptos(movement_aptos) => Ok(movement_aptos.run().await?), + } + } + + /// Builds a [MovementAptosMigrator] from a [NodeConfig]. + pub fn try_from_config(config: NodeConfig) -> Result { + let movement_aptos = MovementAptos::try_from_config(config, None)?; + let runner = Runner::MovementAptos(movement_aptos); + Ok(Self::new(runner)) + } + + /// Builds a [MovementAptosMigrator] from a [MovementAptosNode]. + pub fn from_movement_aptos_node(node: MovementAptosNode) -> Result { + // get the config from the node + let config = node.node_config()?; + Ok(Self::try_from_config(config)?) + } + + /// Rest Api url for the runner. + pub async fn wait_for_rest_api_url( + &self, + condition: impl Into, + ) -> Result { + match &self.runner { + Runner::MovementAptos(movement_aptos) => { + let rest_api = movement_aptos + .rest_api() + .read() + .wait_for(condition) + .await + .context("failed to wait for Movement Aptos rest api")?; + Ok(rest_api.listen_url().to_string()) + } + } + } + + /// Faucet Api url for the runner. + pub async fn wait_for_faucet_api_url( + &self, + condition: impl Into, + ) -> Result { + match &self.runner { + Runner::MovementAptos(movement_aptos) => { + let faucet_api = movement_aptos + .faucet_api() + .read() + .wait_for(condition) + .await + .context("failed to wait for Movement Aptos faucet api")?; + Ok(faucet_api.listen_url().to_string()) + } + } + } + + /// Waits for the rest client to be ready. + pub async fn wait_for_rest_client_ready( + &self, + condition: impl Into, + ) -> Result { + let rest_api_url = self.wait_for_rest_api_url(condition).await?; + let rest_client = + MovementAptosRestClient::new(rest_api_url.parse().map_err(|e| { + anyhow::anyhow!("failed to parse Movement Aptos rest api url: {}", e) + })?); + Ok(rest_client) + } + /// Waits for the rest faucet client to be ready. + pub async fn wait_for_faucet_client_ready( + &self, + condition: impl Into + Clone, + ) -> Result { + let rest_api_url = self.wait_for_rest_api_url(condition.clone()).await?.parse().map_err(|e| { + anyhow::anyhow!("failed to parse Movement Aptos rest api url: {}", e) + })?; + let faucet_api_url = self.wait_for_faucet_api_url(condition).await?.parse().map_err(|e| { + anyhow::anyhow!("failed to parse Movement Aptos faucet api url: {}", e) + })?; + let faucet_client = + MovementAptosFaucetClient::new(rest_api_url, faucet_api_url); + Ok(faucet_client) + } + + /// Gets a [MovementAptosNode] from the runner. + pub async fn node(&self) -> Result { + todo!() + } + +} + +impl TryFrom for MovementAptosMigrator { + type Error = anyhow::Error; + + fn try_from(config: NodeConfig) -> Result { + Ok(Self::try_from_config(config)?) + } +} + +impl TryFrom for MovementAptosMigrator { + type Error = anyhow::Error; + + fn try_from(node: MovementAptosNode) -> Result { + Ok(Self::from_movement_aptos_node(node)?) + } +} diff --git a/environments/util/environment-types/src/migrator/movement_migrator.rs b/environments/util/environment-types/src/migrator/movement_migrator.rs new file mode 100644 index 0000000..e460dbc --- /dev/null +++ b/environments/util/environment-types/src/migrator/movement_migrator.rs @@ -0,0 +1,106 @@ +use anyhow::Context; +use kestrel::WaitCondition; +use movement_core::Movement; +pub use movement_core::{Overlay, Overlays}; +use mtma_node_types::executor::MovementNode; +pub use mtma_types::movement::aptos_types::{chain_id::ChainId, state_store::TStateView}; +use mtma_types::movement::movement_client::rest_client::Client as MovementRestClient; + +/// An enum supporting different types of runners. +/// +/// NOTE: we're starting with just the core runner that has to be embedded. +/// This would expand to include tracking an existing runner. But, in that case, the state files must still be accessible to use derive the executor. +#[derive(Clone)] +pub enum Runner { + /// [Movement] runner. + Movement(Movement), +} + +/// The Movement migration struct as would be presented in the criterion. +/// +/// This has all the controls that a migration implementer should expect to have access to. +#[derive(Clone)] +pub struct MovementMigrator { + /// The Movement e2e runner + runner: Runner, +} + +impl MovementMigrator { + /// Creates a new [MovementMigrator] with the given runner. + pub fn new(runner: Runner) -> Self { + Self { runner } + } + + /// Runs the migrator. + pub async fn run(&self) -> Result<(), anyhow::Error> { + match &self.runner { + Runner::Movement(movement) => Ok(movement.run().await?), + } + } + + /// Creates a new [MovementMigrator] with temp [Movement] runner. + pub fn try_temp() -> Result { + let movement = Movement::try_temp()?; + Ok(Self::new(Runner::Movement(movement))) + } + + /// Creates a new [MovementMigrator] with debug [Movement] runner. + pub fn try_debug() -> Result { + let movement = Movement::try_debug()?; + Ok(Self::new(Runner::Movement(movement))) + } + + /// Create a new [MovementMigrator] with a debug_home [Movement] runner. + pub fn try_debug_home() -> Result { + let movement = Movement::try_debug_home()?; + Ok(Self::new(Runner::Movement(movement))) + } + + /// Rest Api url for the runner. + pub async fn wait_for_rest_api_url( + &self, + condition: impl Into, + ) -> Result { + match &self.runner { + Runner::Movement(movement) => { + let rest_api = movement + .rest_api() + .read() + .wait_for(condition) + .await + .context("failed to wait for Movement rest api")?; + Ok(rest_api.listen_url().to_string()) + } + } + } + + /// Waits for the rest client to be ready. + pub async fn wait_for_rest_client_ready( + &self, + condition: impl Into, + ) -> Result { + let rest_api_url = self.wait_for_rest_api_url(condition).await?; + let rest_client = MovementRestClient::new( + rest_api_url + .parse() + .map_err(|e| anyhow::anyhow!("failed to parse Movement rest api url: {}", e))?, + ); + Ok(rest_client) + } + + /// Produces the [MovementNode] from the runner. + pub async fn node(&self) -> Result { + match &self.runner { + Runner::Movement(movement) => { + MovementNode::try_from_dir(movement.workspace_path().to_path_buf()).await + } + } + } + + /// Sets the overlays for the runner. + pub fn set_overlays(&mut self, overlays: Overlays) { + match &mut self.runner { + Runner::Movement(movement) => movement.set_overlays(overlays), + } + } +} From f6ed894ca916256934d4162367516a63106c9133 Mon Sep 17 00:00:00 2001 From: Liam Makena Monninger Date: Thu, 12 Jun 2025 13:29:54 +0800 Subject: [PATCH 2/7] feat: testing environment. --- Cargo.lock | 23 +-- Cargo.toml | 8 + environments/core/testing/Cargo.toml | 2 + .../src/{migrate.rs => environment.rs} | 4 +- .../core/testing/src/environment/config.rs | 28 ++++ .../testing/src/environment/environment.rs | 58 ++++++++ environments/core/testing/src/lib.rs | 4 +- .../core/testing/src/migrate/config.rs | 103 ------------- .../core/testing/src/migrate/migrate.rs | 84 ----------- .../util/environment-types/Cargo.toml | 33 ----- .../util/environment-types/src/lib.rs | 2 - .../util/environment-types/src/migration.rs | 75 ---------- .../util/environment-types/src/migrator.rs | 5 - .../src/migrator/movement_aptos_migrator.rs | 138 ------------------ .../src/migrator/movement_migrator.rs | 106 -------------- environments/util/types/Cargo.toml | 17 +++ .../{environment-types => types}/README.md | 0 environments/util/types/src/environment.rs | 18 +++ environments/util/types/src/lib.rs | 2 + migration/cli/migrate-node/Cargo.toml | 3 + migration/cli/migrate-node/docs/cli/README.md | 11 +- .../migrate-node/src/cli/migrate/select.rs | 20 ++- 22 files changed, 171 insertions(+), 573 deletions(-) rename environments/core/testing/src/{migrate.rs => environment.rs} (76%) create mode 100644 environments/core/testing/src/environment/config.rs create mode 100644 environments/core/testing/src/environment/environment.rs delete mode 100644 environments/core/testing/src/migrate/config.rs delete mode 100644 environments/core/testing/src/migrate/migrate.rs delete mode 100644 environments/util/environment-types/Cargo.toml delete mode 100644 environments/util/environment-types/src/lib.rs delete mode 100644 environments/util/environment-types/src/migration.rs delete mode 100644 environments/util/environment-types/src/migrator.rs delete mode 100644 environments/util/environment-types/src/migrator/movement_aptos_migrator.rs delete mode 100644 environments/util/environment-types/src/migrator/movement_migrator.rs create mode 100644 environments/util/types/Cargo.toml rename environments/util/{environment-types => types}/README.md (100%) create mode 100644 environments/util/types/src/environment.rs create mode 100644 environments/util/types/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 842dd84..9009e38 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -15608,24 +15608,8 @@ name = "mtma-environment-types" version = "0.0.1" dependencies = [ "anyhow", - "aptos-config 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-executor 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-rest-client 0.0.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-storage-interface 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-types 0.0.3 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-vm 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "either", - "hex", - "kestrel", - "maptos-opt-executor", - "movement-aptos-core", - "movement-client", - "movement-core", - "mtma-node-types", - "mtma-types", - "serde", + "mtma-migrator-types", "thiserror 1.0.69", - "tracing", ] [[package]] @@ -15774,12 +15758,15 @@ dependencies = [ "maptos-execution-util", "movement-syncing", "mtma-core", + "mtma-environment-types", + "mtma-migrator-types", "mtma-node-null-core", "mtma-node-preludes", "mtma-node-test-global-storage-includes-criterion", "mtma-node-test-global-storage-injective-criterion", "mtma-node-test-global-storage-not-empty-criterion", "mtma-node-test-types", + "mtma-testing-environment", "orfile", "rand 0.7.3", "serde", @@ -16297,9 +16284,11 @@ dependencies = [ "clap-markdown-ext", "dotenv", "hex", + "kestrel", "movement-core", "movement-signer", "movement-signer-loader", + "mtma-environment-types", "mtma-migrator-types", "mtma-node-null-core", "mtma-node-types", diff --git a/Cargo.toml b/Cargo.toml index 243303c..5820293 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -216,6 +216,14 @@ movement-aptos-core = { path = "util/movement-aptos/core" } movement-aptos-core-util = { path = "util/movement-aptos/core-util" } mtma-types = { path = "util/types" } +## Environments +### util +mtma-environment-types = { path = "environments/util/types" } +### core +mtma-testing-environment = { path = "environments/core/testing" } +mtma-provisioner-environment = { path = "environments/core/provisioner" } +mtma-box-environment = { path = "environments/box/provisioner" } + [workspace.lints.clippy] debug_assert_with_mut_call = "deny" inefficient_to_string = "deny" diff --git a/environments/core/testing/Cargo.toml b/environments/core/testing/Cargo.toml index 331cc5c..8d17a4e 100644 --- a/environments/core/testing/Cargo.toml +++ b/environments/core/testing/Cargo.toml @@ -35,6 +35,8 @@ movement-signer-loader = { workspace = true } hex = { workspace = true } mtma-types = { workspace = true } movement-core = { workspace = true } +mtma-environment-types = { workspace = true } +kestrel = { workspace = true } [lints] workspace = true diff --git a/environments/core/testing/src/migrate.rs b/environments/core/testing/src/environment.rs similarity index 76% rename from environments/core/testing/src/migrate.rs rename to environments/core/testing/src/environment.rs index 2ca301e..689e33f 100644 --- a/environments/core/testing/src/migrate.rs +++ b/environments/core/testing/src/environment.rs @@ -1,7 +1,7 @@ /// Contains the configuration structs and logic for the migration. pub mod config; /// Contains the logic for the migration. -pub mod migrate; +pub mod environment; pub use config::*; -pub use migrate::*; +pub use environment::*; diff --git a/environments/core/testing/src/environment/config.rs b/environments/core/testing/src/environment/config.rs new file mode 100644 index 0000000..bd7bc63 --- /dev/null +++ b/environments/core/testing/src/environment/config.rs @@ -0,0 +1,28 @@ +use crate::TestingEnvironment; +use clap::Parser; +use serde::{Deserialize, Serialize}; +use std::fmt::Debug; + +/// Errors thrown when working with the [Config]. +#[derive(Debug, thiserror::Error)] +pub enum EnvironmentConfigError { + #[error("failed to build from config: {0}")] + Build(#[source] Box), +} + +/// The config for the [TestingEnvironment]. +/// +/// All fields should be easily statically encodable to a CLI argument. +/// This is the frontend for the core API. +#[derive(Parser, Debug, Serialize, Deserialize, Clone, Default)] +#[clap(help_expected = true)] +pub struct Config {} + +impl Config { + /// Builds the [TestingEnvironment] struct from the config. + /// + /// Note: preserving faillibility here because we may add debug path configuration to the [TestingEnvironment] soon. + pub fn build(&self) -> Result { + Ok(TestingEnvironment::new()) + } +} diff --git a/environments/core/testing/src/environment/environment.rs b/environments/core/testing/src/environment/environment.rs new file mode 100644 index 0000000..12de11f --- /dev/null +++ b/environments/core/testing/src/environment/environment.rs @@ -0,0 +1,58 @@ +use anyhow::Context; +use movement_core::Overlays; +use mtma_environment_types::{EnvironmentError, Environmentish}; +use mtma_migrator_types::migrator::MovementMigrator; +use std::fmt::Debug; + +/// Errors thrown when using the [TestingEnvironment]. +#[derive(Debug, thiserror::Error)] +pub enum TestingEnvironmentError { + #[error("Testing Environment: failed with an internal error: {0}")] + Internal(#[source] Box), +} + +impl From for EnvironmentError { + fn from(e: TestingEnvironmentError) -> Self { + EnvironmentError::Internal(e.into()) + } +} + +pub struct TestingEnvironment {} + +impl TestingEnvironment { + pub fn new() -> Self { + Self {} + } +} + +impl Environmentish for TestingEnvironment { + async fn build_movement_migrator(&self) -> Result { + // Form the migrator. + let mut movement_migrator = MovementMigrator::try_temp() + .map_err(|e| TestingEnvironmentError::Internal(e.into()))?; + movement_migrator.set_overlays(Overlays::default()); + + // Start the migrator so that it's running in the background. + // In the future, some migrators may be for already running nodes. + let movement_migrator_for_task = movement_migrator.clone(); + let movement_migrator_task = kestrel::task(async move { + movement_migrator_for_task.run().await?; + Ok::<_, anyhow::Error>(()) + }); + + // wait for the rest client to be ready + // once we have this, there should also be a config, so we can then kill off the migrator and proceed + movement_migrator + .wait_for_rest_client_ready(tokio::time::Duration::from_secs(600)) // we wait for up to ten minutes because the nix flake in .vendors/movementcan be a bit slow the first time + .await + .context( + "failed to wait for movement migrator rest client while running accounts equal manual prelude", + ).map_err(|e| TestingEnvironmentError::Internal(e.into()))?; + + kestrel::end!(movement_migrator_task) + .context("failed to end movement migrator task") + .map_err(|e| TestingEnvironmentError::Internal(e.into()))?; + + Ok(movement_migrator) + } +} diff --git a/environments/core/testing/src/lib.rs b/environments/core/testing/src/lib.rs index 302fca8..729b68c 100644 --- a/environments/core/testing/src/lib.rs +++ b/environments/core/testing/src/lib.rs @@ -1,2 +1,2 @@ -pub mod migrate; -pub use migrate::*; +pub mod environment; +pub use environment::*; diff --git a/environments/core/testing/src/migrate/config.rs b/environments/core/testing/src/migrate/config.rs deleted file mode 100644 index 1b24597..0000000 --- a/environments/core/testing/src/migrate/config.rs +++ /dev/null @@ -1,103 +0,0 @@ -use crate::Migrate; -use anyhow::Context; -use aptos_framework_pre_l1_merge_release::maptos_framework_release_util::{ - LocalAccountReleaseSigner, OverrideAccountAddressReleaseSigner, -}; -use clap::Parser; -use movement_core::{ - movement::{Celestia, Eth}, - Config as MovementCoreConfig, -}; -use mtma_node_null_core::Config as MtmaNodeNullConfig; -use mtma_types::movement::aptos_sdk::types::{ - account_address::AccountAddress, account_config::aptos_test_root_address, LocalAccount, -}; -use mtma_types::movement::movement_config::Config as MovementConfig; -use serde::{Deserialize, Serialize}; -use std::fmt::Debug; - -/// Errors thrown when working with the [Config]. -#[derive(Debug, thiserror::Error)] -pub enum MigrateConfigError { - #[error("failed to build from config: {0}")] - Build(#[source] Box), -} - -/// The config for the migration. -/// -/// All fields should be easily statically encodable to a CLI argument. -/// This is the frontend for the core API. -#[derive(Parser, Debug, Serialize, Deserialize, Clone)] -#[clap(help_expected = true)] -pub struct Config { - /// The config for the mtma-node-null. - #[clap(flatten)] - mtma_node_null: MtmaNodeNullConfig, - /// The movement config. - #[clap(flatten)] - movement_core: MovementCoreConfig, - /// The account address override for the release signer. - #[clap(long)] - pub account_address: Option, -} - -impl Default for Config { - fn default() -> Self { - let mut movement_core = MovementCoreConfig { - movement_config_string: None, - setup: false, - celestia: Celestia::Local, - eth: Eth::Local, - biarritz_rc1_to_pre_l1_merge: false, - ping_rest_api: false, - ping_faucet: false, - }; - - // Create a default MovementConfig - let movement_config = MovementConfig::default(); - - // Hard-code the core resources address - let account_address = Some(aptos_test_root_address()); - - // Set the movement config - movement_core.set_movement_config(movement_config); - - Self { mtma_node_null: MtmaNodeNullConfig::default(), movement_core, account_address } - } -} - -impl Config { - /// Builds the release signer from the config. - pub fn build_release_signer(&self) -> Result { - // load the signer - let raw_private_key = self - .movement_core - .try_movement_signer_identifier() - .map_err(|e| MigrateConfigError::Build(e.into()))? - .try_raw_private_key() - .context("failed to load raw private key") - .map_err(|e| MigrateConfigError::Build(e.into()))?; - - // get the raw private key - let private_key_hex = hex::encode(raw_private_key); - let root_account = LocalAccount::from_private_key(private_key_hex.as_str(), 0) - .context("failed to build root account") - .map_err(|e| MigrateConfigError::Build(e.into()))?; // sequence number 0 is fine because the release API loads sequence numbers - - Ok(LocalAccountReleaseSigner::new(root_account, None)) - } - - /// Builds the [Migrate] struct from the config. - pub fn build( - &self, - ) -> Result< - Migrate>, - MigrateConfigError, - > { - let mtma_node_null = - self.mtma_node_null.build().map_err(|e| MigrateConfigError::Build(e.into()))?; - let local_signer = self.build_release_signer()?; - let signer = OverrideAccountAddressReleaseSigner::core_resource_account(local_signer); - Ok(Migrate { release_signer: signer, mtma_node_null }) - } -} diff --git a/environments/core/testing/src/migrate/migrate.rs b/environments/core/testing/src/migrate/migrate.rs deleted file mode 100644 index e701d3c..0000000 --- a/environments/core/testing/src/migrate/migrate.rs +++ /dev/null @@ -1,84 +0,0 @@ -use aptos_framework_pre_l1_merge_release::{ - cached::full::feature_upgrade::PreL1Merge, - maptos_framework_release_util::{Release, ReleaseSigner}, -}; -use mtma_migrator_types::migration::{MigrationError, Migrationish}; -use mtma_migrator_types::migrator::{ - movement_aptos_migrator::MovementAptosMigrator, movement_migrator::MovementMigrator, -}; -use mtma_node_null_core::Migrate as MtmaNodeNullMigrate; - -use anyhow::Context; -use std::fmt::Debug; - -/// Errors thrown during the migration. -#[derive(Debug, thiserror::Error)] -pub enum MigrateError { - #[error("failed to migrate with pre-l1-merge: {0}")] - Migrate(#[source] Box), -} - -/// The migration struct will be use to run a migration from Movement -pub struct Migrate -where - S: ReleaseSigner + Send + Sync + 'static, -{ - pub(crate) release_signer: S, - pub(crate) mtma_node_null: MtmaNodeNullMigrate, -} - -impl Migrate -where - S: ReleaseSigner + Send + Sync + 'static, -{ - pub fn new(release_signer: S, mtma_node_null: MtmaNodeNullMigrate) -> Self { - Self { release_signer, mtma_node_null } - } - - pub fn release_signer(&self) -> &S { - &self.release_signer - } - - pub fn mtma_node_null(&self) -> &MtmaNodeNullMigrate { - &self.mtma_node_null - } -} - -impl Migrationish for Migrate -where - S: ReleaseSigner + Send + Sync + 'static, -{ - async fn migrate( - &self, - movement_migrator: &MovementMigrator, - ) -> Result { - // wait for the rest client to be ready - let rest_client = movement_migrator - .wait_for_rest_client_ready(tokio::time::Duration::from_secs(300)) - .await - .context("failed to wait for rest client to be ready") - .map_err(|e| MigrationError::Internal(e.into()))?; - - // build the pre-l1-merge - let pre_l1_merge = PreL1Merge::new(); - - // Run the release - pre_l1_merge - .release(self.release_signer(), 2_000_000, 100, 60, &rest_client) - .await - .context("failed to release with pre-l1-merge") - .map_err(|e| MigrationError::Internal(e.into()))?; - - // migrate with `mtma-node-null` - // NOTE: we're using the blanket implementation to upcast from a node migration to a migrator migration - let movement_aptos_migrator = self - .mtma_node_null - .migrate(movement_migrator) - .await - .context("failed to migrate node with mtma-node-null") - .map_err(|e| MigrationError::Internal(e.into()))?; - - // return the movement aptos migrator - Ok(movement_aptos_migrator) - } -} diff --git a/environments/util/environment-types/Cargo.toml b/environments/util/environment-types/Cargo.toml deleted file mode 100644 index b8bca6e..0000000 --- a/environments/util/environment-types/Cargo.toml +++ /dev/null @@ -1,33 +0,0 @@ -[package] -name = "mtma-environment-types" -version = { workspace = true } -edition = { workspace = true } -license = { workspace = true } -authors = { workspace = true } -homepage = { workspace = true } -publish = { workspace = true } -rust-version = { workspace = true } - -[dependencies] -mtma-node-types = { workspace = true } -serde = { workspace = true } -anyhow = { workspace = true } -hex = { workspace = true } -maptos-opt-executor = { workspace = true } -aptos-executor = { workspace = true } -aptos-vm = { workspace = true } -aptos-types = { workspace = true } -thiserror = { workspace = true } -aptos-storage-interface = { workspace = true } -either = { workspace = true } -tracing = { workspace = true } -movement-core = { workspace = true } -movement-aptos-core = { workspace = true } -kestrel = { workspace = true } -movement-client = { workspace = true } -aptos-rest-client = { workspace = true } -aptos-config = { workspace = true } -mtma-types = { workspace = true } - -[lints] -workspace = true diff --git a/environments/util/environment-types/src/lib.rs b/environments/util/environment-types/src/lib.rs deleted file mode 100644 index f4ab07b..0000000 --- a/environments/util/environment-types/src/lib.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod migration; -pub mod migrator; diff --git a/environments/util/environment-types/src/migration.rs b/environments/util/environment-types/src/migration.rs deleted file mode 100644 index b32d83f..0000000 --- a/environments/util/environment-types/src/migration.rs +++ /dev/null @@ -1,75 +0,0 @@ -pub use crate::migrator::movement_aptos_migrator; -pub use crate::migrator::movement_migrator; - -pub use crate::migrator::movement_aptos_migrator::{ - MovementAptosMigrator, Runner as MovementAptosRunner, -}; -pub use crate::migrator::movement_migrator::MovementMigrator; -use std::future::Future; - -use mtma_node_types::migration::Migrationish as NodeMigrationish; - -/// Errors thrown when working with the [Config]. -#[derive(Debug, thiserror::Error)] -pub enum MigrationError { - #[error("failed to build from config: {0}")] - Unsatisfied(#[source] Box), - #[error("internal error: {0}")] - Internal(#[source] Box), -} - -pub trait Migrationish { - /// Whether the criterion is satisfied by the given movement and movement_aptos executors. - fn migrate( - &self, - movement_migrator: &MovementMigrator, - ) -> impl Future>; -} - -/// The criterion type simply -pub struct Migration(T) -where - T: Migrationish; - -impl Migration -where - T: Migrationish, -{ - pub fn new(t: T) -> Self { - Self(t) - } - - /// Runs the migration. - pub async fn migrate( - &self, - movement_executor: &MovementMigrator, - ) -> Result { - self.0.migrate(movement_executor).await - } -} - -impl Migrationish for T -where - T: NodeMigrationish, -{ - async fn migrate( - &self, - movement_executor: &MovementMigrator, - ) -> Result { - let executor = - movement_executor.node().await.map_err(|e| MigrationError::Internal(e.into()))?; - let movement_aptos_executor = NodeMigrationish::migrate(self, &executor) - .await - .map_err(|e| MigrationError::Internal(e.into()))?; - let movement_aptos = movement_aptos_executor - .test_movement_aptos_config() - .map_err(|e| MigrationError::Internal(e.into()))? - .build() - .map_err(|e| MigrationError::Internal(e.into()))?; - - let movement_aptos_migrator = - MovementAptosMigrator::new(MovementAptosRunner::MovementAptos(movement_aptos)); - - Ok(movement_aptos_migrator) - } -} diff --git a/environments/util/environment-types/src/migrator.rs b/environments/util/environment-types/src/migrator.rs deleted file mode 100644 index cf31069..0000000 --- a/environments/util/environment-types/src/migrator.rs +++ /dev/null @@ -1,5 +0,0 @@ -pub mod movement_aptos_migrator; -pub mod movement_migrator; - -pub use movement_aptos_migrator::MovementAptosMigrator; -pub use movement_migrator::MovementMigrator; diff --git a/environments/util/environment-types/src/migrator/movement_aptos_migrator.rs b/environments/util/environment-types/src/migrator/movement_aptos_migrator.rs deleted file mode 100644 index ef96e1f..0000000 --- a/environments/util/environment-types/src/migrator/movement_aptos_migrator.rs +++ /dev/null @@ -1,138 +0,0 @@ -use anyhow::Context; -use kestrel::WaitCondition; -use movement_aptos_core::{runtime, MovementAptos}; -use mtma_node_types::executor::MovementAptosNode; -use mtma_types::movement_aptos::aptos_config::config::NodeConfig; -use mtma_types::movement_aptos::aptos_rest_client::Client as MovementAptosRestClient; -use mtma_types::movement_aptos::aptos_rest_client::FaucetClient as MovementAptosFaucetClient; - -/// An enum supporting different types of runners. -/// -/// NOTE: we're starting with just the core runner that has to be embedded. -/// This would expand to include tracking an existing runner. But, in that case, the state files must still be accessible to use derive the executor. -#[derive(Clone)] -pub enum Runner { - /// [MovementAptos] runner. - MovementAptos(MovementAptos), -} - -/// The [MovementAptos] migration struct as would be presented in the criterion. -/// -/// This has all of the controls that the a migration implementer should expect to have access to. -#[derive(Clone)] -pub struct MovementAptosMigrator { - runner: Runner, -} - -impl MovementAptosMigrator { - pub fn new(runner: Runner) -> Self { - Self { runner } - } - - /// Runs the migrator. - pub async fn run(&self) -> Result<(), anyhow::Error> { - match &self.runner { - Runner::MovementAptos(movement_aptos) => Ok(movement_aptos.run().await?), - } - } - - /// Builds a [MovementAptosMigrator] from a [NodeConfig]. - pub fn try_from_config(config: NodeConfig) -> Result { - let movement_aptos = MovementAptos::try_from_config(config, None)?; - let runner = Runner::MovementAptos(movement_aptos); - Ok(Self::new(runner)) - } - - /// Builds a [MovementAptosMigrator] from a [MovementAptosNode]. - pub fn from_movement_aptos_node(node: MovementAptosNode) -> Result { - // get the config from the node - let config = node.node_config()?; - Ok(Self::try_from_config(config)?) - } - - /// Rest Api url for the runner. - pub async fn wait_for_rest_api_url( - &self, - condition: impl Into, - ) -> Result { - match &self.runner { - Runner::MovementAptos(movement_aptos) => { - let rest_api = movement_aptos - .rest_api() - .read() - .wait_for(condition) - .await - .context("failed to wait for Movement Aptos rest api")?; - Ok(rest_api.listen_url().to_string()) - } - } - } - - /// Faucet Api url for the runner. - pub async fn wait_for_faucet_api_url( - &self, - condition: impl Into, - ) -> Result { - match &self.runner { - Runner::MovementAptos(movement_aptos) => { - let faucet_api = movement_aptos - .faucet_api() - .read() - .wait_for(condition) - .await - .context("failed to wait for Movement Aptos faucet api")?; - Ok(faucet_api.listen_url().to_string()) - } - } - } - - /// Waits for the rest client to be ready. - pub async fn wait_for_rest_client_ready( - &self, - condition: impl Into, - ) -> Result { - let rest_api_url = self.wait_for_rest_api_url(condition).await?; - let rest_client = - MovementAptosRestClient::new(rest_api_url.parse().map_err(|e| { - anyhow::anyhow!("failed to parse Movement Aptos rest api url: {}", e) - })?); - Ok(rest_client) - } - /// Waits for the rest faucet client to be ready. - pub async fn wait_for_faucet_client_ready( - &self, - condition: impl Into + Clone, - ) -> Result { - let rest_api_url = self.wait_for_rest_api_url(condition.clone()).await?.parse().map_err(|e| { - anyhow::anyhow!("failed to parse Movement Aptos rest api url: {}", e) - })?; - let faucet_api_url = self.wait_for_faucet_api_url(condition).await?.parse().map_err(|e| { - anyhow::anyhow!("failed to parse Movement Aptos faucet api url: {}", e) - })?; - let faucet_client = - MovementAptosFaucetClient::new(rest_api_url, faucet_api_url); - Ok(faucet_client) - } - - /// Gets a [MovementAptosNode] from the runner. - pub async fn node(&self) -> Result { - todo!() - } - -} - -impl TryFrom for MovementAptosMigrator { - type Error = anyhow::Error; - - fn try_from(config: NodeConfig) -> Result { - Ok(Self::try_from_config(config)?) - } -} - -impl TryFrom for MovementAptosMigrator { - type Error = anyhow::Error; - - fn try_from(node: MovementAptosNode) -> Result { - Ok(Self::from_movement_aptos_node(node)?) - } -} diff --git a/environments/util/environment-types/src/migrator/movement_migrator.rs b/environments/util/environment-types/src/migrator/movement_migrator.rs deleted file mode 100644 index e460dbc..0000000 --- a/environments/util/environment-types/src/migrator/movement_migrator.rs +++ /dev/null @@ -1,106 +0,0 @@ -use anyhow::Context; -use kestrel::WaitCondition; -use movement_core::Movement; -pub use movement_core::{Overlay, Overlays}; -use mtma_node_types::executor::MovementNode; -pub use mtma_types::movement::aptos_types::{chain_id::ChainId, state_store::TStateView}; -use mtma_types::movement::movement_client::rest_client::Client as MovementRestClient; - -/// An enum supporting different types of runners. -/// -/// NOTE: we're starting with just the core runner that has to be embedded. -/// This would expand to include tracking an existing runner. But, in that case, the state files must still be accessible to use derive the executor. -#[derive(Clone)] -pub enum Runner { - /// [Movement] runner. - Movement(Movement), -} - -/// The Movement migration struct as would be presented in the criterion. -/// -/// This has all the controls that a migration implementer should expect to have access to. -#[derive(Clone)] -pub struct MovementMigrator { - /// The Movement e2e runner - runner: Runner, -} - -impl MovementMigrator { - /// Creates a new [MovementMigrator] with the given runner. - pub fn new(runner: Runner) -> Self { - Self { runner } - } - - /// Runs the migrator. - pub async fn run(&self) -> Result<(), anyhow::Error> { - match &self.runner { - Runner::Movement(movement) => Ok(movement.run().await?), - } - } - - /// Creates a new [MovementMigrator] with temp [Movement] runner. - pub fn try_temp() -> Result { - let movement = Movement::try_temp()?; - Ok(Self::new(Runner::Movement(movement))) - } - - /// Creates a new [MovementMigrator] with debug [Movement] runner. - pub fn try_debug() -> Result { - let movement = Movement::try_debug()?; - Ok(Self::new(Runner::Movement(movement))) - } - - /// Create a new [MovementMigrator] with a debug_home [Movement] runner. - pub fn try_debug_home() -> Result { - let movement = Movement::try_debug_home()?; - Ok(Self::new(Runner::Movement(movement))) - } - - /// Rest Api url for the runner. - pub async fn wait_for_rest_api_url( - &self, - condition: impl Into, - ) -> Result { - match &self.runner { - Runner::Movement(movement) => { - let rest_api = movement - .rest_api() - .read() - .wait_for(condition) - .await - .context("failed to wait for Movement rest api")?; - Ok(rest_api.listen_url().to_string()) - } - } - } - - /// Waits for the rest client to be ready. - pub async fn wait_for_rest_client_ready( - &self, - condition: impl Into, - ) -> Result { - let rest_api_url = self.wait_for_rest_api_url(condition).await?; - let rest_client = MovementRestClient::new( - rest_api_url - .parse() - .map_err(|e| anyhow::anyhow!("failed to parse Movement rest api url: {}", e))?, - ); - Ok(rest_client) - } - - /// Produces the [MovementNode] from the runner. - pub async fn node(&self) -> Result { - match &self.runner { - Runner::Movement(movement) => { - MovementNode::try_from_dir(movement.workspace_path().to_path_buf()).await - } - } - } - - /// Sets the overlays for the runner. - pub fn set_overlays(&mut self, overlays: Overlays) { - match &mut self.runner { - Runner::Movement(movement) => movement.set_overlays(overlays), - } - } -} diff --git a/environments/util/types/Cargo.toml b/environments/util/types/Cargo.toml new file mode 100644 index 0000000..5ae7780 --- /dev/null +++ b/environments/util/types/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "mtma-environment-types" +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +authors = { workspace = true } +homepage = { workspace = true } +publish = { workspace = true } +rust-version = { workspace = true } + +[dependencies] +mtma-migrator-types = { workspace = true } +anyhow = { workspace = true } +thiserror = { workspace = true } + +[lints] +workspace = true diff --git a/environments/util/environment-types/README.md b/environments/util/types/README.md similarity index 100% rename from environments/util/environment-types/README.md rename to environments/util/types/README.md diff --git a/environments/util/types/src/environment.rs b/environments/util/types/src/environment.rs new file mode 100644 index 0000000..cc58431 --- /dev/null +++ b/environments/util/types/src/environment.rs @@ -0,0 +1,18 @@ +use mtma_migrator_types::migrator::MovementMigrator; +use std::future::Future; + +/// Errors thrown when working with the [Config]. +#[derive(Debug, thiserror::Error)] +pub enum EnvironmentError { + #[error("failed to build from config: {0}")] + Unsatisfied(#[source] Box), + #[error("internal error: {0}")] + Internal(#[source] Box), +} + +pub trait Environmentish { + /// Whether the criterion is satisfied by the given movement and movement_aptos executors. + fn build_movement_migrator( + &self, + ) -> impl Future>; +} diff --git a/environments/util/types/src/lib.rs b/environments/util/types/src/lib.rs new file mode 100644 index 0000000..729b68c --- /dev/null +++ b/environments/util/types/src/lib.rs @@ -0,0 +1,2 @@ +pub mod environment; +pub use environment::*; diff --git a/migration/cli/migrate-node/Cargo.toml b/migration/cli/migrate-node/Cargo.toml index 394f605..046eaef 100644 --- a/migration/cli/migrate-node/Cargo.toml +++ b/migration/cli/migrate-node/Cargo.toml @@ -33,6 +33,9 @@ sysinfo = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true } slect = { workspace = true } +mtma-testing-environment = { workspace = true } +mtma-environment-types = { workspace = true } +mtma-migrator-types = { workspace = true } [lints] workspace = true diff --git a/migration/cli/migrate-node/docs/cli/README.md b/migration/cli/migrate-node/docs/cli/README.md index cc5447f..159e53e 100644 --- a/migration/cli/migrate-node/docs/cli/README.md +++ b/migration/cli/migrate-node/docs/cli/README.md @@ -124,9 +124,18 @@ Select migration over the node ###### **Options:** +* `--environment-testing` — Enable the environment-testing selection * `--null` — Enable the null selection -**Selection (1/1):** `null` +**Selection (1/2):** `environment-testing` +The config for the [TestingEnvironment] + +Usage: --environment-testing.* + +Options: + -h, --help Print help (see more with '--help') + +**Selection (2/2):** `null` The config for the migration Usage: --null.* diff --git a/migration/cli/migrate-node/src/cli/migrate/select.rs b/migration/cli/migrate-node/src/cli/migrate/select.rs index bafab57..73b275f 100644 --- a/migration/cli/migrate-node/src/cli/migrate/select.rs +++ b/migration/cli/migrate-node/src/cli/migrate/select.rs @@ -1,5 +1,9 @@ +use anyhow::Context; use clap::Parser; +use mtma_environment_types::Environmentish; +use mtma_migrator_types::migration::Migrationish; use mtma_node_null_core::Config as NullConfig; +use mtma_testing_environment::Config as TestingEnvironmentConfig; use serde::{Deserialize, Serialize}; use slect::Slect; @@ -8,19 +12,25 @@ use slect::Slect; #[clap(help_expected = true)] pub struct Select { /// Extra args to pass to slect API - #[slect(null = NullConfig)] + #[slect(environment_testing = TestingEnvironmentConfig, null = NullConfig)] extra_args: Vec, } impl select::Select { pub async fn execute(&self) -> Result<(), anyhow::Error> { - let maybe_null = self.select().map_err(|e| anyhow::anyhow!("{}", e))?; + let (maybe_environment_testing, maybe_null) = + self.select().map_err(|e| anyhow::anyhow!("{}", e))?; + + let environment_config = maybe_environment_testing.context( + "--environment-testing is the only supported environment; it must be provided", + )?; + + let movement_migrator = environment_config.build()?.build_movement_migrator().await?; if let Some(null) = maybe_null { - let _build = null.build()?; + let null_migration = null.build()?; - // needs an environment for the node to run. - // How we load this environment is in process of being abstraced. + null_migration.migrate(&movement_migrator).await?; } Ok(()) From 982d2bf829ace80f83a67237139973515edd1df3 Mon Sep 17 00:00:00 2001 From: Liam Makena Monninger Date: Thu, 12 Jun 2025 13:33:36 +0800 Subject: [PATCH 3/7] chore: structure box and provisioner environments. --- Cargo.lock | 4 + environments/core/box/Cargo.toml | 2 + .../box/src/{migrate.rs => environment.rs} | 4 +- .../core/box/src/environment/config.rs | 28 +++++ .../core/box/src/environment/environment.rs | 58 ++++++++++ environments/core/box/src/lib.rs | 4 +- environments/core/box/src/migrate/config.rs | 103 ------------------ environments/core/box/src/migrate/migrate.rs | 84 -------------- environments/core/provisioner/Cargo.toml | 2 + .../src/{migrate.rs => environment.rs} | 4 +- .../provisioner/src/environment/config.rs | 28 +++++ .../src/environment/environment.rs | 58 ++++++++++ environments/core/provisioner/src/lib.rs | 4 +- .../core/provisioner/src/migrate/config.rs | 103 ------------------ .../core/provisioner/src/migrate/migrate.rs | 84 -------------- 15 files changed, 188 insertions(+), 382 deletions(-) rename environments/core/box/src/{migrate.rs => environment.rs} (76%) create mode 100644 environments/core/box/src/environment/config.rs create mode 100644 environments/core/box/src/environment/environment.rs delete mode 100644 environments/core/box/src/migrate/config.rs delete mode 100644 environments/core/box/src/migrate/migrate.rs rename environments/core/provisioner/src/{migrate.rs => environment.rs} (76%) create mode 100644 environments/core/provisioner/src/environment/config.rs create mode 100644 environments/core/provisioner/src/environment/environment.rs delete mode 100644 environments/core/provisioner/src/migrate/config.rs delete mode 100644 environments/core/provisioner/src/migrate/migrate.rs diff --git a/Cargo.lock b/Cargo.lock index 9009e38..e301971 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -15480,9 +15480,11 @@ dependencies = [ "clap-markdown-ext", "dotenv", "hex", + "kestrel", "movement-core", "movement-signer", "movement-signer-loader", + "mtma-environment-types", "mtma-migrator-types", "mtma-node-null-core", "mtma-node-types", @@ -16252,9 +16254,11 @@ dependencies = [ "clap-markdown-ext", "dotenv", "hex", + "kestrel", "movement-core", "movement-signer", "movement-signer-loader", + "mtma-environment-types", "mtma-migrator-types", "mtma-node-null-core", "mtma-node-types", diff --git a/environments/core/box/Cargo.toml b/environments/core/box/Cargo.toml index edb5aef..fabf027 100644 --- a/environments/core/box/Cargo.toml +++ b/environments/core/box/Cargo.toml @@ -35,6 +35,8 @@ movement-signer-loader = { workspace = true } hex = { workspace = true } mtma-types = { workspace = true } movement-core = { workspace = true } +mtma-environment-types = { workspace = true } +kestrel = { workspace = true } [lints] workspace = true diff --git a/environments/core/box/src/migrate.rs b/environments/core/box/src/environment.rs similarity index 76% rename from environments/core/box/src/migrate.rs rename to environments/core/box/src/environment.rs index 2ca301e..689e33f 100644 --- a/environments/core/box/src/migrate.rs +++ b/environments/core/box/src/environment.rs @@ -1,7 +1,7 @@ /// Contains the configuration structs and logic for the migration. pub mod config; /// Contains the logic for the migration. -pub mod migrate; +pub mod environment; pub use config::*; -pub use migrate::*; +pub use environment::*; diff --git a/environments/core/box/src/environment/config.rs b/environments/core/box/src/environment/config.rs new file mode 100644 index 0000000..e383436 --- /dev/null +++ b/environments/core/box/src/environment/config.rs @@ -0,0 +1,28 @@ +use crate::BoxEnvironment; +use clap::Parser; +use serde::{Deserialize, Serialize}; +use std::fmt::Debug; + +/// Errors thrown when working with the [Config]. +#[derive(Debug, thiserror::Error)] +pub enum EnvironmentConfigError { + #[error("failed to build from config: {0}")] + Build(#[source] Box), +} + +/// The config for the [BoxEnvironment]. +/// +/// All fields should be easily statically encodable to a CLI argument. +/// This is the frontend for the core API. +#[derive(Parser, Debug, Serialize, Deserialize, Clone, Default)] +#[clap(help_expected = true)] +pub struct Config {} + +impl Config { + /// Builds the [BoxEnvironment] struct from the config. + /// + /// Note: preserving faillibility here because we may add debug path configuration to the [BoxEnvironment] soon. + pub fn build(&self) -> Result { + Ok(BoxEnvironment::new()) + } +} diff --git a/environments/core/box/src/environment/environment.rs b/environments/core/box/src/environment/environment.rs new file mode 100644 index 0000000..0e94f93 --- /dev/null +++ b/environments/core/box/src/environment/environment.rs @@ -0,0 +1,58 @@ +use anyhow::Context; +use movement_core::Overlays; +use mtma_environment_types::{EnvironmentError, Environmentish}; +use mtma_migrator_types::migrator::MovementMigrator; +use std::fmt::Debug; + +/// Errors thrown when using the [BoxEnvironment]. +#[derive(Debug, thiserror::Error)] +pub enum BoxEnvironmentError { + #[error("Testing Environment: failed with an internal error: {0}")] + Internal(#[source] Box), +} + +impl From for EnvironmentError { + fn from(e: BoxEnvironmentError) -> Self { + EnvironmentError::Internal(e.into()) + } +} + +pub struct BoxEnvironment {} + +impl BoxEnvironment { + pub fn new() -> Self { + Self {} + } +} + +impl Environmentish for BoxEnvironment { + async fn build_movement_migrator(&self) -> Result { + // Form the migrator. + let mut movement_migrator = + MovementMigrator::try_temp().map_err(|e| BoxEnvironmentError::Internal(e.into()))?; + movement_migrator.set_overlays(Overlays::default()); + + // Start the migrator so that it's running in the background. + // In the future, some migrators may be for already running nodes. + let movement_migrator_for_task = movement_migrator.clone(); + let movement_migrator_task = kestrel::task(async move { + movement_migrator_for_task.run().await?; + Ok::<_, anyhow::Error>(()) + }); + + // wait for the rest client to be ready + // once we have this, there should also be a config, so we can then kill off the migrator and proceed + movement_migrator + .wait_for_rest_client_ready(tokio::time::Duration::from_secs(600)) // we wait for up to ten minutes because the nix flake in .vendors/movementcan be a bit slow the first time + .await + .context( + "failed to wait for movement migrator rest client while running accounts equal manual prelude", + ).map_err(|e| BoxEnvironmentError::Internal(e.into()))?; + + kestrel::end!(movement_migrator_task) + .context("failed to end movement migrator task") + .map_err(|e| BoxEnvironmentError::Internal(e.into()))?; + + Ok(movement_migrator) + } +} diff --git a/environments/core/box/src/lib.rs b/environments/core/box/src/lib.rs index 302fca8..729b68c 100644 --- a/environments/core/box/src/lib.rs +++ b/environments/core/box/src/lib.rs @@ -1,2 +1,2 @@ -pub mod migrate; -pub use migrate::*; +pub mod environment; +pub use environment::*; diff --git a/environments/core/box/src/migrate/config.rs b/environments/core/box/src/migrate/config.rs deleted file mode 100644 index 1b24597..0000000 --- a/environments/core/box/src/migrate/config.rs +++ /dev/null @@ -1,103 +0,0 @@ -use crate::Migrate; -use anyhow::Context; -use aptos_framework_pre_l1_merge_release::maptos_framework_release_util::{ - LocalAccountReleaseSigner, OverrideAccountAddressReleaseSigner, -}; -use clap::Parser; -use movement_core::{ - movement::{Celestia, Eth}, - Config as MovementCoreConfig, -}; -use mtma_node_null_core::Config as MtmaNodeNullConfig; -use mtma_types::movement::aptos_sdk::types::{ - account_address::AccountAddress, account_config::aptos_test_root_address, LocalAccount, -}; -use mtma_types::movement::movement_config::Config as MovementConfig; -use serde::{Deserialize, Serialize}; -use std::fmt::Debug; - -/// Errors thrown when working with the [Config]. -#[derive(Debug, thiserror::Error)] -pub enum MigrateConfigError { - #[error("failed to build from config: {0}")] - Build(#[source] Box), -} - -/// The config for the migration. -/// -/// All fields should be easily statically encodable to a CLI argument. -/// This is the frontend for the core API. -#[derive(Parser, Debug, Serialize, Deserialize, Clone)] -#[clap(help_expected = true)] -pub struct Config { - /// The config for the mtma-node-null. - #[clap(flatten)] - mtma_node_null: MtmaNodeNullConfig, - /// The movement config. - #[clap(flatten)] - movement_core: MovementCoreConfig, - /// The account address override for the release signer. - #[clap(long)] - pub account_address: Option, -} - -impl Default for Config { - fn default() -> Self { - let mut movement_core = MovementCoreConfig { - movement_config_string: None, - setup: false, - celestia: Celestia::Local, - eth: Eth::Local, - biarritz_rc1_to_pre_l1_merge: false, - ping_rest_api: false, - ping_faucet: false, - }; - - // Create a default MovementConfig - let movement_config = MovementConfig::default(); - - // Hard-code the core resources address - let account_address = Some(aptos_test_root_address()); - - // Set the movement config - movement_core.set_movement_config(movement_config); - - Self { mtma_node_null: MtmaNodeNullConfig::default(), movement_core, account_address } - } -} - -impl Config { - /// Builds the release signer from the config. - pub fn build_release_signer(&self) -> Result { - // load the signer - let raw_private_key = self - .movement_core - .try_movement_signer_identifier() - .map_err(|e| MigrateConfigError::Build(e.into()))? - .try_raw_private_key() - .context("failed to load raw private key") - .map_err(|e| MigrateConfigError::Build(e.into()))?; - - // get the raw private key - let private_key_hex = hex::encode(raw_private_key); - let root_account = LocalAccount::from_private_key(private_key_hex.as_str(), 0) - .context("failed to build root account") - .map_err(|e| MigrateConfigError::Build(e.into()))?; // sequence number 0 is fine because the release API loads sequence numbers - - Ok(LocalAccountReleaseSigner::new(root_account, None)) - } - - /// Builds the [Migrate] struct from the config. - pub fn build( - &self, - ) -> Result< - Migrate>, - MigrateConfigError, - > { - let mtma_node_null = - self.mtma_node_null.build().map_err(|e| MigrateConfigError::Build(e.into()))?; - let local_signer = self.build_release_signer()?; - let signer = OverrideAccountAddressReleaseSigner::core_resource_account(local_signer); - Ok(Migrate { release_signer: signer, mtma_node_null }) - } -} diff --git a/environments/core/box/src/migrate/migrate.rs b/environments/core/box/src/migrate/migrate.rs deleted file mode 100644 index e701d3c..0000000 --- a/environments/core/box/src/migrate/migrate.rs +++ /dev/null @@ -1,84 +0,0 @@ -use aptos_framework_pre_l1_merge_release::{ - cached::full::feature_upgrade::PreL1Merge, - maptos_framework_release_util::{Release, ReleaseSigner}, -}; -use mtma_migrator_types::migration::{MigrationError, Migrationish}; -use mtma_migrator_types::migrator::{ - movement_aptos_migrator::MovementAptosMigrator, movement_migrator::MovementMigrator, -}; -use mtma_node_null_core::Migrate as MtmaNodeNullMigrate; - -use anyhow::Context; -use std::fmt::Debug; - -/// Errors thrown during the migration. -#[derive(Debug, thiserror::Error)] -pub enum MigrateError { - #[error("failed to migrate with pre-l1-merge: {0}")] - Migrate(#[source] Box), -} - -/// The migration struct will be use to run a migration from Movement -pub struct Migrate -where - S: ReleaseSigner + Send + Sync + 'static, -{ - pub(crate) release_signer: S, - pub(crate) mtma_node_null: MtmaNodeNullMigrate, -} - -impl Migrate -where - S: ReleaseSigner + Send + Sync + 'static, -{ - pub fn new(release_signer: S, mtma_node_null: MtmaNodeNullMigrate) -> Self { - Self { release_signer, mtma_node_null } - } - - pub fn release_signer(&self) -> &S { - &self.release_signer - } - - pub fn mtma_node_null(&self) -> &MtmaNodeNullMigrate { - &self.mtma_node_null - } -} - -impl Migrationish for Migrate -where - S: ReleaseSigner + Send + Sync + 'static, -{ - async fn migrate( - &self, - movement_migrator: &MovementMigrator, - ) -> Result { - // wait for the rest client to be ready - let rest_client = movement_migrator - .wait_for_rest_client_ready(tokio::time::Duration::from_secs(300)) - .await - .context("failed to wait for rest client to be ready") - .map_err(|e| MigrationError::Internal(e.into()))?; - - // build the pre-l1-merge - let pre_l1_merge = PreL1Merge::new(); - - // Run the release - pre_l1_merge - .release(self.release_signer(), 2_000_000, 100, 60, &rest_client) - .await - .context("failed to release with pre-l1-merge") - .map_err(|e| MigrationError::Internal(e.into()))?; - - // migrate with `mtma-node-null` - // NOTE: we're using the blanket implementation to upcast from a node migration to a migrator migration - let movement_aptos_migrator = self - .mtma_node_null - .migrate(movement_migrator) - .await - .context("failed to migrate node with mtma-node-null") - .map_err(|e| MigrationError::Internal(e.into()))?; - - // return the movement aptos migrator - Ok(movement_aptos_migrator) - } -} diff --git a/environments/core/provisioner/Cargo.toml b/environments/core/provisioner/Cargo.toml index 8c6e902..1898430 100644 --- a/environments/core/provisioner/Cargo.toml +++ b/environments/core/provisioner/Cargo.toml @@ -35,6 +35,8 @@ movement-signer-loader = { workspace = true } hex = { workspace = true } mtma-types = { workspace = true } movement-core = { workspace = true } +mtma-environment-types = { workspace = true } +kestrel = { workspace = true } [lints] workspace = true diff --git a/environments/core/provisioner/src/migrate.rs b/environments/core/provisioner/src/environment.rs similarity index 76% rename from environments/core/provisioner/src/migrate.rs rename to environments/core/provisioner/src/environment.rs index 2ca301e..689e33f 100644 --- a/environments/core/provisioner/src/migrate.rs +++ b/environments/core/provisioner/src/environment.rs @@ -1,7 +1,7 @@ /// Contains the configuration structs and logic for the migration. pub mod config; /// Contains the logic for the migration. -pub mod migrate; +pub mod environment; pub use config::*; -pub use migrate::*; +pub use environment::*; diff --git a/environments/core/provisioner/src/environment/config.rs b/environments/core/provisioner/src/environment/config.rs new file mode 100644 index 0000000..307f970 --- /dev/null +++ b/environments/core/provisioner/src/environment/config.rs @@ -0,0 +1,28 @@ +use crate::ProvisionerEnvironment; +use clap::Parser; +use serde::{Deserialize, Serialize}; +use std::fmt::Debug; + +/// Errors thrown when working with the [Config]. +#[derive(Debug, thiserror::Error)] +pub enum EnvironmentConfigError { + #[error("failed to build from config: {0}")] + Build(#[source] Box), +} + +/// The config for the [ProvisionerEnvironment]. +/// +/// All fields should be easily statically encodable to a CLI argument. +/// This is the frontend for the core API. +#[derive(Parser, Debug, Serialize, Deserialize, Clone, Default)] +#[clap(help_expected = true)] +pub struct Config {} + +impl Config { + /// Builds the [ProvisionerEnvironment] struct from the config. + /// + /// Note: preserving faillibility here because we may add debug path configuration to the [ProvisionerEnvironment] soon. + pub fn build(&self) -> Result { + Ok(ProvisionerEnvironment::new()) + } +} diff --git a/environments/core/provisioner/src/environment/environment.rs b/environments/core/provisioner/src/environment/environment.rs new file mode 100644 index 0000000..eeda88a --- /dev/null +++ b/environments/core/provisioner/src/environment/environment.rs @@ -0,0 +1,58 @@ +use anyhow::Context; +use movement_core::Overlays; +use mtma_environment_types::{EnvironmentError, Environmentish}; +use mtma_migrator_types::migrator::MovementMigrator; +use std::fmt::Debug; + +/// Errors thrown when using the [ProvisionerEnvironment]. +#[derive(Debug, thiserror::Error)] +pub enum ProvisionerEnvironmentError { + #[error("Testing Environment: failed with an internal error: {0}")] + Internal(#[source] Box), +} + +impl From for EnvironmentError { + fn from(e: ProvisionerEnvironmentError) -> Self { + EnvironmentError::Internal(e.into()) + } +} + +pub struct ProvisionerEnvironment {} + +impl ProvisionerEnvironment { + pub fn new() -> Self { + Self {} + } +} + +impl Environmentish for ProvisionerEnvironment { + async fn build_movement_migrator(&self) -> Result { + // Form the migrator. + let mut movement_migrator = MovementMigrator::try_temp() + .map_err(|e| ProvisionerEnvironmentError::Internal(e.into()))?; + movement_migrator.set_overlays(Overlays::default()); + + // Start the migrator so that it's running in the background. + // In the future, some migrators may be for already running nodes. + let movement_migrator_for_task = movement_migrator.clone(); + let movement_migrator_task = kestrel::task(async move { + movement_migrator_for_task.run().await?; + Ok::<_, anyhow::Error>(()) + }); + + // wait for the rest client to be ready + // once we have this, there should also be a config, so we can then kill off the migrator and proceed + movement_migrator + .wait_for_rest_client_ready(tokio::time::Duration::from_secs(600)) // we wait for up to ten minutes because the nix flake in .vendors/movementcan be a bit slow the first time + .await + .context( + "failed to wait for movement migrator rest client while running accounts equal manual prelude", + ).map_err(|e| ProvisionerEnvironmentError::Internal(e.into()))?; + + kestrel::end!(movement_migrator_task) + .context("failed to end movement migrator task") + .map_err(|e| ProvisionerEnvironmentError::Internal(e.into()))?; + + Ok(movement_migrator) + } +} diff --git a/environments/core/provisioner/src/lib.rs b/environments/core/provisioner/src/lib.rs index 302fca8..729b68c 100644 --- a/environments/core/provisioner/src/lib.rs +++ b/environments/core/provisioner/src/lib.rs @@ -1,2 +1,2 @@ -pub mod migrate; -pub use migrate::*; +pub mod environment; +pub use environment::*; diff --git a/environments/core/provisioner/src/migrate/config.rs b/environments/core/provisioner/src/migrate/config.rs deleted file mode 100644 index 1b24597..0000000 --- a/environments/core/provisioner/src/migrate/config.rs +++ /dev/null @@ -1,103 +0,0 @@ -use crate::Migrate; -use anyhow::Context; -use aptos_framework_pre_l1_merge_release::maptos_framework_release_util::{ - LocalAccountReleaseSigner, OverrideAccountAddressReleaseSigner, -}; -use clap::Parser; -use movement_core::{ - movement::{Celestia, Eth}, - Config as MovementCoreConfig, -}; -use mtma_node_null_core::Config as MtmaNodeNullConfig; -use mtma_types::movement::aptos_sdk::types::{ - account_address::AccountAddress, account_config::aptos_test_root_address, LocalAccount, -}; -use mtma_types::movement::movement_config::Config as MovementConfig; -use serde::{Deserialize, Serialize}; -use std::fmt::Debug; - -/// Errors thrown when working with the [Config]. -#[derive(Debug, thiserror::Error)] -pub enum MigrateConfigError { - #[error("failed to build from config: {0}")] - Build(#[source] Box), -} - -/// The config for the migration. -/// -/// All fields should be easily statically encodable to a CLI argument. -/// This is the frontend for the core API. -#[derive(Parser, Debug, Serialize, Deserialize, Clone)] -#[clap(help_expected = true)] -pub struct Config { - /// The config for the mtma-node-null. - #[clap(flatten)] - mtma_node_null: MtmaNodeNullConfig, - /// The movement config. - #[clap(flatten)] - movement_core: MovementCoreConfig, - /// The account address override for the release signer. - #[clap(long)] - pub account_address: Option, -} - -impl Default for Config { - fn default() -> Self { - let mut movement_core = MovementCoreConfig { - movement_config_string: None, - setup: false, - celestia: Celestia::Local, - eth: Eth::Local, - biarritz_rc1_to_pre_l1_merge: false, - ping_rest_api: false, - ping_faucet: false, - }; - - // Create a default MovementConfig - let movement_config = MovementConfig::default(); - - // Hard-code the core resources address - let account_address = Some(aptos_test_root_address()); - - // Set the movement config - movement_core.set_movement_config(movement_config); - - Self { mtma_node_null: MtmaNodeNullConfig::default(), movement_core, account_address } - } -} - -impl Config { - /// Builds the release signer from the config. - pub fn build_release_signer(&self) -> Result { - // load the signer - let raw_private_key = self - .movement_core - .try_movement_signer_identifier() - .map_err(|e| MigrateConfigError::Build(e.into()))? - .try_raw_private_key() - .context("failed to load raw private key") - .map_err(|e| MigrateConfigError::Build(e.into()))?; - - // get the raw private key - let private_key_hex = hex::encode(raw_private_key); - let root_account = LocalAccount::from_private_key(private_key_hex.as_str(), 0) - .context("failed to build root account") - .map_err(|e| MigrateConfigError::Build(e.into()))?; // sequence number 0 is fine because the release API loads sequence numbers - - Ok(LocalAccountReleaseSigner::new(root_account, None)) - } - - /// Builds the [Migrate] struct from the config. - pub fn build( - &self, - ) -> Result< - Migrate>, - MigrateConfigError, - > { - let mtma_node_null = - self.mtma_node_null.build().map_err(|e| MigrateConfigError::Build(e.into()))?; - let local_signer = self.build_release_signer()?; - let signer = OverrideAccountAddressReleaseSigner::core_resource_account(local_signer); - Ok(Migrate { release_signer: signer, mtma_node_null }) - } -} diff --git a/environments/core/provisioner/src/migrate/migrate.rs b/environments/core/provisioner/src/migrate/migrate.rs deleted file mode 100644 index e701d3c..0000000 --- a/environments/core/provisioner/src/migrate/migrate.rs +++ /dev/null @@ -1,84 +0,0 @@ -use aptos_framework_pre_l1_merge_release::{ - cached::full::feature_upgrade::PreL1Merge, - maptos_framework_release_util::{Release, ReleaseSigner}, -}; -use mtma_migrator_types::migration::{MigrationError, Migrationish}; -use mtma_migrator_types::migrator::{ - movement_aptos_migrator::MovementAptosMigrator, movement_migrator::MovementMigrator, -}; -use mtma_node_null_core::Migrate as MtmaNodeNullMigrate; - -use anyhow::Context; -use std::fmt::Debug; - -/// Errors thrown during the migration. -#[derive(Debug, thiserror::Error)] -pub enum MigrateError { - #[error("failed to migrate with pre-l1-merge: {0}")] - Migrate(#[source] Box), -} - -/// The migration struct will be use to run a migration from Movement -pub struct Migrate -where - S: ReleaseSigner + Send + Sync + 'static, -{ - pub(crate) release_signer: S, - pub(crate) mtma_node_null: MtmaNodeNullMigrate, -} - -impl Migrate -where - S: ReleaseSigner + Send + Sync + 'static, -{ - pub fn new(release_signer: S, mtma_node_null: MtmaNodeNullMigrate) -> Self { - Self { release_signer, mtma_node_null } - } - - pub fn release_signer(&self) -> &S { - &self.release_signer - } - - pub fn mtma_node_null(&self) -> &MtmaNodeNullMigrate { - &self.mtma_node_null - } -} - -impl Migrationish for Migrate -where - S: ReleaseSigner + Send + Sync + 'static, -{ - async fn migrate( - &self, - movement_migrator: &MovementMigrator, - ) -> Result { - // wait for the rest client to be ready - let rest_client = movement_migrator - .wait_for_rest_client_ready(tokio::time::Duration::from_secs(300)) - .await - .context("failed to wait for rest client to be ready") - .map_err(|e| MigrationError::Internal(e.into()))?; - - // build the pre-l1-merge - let pre_l1_merge = PreL1Merge::new(); - - // Run the release - pre_l1_merge - .release(self.release_signer(), 2_000_000, 100, 60, &rest_client) - .await - .context("failed to release with pre-l1-merge") - .map_err(|e| MigrationError::Internal(e.into()))?; - - // migrate with `mtma-node-null` - // NOTE: we're using the blanket implementation to upcast from a node migration to a migrator migration - let movement_aptos_migrator = self - .mtma_node_null - .migrate(movement_migrator) - .await - .context("failed to migrate node with mtma-node-null") - .map_err(|e| MigrationError::Internal(e.into()))?; - - // return the movement aptos migrator - Ok(movement_aptos_migrator) - } -} From 11e92c43a8d4334ddffb2b262c88176a88b3f012 Mon Sep 17 00:00:00 2001 From: Liam Makena Monninger Date: Thu, 12 Jun 2025 13:42:13 +0800 Subject: [PATCH 4/7] chore: nullify unimplemented environments; demonstrate environment selection. --- Cargo.lock | 2 ++ Cargo.toml | 2 +- .../core/box/src/environment/environment.rs | 30 +------------------ .../src/environment/environment.rs | 30 +------------------ migration/cli/migrate-node/Cargo.toml | 2 ++ migration/cli/migrate-node/docs/cli/README.md | 22 ++++++++++++-- .../migrate-node/src/cli/migrate/select.rs | 23 ++++++++++++-- 7 files changed, 47 insertions(+), 64 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e301971..96613bb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -15759,6 +15759,7 @@ dependencies = [ "jemallocator", "maptos-execution-util", "movement-syncing", + "mtma-box-environment", "mtma-core", "mtma-environment-types", "mtma-migrator-types", @@ -15768,6 +15769,7 @@ dependencies = [ "mtma-node-test-global-storage-injective-criterion", "mtma-node-test-global-storage-not-empty-criterion", "mtma-node-test-types", + "mtma-provisioner-environment", "mtma-testing-environment", "orfile", "rand 0.7.3", diff --git a/Cargo.toml b/Cargo.toml index 5820293..31c22fe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -222,7 +222,7 @@ mtma-environment-types = { path = "environments/util/types" } ### core mtma-testing-environment = { path = "environments/core/testing" } mtma-provisioner-environment = { path = "environments/core/provisioner" } -mtma-box-environment = { path = "environments/box/provisioner" } +mtma-box-environment = { path = "environments/core/box" } [workspace.lints.clippy] debug_assert_with_mut_call = "deny" diff --git a/environments/core/box/src/environment/environment.rs b/environments/core/box/src/environment/environment.rs index 0e94f93..9462687 100644 --- a/environments/core/box/src/environment/environment.rs +++ b/environments/core/box/src/environment/environment.rs @@ -1,5 +1,3 @@ -use anyhow::Context; -use movement_core::Overlays; use mtma_environment_types::{EnvironmentError, Environmentish}; use mtma_migrator_types::migrator::MovementMigrator; use std::fmt::Debug; @@ -27,32 +25,6 @@ impl BoxEnvironment { impl Environmentish for BoxEnvironment { async fn build_movement_migrator(&self) -> Result { - // Form the migrator. - let mut movement_migrator = - MovementMigrator::try_temp().map_err(|e| BoxEnvironmentError::Internal(e.into()))?; - movement_migrator.set_overlays(Overlays::default()); - - // Start the migrator so that it's running in the background. - // In the future, some migrators may be for already running nodes. - let movement_migrator_for_task = movement_migrator.clone(); - let movement_migrator_task = kestrel::task(async move { - movement_migrator_for_task.run().await?; - Ok::<_, anyhow::Error>(()) - }); - - // wait for the rest client to be ready - // once we have this, there should also be a config, so we can then kill off the migrator and proceed - movement_migrator - .wait_for_rest_client_ready(tokio::time::Duration::from_secs(600)) // we wait for up to ten minutes because the nix flake in .vendors/movementcan be a bit slow the first time - .await - .context( - "failed to wait for movement migrator rest client while running accounts equal manual prelude", - ).map_err(|e| BoxEnvironmentError::Internal(e.into()))?; - - kestrel::end!(movement_migrator_task) - .context("failed to end movement migrator task") - .map_err(|e| BoxEnvironmentError::Internal(e.into()))?; - - Ok(movement_migrator) + Err(BoxEnvironmentError::Internal(anyhow::anyhow!("not implemented").into()).into()) } } diff --git a/environments/core/provisioner/src/environment/environment.rs b/environments/core/provisioner/src/environment/environment.rs index eeda88a..531a17c 100644 --- a/environments/core/provisioner/src/environment/environment.rs +++ b/environments/core/provisioner/src/environment/environment.rs @@ -1,5 +1,3 @@ -use anyhow::Context; -use movement_core::Overlays; use mtma_environment_types::{EnvironmentError, Environmentish}; use mtma_migrator_types::migrator::MovementMigrator; use std::fmt::Debug; @@ -27,32 +25,6 @@ impl ProvisionerEnvironment { impl Environmentish for ProvisionerEnvironment { async fn build_movement_migrator(&self) -> Result { - // Form the migrator. - let mut movement_migrator = MovementMigrator::try_temp() - .map_err(|e| ProvisionerEnvironmentError::Internal(e.into()))?; - movement_migrator.set_overlays(Overlays::default()); - - // Start the migrator so that it's running in the background. - // In the future, some migrators may be for already running nodes. - let movement_migrator_for_task = movement_migrator.clone(); - let movement_migrator_task = kestrel::task(async move { - movement_migrator_for_task.run().await?; - Ok::<_, anyhow::Error>(()) - }); - - // wait for the rest client to be ready - // once we have this, there should also be a config, so we can then kill off the migrator and proceed - movement_migrator - .wait_for_rest_client_ready(tokio::time::Duration::from_secs(600)) // we wait for up to ten minutes because the nix flake in .vendors/movementcan be a bit slow the first time - .await - .context( - "failed to wait for movement migrator rest client while running accounts equal manual prelude", - ).map_err(|e| ProvisionerEnvironmentError::Internal(e.into()))?; - - kestrel::end!(movement_migrator_task) - .context("failed to end movement migrator task") - .map_err(|e| ProvisionerEnvironmentError::Internal(e.into()))?; - - Ok(movement_migrator) + Err(ProvisionerEnvironmentError::Internal(anyhow::anyhow!("not implemented").into()).into()) } } diff --git a/migration/cli/migrate-node/Cargo.toml b/migration/cli/migrate-node/Cargo.toml index 046eaef..7d73986 100644 --- a/migration/cli/migrate-node/Cargo.toml +++ b/migration/cli/migrate-node/Cargo.toml @@ -34,6 +34,8 @@ tracing = { workspace = true } tracing-subscriber = { workspace = true } slect = { workspace = true } mtma-testing-environment = { workspace = true } +mtma-box-environment = { workspace = true } +mtma-provisioner-environment = { workspace = true } mtma-environment-types = { workspace = true } mtma-migrator-types = { workspace = true } diff --git a/migration/cli/migrate-node/docs/cli/README.md b/migration/cli/migrate-node/docs/cli/README.md index 159e53e..6c1bb8c 100644 --- a/migration/cli/migrate-node/docs/cli/README.md +++ b/migration/cli/migrate-node/docs/cli/README.md @@ -125,9 +125,11 @@ Select migration over the node ###### **Options:** * `--environment-testing` — Enable the environment-testing selection +* `--environment-box` — Enable the environment-box selection +* `--environment-provisioner` — Enable the environment-provisioner selection * `--null` — Enable the null selection -**Selection (1/2):** `environment-testing` +**Selection (1/4):** `environment-testing` The config for the [TestingEnvironment] Usage: --environment-testing.* @@ -135,7 +137,23 @@ Usage: --environment-testing.* Options: -h, --help Print help (see more with '--help') -**Selection (2/2):** `null` +**Selection (2/4):** `environment-box` +The config for the [BoxEnvironment] + +Usage: --environment-box.* + +Options: + -h, --help Print help (see more with '--help') + +**Selection (3/4):** `environment-provisioner` +The config for the [ProvisionerEnvironment] + +Usage: --environment-provisioner.* + +Options: + -h, --help Print help (see more with '--help') + +**Selection (4/4):** `null` The config for the migration Usage: --null.* diff --git a/migration/cli/migrate-node/src/cli/migrate/select.rs b/migration/cli/migrate-node/src/cli/migrate/select.rs index 73b275f..404fc5e 100644 --- a/migration/cli/migrate-node/src/cli/migrate/select.rs +++ b/migration/cli/migrate-node/src/cli/migrate/select.rs @@ -1,8 +1,10 @@ use anyhow::Context; use clap::Parser; +use mtma_box_environment::Config as BoxEnvironmentConfig; use mtma_environment_types::Environmentish; use mtma_migrator_types::migration::Migrationish; use mtma_node_null_core::Config as NullConfig; +use mtma_provisioner_environment::Config as ProvisionerEnvironmentConfig; use mtma_testing_environment::Config as TestingEnvironmentConfig; use serde::{Deserialize, Serialize}; use slect::Slect; @@ -12,14 +14,29 @@ use slect::Slect; #[clap(help_expected = true)] pub struct Select { /// Extra args to pass to slect API - #[slect(environment_testing = TestingEnvironmentConfig, null = NullConfig)] + #[slect(environment_testing = TestingEnvironmentConfig, environment_box = BoxEnvironmentConfig, environment_provisioner = ProvisionerEnvironmentConfig, null = NullConfig)] extra_args: Vec, } impl select::Select { pub async fn execute(&self) -> Result<(), anyhow::Error> { - let (maybe_environment_testing, maybe_null) = - self.select().map_err(|e| anyhow::anyhow!("{}", e))?; + let ( + maybe_environment_testing, + maybe_environment_box, + maybe_environment_provisioner, + maybe_null, + ) = self.select().map_err(|e| anyhow::anyhow!("{}", e))?; + + // if more than one environment is provided, we need to error + let environment_count = maybe_environment_testing.is_some() as u8 + + maybe_environment_box.is_some() as u8 + + maybe_environment_provisioner.is_some() as u8; + if environment_count > 1 { + return Err(anyhow::anyhow!( + "only one environment should be provided, but got {}", + environment_count + )); + } let environment_config = maybe_environment_testing.context( "--environment-testing is the only supported environment; it must be provided", From 2529fb56f66453eac2283bae945e11936a940b97 Mon Sep 17 00:00:00 2001 From: Liam Makena Monninger Date: Thu, 12 Jun 2025 13:58:07 +0800 Subject: [PATCH 5/7] docs: make it clearer this is the config for the null migration. --- migration/cli/migrate-node/docs/cli/README.md | 2 +- migration/core/node/mtma-null/src/migrate/config.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/migration/cli/migrate-node/docs/cli/README.md b/migration/cli/migrate-node/docs/cli/README.md index 6c1bb8c..95ea71a 100644 --- a/migration/cli/migrate-node/docs/cli/README.md +++ b/migration/cli/migrate-node/docs/cli/README.md @@ -154,7 +154,7 @@ Options: -h, --help Print help (see more with '--help') **Selection (4/4):** `null` -The config for the migration +The config for the null migration Usage: --null.* diff --git a/migration/core/node/mtma-null/src/migrate/config.rs b/migration/core/node/mtma-null/src/migrate/config.rs index 33cf7f4..0991a08 100644 --- a/migration/core/node/mtma-null/src/migrate/config.rs +++ b/migration/core/node/mtma-null/src/migrate/config.rs @@ -9,7 +9,7 @@ pub enum MigrateConfigError { Build(#[source] Box), } -/// The config for the migration. +/// The config for the null migration. /// /// All fields should be easily statically encodable to a CLI argument. /// This is the frontend for the core API. From a6defff0065700ce5663564c67e31be03c2be879 Mon Sep 17 00:00:00 2001 From: Liam Monninger Date: Thu, 12 Jun 2025 21:37:03 +0800 Subject: [PATCH 6/7] chore: machete. --- .githooks/pre-commit | 10 + Cargo.lock | 342 ------------------ .../migrator/checks/pre-l1-merge/Cargo.toml | 8 - checks/migrator/checks/sketchpad/Cargo.toml | 1 - .../citeria/accounts-equal/Cargo.toml | 1 - .../citeria/balances-equal/Cargo.toml | 1 - .../migrator/citeria/transacting/Cargo.toml | 1 - checks/migrator/util/types/Cargo.toml | 7 - .../node/checks/movement-mainnet/Cargo.toml | 5 - checks/node/checks/sketchpad/Cargo.toml | 2 - .../global-storage-includes/Cargo.toml | 1 - .../global-storage-injective/Cargo.toml | 1 - .../global-storage-not-empty/Cargo.toml | 2 - checks/node/preludes/Cargo.toml | 10 - checks/node/util/types/Cargo.toml | 9 - environments/core/box/Cargo.toml | 23 -- environments/core/provisioner/Cargo.toml | 23 -- environments/core/testing/Cargo.toml | 23 +- environments/util/types/Cargo.toml | 1 - flake.nix | 1 + migration/cli/check-dev/Cargo.toml | 16 +- migration/cli/check/Cargo.toml | 16 +- migration/cli/migrate-chain-dev/Cargo.toml | 16 +- migration/cli/migrate-chain/Cargo.toml | 15 +- migration/cli/migrate-dev/Cargo.toml | 15 +- migration/cli/migrate-node-dev/Cargo.toml | 7 - migration/cli/migrate-node/Cargo.toml | 14 +- migration/cli/migrate/Cargo.toml | 15 +- migration/cli/mtma-dev/Cargo.toml | 18 +- migration/cli/mtma/Cargo.toml | 15 +- migration/cli/track-dev/Cargo.toml | 16 +- migration/cli/track/Cargo.toml | 16 +- migration/core/migrator/mtma-null/Cargo.toml | 9 - .../core/migrator/pre-l1-merge/Cargo.toml | 15 - migration/core/mtma-migrate-chain/Cargo.toml | 5 - migration/core/mtma/Cargo.toml | 5 - migration/core/node/mtma-null/Cargo.toml | 10 +- migration/core/node/mtma-replay/Cargo.toml | 6 - migration/util/migrator-types/Cargo.toml | 12 - migration/util/node-types/Cargo.toml | 7 - util/movement-aptos/core/Cargo.toml | 3 - util/movement-aptos/movement-aptos/Cargo.toml | 3 + util/movement/core/Cargo.toml | 5 - util/movement/movement/Cargo.toml | 2 - util/movement/syncing/Cargo.toml | 2 - 45 files changed, 49 insertions(+), 686 deletions(-) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 8b6b4fc..a2afcb9 100644 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -1,6 +1,16 @@ #!/bin/bash set -e +######## +# Cargo dependencies +####### + +# if cargo machete does not return 0 +cargo machete || { + echo "❌ You have unused dependencies in your Cargo.toml. Check the above." + exit 1 +} + ########## # CLAP CLI ########## diff --git a/Cargo.lock b/Cargo.lock index 96613bb..d3c6617 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13436,7 +13436,6 @@ version = "0.0.1" dependencies = [ "anyhow", "kestrel", - "mtma-migrator-pre-l1-merge-core", "mtma-migrator-test-accounts-equal-criterion", "mtma-migrator-test-types", "mtma-migrator-types", @@ -14871,11 +14870,9 @@ dependencies = [ "dotenv", "jemallocator", "movement-core", - "mtma-core", "orfile", "serde", "tokio", - "tracing", "tracing-subscriber 0.3.19", ] @@ -14994,12 +14991,10 @@ version = "0.0.1" dependencies = [ "anyhow", "aptos-cached-packages 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-config 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", "aptos-node 0.0.0-main (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", "cargo_metadata 0.19.2", "chrono", "clap 4.5.36", - "hex", "jsonlvar", "kestrel", "mtma-types", @@ -15010,7 +15005,6 @@ dependencies = [ "serde", "serde_json", "serde_yaml 0.8.26", - "syncador", "thiserror 1.0.69", "tokio", "tracing", @@ -15120,13 +15114,11 @@ dependencies = [ "anyhow", "cargo_metadata 0.19.2", "clap 4.5.36", - "hex", "include-vendor", "jsonlvar", "kestrel", "movement-core-util", "movement-signer-loader", - "movement-types", "mtma-types", "orfile", "ready-docker", @@ -15135,13 +15127,10 @@ dependencies = [ "serde", "serde_json", "strip-ansi-escapes", - "syncador", - "tempdir", "thiserror 1.0.69", "tokio", "tracing", "tracing-test", - "uuid", ] [[package]] @@ -15362,9 +15351,7 @@ name = "movement-syncing" version = "0.0.1" dependencies = [ "anyhow", - "hex", "movement-types", - "serde", "syncador", "tempdir", "uuid", @@ -15440,25 +15427,13 @@ name = "mtma" version = "0.0.1" dependencies = [ "anyhow", - "chrono", "clap 4.5.36", "clap-markdown-ext", "dotenv", - "futures", "jemallocator", - "maptos-execution-util", - "movement-syncing", "mtma-core", - "mtma-node-null-core", - "mtma-node-preludes", - "mtma-node-test-global-storage-includes-criterion", - "mtma-node-test-global-storage-injective-criterion", - "mtma-node-test-global-storage-not-empty-criterion", - "mtma-node-test-types", "orfile", - "rand 0.7.3", "serde", - "sysinfo 0.34.2", "tokio", "tracing", "tracing-subscriber 0.3.19", @@ -15469,33 +15444,10 @@ name = "mtma-box-environment" version = "0.0.1" dependencies = [ "anyhow", - "aptos-config 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-db 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-executor 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-framework-pre-l1-merge-release", - "aptos-storage-interface 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-vm 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "chrono", - "clap 4.5.36", - "clap-markdown-ext", - "dotenv", - "hex", - "kestrel", - "movement-core", - "movement-signer", - "movement-signer-loader", "mtma-environment-types", "mtma-migrator-types", - "mtma-node-null-core", - "mtma-node-types", - "mtma-types", - "orfile", "serde", "thiserror 1.0.69", - "tokio", - "tracing", - "uuid", - "walkdir", ] [[package]] @@ -15503,25 +15455,12 @@ name = "mtma-check" version = "0.0.1" dependencies = [ "anyhow", - "chrono", "clap 4.5.36", "clap-markdown-ext", "dotenv", - "futures", "jemallocator", - "maptos-execution-util", - "movement-syncing", - "mtma-core", - "mtma-node-null-core", - "mtma-node-preludes", - "mtma-node-test-global-storage-includes-criterion", - "mtma-node-test-global-storage-injective-criterion", - "mtma-node-test-global-storage-not-empty-criterion", - "mtma-node-test-types", "orfile", - "rand 0.7.3", "serde", - "sysinfo 0.34.2", "tokio", "tracing", "tracing-subscriber 0.3.19", @@ -15532,25 +15471,12 @@ name = "mtma-check-dev" version = "0.0.1" dependencies = [ "anyhow", - "chrono", "clap 4.5.36", "clap-markdown-ext", "dotenv", - "futures", "jemallocator", - "maptos-execution-util", - "movement-syncing", - "mtma-core", - "mtma-node-null-core", - "mtma-node-preludes", - "mtma-node-test-global-storage-includes-criterion", - "mtma-node-test-global-storage-injective-criterion", - "mtma-node-test-global-storage-not-empty-criterion", - "mtma-node-test-types", "orfile", - "rand 0.7.3", "serde", - "sysinfo 0.34.2", "tokio", "tracing", "tracing-subscriber 0.3.19", @@ -15560,14 +15486,9 @@ dependencies = [ name = "mtma-core" version = "0.0.1" dependencies = [ - "anyhow", "clap 4.5.36", - "clap-markdown-ext", - "dotenv", - "orfile", "serde", "thiserror 1.0.69", - "tokio", ] [[package]] @@ -15575,31 +15496,16 @@ name = "mtma-dev" version = "0.0.1" dependencies = [ "anyhow", - "chrono", "clap 4.5.36", "clap-markdown-ext", "dotenv", - "futures", "jemallocator", - "maptos-execution-util", - "movement-syncing", "mtma-check", "mtma-check-dev", - "mtma-core", "mtma-migrate", "mtma-migrate-dev", - "mtma-node-null-core", - "mtma-node-preludes", - "mtma-node-test-global-storage-includes-criterion", - "mtma-node-test-global-storage-injective-criterion", - "mtma-node-test-global-storage-not-empty-criterion", - "mtma-node-test-types", "mtma-track", "mtma-track-dev", - "orfile", - "rand 0.7.3", - "serde", - "sysinfo 0.34.2", "tokio", "tracing", "tracing-subscriber 0.3.19", @@ -15609,7 +15515,6 @@ dependencies = [ name = "mtma-environment-types" version = "0.0.1" dependencies = [ - "anyhow", "mtma-migrator-types", "thiserror 1.0.69", ] @@ -15619,25 +15524,13 @@ name = "mtma-migrate" version = "0.0.1" dependencies = [ "anyhow", - "chrono", "clap 4.5.36", "clap-markdown-ext", "dotenv", - "futures", "jemallocator", - "maptos-execution-util", - "movement-syncing", "mtma-core", - "mtma-node-null-core", - "mtma-node-preludes", - "mtma-node-test-global-storage-includes-criterion", - "mtma-node-test-global-storage-injective-criterion", - "mtma-node-test-global-storage-not-empty-criterion", - "mtma-node-test-types", "orfile", - "rand 0.7.3", "serde", - "sysinfo 0.34.2", "tokio", "tracing", "tracing-subscriber 0.3.19", @@ -15648,25 +15541,13 @@ name = "mtma-migrate-chain" version = "0.0.1" dependencies = [ "anyhow", - "chrono", "clap 4.5.36", "clap-markdown-ext", "dotenv", - "futures", "jemallocator", - "maptos-execution-util", - "movement-syncing", "mtma-core", - "mtma-node-null-core", - "mtma-node-preludes", - "mtma-node-test-global-storage-includes-criterion", - "mtma-node-test-global-storage-injective-criterion", - "mtma-node-test-global-storage-not-empty-criterion", - "mtma-node-test-types", "orfile", - "rand 0.7.3", "serde", - "sysinfo 0.34.2", "tokio", "tracing", "tracing-subscriber 0.3.19", @@ -15678,13 +15559,8 @@ version = "0.0.1" dependencies = [ "anyhow", "clap 4.5.36", - "clap-markdown-ext", - "dotenv", - "mtma-core", - "orfile", "serde", "thiserror 1.0.69", - "tokio", ] [[package]] @@ -15692,26 +15568,13 @@ name = "mtma-migrate-chain-dev" version = "0.0.1" dependencies = [ "anyhow", - "chrono", "clap 4.5.36", "clap-markdown-ext", "dotenv", - "futures", "jemallocator", - "maptos-execution-util", - "movement-syncing", - "mtma-core", "mtma-migrate-chain-core", - "mtma-node-null-core", - "mtma-node-preludes", - "mtma-node-test-global-storage-includes-criterion", - "mtma-node-test-global-storage-injective-criterion", - "mtma-node-test-global-storage-not-empty-criterion", - "mtma-node-test-types", "orfile", - "rand 0.7.3", "serde", - "sysinfo 0.34.2", "tokio", "tracing", "tracing-subscriber 0.3.19", @@ -15722,25 +15585,13 @@ name = "mtma-migrate-dev" version = "0.0.1" dependencies = [ "anyhow", - "chrono", "clap 4.5.36", "clap-markdown-ext", "dotenv", - "futures", "jemallocator", - "maptos-execution-util", - "movement-syncing", "mtma-core", - "mtma-node-null-core", - "mtma-node-preludes", - "mtma-node-test-global-storage-includes-criterion", - "mtma-node-test-global-storage-injective-criterion", - "mtma-node-test-global-storage-not-empty-criterion", - "mtma-node-test-types", "orfile", - "rand 0.7.3", "serde", - "sysinfo 0.34.2", "tokio", "tracing", "tracing-subscriber 0.3.19", @@ -15751,31 +15602,20 @@ name = "mtma-migrate-node" version = "0.0.1" dependencies = [ "anyhow", - "chrono", "clap 4.5.36", "clap-markdown-ext", "dotenv", - "futures", "jemallocator", - "maptos-execution-util", - "movement-syncing", "mtma-box-environment", "mtma-core", "mtma-environment-types", "mtma-migrator-types", "mtma-node-null-core", - "mtma-node-preludes", - "mtma-node-test-global-storage-includes-criterion", - "mtma-node-test-global-storage-injective-criterion", - "mtma-node-test-global-storage-not-empty-criterion", - "mtma-node-test-types", "mtma-provisioner-environment", "mtma-testing-environment", "orfile", - "rand 0.7.3", "serde", "slect", - "sysinfo 0.34.2", "tokio", "tracing", "tracing-subscriber 0.3.19", @@ -15786,7 +15626,6 @@ name = "mtma-migrate-node-dev" version = "0.0.1" dependencies = [ "anyhow", - "chrono", "clap 4.5.36", "clap-markdown-ext", "dotenv", @@ -15794,17 +15633,11 @@ dependencies = [ "jemallocator", "maptos-execution-util", "movement-syncing", - "mtma-core", "mtma-node-null-core", - "mtma-node-preludes", "mtma-node-test-global-storage-includes-criterion", - "mtma-node-test-global-storage-injective-criterion", - "mtma-node-test-global-storage-not-empty-criterion", "mtma-node-test-types", "orfile", - "rand 0.7.3", "serde", - "sysinfo 0.34.2", "tokio", "tracing", "tracing-subscriber 0.3.19", @@ -15831,22 +15664,14 @@ name = "mtma-migrator-checks-pre-l1-merge" version = "0.0.1" dependencies = [ "anyhow", - "chrono", "kestrel", "movement-core", "mtma-migrator-pre-l1-merge-core", "mtma-migrator-test-accounts-equal-criterion", "mtma-migrator-test-types", "mtma-migrator-types", - "mtma-node-null-core", - "mtma-node-preludes", - "mtma-node-replay-core", - "mtma-node-test-global-storage-includes-criterion", - "mtma-node-test-global-storage-injective-criterion", - "mtma-node-test-global-storage-not-empty-criterion", "mtma-node-test-types", "mtma-types", - "rand 0.7.3", "tempfile", "tokio", "tracing", @@ -15874,21 +15699,12 @@ name = "mtma-migrator-null-core" version = "0.0.1" dependencies = [ "anyhow", - "aptos-config 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-db 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-executor 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-storage-interface 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-vm 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", "chrono", "clap 4.5.36", - "clap-markdown-ext", - "dotenv", "mtma-node-types", "mtma-types", - "orfile", "serde", "thiserror 1.0.69", - "tokio", "tracing", "uuid", "walkdir", @@ -15899,31 +15715,16 @@ name = "mtma-migrator-pre-l1-merge-core" version = "0.0.1" dependencies = [ "anyhow", - "aptos-config 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-db 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-executor 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", "aptos-framework-pre-l1-merge-release", - "aptos-storage-interface 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-vm 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "chrono", "clap 4.5.36", - "clap-markdown-ext", - "dotenv", "hex", "movement-core", - "movement-signer", - "movement-signer-loader", "mtma-migrator-types", "mtma-node-null-core", - "mtma-node-types", "mtma-types", - "orfile", "serde", "thiserror 1.0.69", "tokio", - "tracing", - "uuid", - "walkdir", ] [[package]] @@ -15931,7 +15732,6 @@ name = "mtma-migrator-test-accounts-equal-criterion" version = "0.0.1" dependencies = [ "anyhow", - "bcs 0.1.4", "bcs-ext", "mtma-migrator-test-types", "tokio", @@ -15943,7 +15743,6 @@ name = "mtma-migrator-test-balances-equal-criterion" version = "0.0.1" dependencies = [ "anyhow", - "bcs 0.1.4", "bcs-ext", "mtma-migrator-test-types", "tokio", @@ -15973,7 +15772,6 @@ name = "mtma-migrator-test-transacting-criterion" version = "0.0.1" dependencies = [ "anyhow", - "aptos-rest-client 0.0.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", "aptos-sdk 0.0.3 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", "bcs 0.1.4", "mtma-migrator-test-types", @@ -15986,16 +15784,9 @@ name = "mtma-migrator-test-types" version = "0.0.1" dependencies = [ "anyhow", - "aptos-rest-client 0.0.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-sdk 0.0.3 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "bcs 0.1.4", - "hex", "kestrel", - "movement-client", "mtma-migrator-types", "mtma-node-test-types", - "mtma-types", - "serde", "thiserror 1.0.69", "tokio", "tracing", @@ -16024,24 +15815,12 @@ name = "mtma-migrator-types" version = "0.0.1" dependencies = [ "anyhow", - "aptos-config 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-executor 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-rest-client 0.0.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-storage-interface 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-types 0.0.3 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-vm 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "either", - "hex", "kestrel", - "maptos-opt-executor", "movement-aptos-core", - "movement-client", "movement-core", "mtma-node-types", "mtma-types", - "serde", "thiserror 1.0.69", - "tracing", ] [[package]] @@ -16049,17 +15828,12 @@ name = "mtma-node-checks-mainnet" version = "0.0.1" dependencies = [ "anyhow", - "chrono", "futures", "maptos-execution-util", "movement-syncing", "mtma-node-null-core", - "mtma-node-preludes", "mtma-node-test-global-storage-includes-criterion", - "mtma-node-test-global-storage-injective-criterion", - "mtma-node-test-global-storage-not-empty-criterion", "mtma-node-test-types", - "rand 0.7.3", "sysinfo 0.34.2", "tokio", "tracing", @@ -16071,7 +15845,6 @@ name = "mtma-node-checks-sketchpad" version = "0.0.1" dependencies = [ "anyhow", - "chrono", "mtma-node-null-core", "mtma-node-preludes", "mtma-node-replay-core", @@ -16079,7 +15852,6 @@ dependencies = [ "mtma-node-test-global-storage-injective-criterion", "mtma-node-test-global-storage-not-empty-criterion", "mtma-node-test-types", - "rand 0.7.3", "tokio", "tracing", "tracing-test", @@ -16090,21 +15862,12 @@ name = "mtma-node-null-core" version = "0.0.1" dependencies = [ "anyhow", - "aptos-config 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-db 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-executor 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-storage-interface 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-vm 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", "chrono", "clap 4.5.36", - "clap-markdown-ext", - "dotenv", "mtma-node-types", "mtma-types", - "orfile", "serde", "thiserror 1.0.69", - "tokio", "tracing", "uuid", "walkdir", @@ -16114,20 +15877,10 @@ dependencies = [ name = "mtma-node-preludes" version = "0.0.1" dependencies = [ - "anyhow", - "aptos-executor 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-storage-interface 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", "aptos-types 0.0.3 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-vm 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", "chrono", - "either", - "hex", - "maptos-opt-executor", "mtma-node-test-types", - "mtma-node-types", "rand 0.7.3", - "serde", - "thiserror 1.0.69", ] [[package]] @@ -16142,22 +15895,16 @@ dependencies = [ "aptos-executor-types 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", "aptos-storage-interface 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", "aptos-types 0.0.3 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-vm 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", "aptos-vm-genesis 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", "bcs 0.1.4", "bcs-ext", "chrono", "clap 4.5.36", - "clap-markdown-ext", - "dotenv", "mtma-node-types", - "orfile", "serde", "thiserror 1.0.69", - "tokio", "tracing", "uuid", - "walkdir", ] [[package]] @@ -16171,7 +15918,6 @@ dependencies = [ name = "mtma-node-test-global-storage-includes-criterion" version = "0.0.1" dependencies = [ - "anyhow", "mtma-node-test-types", "mtma-types", "tracing", @@ -16181,7 +15927,6 @@ dependencies = [ name = "mtma-node-test-global-storage-injective-criterion" version = "0.0.1" dependencies = [ - "anyhow", "mtma-node-test-types", "mtma-types", "tracing", @@ -16191,7 +15936,6 @@ dependencies = [ name = "mtma-node-test-global-storage-not-empty-criterion" version = "0.0.1" dependencies = [ - "anyhow", "mtma-node-test-types", ] @@ -16199,18 +15943,9 @@ dependencies = [ name = "mtma-node-test-types" version = "0.0.1" dependencies = [ - "anyhow", - "aptos-executor 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-storage-interface 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-types 0.0.3 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-vm 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", "chrono", - "either", - "hex", - "maptos-opt-executor", "mtma-node-types", "mtma-types", - "serde", "thiserror 1.0.69", ] @@ -16219,21 +15954,14 @@ name = "mtma-node-types" version = "0.0.1" dependencies = [ "anyhow", - "aptos-executor 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-storage-interface 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-types 0.0.3 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-vm 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", "either", "futures-channel", - "hex", "maptos-opt-executor", "movement-aptos-core", "movement-util", "mtma-types", - "serde", "tempfile", "thiserror 1.0.69", - "tokio", "tracing", "tracing-test", "uuid", @@ -16245,33 +15973,10 @@ name = "mtma-provisioner-environment" version = "0.0.1" dependencies = [ "anyhow", - "aptos-config 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-db 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-executor 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-framework-pre-l1-merge-release", - "aptos-storage-interface 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-vm 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "chrono", - "clap 4.5.36", - "clap-markdown-ext", - "dotenv", - "hex", - "kestrel", - "movement-core", - "movement-signer", - "movement-signer-loader", "mtma-environment-types", "mtma-migrator-types", - "mtma-node-null-core", - "mtma-node-types", - "mtma-types", - "orfile", "serde", "thiserror 1.0.69", - "tokio", - "tracing", - "uuid", - "walkdir", ] [[package]] @@ -16279,33 +15984,12 @@ name = "mtma-testing-environment" version = "0.0.1" dependencies = [ "anyhow", - "aptos-config 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-db 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-executor 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-framework-pre-l1-merge-release", - "aptos-storage-interface 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "aptos-vm 0.1.0 (git+https://github.com/movementlabsxyz/aptos-core.git?rev=cb3b7b02f68c7d6982257e4c59955d0e63b513db)", - "chrono", - "clap 4.5.36", - "clap-markdown-ext", - "dotenv", - "hex", "kestrel", "movement-core", - "movement-signer", - "movement-signer-loader", "mtma-environment-types", "mtma-migrator-types", - "mtma-node-null-core", - "mtma-node-types", - "mtma-types", - "orfile", "serde", "thiserror 1.0.69", - "tokio", - "tracing", - "uuid", - "walkdir", ] [[package]] @@ -16313,25 +15997,12 @@ name = "mtma-track" version = "0.0.1" dependencies = [ "anyhow", - "chrono", "clap 4.5.36", "clap-markdown-ext", "dotenv", - "futures", "jemallocator", - "maptos-execution-util", - "movement-syncing", - "mtma-core", - "mtma-node-null-core", - "mtma-node-preludes", - "mtma-node-test-global-storage-includes-criterion", - "mtma-node-test-global-storage-injective-criterion", - "mtma-node-test-global-storage-not-empty-criterion", - "mtma-node-test-types", "orfile", - "rand 0.7.3", "serde", - "sysinfo 0.34.2", "tokio", "tracing", "tracing-subscriber 0.3.19", @@ -16342,25 +16013,12 @@ name = "mtma-track-dev" version = "0.0.1" dependencies = [ "anyhow", - "chrono", "clap 4.5.36", "clap-markdown-ext", "dotenv", - "futures", "jemallocator", - "maptos-execution-util", - "movement-syncing", - "mtma-core", - "mtma-node-null-core", - "mtma-node-preludes", - "mtma-node-test-global-storage-includes-criterion", - "mtma-node-test-global-storage-injective-criterion", - "mtma-node-test-global-storage-not-empty-criterion", - "mtma-node-test-types", "orfile", - "rand 0.7.3", "serde", - "sysinfo 0.34.2", "tokio", "tracing", "tracing-subscriber 0.3.19", diff --git a/checks/migrator/checks/pre-l1-merge/Cargo.toml b/checks/migrator/checks/pre-l1-merge/Cargo.toml index 8b4f2dd..4cba583 100644 --- a/checks/migrator/checks/pre-l1-merge/Cargo.toml +++ b/checks/migrator/checks/pre-l1-merge/Cargo.toml @@ -13,16 +13,8 @@ mtma-types = { workspace = true } mtma-migrator-types = { workspace = true } mtma-migrator-test-types = { workspace = true } anyhow = { workspace = true } -mtma-node-replay-core = { workspace = true } -mtma-node-test-global-storage-injective-criterion = { workspace = true } -mtma-node-test-global-storage-includes-criterion = { workspace = true } -mtma-node-test-global-storage-not-empty-criterion = { workspace = true } mtma-migrator-test-accounts-equal-criterion = { workspace = true } -mtma-node-preludes = { workspace = true } -mtma-node-null-core = { workspace = true } tokio = { workspace = true } -chrono = { workspace = true } -rand = { workspace = true } kestrel = { workspace = true } mtma-node-test-types = { workspace = true } mtma-migrator-pre-l1-merge-core = { workspace = true } diff --git a/checks/migrator/checks/sketchpad/Cargo.toml b/checks/migrator/checks/sketchpad/Cargo.toml index bca0c40..111a2ec 100644 --- a/checks/migrator/checks/sketchpad/Cargo.toml +++ b/checks/migrator/checks/sketchpad/Cargo.toml @@ -17,7 +17,6 @@ mtma-node-null-core = { workspace = true } tokio = { workspace = true } kestrel = { workspace = true } mtma-node-test-types = { workspace = true } -mtma-migrator-pre-l1-merge-core = { workspace = true } [dev-dependencies] tracing-test = { workspace = true } diff --git a/checks/migrator/citeria/accounts-equal/Cargo.toml b/checks/migrator/citeria/accounts-equal/Cargo.toml index 79c5b74..c67c171 100644 --- a/checks/migrator/citeria/accounts-equal/Cargo.toml +++ b/checks/migrator/citeria/accounts-equal/Cargo.toml @@ -10,7 +10,6 @@ rust-version = { workspace = true } [dependencies] mtma-migrator-test-types = { workspace = true } -bcs = { workspace = true } bcs-ext = { workspace = true } tokio = { workspace = true } anyhow = { workspace = true } diff --git a/checks/migrator/citeria/balances-equal/Cargo.toml b/checks/migrator/citeria/balances-equal/Cargo.toml index ed9d1cd..ac394a0 100644 --- a/checks/migrator/citeria/balances-equal/Cargo.toml +++ b/checks/migrator/citeria/balances-equal/Cargo.toml @@ -10,7 +10,6 @@ rust-version = { workspace = true } [dependencies] mtma-migrator-test-types = { workspace = true } -bcs = { workspace = true } bcs-ext = { workspace = true } tokio = { workspace = true } anyhow = { workspace = true } diff --git a/checks/migrator/citeria/transacting/Cargo.toml b/checks/migrator/citeria/transacting/Cargo.toml index 34e4686..354ba7b 100644 --- a/checks/migrator/citeria/transacting/Cargo.toml +++ b/checks/migrator/citeria/transacting/Cargo.toml @@ -11,7 +11,6 @@ rust-version = { workspace = true } [dependencies] mtma-migrator-test-types = { workspace = true } anyhow = { workspace = true } -aptos-rest-client = { workspace = true } aptos-sdk = { workspace = true } bcs = { workspace = true } rand = { workspace = true } diff --git a/checks/migrator/util/types/Cargo.toml b/checks/migrator/util/types/Cargo.toml index f3ffd06..bcf49e8 100644 --- a/checks/migrator/util/types/Cargo.toml +++ b/checks/migrator/util/types/Cargo.toml @@ -11,16 +11,9 @@ rust-version = { workspace = true } [dependencies] mtma-node-test-types = { workspace = true } mtma-migrator-types = { workspace = true } -serde = { workspace = true } anyhow = { workspace = true } -hex = { workspace = true } -movement-client = { workspace = true } -aptos-rest-client = { workspace = true } -aptos-sdk = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true } -bcs = { workspace = true } -mtma-types = { workspace = true } kestrel = { workspace = true } tracing = { workspace = true } diff --git a/checks/node/checks/movement-mainnet/Cargo.toml b/checks/node/checks/movement-mainnet/Cargo.toml index 6fa6c77..866afb9 100644 --- a/checks/node/checks/movement-mainnet/Cargo.toml +++ b/checks/node/checks/movement-mainnet/Cargo.toml @@ -12,15 +12,10 @@ rust-version = { workspace = true } mtma-node-test-types = { workspace = true } anyhow = { workspace = true } mtma-node-null-core = { workspace = true } -mtma-node-test-global-storage-injective-criterion = { workspace = true } mtma-node-test-global-storage-includes-criterion = { workspace = true } -mtma-node-test-global-storage-not-empty-criterion = { workspace = true } -mtma-node-preludes = { workspace = true } movement-syncing = { workspace = true } maptos-execution-util = { workspace = true } tokio = { workspace = true } -chrono = { workspace = true } -rand = { workspace = true } futures = { workspace = true } sysinfo = { workspace = true } tracing = { workspace = true } diff --git a/checks/node/checks/sketchpad/Cargo.toml b/checks/node/checks/sketchpad/Cargo.toml index e1203dc..92d1f97 100644 --- a/checks/node/checks/sketchpad/Cargo.toml +++ b/checks/node/checks/sketchpad/Cargo.toml @@ -18,8 +18,6 @@ mtma-node-test-global-storage-includes-criterion = { workspace = true } mtma-node-test-global-storage-not-empty-criterion = { workspace = true } mtma-node-preludes = { workspace = true } tokio = { workspace = true } -chrono = { workspace = true } -rand = { workspace = true } [dev-dependencies] tracing-test = { workspace = true } diff --git a/checks/node/citeria/global-storage-includes/Cargo.toml b/checks/node/citeria/global-storage-includes/Cargo.toml index a2f56d5..7286a3f 100644 --- a/checks/node/citeria/global-storage-includes/Cargo.toml +++ b/checks/node/citeria/global-storage-includes/Cargo.toml @@ -11,7 +11,6 @@ rust-version = { workspace = true } [dependencies] mtma-node-test-types = { workspace = true } mtma-types = { workspace = true } -anyhow = { workspace = true } tracing = { workspace = true } diff --git a/checks/node/citeria/global-storage-injective/Cargo.toml b/checks/node/citeria/global-storage-injective/Cargo.toml index 37cce63..53d062d 100644 --- a/checks/node/citeria/global-storage-injective/Cargo.toml +++ b/checks/node/citeria/global-storage-injective/Cargo.toml @@ -11,7 +11,6 @@ rust-version = { workspace = true } [dependencies] mtma-node-test-types = { workspace = true } mtma-types = { workspace = true } -anyhow = { workspace = true } tracing = { workspace = true } [lints] diff --git a/checks/node/citeria/global-storage-not-empty/Cargo.toml b/checks/node/citeria/global-storage-not-empty/Cargo.toml index 8ab941a..c288257 100644 --- a/checks/node/citeria/global-storage-not-empty/Cargo.toml +++ b/checks/node/citeria/global-storage-not-empty/Cargo.toml @@ -10,8 +10,6 @@ rust-version = { workspace = true } [dependencies] mtma-node-test-types = { workspace = true } -anyhow = { workspace = true } - [lints] workspace = true diff --git a/checks/node/preludes/Cargo.toml b/checks/node/preludes/Cargo.toml index 05e74ad..b184f5b 100644 --- a/checks/node/preludes/Cargo.toml +++ b/checks/node/preludes/Cargo.toml @@ -9,17 +9,7 @@ publish = { workspace = true } rust-version = { workspace = true } [dependencies] -serde = { workspace = true } -anyhow = { workspace = true } -hex = { workspace = true } -maptos-opt-executor = { workspace = true } -aptos-executor = { workspace = true } -aptos-vm = { workspace = true } aptos-types = { workspace = true } -thiserror = { workspace = true } -aptos-storage-interface = { workspace = true } -either = { workspace = true } -mtma-node-types = { workspace = true } chrono = { workspace = true } mtma-node-test-types = { workspace = true } rand = { workspace = true } diff --git a/checks/node/util/types/Cargo.toml b/checks/node/util/types/Cargo.toml index 0f7d1ac..1282bb8 100644 --- a/checks/node/util/types/Cargo.toml +++ b/checks/node/util/types/Cargo.toml @@ -9,16 +9,7 @@ publish = { workspace = true } rust-version = { workspace = true } [dependencies] -serde = { workspace = true } -anyhow = { workspace = true } -hex = { workspace = true } -maptos-opt-executor = { workspace = true } -aptos-executor = { workspace = true } -aptos-vm = { workspace = true } -aptos-types = { workspace = true } thiserror = { workspace = true } -aptos-storage-interface = { workspace = true } -either = { workspace = true } mtma-node-types = { workspace = true } chrono = { workspace = true } mtma-types = { workspace = true } diff --git a/environments/core/box/Cargo.toml b/environments/core/box/Cargo.toml index fabf027..fe91414 100644 --- a/environments/core/box/Cargo.toml +++ b/environments/core/box/Cargo.toml @@ -9,34 +9,11 @@ publish = { workspace = true } rust-version = { workspace = true } [dependencies] -tokio = { workspace = true } serde = { workspace = true, features = ["derive"] } -clap = { workspace = true, features = ["derive"] } -dotenv = { workspace = true } anyhow = { workspace = true } -clap-markdown-ext = { workspace = true } thiserror = { workspace = true } -orfile = { workspace = true } -mtma-node-types = { workspace = true } mtma-migrator-types = { workspace = true } -mtma-node-null-core = { workspace = true } -aptos-db = { workspace = true } -aptos-storage-interface = { workspace = true } -aptos-config = { workspace = true } -aptos-executor = { workspace = true } -aptos-vm = { workspace = true } -chrono = { workspace = true } -walkdir = { workspace = true } -uuid = { workspace = true } -tracing = { workspace = true } -aptos-framework-pre-l1-merge-release = { workspace = true } -movement-signer = { workspace = true } -movement-signer-loader = { workspace = true } -hex = { workspace = true } -mtma-types = { workspace = true } -movement-core = { workspace = true } mtma-environment-types = { workspace = true } -kestrel = { workspace = true } [lints] workspace = true diff --git a/environments/core/provisioner/Cargo.toml b/environments/core/provisioner/Cargo.toml index 1898430..8942824 100644 --- a/environments/core/provisioner/Cargo.toml +++ b/environments/core/provisioner/Cargo.toml @@ -9,34 +9,11 @@ publish = { workspace = true } rust-version = { workspace = true } [dependencies] -tokio = { workspace = true } serde = { workspace = true, features = ["derive"] } -clap = { workspace = true, features = ["derive"] } -dotenv = { workspace = true } anyhow = { workspace = true } -clap-markdown-ext = { workspace = true } thiserror = { workspace = true } -orfile = { workspace = true } -mtma-node-types = { workspace = true } mtma-migrator-types = { workspace = true } -mtma-node-null-core = { workspace = true } -aptos-db = { workspace = true } -aptos-storage-interface = { workspace = true } -aptos-config = { workspace = true } -aptos-executor = { workspace = true } -aptos-vm = { workspace = true } -chrono = { workspace = true } -walkdir = { workspace = true } -uuid = { workspace = true } -tracing = { workspace = true } -aptos-framework-pre-l1-merge-release = { workspace = true } -movement-signer = { workspace = true } -movement-signer-loader = { workspace = true } -hex = { workspace = true } -mtma-types = { workspace = true } -movement-core = { workspace = true } mtma-environment-types = { workspace = true } -kestrel = { workspace = true } [lints] workspace = true diff --git a/environments/core/testing/Cargo.toml b/environments/core/testing/Cargo.toml index 8d17a4e..d7db5d3 100644 --- a/environments/core/testing/Cargo.toml +++ b/environments/core/testing/Cargo.toml @@ -9,33 +9,12 @@ publish = { workspace = true } rust-version = { workspace = true } [dependencies] -tokio = { workspace = true } serde = { workspace = true, features = ["derive"] } -clap = { workspace = true, features = ["derive"] } -dotenv = { workspace = true } anyhow = { workspace = true } -clap-markdown-ext = { workspace = true } thiserror = { workspace = true } -orfile = { workspace = true } -mtma-node-types = { workspace = true } mtma-migrator-types = { workspace = true } -mtma-node-null-core = { workspace = true } -aptos-db = { workspace = true } -aptos-storage-interface = { workspace = true } -aptos-config = { workspace = true } -aptos-executor = { workspace = true } -aptos-vm = { workspace = true } -chrono = { workspace = true } -walkdir = { workspace = true } -uuid = { workspace = true } -tracing = { workspace = true } -aptos-framework-pre-l1-merge-release = { workspace = true } -movement-signer = { workspace = true } -movement-signer-loader = { workspace = true } -hex = { workspace = true } -mtma-types = { workspace = true } -movement-core = { workspace = true } mtma-environment-types = { workspace = true } +movement-core = { workspace = true } kestrel = { workspace = true } [lints] diff --git a/environments/util/types/Cargo.toml b/environments/util/types/Cargo.toml index 5ae7780..227e8d4 100644 --- a/environments/util/types/Cargo.toml +++ b/environments/util/types/Cargo.toml @@ -10,7 +10,6 @@ rust-version = { workspace = true } [dependencies] mtma-migrator-types = { workspace = true } -anyhow = { workspace = true } thiserror = { workspace = true } [lints] diff --git a/flake.nix b/flake.nix index 5b70864..03691ee 100644 --- a/flake.nix +++ b/flake.nix @@ -57,6 +57,7 @@ qemu_kvm qemu-utils libvirt + cargo-machete ] ++ lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ] ++ lib.optionals stdenv.isLinux [ diff --git a/migration/cli/check-dev/Cargo.toml b/migration/cli/check-dev/Cargo.toml index b9bc8c3..e695843 100644 --- a/migration/cli/check-dev/Cargo.toml +++ b/migration/cli/check-dev/Cargo.toml @@ -16,22 +16,12 @@ dotenv = { workspace = true } anyhow = { workspace = true } clap-markdown-ext = { workspace = true } orfile = { workspace = true } -mtma-core = { workspace = true } jemallocator = { workspace = true } -mtma-node-null-core = { workspace = true } -mtma-node-test-global-storage-injective-criterion = { workspace = true } -mtma-node-test-global-storage-includes-criterion = { workspace = true } -mtma-node-test-global-storage-not-empty-criterion = { workspace = true } -mtma-node-preludes = { workspace = true } -mtma-node-test-types = { workspace = true } -movement-syncing = { workspace = true } -maptos-execution-util = { workspace = true } -chrono = { workspace = true } -rand = { workspace = true } -futures = { workspace = true } -sysinfo = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true } +[package.metadata.cargo-machete] +ignored = ["tracing"] + [lints] workspace = true diff --git a/migration/cli/check/Cargo.toml b/migration/cli/check/Cargo.toml index 33f5454..ed78c55 100644 --- a/migration/cli/check/Cargo.toml +++ b/migration/cli/check/Cargo.toml @@ -16,22 +16,12 @@ dotenv = { workspace = true } anyhow = { workspace = true } clap-markdown-ext = { workspace = true } orfile = { workspace = true } -mtma-core = { workspace = true } jemallocator = { workspace = true } -mtma-node-null-core = { workspace = true } -mtma-node-test-global-storage-injective-criterion = { workspace = true } -mtma-node-test-global-storage-includes-criterion = { workspace = true } -mtma-node-test-global-storage-not-empty-criterion = { workspace = true } -mtma-node-preludes = { workspace = true } -mtma-node-test-types = { workspace = true } -movement-syncing = { workspace = true } -maptos-execution-util = { workspace = true } -chrono = { workspace = true } -rand = { workspace = true } -futures = { workspace = true } -sysinfo = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true } +[package.metadata.cargo-machete] +ignored = ["tracing"] + [lints] workspace = true diff --git a/migration/cli/migrate-chain-dev/Cargo.toml b/migration/cli/migrate-chain-dev/Cargo.toml index 8686182..0e2f18b 100644 --- a/migration/cli/migrate-chain-dev/Cargo.toml +++ b/migration/cli/migrate-chain-dev/Cargo.toml @@ -16,23 +16,13 @@ dotenv = { workspace = true } anyhow = { workspace = true } clap-markdown-ext = { workspace = true } orfile = { workspace = true } -mtma-core = { workspace = true } mtma-migrate-chain-core = { workspace = true } jemallocator = { workspace = true } -mtma-node-null-core = { workspace = true } -mtma-node-test-global-storage-injective-criterion = { workspace = true } -mtma-node-test-global-storage-includes-criterion = { workspace = true } -mtma-node-test-global-storage-not-empty-criterion = { workspace = true } -mtma-node-preludes = { workspace = true } -mtma-node-test-types = { workspace = true } -movement-syncing = { workspace = true } -maptos-execution-util = { workspace = true } -chrono = { workspace = true } -rand = { workspace = true } -futures = { workspace = true } -sysinfo = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true } +[package.metadata.cargo-machete] +ignored = ["tracing"] + [lints] workspace = true diff --git a/migration/cli/migrate-chain/Cargo.toml b/migration/cli/migrate-chain/Cargo.toml index fd1ca7c..6429a47 100644 --- a/migration/cli/migrate-chain/Cargo.toml +++ b/migration/cli/migrate-chain/Cargo.toml @@ -18,20 +18,11 @@ clap-markdown-ext = { workspace = true } orfile = { workspace = true } mtma-core = { workspace = true } jemallocator = { workspace = true } -mtma-node-null-core = { workspace = true } -mtma-node-test-global-storage-injective-criterion = { workspace = true } -mtma-node-test-global-storage-includes-criterion = { workspace = true } -mtma-node-test-global-storage-not-empty-criterion = { workspace = true } -mtma-node-preludes = { workspace = true } -mtma-node-test-types = { workspace = true } -movement-syncing = { workspace = true } -maptos-execution-util = { workspace = true } -chrono = { workspace = true } -rand = { workspace = true } -futures = { workspace = true } -sysinfo = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true } +[package.metadata.cargo-machete] +ignored = ["tracing"] + [lints] workspace = true diff --git a/migration/cli/migrate-dev/Cargo.toml b/migration/cli/migrate-dev/Cargo.toml index 378bd61..7e343fa 100644 --- a/migration/cli/migrate-dev/Cargo.toml +++ b/migration/cli/migrate-dev/Cargo.toml @@ -18,20 +18,11 @@ clap-markdown-ext = { workspace = true } orfile = { workspace = true } mtma-core = { workspace = true } jemallocator = { workspace = true } -mtma-node-null-core = { workspace = true } -mtma-node-test-global-storage-injective-criterion = { workspace = true } -mtma-node-test-global-storage-includes-criterion = { workspace = true } -mtma-node-test-global-storage-not-empty-criterion = { workspace = true } -mtma-node-preludes = { workspace = true } -mtma-node-test-types = { workspace = true } -movement-syncing = { workspace = true } -maptos-execution-util = { workspace = true } -chrono = { workspace = true } -rand = { workspace = true } -futures = { workspace = true } -sysinfo = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true } +[package.metadata.cargo-machete] +ignored = ["tracing"] + [lints] workspace = true diff --git a/migration/cli/migrate-node-dev/Cargo.toml b/migration/cli/migrate-node-dev/Cargo.toml index 518631e..d0da6c8 100644 --- a/migration/cli/migrate-node-dev/Cargo.toml +++ b/migration/cli/migrate-node-dev/Cargo.toml @@ -16,20 +16,13 @@ dotenv = { workspace = true } anyhow = { workspace = true } clap-markdown-ext = { workspace = true } orfile = { workspace = true } -mtma-core = { workspace = true } jemallocator = { workspace = true } mtma-node-null-core = { workspace = true } -mtma-node-test-global-storage-injective-criterion = { workspace = true } mtma-node-test-global-storage-includes-criterion = { workspace = true } -mtma-node-test-global-storage-not-empty-criterion = { workspace = true } -mtma-node-preludes = { workspace = true } mtma-node-test-types = { workspace = true } movement-syncing = { workspace = true } maptos-execution-util = { workspace = true } -chrono = { workspace = true } -rand = { workspace = true } futures = { workspace = true } -sysinfo = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true } diff --git a/migration/cli/migrate-node/Cargo.toml b/migration/cli/migrate-node/Cargo.toml index 7d73986..8b28793 100644 --- a/migration/cli/migrate-node/Cargo.toml +++ b/migration/cli/migrate-node/Cargo.toml @@ -19,17 +19,6 @@ orfile = { workspace = true } mtma-core = { workspace = true } jemallocator = { workspace = true } mtma-node-null-core = { workspace = true } -mtma-node-test-global-storage-injective-criterion = { workspace = true } -mtma-node-test-global-storage-includes-criterion = { workspace = true } -mtma-node-test-global-storage-not-empty-criterion = { workspace = true } -mtma-node-preludes = { workspace = true } -mtma-node-test-types = { workspace = true } -movement-syncing = { workspace = true } -maptos-execution-util = { workspace = true } -chrono = { workspace = true } -rand = { workspace = true } -futures = { workspace = true } -sysinfo = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true } slect = { workspace = true } @@ -39,5 +28,8 @@ mtma-provisioner-environment = { workspace = true } mtma-environment-types = { workspace = true } mtma-migrator-types = { workspace = true } +[package.metadata.cargo-machete] +ignored = ["tracing"] + [lints] workspace = true diff --git a/migration/cli/migrate/Cargo.toml b/migration/cli/migrate/Cargo.toml index 447dbb0..5821c82 100644 --- a/migration/cli/migrate/Cargo.toml +++ b/migration/cli/migrate/Cargo.toml @@ -18,20 +18,11 @@ clap-markdown-ext = { workspace = true } orfile = { workspace = true } mtma-core = { workspace = true } jemallocator = { workspace = true } -mtma-node-null-core = { workspace = true } -mtma-node-test-global-storage-injective-criterion = { workspace = true } -mtma-node-test-global-storage-includes-criterion = { workspace = true } -mtma-node-test-global-storage-not-empty-criterion = { workspace = true } -mtma-node-preludes = { workspace = true } -mtma-node-test-types = { workspace = true } -movement-syncing = { workspace = true } -maptos-execution-util = { workspace = true } -chrono = { workspace = true } -rand = { workspace = true } -futures = { workspace = true } -sysinfo = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true } +[package.metadata.cargo-machete] +ignored = ["tracing"] + [lints] workspace = true diff --git a/migration/cli/mtma-dev/Cargo.toml b/migration/cli/mtma-dev/Cargo.toml index d1bdfda..58fb03f 100644 --- a/migration/cli/mtma-dev/Cargo.toml +++ b/migration/cli/mtma-dev/Cargo.toml @@ -10,26 +10,11 @@ rust-version = { workspace = true } [dependencies] tokio = { workspace = true } -serde = { workspace = true, features = ["derive"] } clap = { workspace = true, features = ["derive"] } dotenv = { workspace = true } anyhow = { workspace = true } clap-markdown-ext = { workspace = true } -orfile = { workspace = true } -mtma-core = { workspace = true } jemallocator = { workspace = true } -mtma-node-null-core = { workspace = true } -mtma-node-test-global-storage-injective-criterion = { workspace = true } -mtma-node-test-global-storage-includes-criterion = { workspace = true } -mtma-node-test-global-storage-not-empty-criterion = { workspace = true } -mtma-node-preludes = { workspace = true } -mtma-node-test-types = { workspace = true } -movement-syncing = { workspace = true } -maptos-execution-util = { workspace = true } -chrono = { workspace = true } -rand = { workspace = true } -futures = { workspace = true } -sysinfo = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true } @@ -41,5 +26,8 @@ mtma-check-dev = { workspace = true } mtma-migrate-dev = { workspace = true } mtma-track-dev = { workspace = true } +[package.metadata.cargo-machete] +ignored = ["tracing"] + [lints] workspace = true diff --git a/migration/cli/mtma/Cargo.toml b/migration/cli/mtma/Cargo.toml index 4724ee0..411d6f5 100644 --- a/migration/cli/mtma/Cargo.toml +++ b/migration/cli/mtma/Cargo.toml @@ -18,20 +18,11 @@ clap-markdown-ext = { workspace = true } orfile = { workspace = true } mtma-core = { workspace = true } jemallocator = { workspace = true } -mtma-node-null-core = { workspace = true } -mtma-node-test-global-storage-injective-criterion = { workspace = true } -mtma-node-test-global-storage-includes-criterion = { workspace = true } -mtma-node-test-global-storage-not-empty-criterion = { workspace = true } -mtma-node-preludes = { workspace = true } -mtma-node-test-types = { workspace = true } -movement-syncing = { workspace = true } -maptos-execution-util = { workspace = true } -chrono = { workspace = true } -rand = { workspace = true } -futures = { workspace = true } -sysinfo = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true } +[package.metadata.cargo-machete] +ignored = ["tracing"] + [lints] workspace = true diff --git a/migration/cli/track-dev/Cargo.toml b/migration/cli/track-dev/Cargo.toml index 746825d..3a347be 100644 --- a/migration/cli/track-dev/Cargo.toml +++ b/migration/cli/track-dev/Cargo.toml @@ -16,22 +16,12 @@ dotenv = { workspace = true } anyhow = { workspace = true } clap-markdown-ext = { workspace = true } orfile = { workspace = true } -mtma-core = { workspace = true } jemallocator = { workspace = true } -mtma-node-null-core = { workspace = true } -mtma-node-test-global-storage-injective-criterion = { workspace = true } -mtma-node-test-global-storage-includes-criterion = { workspace = true } -mtma-node-test-global-storage-not-empty-criterion = { workspace = true } -mtma-node-preludes = { workspace = true } -mtma-node-test-types = { workspace = true } -movement-syncing = { workspace = true } -maptos-execution-util = { workspace = true } -chrono = { workspace = true } -rand = { workspace = true } -futures = { workspace = true } -sysinfo = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true } +[package.metadata.cargo-machete] +ignored = ["tracing"] + [lints] workspace = true diff --git a/migration/cli/track/Cargo.toml b/migration/cli/track/Cargo.toml index c2e22b6..7fe8739 100644 --- a/migration/cli/track/Cargo.toml +++ b/migration/cli/track/Cargo.toml @@ -16,22 +16,12 @@ dotenv = { workspace = true } anyhow = { workspace = true } clap-markdown-ext = { workspace = true } orfile = { workspace = true } -mtma-core = { workspace = true } jemallocator = { workspace = true } -mtma-node-null-core = { workspace = true } -mtma-node-test-global-storage-injective-criterion = { workspace = true } -mtma-node-test-global-storage-includes-criterion = { workspace = true } -mtma-node-test-global-storage-not-empty-criterion = { workspace = true } -mtma-node-preludes = { workspace = true } -mtma-node-test-types = { workspace = true } -movement-syncing = { workspace = true } -maptos-execution-util = { workspace = true } -chrono = { workspace = true } -rand = { workspace = true } -futures = { workspace = true } -sysinfo = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true } +[package.metadata.cargo-machete] +ignored = ["tracing"] + [lints] workspace = true diff --git a/migration/core/migrator/mtma-null/Cargo.toml b/migration/core/migrator/mtma-null/Cargo.toml index 931b718..e455b9f 100644 --- a/migration/core/migrator/mtma-null/Cargo.toml +++ b/migration/core/migrator/mtma-null/Cargo.toml @@ -9,20 +9,11 @@ publish = { workspace = true } rust-version = { workspace = true } [dependencies] -tokio = { workspace = true } serde = { workspace = true, features = ["derive"] } clap = { workspace = true, features = ["derive"] } -dotenv = { workspace = true } anyhow = { workspace = true } -clap-markdown-ext = { workspace = true } thiserror = { workspace = true } -orfile = { workspace = true } mtma-node-types = { workspace = true } -aptos-db = { workspace = true } -aptos-storage-interface = { workspace = true } -aptos-config = { workspace = true } -aptos-executor = { workspace = true } -aptos-vm = { workspace = true } chrono = { workspace = true } walkdir = { workspace = true } uuid = { workspace = true } diff --git a/migration/core/migrator/pre-l1-merge/Cargo.toml b/migration/core/migrator/pre-l1-merge/Cargo.toml index 7c71736..d8d1f88 100644 --- a/migration/core/migrator/pre-l1-merge/Cargo.toml +++ b/migration/core/migrator/pre-l1-merge/Cargo.toml @@ -12,26 +12,11 @@ rust-version = { workspace = true } tokio = { workspace = true } serde = { workspace = true, features = ["derive"] } clap = { workspace = true, features = ["derive"] } -dotenv = { workspace = true } anyhow = { workspace = true } -clap-markdown-ext = { workspace = true } thiserror = { workspace = true } -orfile = { workspace = true } -mtma-node-types = { workspace = true } mtma-migrator-types = { workspace = true } mtma-node-null-core = { workspace = true } -aptos-db = { workspace = true } -aptos-storage-interface = { workspace = true } -aptos-config = { workspace = true } -aptos-executor = { workspace = true } -aptos-vm = { workspace = true } -chrono = { workspace = true } -walkdir = { workspace = true } -uuid = { workspace = true } -tracing = { workspace = true } aptos-framework-pre-l1-merge-release = { workspace = true } -movement-signer = { workspace = true } -movement-signer-loader = { workspace = true } hex = { workspace = true } mtma-types = { workspace = true } movement-core = { workspace = true } diff --git a/migration/core/mtma-migrate-chain/Cargo.toml b/migration/core/mtma-migrate-chain/Cargo.toml index b77ca9a..6b324b2 100644 --- a/migration/core/mtma-migrate-chain/Cargo.toml +++ b/migration/core/mtma-migrate-chain/Cargo.toml @@ -9,15 +9,10 @@ publish = { workspace = true } rust-version = { workspace = true } [dependencies] -tokio = { workspace = true } serde = { workspace = true, features = ["derive"] } clap = { workspace = true, features = ["derive"] } -dotenv = { workspace = true } anyhow = { workspace = true } -clap-markdown-ext = { workspace = true } thiserror = { workspace = true } -orfile = { workspace = true } -mtma-core = { workspace = true } [lints] workspace = true \ No newline at end of file diff --git a/migration/core/mtma/Cargo.toml b/migration/core/mtma/Cargo.toml index c124720..9867c8f 100644 --- a/migration/core/mtma/Cargo.toml +++ b/migration/core/mtma/Cargo.toml @@ -9,14 +9,9 @@ publish = { workspace = true } rust-version = { workspace = true } [dependencies] -tokio = { workspace = true } serde = { workspace = true, features = ["derive"] } clap = { workspace = true, features = ["derive"] } -dotenv = { workspace = true } -anyhow = { workspace = true } -clap-markdown-ext = { workspace = true } thiserror = { workspace = true } -orfile = { workspace = true } [lints] workspace = true diff --git a/migration/core/node/mtma-null/Cargo.toml b/migration/core/node/mtma-null/Cargo.toml index 779760c..4949400 100644 --- a/migration/core/node/mtma-null/Cargo.toml +++ b/migration/core/node/mtma-null/Cargo.toml @@ -9,24 +9,16 @@ publish = { workspace = true } rust-version = { workspace = true } [dependencies] -tokio = { workspace = true } serde = { workspace = true, features = ["derive"] } clap = { workspace = true, features = ["derive"] } -dotenv = { workspace = true } anyhow = { workspace = true } -clap-markdown-ext = { workspace = true } thiserror = { workspace = true } -orfile = { workspace = true } mtma-node-types = { workspace = true } -aptos-db = { workspace = true } -aptos-storage-interface = { workspace = true } -aptos-config = { workspace = true } -aptos-executor = { workspace = true } -aptos-vm = { workspace = true } chrono = { workspace = true } walkdir = { workspace = true } uuid = { workspace = true } tracing = { workspace = true } mtma-types = { workspace = true } + [lints] workspace = true diff --git a/migration/core/node/mtma-replay/Cargo.toml b/migration/core/node/mtma-replay/Cargo.toml index bfd5e66..a3990d5 100644 --- a/migration/core/node/mtma-replay/Cargo.toml +++ b/migration/core/node/mtma-replay/Cargo.toml @@ -9,23 +9,17 @@ publish = { workspace = true } rust-version = { workspace = true } [dependencies] -tokio = { workspace = true } serde = { workspace = true, features = ["derive"] } clap = { workspace = true, features = ["derive"] } -dotenv = { workspace = true } anyhow = { workspace = true } -clap-markdown-ext = { workspace = true } thiserror = { workspace = true } -orfile = { workspace = true } mtma-node-types = { workspace = true } aptos-db = { workspace = true } aptos-storage-interface = { workspace = true } aptos-config = { workspace = true } aptos-executor = { workspace = true } -aptos-vm = { workspace = true } aptos-vm-genesis = { workspace = true } chrono = { workspace = true } -walkdir = { workspace = true } uuid = { workspace = true } tracing = { workspace = true } aptos-executor-types = { workspace = true } diff --git a/migration/util/migrator-types/Cargo.toml b/migration/util/migrator-types/Cargo.toml index b262d46..3428e6d 100644 --- a/migration/util/migrator-types/Cargo.toml +++ b/migration/util/migrator-types/Cargo.toml @@ -10,23 +10,11 @@ rust-version = { workspace = true } [dependencies] mtma-node-types = { workspace = true } -serde = { workspace = true } anyhow = { workspace = true } -hex = { workspace = true } -maptos-opt-executor = { workspace = true } -aptos-executor = { workspace = true } -aptos-vm = { workspace = true } -aptos-types = { workspace = true } thiserror = { workspace = true } -aptos-storage-interface = { workspace = true } -either = { workspace = true } -tracing = { workspace = true } movement-core = { workspace = true } movement-aptos-core = { workspace = true } kestrel = { workspace = true } -movement-client = { workspace = true } -aptos-rest-client = { workspace = true } -aptos-config = { workspace = true } mtma-types = { workspace = true } [lints] diff --git a/migration/util/node-types/Cargo.toml b/migration/util/node-types/Cargo.toml index f04bb45..b19ba56 100644 --- a/migration/util/node-types/Cargo.toml +++ b/migration/util/node-types/Cargo.toml @@ -9,20 +9,13 @@ publish = { workspace = true } rust-version = { workspace = true } [dependencies] -serde = { workspace = true } anyhow = { workspace = true } -hex = { workspace = true } maptos-opt-executor = { workspace = true } -aptos-executor = { workspace = true } -aptos-vm = { workspace = true } -aptos-types = { workspace = true } thiserror = { workspace = true } -aptos-storage-interface = { workspace = true } either = { workspace = true } tracing = { workspace = true } movement-aptos-core = { workspace = true } futures-channel = { workspace = true } -tokio = { workspace = true } movement-util = { workspace = true } uuid = { workspace = true } walkdir = { workspace = true } diff --git a/util/movement-aptos/core/Cargo.toml b/util/movement-aptos/core/Cargo.toml index eb2a1d0..976d736 100644 --- a/util/movement-aptos/core/Cargo.toml +++ b/util/movement-aptos/core/Cargo.toml @@ -12,11 +12,8 @@ rust-version = { workspace = true } thiserror = { workspace = true } serde = { workspace = true } anyhow = { workspace = true } -hex = { workspace = true } -syncador = { workspace = true } tokio = { workspace = true } aptos-node = { workspace = true } -aptos-config = { workspace = true } serde_json = { workspace = true } clap = { workspace = true } jsonlvar = { workspace = true } diff --git a/util/movement-aptos/movement-aptos/Cargo.toml b/util/movement-aptos/movement-aptos/Cargo.toml index 674bc91..44f216a 100644 --- a/util/movement-aptos/movement-aptos/Cargo.toml +++ b/util/movement-aptos/movement-aptos/Cargo.toml @@ -21,5 +21,8 @@ movement-aptos-core = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true } +[package.metadata.cargo-machete] +ignored = ["tracing"] + [lints] workspace = true diff --git a/util/movement/core/Cargo.toml b/util/movement/core/Cargo.toml index 1bdc2a0..c859664 100644 --- a/util/movement/core/Cargo.toml +++ b/util/movement/core/Cargo.toml @@ -12,11 +12,6 @@ rust-version = { workspace = true } thiserror = { workspace = true } serde = { workspace = true } anyhow = { workspace = true } -hex = { workspace = true } -syncador = { workspace = true } -movement-types = { workspace = true } -tempdir = { workspace = true } -uuid = { workspace = true } include-vendor = { workspace = true } tokio = { workspace = true } jsonlvar = { workspace = true } diff --git a/util/movement/movement/Cargo.toml b/util/movement/movement/Cargo.toml index 9e0e405..f551580 100644 --- a/util/movement/movement/Cargo.toml +++ b/util/movement/movement/Cargo.toml @@ -16,10 +16,8 @@ dotenv = { workspace = true } anyhow = { workspace = true } clap-markdown-ext = { workspace = true } orfile = { workspace = true } -mtma-core = { workspace = true } jemallocator = { workspace = true } movement-core = { workspace = true } -tracing = { workspace = true } tracing-subscriber = { workspace = true } [lints] diff --git a/util/movement/syncing/Cargo.toml b/util/movement/syncing/Cargo.toml index 12ff3ef..4827fc8 100644 --- a/util/movement/syncing/Cargo.toml +++ b/util/movement/syncing/Cargo.toml @@ -9,9 +9,7 @@ publish = { workspace = true } rust-version = { workspace = true } [dependencies] -serde = { workspace = true } anyhow = { workspace = true } -hex = { workspace = true } syncador = { workspace = true } movement-types = { workspace = true } tempdir = { workspace = true } From 66aec5a399b28fd13ab37906400e891eebe29af5 Mon Sep 17 00:00:00 2001 From: Andy Golay Date: Thu, 12 Jun 2025 13:43:11 -0400 Subject: [PATCH 7/7] chore: add missing deps required for build --- Cargo.lock | 4 ++++ environments/core/box/Cargo.toml | 1 + environments/core/provisioner/Cargo.toml | 1 + environments/core/testing/Cargo.toml | 2 ++ environments/core/testing/src/environment/environment.rs | 1 + 5 files changed, 9 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index d3c6617..c88d879 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -15444,6 +15444,7 @@ name = "mtma-box-environment" version = "0.0.1" dependencies = [ "anyhow", + "clap 4.5.36", "mtma-environment-types", "mtma-migrator-types", "serde", @@ -15973,6 +15974,7 @@ name = "mtma-provisioner-environment" version = "0.0.1" dependencies = [ "anyhow", + "clap 4.5.36", "mtma-environment-types", "mtma-migrator-types", "serde", @@ -15984,12 +15986,14 @@ name = "mtma-testing-environment" version = "0.0.1" dependencies = [ "anyhow", + "clap 4.5.36", "kestrel", "movement-core", "mtma-environment-types", "mtma-migrator-types", "serde", "thiserror 1.0.69", + "tokio", ] [[package]] diff --git a/environments/core/box/Cargo.toml b/environments/core/box/Cargo.toml index fe91414..535f332 100644 --- a/environments/core/box/Cargo.toml +++ b/environments/core/box/Cargo.toml @@ -11,6 +11,7 @@ rust-version = { workspace = true } [dependencies] serde = { workspace = true, features = ["derive"] } anyhow = { workspace = true } +clap = { workspace = true } thiserror = { workspace = true } mtma-migrator-types = { workspace = true } mtma-environment-types = { workspace = true } diff --git a/environments/core/provisioner/Cargo.toml b/environments/core/provisioner/Cargo.toml index 8942824..c8d7a64 100644 --- a/environments/core/provisioner/Cargo.toml +++ b/environments/core/provisioner/Cargo.toml @@ -11,6 +11,7 @@ rust-version = { workspace = true } [dependencies] serde = { workspace = true, features = ["derive"] } anyhow = { workspace = true } +clap = { workspace = true } thiserror = { workspace = true } mtma-migrator-types = { workspace = true } mtma-environment-types = { workspace = true } diff --git a/environments/core/testing/Cargo.toml b/environments/core/testing/Cargo.toml index d7db5d3..c56dc3e 100644 --- a/environments/core/testing/Cargo.toml +++ b/environments/core/testing/Cargo.toml @@ -11,7 +11,9 @@ rust-version = { workspace = true } [dependencies] serde = { workspace = true, features = ["derive"] } anyhow = { workspace = true } +clap = { workspace = true } thiserror = { workspace = true } +tokio = { workspace = true } mtma-migrator-types = { workspace = true } mtma-environment-types = { workspace = true } movement-core = { workspace = true } diff --git a/environments/core/testing/src/environment/environment.rs b/environments/core/testing/src/environment/environment.rs index 12de11f..86d97bc 100644 --- a/environments/core/testing/src/environment/environment.rs +++ b/environments/core/testing/src/environment/environment.rs @@ -3,6 +3,7 @@ use movement_core::Overlays; use mtma_environment_types::{EnvironmentError, Environmentish}; use mtma_migrator_types::migrator::MovementMigrator; use std::fmt::Debug; +use tokio; /// Errors thrown when using the [TestingEnvironment]. #[derive(Debug, thiserror::Error)]