Skip to content

Commit 694fc7e

Browse files
authored
Merge pull request #68 from movementlabsxyz/l-monninger/mtma-ergonomics
feat: mtma ergonomics; functions as feature branch for e2e CLI work
2 parents c8bb60e + d68c2e7 commit 694fc7e

File tree

214 files changed

+10662
-1771
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

214 files changed

+10662
-1771
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
target
22
*.pem
33
.debug
4+
debug
45
.env*
56
.idea
6-
.direnv
7+
.direnv
8+
.vendors
9+
.DS_Store

Cargo.lock

Lines changed: 2889 additions & 1256 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 66 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,22 @@ members = [
66

77
# migration
88
"migration/cli/*",
9-
"migration/core/*",
9+
"migration/core/mtma",
10+
"migration/core/node/*",
11+
"migration/core/migrator/*",
1012
"migration/util/*",
1113
# executor
12-
"checks/executor/util/*",
13-
"checks/executor/citeria/*",
14-
"checks/executor/checks/*",
15-
"checks/executor/preludes",
14+
"checks/node/util/*",
15+
"checks/node/citeria/*",
16+
"checks/node/checks/*",
17+
"checks/node/preludes",
1618
# e2e
17-
"checks/e2e/util/*",
18-
"checks/e2e/citeria/*",
19+
"checks/migrator/util/*",
20+
"checks/migrator/citeria/*",
21+
"checks/migrator/checks/*",
1922
# util
20-
"util/include-dir",
21-
"util/movement-syncing",
23+
"util/movement/*",
24+
"util/movement-aptos/*",
2225

2326
]
2427

@@ -39,8 +42,10 @@ async-trait = "0.1.71"
3942
clap = { version = "4.4.10", features = ["derive"] }
4043
dotenv = "0.15.0"
4144
futures = "0.3.17"
45+
futures-channel = "0.3.17"
4246
serde = "1.0"
4347
serde_json = "1.0.140"
48+
serde_yaml = "0.8.24"
4449
serde_derive = "1.0"
4550
thiserror = "1.0.50"
4651
tracing = "0.1.40"
@@ -85,10 +90,13 @@ jemallocator = { version = "0.5.0", features = [
8590
"unprefixed_malloc_on_supported_platforms",
8691
] }
8792
jemalloc-sys = "0.5.4"
93+
reqwest = { version = "0.12.11", features = ["json"] }
8894

8995
either = "1.8.1"
9096
tempdir = "0.3.7"
9197
sysinfo = "0.34.2"
98+
portpicker = "0.1.0"
99+
92100

93101
# movement
94102
maptos-opt-executor = { git = "https://github.com/movementlabsxyz/movement.git", rev = "aa1ffed1a113441a65662792d15682ad52406108" }
@@ -98,16 +106,17 @@ movement-types = { git = "https://github.com/movementlabsxyz/movement.git", rev
98106
maptos-execution-util = { git = "https://github.com/movementlabsxyz/movement.git", rev = "aa1ffed1a113441a65662792d15682ad52406108" }
99107

100108
# aptos-core
101-
aptos-executor = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "2941ee2b5876ab93cfb8010154c9466d7d593ed9" }
102-
aptos-vm = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "2941ee2b5876ab93cfb8010154c9466d7d593ed9" }
103-
aptos-rest-client = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "2941ee2b5876ab93cfb8010154c9466d7d593ed9" }
104-
aptos-storage-interface = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "2941ee2b5876ab93cfb8010154c9466d7d593ed9" }
105-
aptos-types = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "2941ee2b5876ab93cfb8010154c9466d7d593ed9" }
106-
aptos-db = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "2941ee2b5876ab93cfb8010154c9466d7d593ed9" }
107-
aptos_schemadb = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "2941ee2b5876ab93cfb8010154c9466d7d593ed9" }
108-
aptos-config = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "2941ee2b5876ab93cfb8010154c9466d7d593ed9" }
109-
aptos-db-indexer = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "2941ee2b5876ab93cfb8010154c9466d7d593ed9" }
110-
# model checking and verification
109+
aptos-executor = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "cb3b7b02f68c7d6982257e4c59955d0e63b513db" }
110+
aptos-vm = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "cb3b7b02f68c7d6982257e4c59955d0e63b513db" }
111+
aptos-rest-client = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "cb3b7b02f68c7d6982257e4c59955d0e63b513db" }
112+
aptos-storage-interface = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "cb3b7b02f68c7d6982257e4c59955d0e63b513db" }
113+
aptos-types = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "cb3b7b02f68c7d6982257e4c59955d0e63b513db" }
114+
aptos-db = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "cb3b7b02f68c7d6982257e4c59955d0e63b513db" }
115+
aptos_schemadb = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "cb3b7b02f68c7d6982257e4c59955d0e63b513db" }
116+
aptos-config = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "cb3b7b02f68c7d6982257e4c59955d0e63b513db" }
117+
aptos-db-indexer = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "cb3b7b02f68c7d6982257e4c59955d0e63b513db" }
118+
aptos-node = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "cb3b7b02f68c7d6982257e4c59955d0e63b513db" }
119+
aptos-cached-packages = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "cb3b7b02f68c7d6982257e4c59955d0e63b513db" }
111120

112121

113122
# secure-signing
@@ -116,43 +125,66 @@ secure-signer-loader = { git = "https://github.com/movementlabsxyz/secure-signin
116125
secure-signer-aws-kms = { git = "https://github.com/movementlabsxyz/secure-signing.git", rev = "f37eebd6d494d21b26b2faa44e1188de42ff1007" }
117126

118127
# kestrel
119-
kestrel = { git = "https://github.com/movementlabsxyz/kestrel.git", rev = "85e2f681ae3e54b29bb18d4ed7ca750116173321" }
120-
jsonlvar = { git = "https://github.com/movementlabsxyz/kestrel.git", rev = "85e2f681ae3e54b29bb18d4ed7ca750116173321" }
121-
commander = { git = "https://github.com/movementlabsxyz/kestrel.git", rev = "85e2f681ae3e54b29bb18d4ed7ca750116173321" }
128+
kestrel = { git = "https://github.com/movementlabsxyz/kestrel.git", rev = "9c56eb9f6dde1564493835c7e2c61b9fd2b00a6c" }
129+
jsonlvar = { git = "https://github.com/movementlabsxyz/kestrel.git", rev = "9c56eb9f6dde1564493835c7e2c61b9fd2b00a6c" }
130+
commander = { git = "https://github.com/movementlabsxyz/kestrel.git", rev = "9c56eb9f6dde1564493835c7e2c61b9fd2b00a6c" }
131+
include-dir = { git = "https://github.com/movementlabsxyz/kestrel.git", rev = "9c56eb9f6dde1564493835c7e2c61b9fd2b00a6c" }
132+
include-vendor = { git = "https://github.com/movementlabsxyz/kestrel.git", rev = "9c56eb9f6dde1564493835c7e2c61b9fd2b00a6c" }
133+
ready-docker = { git = "https://github.com/movementlabsxyz/kestrel.git", rev = "9c56eb9f6dde1564493835c7e2c61b9fd2b00a6c" }
122134

123135
# orfile
124-
orfile = { git = "https://github.com/movementlabsxyz/orfile.git", rev = "d02299214e5aa202130cd1eb9593ce8064d1ec69" }
136+
orfile = { git = "https://github.com/movementlabsxyz/orfile.git", rev = "b49cb42495816fa00a1107be5bbf41aff3a8255d" }
125137

126138
# docs
127139
clap-markdown-ext = { git = "https://github.com/movementlabsxyz/clap-markdown-ext.git", rev = "8f54fe424504bf37fb01dc69aaed8166e429fe6a" }
128140

129141
# internal
130142
## migration
143+
### cli
144+
mtma = { path = "migration/cli/mtma" }
145+
mtma-dev = { path = "migration/cli/mtma-dev" }
146+
mtma-check = { path = "migration/cli/check" }
147+
mtma-check-dev = { path = "migration/cli/check-dev" }
148+
mtma-migrate = { path = "migration/cli/migrate" }
149+
mtma-migrate-dev = { path = "migration/cli/migrate-dev" }
150+
mtma-migrate-chain = { path = "migration/cli/migrate-chain" }
151+
mtma-migrate-chain-dev = { path = "migration/cli/migrate-chain-dev" }
152+
mtma-migrate-node = { path = "migration/cli/migrate-node" }
153+
mtma-migrate-node-dev = { path = "migration/cli/migrate-node-dev" }
154+
mtma-track = { path = "migration/cli/track" }
155+
mtma-track-dev = { path = "migration/cli/track-dev" }
131156

132157
### core
133158
mtma-core = { path = "migration/core/mtma" }
134-
mtma-null-core = { path = "migration/core/mtma-null" }
159+
#### migrator
160+
mtma-migrator-null-core = { path = "migration/core/migrator/mtma-null" }
161+
162+
#### node
163+
mtma-node-null-core = { path = "migration/core/node/mtma-null" }
135164

136165
### preludes
137-
migration-executor-preludes = { path = "checks/executor/preludes" }
166+
mtma-node-preludes = { path = "checks/node/preludes" }
138167

139168
### util
140-
migration-executor-types = { path = "migration/util/executor-types" }
141-
169+
mtma-node-types = { path = "migration/util/node-types" }
170+
mtma-migrator-types = { path = "migration/util/migrator-types" }
142171
## checks
143172
### executor
144-
migration-executor-test-types = { path = "checks/executor/util/types" }
145-
migration-executor-test-global-storage-injective-criterion = { path = "checks/executor/citeria/global-storage-injective" }
146-
migration-executor-test-global-storage-includes-criterion = { path = "checks/executor/citeria/global-storage-includes" }
147-
migration-executor-test-global-storage-not-empty-criterion = { path = "checks/executor/citeria/global-storage-not-empty" }
173+
mtma-node-test-types = { path = "checks/node/util/types" }
174+
mtma-node-test-global-storage-injective-criterion = { path = "checks/node/citeria/global-storage-injective" }
175+
mtma-node-test-global-storage-includes-criterion = { path = "checks/node/citeria/global-storage-includes" }
176+
mtma-node-test-global-storage-not-empty-criterion = { path = "checks/node/citeria/global-storage-not-empty" }
148177

149178

150179
### e2e
151-
migration-e2e-test-types = { path = "checks/e2e/util/types" }
180+
mtma-migrator-test-types = { path = "checks/migrator/util/types" }
152181

153182
## util
154-
include-dir = { path = "util/include-dir" }
155-
movement-syncing = { path = "util/movement-syncing" }
183+
movement-syncing = { path = "util/movement/movement-syncing" }
184+
movement-core = { path = "util/movement/movement-core" }
185+
movement-util = { path = "util/movement/movement-util" }
186+
movement-aptos = { path = "util/movement-aptos/movement-aptos" }
187+
movement-aptos-core = { path = "util/movement-aptos/movement-aptos-core" }
156188

157189
[workspace.lints.clippy]
158190
debug_assert_with_mut_call = "deny"

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ We otherwise recommend reading the [checks](./checks/README.md) and working down
2323

2424
Please see [CONTRIBUTING.md](CONTRIBUTING.md) file for additional contribution guidelines.
2525

26+
## Strategies
27+
The migration is organized into passes, which are categorized as follows:
28+
29+
- [`node`](/migration/core/node) for migration passes that take place with access to node processes, memory, and disk.
30+
- `transaction` is suggested but not broken out for all over-the-wire/transaction-based migration passes.
31+
- [`migrator`](migration/core/migrator) for migration passes that take place with direct or indirect access to all other levels of abstraction--everything that is needed to migrate.
32+
2633
## Organization
2734

2835
There are five subdirectories which progressively build on one another for node logic.
File renamed without changes.

checks/executor/checks/sketchpad/Cargo.toml renamed to checks/migrator/checks/sketchpad/Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "migration-executor-checks-sketchpad"
2+
name = "mtma-migrator-checks-sketchpad"
33
version = { workspace = true }
44
edition = { workspace = true }
55
license = { workspace = true }
@@ -9,16 +9,16 @@ publish = { workspace = true }
99
rust-version = { workspace = true }
1010

1111
[dependencies]
12-
migration-executor-test-types = { workspace = true }
12+
mtma-migrator-types = { workspace = true }
13+
mtma-migrator-test-types = { workspace = true }
1314
anyhow = { workspace = true }
14-
mtma-null-core = { workspace = true }
15-
migration-executor-test-global-storage-injective-criterion = { workspace = true }
16-
migration-executor-test-global-storage-includes-criterion = { workspace = true }
17-
migration-executor-test-global-storage-not-empty-criterion = { workspace = true }
18-
migration-executor-preludes = { workspace = true }
15+
mtma-node-null-core = { workspace = true }
1916
tokio = { workspace = true }
2017
chrono = { workspace = true }
2118
rand = { workspace = true }
19+
kestrel = { workspace = true }
20+
mtma-node-preludes = { workspace = true }
21+
mtma-node-test-types = { workspace = true }
2222

2323
[dev-dependencies]
2424
tracing-test = { workspace = true }
File renamed without changes.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#[cfg(test)]
2+
pub mod test {
3+
4+
use mtma_migrator_test_types::check::checked_migration;
5+
use mtma_migrator_types::migrator::MovementMigrator;
6+
use mtma_node_null_core::config::Config as MtmaNullConfig;
7+
use mtma_node_test_types::prelude::Prelude;
8+
9+
#[ignore] // this is just an example, so it's not expected to pass
10+
#[tokio::test]
11+
#[tracing_test::traced_test]
12+
async fn test_global_storage_includes_null() -> Result<(), anyhow::Error> {
13+
// Form the migrator.
14+
let mut movement_migrator = MovementMigrator::try_temp()?;
15+
16+
// Start the migrator so that it's running in the background.
17+
// In the future, some migrators may be for already running nodes.
18+
let movement_migrator_for_task = movement_migrator.clone();
19+
let movement_migrator_task = kestrel::task(async move {
20+
movement_migrator_for_task.run().await?;
21+
Ok::<_, anyhow::Error>(())
22+
});
23+
24+
// Form the prelude.
25+
// todo: this needs to be updated to use the prelude generator
26+
let prelude = Prelude::new_empty();
27+
28+
// Form the migration.
29+
let migration_config = MtmaNullConfig::default();
30+
let migration = migration_config.build()?;
31+
32+
// Run the checked migration.
33+
checked_migration(&mut movement_migrator, &prelude, &migration, vec![]).await?;
34+
35+
// WITHIN THE CRITERION, you'd be able to do similar background startup and processing to the above. The [Migrationish] trait will give you a [MovementAptosMigrator] which can spawn the runner in the background.
36+
//
37+
// Note: WITHIN THE CRITERION, you'll be able to do something like the below.
38+
// let movement_aptos_migrator_for_task = movement_aptos_migrator.clone();
39+
// let movement_aptos_migrator_task = kestrel::task(async move {
40+
// movement_aptos_migrator_for_task.run().await?;
41+
// Ok::<_, anyhow::Error>(())
42+
// });
43+
// // TODO: SOMETHING
44+
// kestrel::end!(movement_aptos_migrator_task)?;
45+
46+
// end the running migrators
47+
kestrel::end!(movement_migrator_task)?;
48+
49+
Ok(())
50+
}
51+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub mod example;
File renamed without changes.

0 commit comments

Comments
 (0)