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

chore(ci): run F3 sidecar with FFI in devnet checks #4732

Merged
merged 20 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
25 changes: 3 additions & 22 deletions scripts/devnet/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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.
Expand Down
16 changes: 15 additions & 1 deletion src/daemon/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<i64>() {
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
Expand Down
2 changes: 1 addition & 1 deletion src/f3/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Loading