Skip to content

Commit

Permalink
fix: follower.
Browse files Browse the repository at this point in the history
  • Loading branch information
l-monninger committed Nov 26, 2024
1 parent fd160bc commit 82e923e
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
services:
setup:
image: ghcr.io/movementlabsxyz/movement-full-node-setup:${CONTAINER_REV}
container_name: setup
environment:
DOT_MOVEMENT_PATH: /.movement
# needs to have a connection to the movement-celestia-da-light-node
MOVEMENT_DA_LIGHT_NODE_CONNECTION_PROTOCOL: https
MOVEMENT_DA_LIGHT_NODE_CONNECTION_HOSTNAME: m1-da-light-node.testnet.bardock.movementlabs.xyz
MOVEMENT_DA_LIGHT_NODE_CONNECTION_PORT: 443
INDEXER_PROCESSOR_POSTGRES_CONNECTION_STRING: postgres://postgres:password@postgres:5432/postgres
AWS_REGION: ${AWS_REGION:?AWS_REGION is not set}
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
MOVEMENT_SYNC: follower::follower-test-$MOVEMENT_SHARED_RANDOM_1<=>{maptos,maptos-storage,movement-da-db}/**
MAYBE_RUN_LOCAL: "false"
volumes:
- ${DOT_MOVEMENT_PATH}:/.movement
# mount if exists
- ~/.aws/:/root/.aws:ro

healthcheck:
test: [ "CMD-SHELL", "echo 'health check'" ]
retries: 10
interval: 10s
timeout: 5s

# turn off underlying da light nodes
celestia-light-node:
image: busybox
container_name: celestia-light-node
command: sleep infinity
environment:
- DOT_MOVEMENT_PATH=/.movement
- CELESTIA_RPC_ADDRESS=celestia-light-node:26657
volumes:
- ${DOT_MOVEMENT_PATH}:/.movement
depends_on:
setup:
condition: service_healthy
healthcheck:
test: [ "CMD-SHELL", "echo 'health check'" ]
retries: 3
start_period: 3s
restart: on-failure:3

# turn off celestia-light-node-synced
celestia-light-node-synced:
image: busybox
container_name: celestia-light-node-synced
command: echo "No sync check when following."
environment:
- DOT_MOVEMENT_PATH=/.movement
volumes:
- ${DOT_MOVEMENT_PATH}:/.movement
depends_on:
celestia-light-node:
condition: service_healthy

# turn off movement-celestia-da-light-node
movement-celestia-da-light-node:
image: busybox
container_name: movement-celestia-da-light-node
command: sleep infinity
healthcheck:
test: [ "CMD-SHELL", "echo 'health check'" ]
retries: 3
start_period: 3s

# 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

movement-full-node:
environment:
ETH_RPC_CONNECTION_PROTOCOL: https
ETH_RPC_CONNECTION_HOSTNAME: ethereum-holesky-rpc.publicnode.com
ETH_RPC_CONNECTION_PORT: 443
ETH_WS_CONNECTION_PROTOCOL: wss
ETH_WS_CONNECTION_HOSTNAME: ethereum-holesky-rpc.publicnode.com
ETH_WS_CONNECTION_PORT: 443
Empty file.
23 changes: 13 additions & 10 deletions networks/movement/movement-full-node/src/node/partial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use tracing::debug;
pub struct MovementPartialNode<T> {
executor: T,
light_node_client: MovementDaLightNodeClient,
settlement_manager: McrSettlementManager,
settlement_manager: Option<McrSettlementManager>,
commitment_events: Option<CommitmentEventStream>,
movement_rest: MovementRest,
config: Config,
Expand All @@ -27,7 +27,7 @@ impl<T> MovementPartialNode<T>
where
T: DynOptFinExecutor + Send + 'static,
{
pub fn settlement_manager(&self) -> &McrSettlementManager {
pub fn settlement_manager(&self) -> &Option<McrSettlementManager> {
&self.settlement_manager
}

Expand Down Expand Up @@ -142,14 +142,17 @@ impl MovementPartialNode<Executor> {
let executor = Executor::try_from_config(config.execution_config.maptos_config.clone())
.context("Failed to create the inner executor")?;

debug!("Creating the settlement client");
let settlement_client = McrSettlementClient::build_with_config(&config.mcr)
.await
.context("Failed to build MCR settlement client with config")?;
let (settlement_manager, commitment_events) =
McrSettlementManager::new(settlement_client, &config.mcr);
let commitment_events =
if config.mcr.should_settle() { Some(commitment_events) } else { None };
let (settlement_manager, commitment_events) = if config.mcr.should_settle() {
debug!("Creating the settlement client");
let settlement_client = McrSettlementClient::build_with_config(&config.mcr)
.await
.context("Failed to build MCR settlement client with config")?;
let (settlement_manager, commitment_events) =
McrSettlementManager::new(settlement_client, &config.mcr);
(Some(settlement_manager), Some(commitment_events))
} else {
(None, None)
};

debug!("Creating the movement rest service");
let movement_rest =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use tracing::{debug, error, info, info_span, Instrument};

pub struct Task<E, S> {
executor: E,
settlement_manager: S,
settlement_manager: Option<S>,
da_db: DaDB,
da_light_node_client: MovementDaLightNodeClient,
// Stream receiving commitment events, conditionally enabled
Expand All @@ -35,7 +35,7 @@ pub struct Task<E, S> {
impl<E, S> Task<E, S> {
pub(crate) fn new(
executor: E,
settlement_manager: S,
settlement_manager: Option<S>,
da_db: DaDB,
da_light_node_client: MovementDaLightNodeClient,
commitment_events: Option<CommitmentEventStream>,
Expand Down Expand Up @@ -152,10 +152,17 @@ where
&& da_height % self.settlement_config.settle.settlement_super_block_size == 0
{
info!("Posting block commitment via settlement manager");
match self.settlement_manager.post_block_commitment(commitment).await {
Ok(_) => {}
Err(e) => {
error!("Failed to post block commitment: {:?}", e);
match &self.settlement_manager {
Some(settlement_manager) => {
match settlement_manager.post_block_commitment(commitment).await {
Ok(_) => {}
Err(e) => {
error!("Failed to post block commitment: {:?}", e);
}
}
}
None => {
error!("Settlement manager not initialized");
}
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,7 @@ processes:

setup-follower-2:
environment:
- "ETH_RPC_CONNECTION_PROTOCOL=http"
- "ETH_RPC_CONNECTION_HOSTNAME=0.0.0.0"
- "ETH_RPC_CONNECTION_PORT=8090"
- "ETH_WS_CONNECTION_PROTOCOL=ws"
- "ETH_WS_CONNECTION_HOSTNAME=0.0.0.0"
- "ETH_WS_CONNECTION_PORT=8090"
# use invalid eth hostnames to check that non-settling follower doesn't have build issues.
- "MAYBE_RUN_LOCAL=true"
- "MOVEMENT_DA_LIGHT_NODE_HTTP1=false"
command: |
Expand Down

0 comments on commit 82e923e

Please sign in to comment.