Skip to content

Commit b8b614a

Browse files
authored
Merge pull request #96 from movementlabsxyz/l-monninger/accounts-citerion-redux
chore: Accounts criterion redux
2 parents 694fc7e + 2c90f0c commit b8b614a

File tree

86 files changed

+3246
-1791
lines changed

Some content is hidden

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

86 files changed

+3246
-1791
lines changed

.github/workflows/nix-command.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ on:
1919

2020
jobs:
2121
run-command:
22-
runs-on: buildjet-16vcpu-ubuntu-2204
22+
runs-on: movement-runner
2323
steps:
2424
- name: Free Disk Space (Ubuntu)
2525
uses: jlumbroso/free-disk-space@main

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ debug
55
.env*
66
.idea
77
.direnv
8+
.DS_Store
89
.vendors
9-
.DS_Store

Cargo.lock

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

Cargo.toml

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ members = [
2020
"checks/migrator/citeria/*",
2121
"checks/migrator/checks/*",
2222
# util
23+
"util/bcs-ext",
2324
"util/movement/*",
2425
"util/movement-aptos/*",
26+
"util/bcs-ext",
27+
"util/types"
2528

2629
]
2730

@@ -81,6 +84,7 @@ libp2p = { version = "0.55.0", features = ["tcp", "quic"] }
8184
chrono = "0.4.31"
8285
rand = "0.7.3"
8386
uuid = "1.10.0"
87+
glob = "0.3.2"
8488

8589
poem = { version = "=3.1.3", features = ["anyhow", "compression", "rustls"] }
8690
poem-openapi = { version = "=5.1.2", features = ["swagger-ui", "url"] }
@@ -93,17 +97,20 @@ jemalloc-sys = "0.5.4"
9397
reqwest = { version = "0.12.11", features = ["json"] }
9498

9599
either = "1.8.1"
100+
bcs = { git = "https://github.com/aptos-labs/bcs.git", rev = "d31fab9d81748e2594be5cd5cdf845786a30562d" }
96101
tempdir = "0.3.7"
97102
sysinfo = "0.34.2"
98103
portpicker = "0.1.0"
99104

100105

101106
# movement
102-
maptos-opt-executor = { git = "https://github.com/movementlabsxyz/movement.git", rev = "aa1ffed1a113441a65662792d15682ad52406108" }
103-
movement-client = { git = "https://github.com/movementlabsxyz/movement.git", rev = "aa1ffed1a113441a65662792d15682ad52406108" }
104-
syncador = { git = "https://github.com/movementlabsxyz/movement.git", rev = "aa1ffed1a113441a65662792d15682ad52406108" }
105-
movement-types = { git = "https://github.com/movementlabsxyz/movement.git", rev = "aa1ffed1a113441a65662792d15682ad52406108" }
106-
maptos-execution-util = { git = "https://github.com/movementlabsxyz/movement.git", rev = "aa1ffed1a113441a65662792d15682ad52406108" }
107+
maptos-opt-executor = { git = "https://github.com/movementlabsxyz/movement.git", rev = "8f820a5c23ce2b632200043acdabb3e6582c078a" }
108+
movement-client = { git = "https://github.com/movementlabsxyz/movement.git", rev = "8f820a5c23ce2b632200043acdabb3e6582c078a" }
109+
syncador = { git = "https://github.com/movementlabsxyz/movement.git", rev = "8f820a5c23ce2b632200043acdabb3e6582c078a" }
110+
movement-types = { git = "https://github.com/movementlabsxyz/movement.git", rev = "8f820a5c23ce2b632200043acdabb3e6582c078a" }
111+
maptos-execution-util = { git = "https://github.com/movementlabsxyz/movement.git", rev = "8f820a5c23ce2b632200043acdabb3e6582c078a" }
112+
movement-util = { git = "https://github.com/movementlabsxyz/movement.git", rev = "8f820a5c23ce2b632200043acdabb3e6582c078a" }
113+
107114

108115
# aptos-core
109116
aptos-executor = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "cb3b7b02f68c7d6982257e4c59955d0e63b513db" }
@@ -117,6 +124,10 @@ aptos-config = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev
117124
aptos-db-indexer = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "cb3b7b02f68c7d6982257e4c59955d0e63b513db" }
118125
aptos-node = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "cb3b7b02f68c7d6982257e4c59955d0e63b513db" }
119126
aptos-cached-packages = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "cb3b7b02f68c7d6982257e4c59955d0e63b513db" }
127+
aptos-sdk = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "cb3b7b02f68c7d6982257e4c59955d0e63b513db" }
128+
aptos-crypto = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "cb3b7b02f68c7d6982257e4c59955d0e63b513db" }
129+
aptos-executor-types = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "cb3b7b02f68c7d6982257e4c59955d0e63b513db" }
130+
aptos-vm-genesis = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "cb3b7b02f68c7d6982257e4c59955d0e63b513db" }
120131

121132

122133
# secure-signing
@@ -125,12 +136,12 @@ secure-signer-loader = { git = "https://github.com/movementlabsxyz/secure-signin
125136
secure-signer-aws-kms = { git = "https://github.com/movementlabsxyz/secure-signing.git", rev = "f37eebd6d494d21b26b2faa44e1188de42ff1007" }
126137

127138
# kestrel
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" }
139+
kestrel = { git = "https://github.com/movementlabsxyz/kestrel.git", rev = "3220d704df7e06d1dcc5266e15eaf05db86fdb07" }
140+
jsonlvar = { git = "https://github.com/movementlabsxyz/kestrel.git", rev = "3220d704df7e06d1dcc5266e15eaf05db86fdb07" }
141+
commander = { git = "https://github.com/movementlabsxyz/kestrel.git", rev = "3220d704df7e06d1dcc5266e15eaf05db86fdb07" }
142+
include-dir = { git = "https://github.com/movementlabsxyz/kestrel.git", rev = "3220d704df7e06d1dcc5266e15eaf05db86fdb07" }
143+
include-vendor = { git = "https://github.com/movementlabsxyz/kestrel.git", rev = "3220d704df7e06d1dcc5266e15eaf05db86fdb07" }
144+
ready-docker = { git = "https://github.com/movementlabsxyz/kestrel.git", rev = "3220d704df7e06d1dcc5266e15eaf05db86fdb07" }
134145

135146
# orfile
136147
orfile = { git = "https://github.com/movementlabsxyz/orfile.git", rev = "b49cb42495816fa00a1107be5bbf41aff3a8255d" }
@@ -156,6 +167,8 @@ mtma-track-dev = { path = "migration/cli/track-dev" }
156167

157168
### core
158169
mtma-core = { path = "migration/core/mtma" }
170+
mtma-null-core = { path = "migration/core/mtma-null" }
171+
mtma-node-replay-core = { path = "migration/core/node/mtma-replay" }
159172
#### migrator
160173
mtma-migrator-null-core = { path = "migration/core/migrator/mtma-null" }
161174

@@ -178,13 +191,16 @@ mtma-node-test-global-storage-not-empty-criterion = { path = "checks/node/citeri
178191

179192
### e2e
180193
mtma-migrator-test-types = { path = "checks/migrator/util/types" }
181-
194+
mtma-migrator-test-accounts-equal-criterion = { path = "checks/migrator/citeria/accounts-equal" }
182195
## util
183-
movement-syncing = { path = "util/movement/movement-syncing" }
184-
movement-core = { path = "util/movement/movement-core" }
185-
movement-util = { path = "util/movement/movement-util" }
196+
bcs-ext = { path = "util/bcs-ext" }
197+
movement-syncing = { path = "util/movement/syncing" }
198+
movement-core = { path = "util/movement/core" }
199+
movement-core-util = { path = "util/movement/core-util" }
186200
movement-aptos = { path = "util/movement-aptos/movement-aptos" }
187-
movement-aptos-core = { path = "util/movement-aptos/movement-aptos-core" }
201+
movement-aptos-core = { path = "util/movement-aptos/core" }
202+
movement-aptos-core-util = { path = "util/movement-aptos/core-util" }
203+
mtma-types = { path = "util/types" }
188204

189205
[workspace.lints.clippy]
190206
debug_assert_with_mut_call = "deny"
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "mtma-migrator-checks-sketchpad"
2+
name = "migrator-sketchpad"
33
version = { workspace = true }
44
edition = { workspace = true }
55
license = { workspace = true }
@@ -9,20 +9,27 @@ publish = { workspace = true }
99
rust-version = { workspace = true }
1010

1111
[dependencies]
12+
mtma-types = { workspace = true }
1213
mtma-migrator-types = { workspace = true }
1314
mtma-migrator-test-types = { workspace = true }
1415
anyhow = { workspace = true }
16+
mtma-node-replay-core = { workspace = true }
17+
mtma-node-test-global-storage-injective-criterion = { workspace = true }
18+
mtma-node-test-global-storage-includes-criterion = { workspace = true }
19+
mtma-node-test-global-storage-not-empty-criterion = { workspace = true }
20+
mtma-migrator-test-accounts-equal-criterion = { workspace = true }
21+
mtma-node-preludes = { workspace = true }
1522
mtma-node-null-core = { workspace = true }
1623
tokio = { workspace = true }
1724
chrono = { workspace = true }
1825
rand = { workspace = true }
1926
kestrel = { workspace = true }
20-
mtma-node-preludes = { workspace = true }
2127
mtma-node-test-types = { workspace = true }
2228

2329
[dev-dependencies]
2430
tracing-test = { workspace = true }
2531
tracing = { workspace = true }
32+
tempfile = { workspace = true }
2633

2734
[lints]
2835
workspace = true
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#[cfg(test)]
2+
pub mod test {
3+
4+
use anyhow::Context;
5+
use mtma_migrator_test_accounts_equal_criterion::AccountsEqual;
6+
use mtma_migrator_test_types::check::checked_migration;
7+
use mtma_migrator_types::migrator::{movement_migrator::Overlays, MovementMigrator};
8+
use mtma_node_null_core::config::Config as MtmaNullConfig;
9+
use mtma_node_test_types::prelude::Prelude;
10+
use tracing::info;
11+
12+
#[tokio::test(flavor = "multi_thread")]
13+
#[tracing_test::traced_test]
14+
async fn test_accounts_equal() -> Result<(), anyhow::Error> {
15+
// use a scope to ensure everything is dropped
16+
{
17+
// Form the migrator.
18+
let mut movement_migrator = MovementMigrator::try_temp()?;
19+
movement_migrator.set_overlays(Overlays::default());
20+
21+
// Start the migrator so that it's running in the background.
22+
// In the future, some migrators may be for already running nodes.
23+
let movement_migrator_for_task = movement_migrator.clone();
24+
let movement_migrator_task = kestrel::task(async move {
25+
movement_migrator_for_task.run().await?;
26+
Ok::<_, anyhow::Error>(())
27+
});
28+
29+
// wait for the rest client to be ready
30+
// once we have this, there should also be a config, so we can then kill off the migrator and proceed
31+
movement_migrator
32+
.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
33+
.await
34+
.context(
35+
"failed to wait for movement migrator rest client while running accounts equal manual prelude",
36+
)?;
37+
38+
kestrel::end!(movement_migrator_task)?;
39+
40+
// Form the prelude.
41+
// todo: this needs to be updated to use the prelude generator
42+
let prelude = Prelude::new_empty();
43+
44+
// Form the migration.
45+
let migration_config = MtmaNullConfig::default();
46+
let migration = migration_config.build()?;
47+
48+
// Run the checked migration.
49+
let accounts_equal = AccountsEqual::new();
50+
info!("Running migration");
51+
match checked_migration(
52+
&mut movement_migrator,
53+
&prelude,
54+
&migration,
55+
vec![accounts_equal],
56+
)
57+
.await
58+
{
59+
Ok(()) => {}
60+
Err(e) => {
61+
info!("Migration failed: {:?}", e);
62+
return Err(anyhow::anyhow!("Migration failed: {:?}", e));
63+
}
64+
}
65+
info!("Migration succeeded");
66+
}
67+
68+
// exit the test is fine when you only have one test per crate because when cargo test is run across a workspace, it actually multi-processes the tests by crate
69+
std::process::exit(0);
70+
71+
Ok(())
72+
}
73+
}

checks/migrator/checks/sketchpad/src/example.rs

Lines changed: 0 additions & 51 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pub mod example;
1+
pub mod accounts_equal;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[package]
2+
name = "mtma-migrator-test-accounts-equal-criterion"
3+
version = { workspace = true }
4+
edition = { workspace = true }
5+
license = { workspace = true }
6+
authors = { workspace = true }
7+
homepage = { workspace = true }
8+
publish = { workspace = true }
9+
rust-version = { workspace = true }
10+
11+
[dependencies]
12+
mtma-migrator-test-types = { workspace = true }
13+
bcs = { workspace = true }
14+
bcs-ext = { workspace = true }
15+
tokio = { workspace = true }
16+
anyhow = { workspace = true }
17+
tracing = { workspace = true }
18+
19+
[lints]
20+
workspace = true
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Accounts Equal
2+
Checks that accounts serialize to the same bytes.

0 commit comments

Comments
 (0)