Skip to content

Conversation

ValuedMammal
Copy link
Collaborator

@ValuedMammal ValuedMammal commented Jun 6, 2025

Description

Before, the chain_update function might have panicked if the local checkpoint was not on the same network as the remote server. Now if we have iterated all of the blocks of the local CP and do not find a point of agreement, then we return early with a esplora_client::Error::HeaderHashNotFound.

cc bitcoindevkit/bdk_wallet#30

Notes to the reviewers

Changelog notice

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo +nightly fmt and cargo clippy before committing

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

@ValuedMammal ValuedMammal moved this to Needs Review in BDK Chain Jun 6, 2025
Copy link
Contributor

@oleonardolima oleonardolima left a comment

Choose a reason for hiding this comment

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

utACK 96a6207

It's valid to note that we covered the fetch_blocks emptyness scenario on the client side too, at bitcoindevkit/rust-esplora-client#113

Comment on lines +583 to +585
while client.get_height().await? < mine_to {
std::thread::sleep(Duration::from_millis(64));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: FWIW, you can use wait_until_electrum_sees_block if #1640 ends up landing before this one.

Copy link
Contributor

@LagginTimes LagginTimes left a comment

Choose a reason for hiding this comment

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

ACK 96a6207

Before, the `chain_update` function would hit a panic if the
local checkpoint was not on the same network as the remote
server. Now if we have iterated all of the blocks of the
`local_cp` and do not find a "point of agreement", then we
return early with a `esplora_client::Error::HeaderHashNotFound`.
@ValuedMammal ValuedMammal force-pushed the fix/esplora-chain-update branch from 96a6207 to 568a366 Compare July 1, 2025 15:30
@ValuedMammal
Copy link
Collaborator Author

ValuedMammal commented Jul 1, 2025

I had to rebase after #1978.

ACK 568a366

@ValuedMammal ValuedMammal merged commit c496cde into bitcoindevkit:master Jul 3, 2025
19 checks passed
@github-project-automation github-project-automation bot moved this from Needs Review to Done in BDK Chain Jul 3, 2025
@ValuedMammal ValuedMammal deleted the fix/esplora-chain-update branch July 3, 2025 14:24
@oleonardolima oleonardolima mentioned this pull request Jul 31, 2025
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants