Skip to content

Commit

Permalink
fix: decrease BDK_CLIENT_STOP_GAP, re-enable incremental sync
Browse files Browse the repository at this point in the history
  • Loading branch information
rolznz committed Nov 4, 2024
1 parent 500df72 commit 1b02d2b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/chain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,8 @@ impl ChainSource {
let res = {
// If this is our first sync, do a full scan with the configured gap limit.
// Otherwise just do an incremental sync.
// Alby: always do full sync
let incremental_sync = false; //node_metrics.read().unwrap().latest_onchain_wallet_sync_timestamp.is_some();
let incremental_sync =
node_metrics.read().unwrap().latest_onchain_wallet_sync_timestamp.is_some();

log_info!(logger, "Starting onchain wallet sync");

Expand Down
5 changes: 4 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,15 @@ pub(crate) const ENABLE_BACKGROUND_SYNC: bool = false;

// The 'stop gap' parameter used by BDK's wallet sync. This seems to configure the threshold
// number of derivation indexes after which BDK stops looking for new scripts belonging to the wallet.
pub(crate) const BDK_CLIENT_STOP_GAP: usize = 20;
// Alby: decreased to do less unnecessary requests. The actual amount is twice this (for internal + external addresses)
// but also is based on the BDK_CLIENT_CONCURRENCY below (using less than 4 has no effect).
pub(crate) const BDK_CLIENT_STOP_GAP: usize = 1; // 20

// The number of concurrent requests made against the API provider.
pub(crate) const BDK_CLIENT_CONCURRENCY: usize = 4;

// The timeout after which we abandon retrying failed payments.
// Alby: increase this for extra retries
pub(crate) const LDK_PAYMENT_RETRY_TIMEOUT: Duration = Duration::from_secs(50); // (10);

// The interval (in block height) after which we retry archiving fully resolved channel monitors.
Expand Down

0 comments on commit 1b02d2b

Please sign in to comment.