diff --git a/scripts/devnet/docker-compose.yml b/scripts/devnet/docker-compose.yml index 113e77dfa1d..74d3ad42386 100644 --- a/scripts/devnet/docker-compose.yml +++ b/scripts/devnet/docker-compose.yml @@ -181,8 +181,10 @@ services: environment: - FIL_PROOFS_PARAMETER_CACHE=${FIL_PROOFS_PARAMETER_CACHE} - RUST_LOG=info,forest_filecoin::blocks::header=trace + - FOREST_F3_SIDECAR_FFI_ENABLED=1 + - FOREST_F3_FINALITY=${F3_FINALITY} - FOREST_F3_PERMANENT_PARTICIPATING_MINER_ADDRESSES=${MINER_ACTOR_ADDRESS} - - FOREST_F3_SIDECAR_RPC_ENDPOINT=f3:${F3_RPC_PORT} + - FOREST_F3_SIDECAR_RPC_ENDPOINT=127.0.0.1:${F3_RPC_PORT} - FOREST_GENESIS_NETWORK_VERSION=${GENESIS_NETWORK_VERSION} - FOREST_SHARK_HEIGHT=${SHARK_HEIGHT} - FOREST_HYGGE_HEIGHT=${HYGGE_HEIGHT} @@ -275,27 +277,6 @@ services: export FULLNODE_API_INFO=$$TOKEN:/dns/forest/tcp/${FOREST_RPC_PORT}/http forest-wallet --remote-wallet import ${LOTUS_DATA_DIR}/genesis-sectors/pre-seal-${MINER_ACTOR_ADDRESS}.key || true forest-cli net connect /dns/lotus/tcp/${LOTUS_P2P_PORT}/p2p/$$(cat ${LOTUS_DATA_DIR}/PEER_ID) - f3: - user: root - depends_on: - forest_connecter: - condition: service_completed_successfully - build: - context: ../../f3-sidecar - dockerfile: Dockerfile - container_name: f3 - volumes: - - lotus-data:${LOTUS_DATA_DIR} - - forest-data:${FOREST_DATA_DIR} - ports: - - ${F3_RPC_PORT}:${F3_RPC_PORT} - networks: - - devnet - entrypoint: ["/bin/bash", "-c" ] - command: - - | - set -euxo pipefail - f3-sidecar -finality ${F3_FINALITY} -rpc http://forest:${FOREST_RPC_PORT}/rpc/v1 -f3-rpc 0.0.0.0:${F3_RPC_PORT} volumes: # Shared proof parameter files. It is re-used by both Lotus and Forest. diff --git a/src/daemon/mod.rs b/src/daemon/mod.rs index 283c391a842..33af3bf47d9 100644 --- a/src/daemon/mod.rs +++ b/src/daemon/mod.rs @@ -413,7 +413,21 @@ pub(super) async fn start( }); services.spawn_blocking({ - let finality = chain_config.policy.chain_finality; + let finality = std::env::var("FOREST_F3_FINALITY") + .ok() + .and_then(|v| match v.parse::() { + Ok(f) if f > 0 => { + tracing::info!("Using F3 finality {f} set by FOREST_F3_FINALITY"); + Some(f) + } + _ => { + tracing::warn!( + "Invalid FOREST_F3_FINALITY value {v}. A positive integer is expected." + ); + None + } + }) + .unwrap_or(chain_config.policy.chain_finality); let default_f3_db_path = config .client .data_dir diff --git a/src/f3/mod.rs b/src/f3/mod.rs index 6e62703d3ee..5aed1f90d8a 100644 --- a/src/f3/mod.rs +++ b/src/f3/mod.rs @@ -39,7 +39,7 @@ fn is_sidecar_ffi_enabled() -> bool { } else { if enabled { - tracing::error!("Failed to enable F3 sidecar, the forerst binary is not compiled with f3-sidecar Go lib"); + tracing::error!("Failed to enable F3 sidecar, the Forest binary is not compiled with f3-sidecar Go lib"); } false }