Skip to content

Commit

Permalink
Merge pull request fedimint#6315 from dpc/24-11-08-speedup-devimint-s…
Browse files Browse the repository at this point in the history
…tartup

 chore(ci): speed up devimint startup
  • Loading branch information
elsirion authored Nov 9, 2024
2 parents db82914 + 129f553 commit 009dd6c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions devimint/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ impl ProcessManager {

/// Logs to $FM_LOGS_DIR/{name}.{out,err}
pub async fn spawn_daemon(&self, name: &str, mut cmd: Command) -> Result<ProcessHandle> {
debug!(target: LOG_DEVIMINT, %name, "Spawning daemon");
let logs_dir = env::var(FM_LOGS_DIR_ENV)?;
let path = format!("{logs_dir}/{name}.log");
let log = OpenOptions::new()
Expand Down
4 changes: 3 additions & 1 deletion fedimint-logging/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,11 @@ impl TracingSetup {
// We prefix everything with a default general log level and
// good per-module specific default. User provided RUST_LOG
// can override one or both
"{},{},{},{},{},{}",
"{},{},{},{},{},{},{},{}",
self.base_level.as_deref().unwrap_or("info"),
"jsonrpsee_core::client::async_client=off",
"hyper=off",
"h2=off",
"jsonrpsee_server=warn,jsonrpsee_server::transport=off",
"AlephBFT-=error",
var,
Expand Down
10 changes: 9 additions & 1 deletion gateway/ln-gateway/src/lightning/ldk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ use async_trait::async_trait;
use bitcoin::hashes::Hash;
use bitcoin::{Network, OutPoint};
use fedimint_bip39::Mnemonic;
use fedimint_core::task::{TaskGroup, TaskHandle};
use fedimint_core::envs::is_env_var_set;
use fedimint_core::task::{block_in_place, TaskGroup, TaskHandle};
use fedimint_core::{Amount, BitcoinAmountOrAll};
use fedimint_ln_common::contracts::Preimage;
use ldk_node::config::EsploraSyncConfig;
Expand Down Expand Up @@ -225,6 +226,13 @@ impl Drop for GatewayLdkClient {
#[async_trait]
impl ILnRpcClient for GatewayLdkClient {
async fn info(&self) -> Result<GetNodeInfoResponse, LightningRpcError> {
// HACK: https://github.com/lightningdevkit/ldk-node/issues/339 when running in devimint
// to speed up tests
if is_env_var_set("FM_IN_DEVIMINT") {
block_in_place(|| {
let _ = self.node.sync_wallets();
});
}
let node_status = self.node.status();

let Some(esplora_chain_tip_block_summary) = self
Expand Down

0 comments on commit 009dd6c

Please sign in to comment.