Skip to content

Conversation

@tnull
Copy link
Collaborator

@tnull tnull commented Jan 29, 2026

Previously, the timeouts applied to chain syncing weren't configurable
to users. While historically there were good reasons for this (mostly to
avoid leaving the Node in a blocked state for extended periods during
chain syncing), by now we should be good to let the users configure
timeouts ~freely, if they deem it fit. Here we allow for exactly that.

We also bump the previous defaults considerably, in the hopes that users now normally
shouldn't hit them ever.

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Jan 29, 2026

👋 Thanks for assigning @jkczyz as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@tnull tnull moved this to Goal: Merge in Weekly Goals Jan 29, 2026
@tnull tnull self-assigned this Jan 29, 2026
tnull added 2 commits January 29, 2026 11:33
Previously, the timeouts applied to chain syncing weren't configurable
to users. While historically there were good reasons for this (mostly to
avoid leaving the Node in a blocked state for extended periods during
chain syncing), by now we should be good to let the users configure
timeouts ~freely, if they deem it fit. Here we allow for exactly that.

Signed-off-by: Elias Rohrer <dev@tnull.de>
It seems that users often hit these timeouts when running in production,
especially when run in sub-optimal network condidtions. Here we
considerably bump the timeouts, in the hopes that users now normally
shouldn't hit them ever.

Signed-off-by: Elias Rohrer <dev@tnull.de>
@tnull tnull force-pushed the 2026-01-make-sync-timeouts-configurable branch from 13ae399 to 40c4b09 Compare January 29, 2026 10:34

// The default timeout after which we abort a wallet syncing operation.
const DEFAULT_BDK_WALLET_SYNC_TIMEOUT_SECS: u64 = 20;
const DEFAULT_BDK_WALLET_SYNC_TIMEOUT_SECS: u64 = 60;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is an outstanding sync, do we skip a newly requested one?

Copy link
Collaborator Author

@tnull tnull Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually no, additional sync calls would subscribe and wait for the the pending sync to finish. The result will then be propagated via propagate_result_to_subscribers:

fn propagate_result_to_subscribers(&mut self, res: Result<(), Error>) {
// Send the notification to any other tasks that might be waiting on it by now.
{
match self {
WalletSyncStatus::Completed => {
// No sync in-progress, do nothing.
return;
},
WalletSyncStatus::InProgress { subscribers } => {
// A sync is in-progress, we notify subscribers.
if subscribers.receiver_count() > 0 {
match subscribers.send(res) {
Ok(_) => (),
Err(e) => {
debug_assert!(
false,
"Failed to send wallet sync result to subscribers: {:?}",
e
);
},
}
}
*self = WalletSyncStatus::Completed;
},
}
}
}
}

In case of a timeout that would be an Error::TxSyncTimeout.

@tnull tnull requested a review from jkczyz January 30, 2026 09:15
@tnull tnull merged commit d261724 into lightningdevkit:main Jan 30, 2026
22 of 28 checks passed
@github-project-automation github-project-automation bot moved this from Goal: Merge to Done in Weekly Goals Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants