feat(cbf): add auto-restart with exponential backoff#10
Merged
febyeji merged 5 commits intoadd-cbf-chain-sourcefrom Apr 6, 2026
Merged
feat(cbf):
add auto-restart with exponential backoff#10febyeji merged 5 commits intoadd-cbf-chain-sourcefrom
febyeji merged 5 commits intoadd-cbf-chain-sourcefrom
Conversation
Preparation for auto-restart: extract bip157 node build logic into a reusable helper method, add chain_state() from wallet checkpoint to avoid genesis re-sync, and thread Arc<Wallet> through start(). AI: claude
When node.run() exits (e.g. NoReachablePeers from kyoto lightningdevkit#558), the background task rebuilds the node, swaps the requester, and respawns channel processing tasks, up to MAX_RESTART_RETRIES (5) attempts with doubling backoff starting at 500ms. - Change cbf_runtime_status from Mutex<> to Arc<Mutex<>> so it can be shared with the async restart loop - Extract build_cbf_node_static() that takes explicit params instead of &self, enabling calls from 'static async blocks - Move all task spawning (info/warn/event + node.run) into a single restart loop inside spawn_background_task AI: claude
requester() now checks is_running() to give callers an immediate failure signal instead of waiting for SendError to propagate through the channel.
Extract cleanup_scan_state() helper and call it on error paths in run_filter_scan() to prevent stale watched_scripts, matched_block_hashes, and filter_skip_height from leaking between scans.
Wrap individual get_block() calls in tokio::time::timeout using the existing per_request_timeout_secs config. Previously only the overall sync had a timeout; individual block fetches could hang indefinitely (kyoto lightningdevkit#556).
febyeji
added a commit
that referenced
this pull request
Apr 7, 2026
add auto-restart with exponential backoff (#10) * refactor(cbf): extract build_cbf_node helper and add wallet reference * feat(cbf): auto-restart bip157 node with exponential backoff * feat(cbf): add liveness check before returning requester * fix(cbf): clean up scan state on filter scan failure * fix(cbf): add per-block-fetch timeout to wallet sync
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
base, max 5 retries)
EOF
gh pr create --repo febyeji/ldk-node --base add-cbf-chain-source --head add-cbf-auto-restart --title
"feat(cbf): add auto-restart with exponential backoff" --body-file /tmp/pr-body.txt