Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Celestia mainnet config #1038

Merged
merged 39 commits into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
196c1fb
feat!: Celestia mainnet config
mzabaluev Feb 6, 2025
39b8d73
fix(CI): movement-da-util in unit-tests
mzabaluev Feb 6, 2025
180cdbd
fix: celestia mainnet URLs
mzabaluev Feb 10, 2025
29c0428
feat!(da): celestia light node keyname configuration
mzabaluev Feb 10, 2025
e7d94fd
feat: process-compose overlay for celestia-mainnet
mzabaluev Feb 10, 2025
fc7fb79
feat(da): set Celestia light node key name from env
mzabaluev Feb 10, 2025
e60f2e5
chore(da): clean up old celestia files
mzabaluev Feb 12, 2025
4806157
fix(da): --keyring.backend to celestia light init
mzabaluev Feb 12, 2025
e1c73f7
feat(da): output namespace in da light node log
mzabaluev Feb 12, 2025
5c46929
fix(da): --keyring.backend for celestia light start
mzabaluev Feb 12, 2025
fbe04d1
fix(da): don't ignore celestia RPC errors
mzabaluev Feb 13, 2025
b955c7c
ci: cut out movement-signer-test
mzabaluev Feb 14, 2025
0d8d851
fix(da): streamline random celestia ID generation
mzabaluev Feb 17, 2025
95e1d16
feat!: set initial celestia synced_height
mzabaluev Feb 17, 2025
2ef3ca9
fix(da): fetch current block height in setup
mzabaluev Feb 18, 2025
90a4418
fix(da): force_new_chain to false when well-known
mzabaluev Feb 18, 2025
186730f
fix(da): saner parsing of CELESTIA_NAMESPACE env
mzabaluev Feb 19, 2025
c23a46d
fix: redundant clone
mzabaluev Feb 19, 2025
c586b80
Merge branch 'main' into mikhail/celestia-mainnet-config
mzabaluev Feb 20, 2025
d5b88aa
feat: celestia-appd loop.
l-monninger Feb 21, 2025
51308b5
fix: increase to 16cpvu.
l-monninger Feb 21, 2025
c894644
fix(process-compose): pre-build tests
mzabaluev Feb 21, 2025
19f0c45
feat: move into docker compose.
l-monninger Feb 21, 2025
4a954bd
Merge branch 'mikhail/celestia-mainnet-config' of https://github.com/…
l-monninger Feb 21, 2025
94f7f0d
fix: strip out eth.
l-monninger Feb 21, 2025
427b651
fix: movement celestia still needed.
l-monninger Feb 21, 2025
d837e68
fix: udpate websocket connection.
l-monninger Feb 21, 2025
e0392e3
fix(docker): run light node for celestia-mainnet
mzabaluev Feb 21, 2025
bc90825
fix(docker): workable celestia light node check
mzabaluev Feb 21, 2025
3e7ff9d
fix(docker): workable CELESTIA_NAMESPACE
mzabaluev Feb 21, 2025
5a07c0e
feat: Run celestia light node with --node.store
mzabaluev Feb 21, 2025
796fc4c
fix(docker): use --node.store with celestia light node
mzabaluev Feb 21, 2025
742e884
fix: lumina version.
l-monninger Feb 22, 2025
fbc3175
Merge branch 'mikhail/celestia-mainnet-config' of https://github.com/…
l-monninger Feb 22, 2025
4064b6b
fix: debug add blogb logging.
l-monninger Feb 23, 2025
209bf3a
fix: additional logging for da blob.
l-monninger Feb 23, 2025
e82cbf6
Config parameter for celestia light node store directory (#1066)
mzabaluev Feb 24, 2025
c2c40ad
deps: switch lumina back to upstream
mzabaluev Feb 24, 2025
04c5590
Merge branch 'main' into mikhail/celestia-mainnet-config
mzabaluev Feb 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
230 changes: 84 additions & 146 deletions Cargo.lock

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ movement-signing-eth = { path = "util/signing/integrations/eth" }
vaultrs = { version = "0.7.3" }
aws-sdk-kms = "1.51.0"
google-cloud-kms = "0.6.0"
base64 = { version = "0.13.0" }

# Serialization and Deserialization
serde = "1.0"
Expand Down Expand Up @@ -229,8 +228,8 @@ secp256k1 = { version = "0.27", default-features = false, features = [
] }

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

# External Dependencies

Expand Down Expand Up @@ -267,6 +266,7 @@ async-stream = "0.3.0"
async-trait = "0.1.71"
async-recursion = "1.1.1"
auto_impl = "1.2.0"
base64 = { version = "0.22.1" }
blake3 = { version = "1.4.0", features = ["traits-preview"] }
bytes = { version = "1.2.1", default-features = false }
chrono = "0.4.37"
Expand All @@ -288,9 +288,8 @@ hex = { version = "0.4.3", default-features = false, features = [
ics23 = { version = "0.11.0" }
k256 = { version = "0.13.3" }
keccak-hash = "0.10.0"
itertools = { version = "0.12.1", default-features = false }
itertools = { version = "0.13.0", default-features = false }
jmt = "0.9.0"
jsonrpsee = { version = "0.20.1", features = ["jsonrpsee-types"] }
log = "0.4.21"
mirai-annotations = "1.10.1"
move-vm-integration-test-helpers = { path = "test-helpers/move-vm-integration-test-helpers" }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
services:
setup:
image: ghcr.io/movementlabsxyz/movement-full-node-setup:${CONTAINER_REV}
container_name: setup
environment:
CELESTIA_NAMESPACE: "0xa21de06de7aa38c2a812"
CELESTIA_NETWORK: mainnet
# ws://celestia-light-node:26658
CELESTIA_WEBSOCKET_CONNECTION_PROTOCOL: ws
CELESTIA_WEBSOCKET_CONNECTION_HOSTNAME: celestia-light-node
CELESTIA_WEBSOCKET_CONNECTION_PORT: 26658
INDEXER_PROCESSOR_POSTGRES_CONNECTION_STRING: postgres://postgres:password@postgres:5432/postgres
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
AWS_REGION: ${AWS_DEFAULT_REGION}
volumes:
- ${DOT_MOVEMENT_PATH}:/.movement
healthcheck:
test: [ "CMD-SHELL", "echo 'health check'" ]
retries: 30
interval: 10s
timeout: 5s

celestia-light-node:
image: ghcr.io/celestiaorg/celestia-node:v0.21.5
container_name: celestia-light-node
command: |
celestia light start
--core.ip rpc.celestia.pops.one
--p2p.network celestia
--node.store /.movement/celestia/movement/.celestia-light
--keyring.backend test
--keyring.keyname movement_celestia_light
--log.level WARN
environment:
- NODE_TYPE=light
- P2P_NETWORK=celestia
volumes:
- ${DOT_MOVEMENT_PATH}/celestia:/.movement/celestia
ports:
- 26658:26658
depends_on:
setup:
condition: service_healthy
healthcheck:
test: "celestia node info"
restart: on-failure:3
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:

# turn off movement-faucet-service
movement-faucet-service:
image: busybox
container_name: movement-faucet-service
command: sleep infinity
healthcheck:
test: [ "CMD-SHELL", "echo 'health check'" ]
retries: 3
start_period: 3s
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,11 @@ mod tests {
})
);

let da_signers = match &config.celestia_da_light_node.celestia_da_light_node_config {
movement_da_util::config::Config::Local(local) => &local.da_light_node.da_signers,
let da_light_node_config = &config.celestia_da_light_node.celestia_da_light_node_config;
let da_signers = match &da_light_node_config.network {
movement_da_util::config::Network::Local => {
&da_light_node_config.da_light_node.da_signers
}
_ => panic!("Expected Local"),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ use serde::{Deserialize, Serialize};
pub struct Config {
#[serde(default = "default_da_db_path")]
pub da_db_path: String,
#[serde(default = "default_start_sync_height")]
pub start_sync_height: u64,
}

impl Default for Config {
fn default() -> Self {
Self { da_db_path: default_da_db_path() }
Self { da_db_path: default_da_db_path(), start_sync_height: default_start_sync_height() }
}
}

env_default!(default_da_db_path, "SUZUKA_DA_DB_PATH", String, "movement-da-db".to_string());
env_default!(default_start_sync_height, "MOVEMENT_START_SYNC_HEIGHT", u64, 0);
25 changes: 25 additions & 0 deletions networks/movement/movement-full-node/src/node/da_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ impl DaDB {
Ok(())
}

/// Get the synced height marker stored in the database.
pub async fn get_synced_height(&self) -> Result<u64, anyhow::Error> {
// This is heavy for this purpose, but progressively the contents of the DA DB will be used for more things
let da_db = self.inner.clone();
Expand All @@ -97,4 +98,28 @@ impl DaDB {
.await??;
Ok(height)
}

/// Set the initial value of the synced height, unless a value is stored.
pub async fn initialize_synced_height(&self, min_height: u64) -> Result<(), anyhow::Error> {
// This is heavy for this purpose, but progressively the contents of the DA DB will be used for more things
let da_db = self.inner.clone();
tokio::task::spawn_blocking(move || {
let cf = da_db
.cf_handle(SYNCED_HEIGHT)
.ok_or(anyhow::anyhow!("No synced_height column family"))?;
let height = da_db
.get_cf(&cf, "synced_height")
.map_err(|e| anyhow::anyhow!("Failed to get synced height: {:?}", e))?;
if height.is_none() {
let height = serde_json::to_string(&min_height)
.map_err(|e| anyhow::anyhow!("Failed to serialize synced height: {:?}", e))?;
da_db
.put_cf(&cf, "synced_height", height)
.map_err(|e| anyhow::anyhow!("Failed to set synced height: {:?}", e))?;
}
Ok::<(), anyhow::Error>(())
})
.await??;
Ok(())
}
}
7 changes: 7 additions & 0 deletions networks/movement/movement-full-node/src/node/partial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,13 @@ impl MovementPartialNode<Executor> {
let da_db =
DaDB::open(&config.da_db.da_db_path).context("Failed to create or get DA DB")?;

// FIXME: the config value is probably misplaced
da_db
.initialize_synced_height(
config.celestia_da_light_node.celestia_da_light_node_config.initial_height,
)
.await?;

Ok(Self {
executor,
light_node_client,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ where
{
pub async fn run(mut self) -> anyhow::Result<()> {
let synced_height = self.da_db.get_synced_height().await?;
info!("Synced height: {:?}", synced_height);
info!("DA synced height: {:?}", synced_height);
let mut blocks_from_da = self
.da_light_node_client
.stream_read_from_height(StreamReadFromHeightRequest { height: synced_height })
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! Task to process incoming transactions and write to DA

use maptos_dof_execution::SignedTransaction;
use movement_da_util::config::Config as LightNodeConfig;
use movement_da_light_node_client::MovementDaLightNodeClient;
use movement_da_light_node_proto::{BatchWriteRequest, BlobWrite};
use movement_da_util::config::Config as LightNodeConfig;

use tokio::sync::mpsc;
use tracing::{info, warn};
Expand Down Expand Up @@ -43,7 +43,7 @@ impl Task {

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

let mut transactions = Vec::new();

Expand Down
2 changes: 1 addition & 1 deletion networks/movement/setup/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ async fn main() -> Result<(), anyhow::Error> {
// set up anvil
let (config, anvil_join_handle) = Local::default().setup(dot_movement, config).await?;

Ok((Some(config.clone()), anvil_join_handle))
Ok((Some(config), anvil_join_handle))
})
.await?;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: "3"

processes:

setup:
environment:
- "CELESTIA_NETWORK=mainnet"

celestia-light-node:
command: |
movement-celestia-light
readiness_probe:
initial_delay_seconds: 60
exec:
command: curl http://0.0.0.0:26658
depends_on:
setup:
condition: process_healthy
9 changes: 9 additions & 0 deletions process-compose/movement-full-node/process-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@ environment:

processes:

build-movement-client-tests:
command: |
cargo test --no-run -p movement-client test_example_
depends_on:
build:
condition: process_completed_successfully

movement-client-tests:
command: |
cargo test -p movement-client test_example_
depends_on:
build-movement-client-tests:
condition: process_completed_successfully
movement-full-node:
condition: process_healthy
movement-faucet:
Expand Down

This file was deleted.

Loading
Loading