diff --git a/docs/docs/users/reference/env_variables.md b/docs/docs/users/reference/env_variables.md index 2942270a0bfb..4627aab77a29 100644 --- a/docs/docs/users/reference/env_variables.md +++ b/docs/docs/users/reference/env_variables.md @@ -29,6 +29,7 @@ process. | `FOREST_STATE_MIGRATION_THREADS` | integer | Depends on the machine. | 3 | The number of threads for state migration thread-pool. Advanced users only. | | `FOREST_CONFIG_PATH` | string | /$FOREST_HOME/com.ChainSafe.Forest/config.toml | `/path/to/config.toml` | Forest configuration path. Alternatively supplied via `--config` cli parameter. | | `RUST_LOG` | string | empty | `debug,forest_libp2p::service=info` | Allows for log level customization. | +| `FOREST_IGNORE_DRAND` | 1 or true | empty | 1 | Ignore Drand validation. | | `FOREST_F3_SIDECAR_RPC_ENDPOINT` | string | 127.0.0.1:23456 | `127.0.0.1:23456` | An RPC endpoint of F3 sidecar. | | `FOREST_F3_SIDECAR_FFI_ENABLED` | 1 or true | hard-coded per chain | 1 | Whether or not to start the F3 sidecar via FFI | | `FOREST_F3_CONSENSUS_ENABLED` | 1 or true | hard-coded per chain | 1 | Whether or not to apply the F3 consensus to the node | diff --git a/src/beacon/drand.rs b/src/beacon/drand.rs index 0f87ff4b226f..d41ee2c39659 100644 --- a/src/beacon/drand.rs +++ b/src/beacon/drand.rs @@ -26,7 +26,7 @@ use url::Url; /// Environmental Variable to ignore `Drand`. Lotus parallel is /// `LOTUS_IGNORE_DRAND` -pub const IGNORE_DRAND_VAR: &str = "IGNORE_DRAND"; +pub const IGNORE_DRAND_VAR: &str = "FOREST_IGNORE_DRAND"; /// Type of the `drand` network. `mainnet` is chained and `quicknet` is unchained. /// For the details, see diff --git a/src/chain/store/index.rs b/src/chain/store/index.rs index 5b99f69641e0..a7e685c7b3d7 100644 --- a/src/chain/store/index.rs +++ b/src/chain/store/index.rs @@ -173,7 +173,7 @@ impl ChainIndex { } } - if std::env::var(IGNORE_DRAND_VAR) == Ok("1".to_owned()) { + if is_env_truthy(IGNORE_DRAND_VAR) { return Ok(BeaconEntry::new(0, vec![9; 16])); } diff --git a/src/fil_cns/validation.rs b/src/fil_cns/validation.rs index ebd4eb9a931d..b56944f77b88 100644 --- a/src/fil_cns/validation.rs +++ b/src/fil_cns/validation.rs @@ -23,6 +23,7 @@ use crate::shim::{ }; use crate::state_manager::StateManager; use crate::utils::encoding::prover_id_from_u64; +use crate::utils::misc::env::is_env_truthy; use cid::Cid; use fil_actors_shared::filecoin_proofs_api::{post, PublicReplicaInfo, SectorId}; use fil_actors_shared::v10::runtime::DomainSeparationTag; @@ -129,7 +130,7 @@ pub(in crate::fil_cns) async fn validate_block bool { pub fn is_env_set_and_truthy(env: &str) -> Option { std::env::var(env) .ok() - .map(|var| matches!(var.to_lowercase().as_str(), "1" | "true")) + .map(|var| matches!(var.to_lowercase().as_str(), "1" | "true" | "yes" | "_yes_")) } #[cfg(test)]