Skip to content

Commit 338d56b

Browse files
mzabaluevl-monninger
authored andcommitted
fix: Celestia mainnet config (#1038)
Co-authored-by: Liam Monninger <[email protected]>
1 parent fcfafac commit 338d56b

File tree

45 files changed

+895
-1683
lines changed

Some content is hidden

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

45 files changed

+895
-1683
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ movement-signing-eth = { path = "util/signing/integrations/eth" }
152152
vaultrs = { version = "0.7.3" }
153153
aws-sdk-kms = "1.51.0"
154154
google-cloud-kms = "0.6.0"
155-
base64 = { version = "0.13.0" }
156155

157156
# Serialization and Deserialization
158157
serde = "1.0"
@@ -229,8 +228,8 @@ secp256k1 = { version = "0.27", default-features = false, features = [
229228
] }
230229

231230
## Celestia Dependencies
232-
celestia-rpc = { git = "https://github.com/movementlabsxyz/lumina", rev = "2d16e6733949f6bf70849eb60c14114e6d8ea63e" } #{ version = "0.7.0" }
233-
celestia-types = { git = "https://github.com/movementlabsxyz/lumina", rev = "2d16e6733949f6bf70849eb60c14114e6d8ea63e" } #{ version = "0.7.0" }
231+
celestia-rpc = { git = "https://github.com/eigerco/lumina", rev = "c6e5b7f5e3a3040bce4262fe5fba5c21a2637b5" } #{ version = "0.7.0" }
232+
celestia-types = { git = "https://github.com/eigerco/lumina", rev = "c6e5b7f5e3a3040bce4262fe5fba5c21a2637b5" } #{ version = "0.7.0" }
234233

235234
# External Dependencies
236235

@@ -267,6 +266,7 @@ async-stream = "0.3.0"
267266
async-trait = "0.1.71"
268267
async-recursion = "1.1.1"
269268
auto_impl = "1.2.0"
269+
base64 = { version = "0.22.1" }
270270
blake3 = { version = "1.4.0", features = ["traits-preview"] }
271271
bytes = { version = "1.2.1", default-features = false }
272272
chrono = "0.4.37"
@@ -288,9 +288,8 @@ hex = { version = "0.4.3", default-features = false, features = [
288288
ics23 = { version = "0.11.0" }
289289
k256 = { version = "0.13.3" }
290290
keccak-hash = "0.10.0"
291-
itertools = { version = "0.12.1", default-features = false }
291+
itertools = { version = "0.13.0", default-features = false }
292292
jmt = "0.9.0"
293-
jsonrpsee = { version = "0.20.1", features = ["jsonrpsee-types"] }
294293
log = "0.4.21"
295294
mirai-annotations = "1.10.1"
296295
move-vm-integration-test-helpers = { path = "test-helpers/move-vm-integration-test-helpers" }
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
services:
2+
setup:
3+
image: ghcr.io/movementlabsxyz/movement-full-node-setup:${CONTAINER_REV}
4+
container_name: setup
5+
environment:
6+
CELESTIA_NAMESPACE: "0xa21de06de7aa38c2a812"
7+
CELESTIA_NETWORK: mainnet
8+
# ws://celestia-light-node:26658
9+
CELESTIA_WEBSOCKET_CONNECTION_PROTOCOL: ws
10+
CELESTIA_WEBSOCKET_CONNECTION_HOSTNAME: celestia-light-node
11+
CELESTIA_WEBSOCKET_CONNECTION_PORT: 26658
12+
INDEXER_PROCESSOR_POSTGRES_CONNECTION_STRING: postgres://postgres:password@postgres:5432/postgres
13+
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
14+
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
15+
AWS_REGION: ${AWS_DEFAULT_REGION}
16+
volumes:
17+
- ${DOT_MOVEMENT_PATH}:/.movement
18+
healthcheck:
19+
test: [ "CMD-SHELL", "echo 'health check'" ]
20+
retries: 30
21+
interval: 10s
22+
timeout: 5s
23+
24+
celestia-light-node:
25+
image: ghcr.io/celestiaorg/celestia-node:v0.21.5
26+
container_name: celestia-light-node
27+
command: |
28+
celestia light start
29+
--core.ip rpc.celestia.pops.one
30+
--p2p.network celestia
31+
--node.store /.movement/celestia/movement/.celestia-light
32+
--keyring.backend test
33+
--keyring.keyname movement_celestia_light
34+
--log.level WARN
35+
environment:
36+
- NODE_TYPE=light
37+
- P2P_NETWORK=celestia
38+
volumes:
39+
- ${DOT_MOVEMENT_PATH}/celestia:/.movement/celestia
40+
ports:
41+
- 26658:26658
42+
depends_on:
43+
setup:
44+
condition: service_healthy
45+
healthcheck:
46+
test: "celestia node info"
47+
restart: on-failure:3
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
services:
2+
3+
# turn off movement-faucet-service
4+
movement-faucet-service:
5+
image: busybox
6+
container_name: movement-faucet-service
7+
command: sleep infinity
8+
healthcheck:
9+
test: [ "CMD-SHELL", "echo 'health check'" ]
10+
retries: 3
11+
start_period: 3s

networks/movement/movement-config/src/migrations/elsa_to_biarritz_rc1/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,8 +607,11 @@ mod tests {
607607
})
608608
);
609609

610-
let da_signers = match &config.celestia_da_light_node.celestia_da_light_node_config {
611-
movement_da_util::config::Config::Local(local) => &local.da_light_node.da_signers,
610+
let da_light_node_config = &config.celestia_da_light_node.celestia_da_light_node_config;
611+
let da_signers = match &da_light_node_config.network {
612+
movement_da_util::config::Network::Local => {
613+
&da_light_node_config.da_light_node.da_signers
614+
}
612615
_ => panic!("Expected Local"),
613616
};
614617

networks/movement/movement-config/src/releases/biarritz_rc1/da_db.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ use serde::{Deserialize, Serialize};
55
pub struct Config {
66
#[serde(default = "default_da_db_path")]
77
pub da_db_path: String,
8+
#[serde(default = "default_start_sync_height")]
9+
pub start_sync_height: u64,
810
}
911

1012
impl Default for Config {
1113
fn default() -> Self {
12-
Self { da_db_path: default_da_db_path() }
14+
Self { da_db_path: default_da_db_path(), start_sync_height: default_start_sync_height() }
1315
}
1416
}
1517

1618
env_default!(default_da_db_path, "SUZUKA_DA_DB_PATH", String, "movement-da-db".to_string());
19+
env_default!(default_start_sync_height, "MOVEMENT_START_SYNC_HEIGHT", u64, 0);

networks/movement/movement-full-node/src/node/da_db.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ impl DaDB {
7777
Ok(())
7878
}
7979

80+
/// Get the synced height marker stored in the database.
8081
pub async fn get_synced_height(&self) -> Result<u64, anyhow::Error> {
8182
// This is heavy for this purpose, but progressively the contents of the DA DB will be used for more things
8283
let da_db = self.inner.clone();
@@ -97,4 +98,28 @@ impl DaDB {
9798
.await??;
9899
Ok(height)
99100
}
101+
102+
/// Set the initial value of the synced height, unless a value is stored.
103+
pub async fn initialize_synced_height(&self, min_height: u64) -> Result<(), anyhow::Error> {
104+
// This is heavy for this purpose, but progressively the contents of the DA DB will be used for more things
105+
let da_db = self.inner.clone();
106+
tokio::task::spawn_blocking(move || {
107+
let cf = da_db
108+
.cf_handle(SYNCED_HEIGHT)
109+
.ok_or(anyhow::anyhow!("No synced_height column family"))?;
110+
let height = da_db
111+
.get_cf(&cf, "synced_height")
112+
.map_err(|e| anyhow::anyhow!("Failed to get synced height: {:?}", e))?;
113+
if height.is_none() {
114+
let height = serde_json::to_string(&min_height)
115+
.map_err(|e| anyhow::anyhow!("Failed to serialize synced height: {:?}", e))?;
116+
da_db
117+
.put_cf(&cf, "synced_height", height)
118+
.map_err(|e| anyhow::anyhow!("Failed to set synced height: {:?}", e))?;
119+
}
120+
Ok::<(), anyhow::Error>(())
121+
})
122+
.await??;
123+
Ok(())
124+
}
100125
}

networks/movement/movement-full-node/src/node/partial.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,13 @@ impl MovementPartialNode<Executor> {
164164
let da_db =
165165
DaDB::open(&config.da_db.da_db_path).context("Failed to create or get DA DB")?;
166166

167+
// FIXME: the config value is probably misplaced
168+
da_db
169+
.initialize_synced_height(
170+
config.celestia_da_light_node.celestia_da_light_node_config.initial_height,
171+
)
172+
.await?;
173+
167174
Ok(Self {
168175
executor,
169176
light_node_client,

networks/movement/movement-full-node/src/node/tasks/execute_settle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ where
6969
{
7070
pub async fn run(mut self) -> anyhow::Result<()> {
7171
let synced_height = self.da_db.get_synced_height().await?;
72-
info!("Synced height: {:?}", synced_height);
72+
info!("DA synced height: {:?}", synced_height);
7373
let mut blocks_from_da = self
7474
.da_light_node_client
7575
.stream_read_from_height(StreamReadFromHeightRequest { height: synced_height })

networks/movement/movement-full-node/src/node/tasks/transaction_ingress.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//! Task to process incoming transactions and write to DA
22
33
use maptos_dof_execution::SignedTransaction;
4-
use movement_da_util::config::Config as LightNodeConfig;
54
use movement_da_light_node_client::MovementDaLightNodeClient;
65
use movement_da_light_node_proto::{BatchWriteRequest, BlobWrite};
6+
use movement_da_util::config::Config as LightNodeConfig;
77

88
use tokio::sync::mpsc;
99
use tracing::{info, warn};
@@ -43,7 +43,7 @@ impl Task {
4343

4444
// limit the total time batching transactions
4545
let start = Instant::now();
46-
let (_, half_building_time) = self.da_light_node_config.try_block_building_parameters()?;
46+
let (_, half_building_time) = self.da_light_node_config.block_building_parameters();
4747

4848
let mut transactions = Vec::new();
4949

0 commit comments

Comments
 (0)