Repository navigation
Report failed bitcoind block syncs as errors - #1267
Open
ajaysehwal wants to merge 1 commit into
Open
ajaysehwal wants to merge 1 commit into
ajaysehwal wants to merge 1 commit into
Conversation
`SpvClient::poll_best_tip` returns `(ChainTip::Better(_), false)` when it found a better chain tip but couldn't connect any block towards it, for example because fetching the blocks failed. We ignored that case, so the poll still bumped the wallet sync timestamps and `sync_wallets` reported success while the node fell behind the chain. Log the failure and return `TxSyncFailed` instead, as we already do when polling itself fails.
|
I've assigned @tnull as a reviewer! |
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.
SpvClient::poll_best_tipreturns(ChainTip::Better(_), false)when it found a better chain tip but couldn't connect any block towards it, e.g. because fetching the blocks from bitcoind failed (pruned node, REST disabled, a response above the HTTP size limit). We only matched(Better, true)and ignored everything else, so in that case the poll still bumped the wallet sync timestamps andsync_walletsreturnedOkwhile the node silently fell behind the chain. Nothing was logged.This logs the failure and returns
TxSyncFailed, as we already do when polling itself fails. The polling loop retries on its next tick as before.(Better, true)(full or partial progress),CommonandWorseare unchanged.Testing
cargo test --libpasses.poll_and_update_listeners_inneruses the concrete bitcoind client, so the mock block source instartup_tests.rs(which can fail block fetches) can't drive it without a refactor, which I left out to keep this minimal.