Skip to content

Commit 3b5d0a9

Browse files
committed
chore: update overlays.
1 parent ba165dd commit 3b5d0a9

File tree

8 files changed

+68
-113
lines changed

8 files changed

+68
-113
lines changed

flake.lock

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

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
rust-overlay.url = "github:oxalica/rust-overlay/47beae969336c05e892e1e4a9dbaac9593de34ab";
55
flake-utils.url = "github:numtide/flake-utils";
66
crane.url = "github:ipetkov/crane";
7-
movement.url = "github:movementlabsxyz/movement/c57483427c16ab637ba05bd345b65d94785a8b08";
7+
movement.url = "github:movementlabsxyz/movement/ecb4dddebfdd6363af26977163c0803e57a0bbad";
88
};
99

1010
outputs = { nixpkgs, rust-overlay, flake-utils, crane, movement, ... }:

migration/cli/migrate-node/docs/cli/README.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,11 @@ The config for the [BoxEnvironment]
143143
Usage: --environment-box.* [OPTIONS] --rest-api-url <REST_API_URL> --db-dir <DB_DIR>
144144

145145
Options:
146-
--rest-api-url <REST_API_URL>
147-
The rest api url of the box environment
148-
--db-dir <DB_DIR>
149-
The db dir of the box environment
150-
--snapshot-dir <SNAPSHOT_DIR>
151-
Whether to isolate the box environment by snapshotting the movement
152-
runner and where to store the snapshot
153-
-h, --help
154-
Print help (see more with '--help')
146+
--rest-api-url <REST_API_URL> The rest api url of the box environment
147+
--db-dir <DB_DIR> The db dir of the box environment
148+
--snapshot-dir <SNAPSHOT_DIR> Whether to isolate the box environment by snapshotting the movement runner and where
149+
to store the snapshot
150+
-h, --help Print help (see more with '--help')
155151

156152
**Selection (3/4):** `environment-provisioner`
157153
The config for the [ProvisionerEnvironment]

migration/core/migrator/pre-l1-merge/src/migrate/config.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ use aptos_framework_pre_l1_merge_release::maptos_framework_release_util::{
44
LocalAccountReleaseSigner, OverrideAccountAddressReleaseSigner,
55
};
66
use clap::Parser;
7-
use movement_core::{
8-
movement::{Celestia, Eth},
9-
Config as MovementCoreConfig,
10-
};
7+
use movement_core::{Config as MovementCoreConfig, Overlays};
118
use mtma_node_null_core::Config as MtmaNodeNullConfig;
129
use mtma_types::movement::aptos_sdk::types::{
1310
account_address::AccountAddress, account_config::aptos_test_root_address, LocalAccount,
@@ -46,9 +43,7 @@ impl Default for Config {
4643
let mut movement_core = MovementCoreConfig {
4744
movement_config_string: None,
4845
setup: false,
49-
celestia: Celestia::Local,
50-
eth: Eth::Local,
51-
biarritz_rc1_to_pre_l1_merge: false,
46+
overlays: Overlays::default().as_vec(),
5247
ping_rest_api: false,
5348
ping_faucet: false,
5449
};

util/movement/core-util/src/lib.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pub use movement_config;
44
pub use movement_util::{self, *};
55

66
pub const CONTAINER_REPO: &str = "ghcr.io/movementlabsxyz";
7-
pub const CONTAINER_REV: &str = "c574834";
7+
pub const CONTAINER_REV: &str = "ecb4ddd";
88

99
#[derive(Debug, Clone)]
1010
pub struct Container<'a> {
@@ -33,10 +33,5 @@ impl<'a> Container<'a> {
3333

3434
pub const CONTAINERS: &[Container] = &[
3535
Container { repo: CONTAINER_REPO, name: "movement-full-node", rev: CONTAINER_REV },
36-
Container { repo: CONTAINER_REPO, name: "movement-celestia-da-light-node", rev: CONTAINER_REV },
37-
Container { repo: CONTAINER_REPO, name: "movement-full-node-setup", rev: CONTAINER_REV },
3836
Container { repo: CONTAINER_REPO, name: "movement-faucet-service", rev: CONTAINER_REV },
39-
Container { repo: CONTAINER_REPO, name: "movement-celestia-bridge", rev: CONTAINER_REV },
40-
Container { repo: CONTAINER_REPO, name: "movement-celestia-appd", rev: CONTAINER_REV },
41-
Container { repo: CONTAINER_REPO, name: "wait-for-celestia-light-node", rev: CONTAINER_REV },
4237
];

util/movement/core/src/config.rs

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::movement::{Celestia, Eth, Movement, MovementWorkspace, Overlay, Overlays};
1+
use crate::movement::{Movement, MovementWorkspace, Overlay, Overlays};
22
use clap::Parser;
33
use jsonlvar::Jsonl;
44
use movement_signer_loader::identifiers::SignerIdentifier;
@@ -23,21 +23,15 @@ pub struct Config {
2323
/// Whether to use the setup overlay.
2424
#[clap(long)]
2525
pub setup: bool,
26-
/// Which celestia network to use.
27-
#[clap(long)]
28-
pub celestia: Celestia,
29-
/// Which ethereum network to use.
30-
#[clap(long)]
31-
pub eth: Eth,
32-
/// Whether to use the BiarritizRc1ToPreL1Merge overlay.
33-
#[clap(long)]
34-
pub biarritz_rc1_to_pre_l1_merge: bool,
3526
/// Whether to ping the rest api to ensure it is responding to pings.
3627
#[clap(long)]
3728
pub ping_rest_api: bool,
3829
/// Whether to ping the faucet to ensure it is responding to pings.
3930
#[clap(long)]
4031
pub ping_faucet: bool,
32+
/// Overlays
33+
#[clap(long)]
34+
pub overlays: Vec<Overlay>,
4135
}
4236

4337
impl Config {
@@ -63,16 +57,7 @@ impl Config {
6357

6458
/// Computes the overlays for the movement runner.
6559
pub fn overlays(&self) -> Overlays {
66-
let mut overlays = Overlays::empty();
67-
68-
overlays.add(Overlay::Celestia(self.celestia));
69-
overlays.add(Overlay::Eth(self.eth));
70-
71-
if self.biarritz_rc1_to_pre_l1_merge {
72-
overlays.add(Overlay::TestMigrateBiarritzRc1ToPreL1Merge);
73-
}
74-
75-
overlays
60+
Overlays::new(self.overlays.iter().cloned().collect())
7661
}
7762

7863
/// Builds the config into a [Movement] runner.

util/movement/core/src/movement.rs

Lines changed: 44 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub mod faucet;
1111
pub mod rest_api;
1212
use std::path::PathBuf;
1313

14-
use faucet::{Faucet, ParseFaucet};
14+
use faucet::{Faucet as FaucetApi, ParseFaucet};
1515
use movement_signer_loader::identifiers::SignerIdentifier;
1616
use mtma_types::movement::movement_config::Config as MovementConfig;
1717
use rest_api::{ParseRestApi, RestApi};
@@ -26,90 +26,72 @@ vendor_workspace!(MovementWorkspace, "movement");
2626
/// The different overlays that can be applied to the movement runner. s
2727
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
2828
pub enum Overlay {
29-
/// The celestia overlay is used to run the movement runner on a select Celestia network.
30-
Celestia(Celestia),
31-
/// The eth overlay is used to run the movement runner on a select Ethereum network.
32-
Eth(Eth),
33-
/// The test migration overlay is used to run and check the migration to the L1 pre-merge chain.
34-
///
35-
/// TODO: in this repo, we may want to remove this from the runner and place it actual embeeded code under the -core lib for https://github.com/movementlabsxyz/movement-migration/issues/61
36-
TestMigrateBiarritzRc1ToPreL1Merge,
29+
/// The local overlay takes care of setting up the DA sequencer and the full nodd
30+
Local(Local),
31+
/// The faucet overlay adds the faucet to whatever orchestration
32+
Faucet(Faucet),
33+
/// The fullnode overlay is best used for connecting to an existing network
34+
Fullnode(Fullnode),
3735
}
3836

3937
impl Overlay {
4038
/// Returns the overlay as a string as would be used in a nix command.
4139
pub fn overlay_arg(&self) -> &str {
4240
match self {
43-
Self::Celestia(celestia) => celestia.overlay_arg(),
44-
Self::Eth(eth) => eth.overlay_arg(),
45-
Self::TestMigrateBiarritzRc1ToPreL1Merge => "test-migrate-biarritz-rc1-to-pre-l1-merge",
41+
Self::Local(local) => local.overlay_arg(),
42+
Self::Faucet(faucet) => faucet.overlay_arg(),
43+
Self::Fullnode(fullnode) => fullnode.overlay_arg(),
4644
}
4745
}
4846
}
4947

50-
/// Errors thrown when parsing an [Eth] network.
48+
/// Errors thrown when parsing an [Overlay] network.
5149
#[derive(Debug, thiserror::Error)]
52-
pub enum EthError {
53-
#[error("invalid ethereum network: {0}")]
54-
InvalidNetwork(#[source] Box<dyn std::error::Error + Send + Sync>),
55-
}
56-
57-
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
58-
pub enum Eth {
59-
/// The local network.
60-
Local,
50+
pub enum OverlayError {
51+
#[error("invalid overlay selection: {0}")]
52+
InvalidOverlaySelection(#[source] Box<dyn std::error::Error + Send + Sync>),
6153
}
6254

63-
impl FromStr for Eth {
64-
type Err = EthError;
55+
impl FromStr for Overlay {
56+
type Err = OverlayError;
6557

6658
fn from_str(s: &str) -> Result<Self, Self::Err> {
6759
Ok(match s {
68-
"local" => Self::Local,
69-
network => return Err(EthError::InvalidNetwork(network.into())),
60+
"local" => Self::Local(Local),
61+
"faucet" => Self::Faucet(Faucet),
62+
"fullnode" => Self::Fullnode(Fullnode),
63+
overlay => return Err(OverlayError::InvalidOverlaySelection(overlay.into())),
7064
})
7165
}
7266
}
7367

74-
impl Eth {
68+
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
69+
pub struct Local;
70+
71+
impl Local {
7572
/// Returns the overlay as a string as would be used in a nix command.
7673
pub fn overlay_arg(&self) -> &str {
77-
match self {
78-
Self::Local => "local",
79-
}
74+
"local"
8075
}
8176
}
8277

8378
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
84-
pub enum Celestia {
85-
/// The local network.
86-
Local,
87-
}
88-
89-
/// Errors thrown when parsing a [Celestia] network.
90-
#[derive(Debug, thiserror::Error)]
91-
pub enum CelestiaError {
92-
#[error("invalid celestia network: {0}")]
93-
InvalidNetwork(#[source] Box<dyn std::error::Error + Send + Sync>),
94-
}
79+
pub struct Faucet;
9580

96-
impl FromStr for Celestia {
97-
type Err = CelestiaError;
98-
99-
fn from_str(s: &str) -> Result<Self, Self::Err> {
100-
Ok(match s {
101-
"local" => Self::Local,
102-
network => return Err(CelestiaError::InvalidNetwork(network.into())),
103-
})
81+
impl Faucet {
82+
/// Returns the overlay as a string as would be used in a nix command.
83+
pub fn overlay_arg(&self) -> &str {
84+
"faucet"
10485
}
10586
}
10687

107-
impl Celestia {
88+
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
89+
pub struct Fullnode;
90+
91+
impl Fullnode {
10892
/// Returns the overlay as a string as would be used in a nix command.
10993
pub fn overlay_arg(&self) -> &str {
110-
match self {
111-
Self::Local => "local",
112-
}
94+
"fullnode"
11395
}
11496
}
11597

@@ -141,6 +123,10 @@ impl Overlays {
141123
pub fn to_overlay_args(&self) -> String {
142124
self.0.iter().map(|o| o.overlay_arg()).collect::<Vec<_>>().join(".")
143125
}
126+
127+
pub fn as_vec(&self) -> Vec<Overlay> {
128+
self.0.iter().cloned().collect()
129+
}
144130
}
145131

146132
impl From<BTreeSet<Overlay>> for Overlays {
@@ -152,8 +138,8 @@ impl From<BTreeSet<Overlay>> for Overlays {
152138
impl Default for Overlays {
153139
fn default() -> Self {
154140
Self::new(BTreeSet::new())
155-
.with(Overlay::Eth(Eth::Local))
156-
.with(Overlay::Celestia(Celestia::Local))
141+
.with(Overlay::Local(Local))
142+
.with(Overlay::Faucet(Faucet))
157143
}
158144
}
159145

@@ -199,7 +185,7 @@ pub struct Movement {
199185
/// Whether to ping the faucet to ensure it is responding to pings.
200186
ping_faucet: bool,
201187
/// The faucet state.
202-
faucet: State<Faucet>,
188+
faucet: State<FaucetApi>,
203189
}
204190

205191
/// Errors thrown when running [Movement].
@@ -376,8 +362,8 @@ impl Movement {
376362
&self.rest_api
377363
}
378364

379-
/// Borrows the [Faucet] state.
380-
pub fn faucet(&self) -> &State<Faucet> {
365+
/// Borrows the [FaucetApi] state.
366+
pub fn faucet(&self) -> &State<FaucetApi> {
381367
&self.faucet
382368
}
383369

util/movement/movement/docs/cli/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,17 +103,15 @@ Run the movement
103103

104104
Run run with all parameters passed explicitly as CLI flags. See Orfile documentation for more details: <https://github.com/movementlabsxyz/orfile>
105105

106-
**Usage:** `movement run where [OPTIONS] --celestia <CELESTIA> --eth <ETH>`
106+
**Usage:** `movement run where [OPTIONS]`
107107

108108
###### **Options:**
109109

110110
* `--movement-config-string <MOVEMENT_CONFIG_STRING>` — The movement config
111111
* `--setup` — Whether to use the setup overlay
112-
* `--celestia <CELESTIA>` — Which celestia network to use
113-
* `--eth <ETH>` — Which ethereum network to use
114-
* `--biarritz-rc1-to-pre-l1-merge` — Whether to use the BiarritizRc1ToPreL1Merge overlay
115112
* `--ping-rest-api` — Whether to ping the rest api to ensure it is responding to pings
116113
* `--ping-faucet` — Whether to ping the faucet to ensure it is responding to pings
114+
* `--overlays <OVERLAYS>` — Overlays
117115

118116

119117

0 commit comments

Comments
 (0)