bitcoindevkit / bdk-kyoto

BDK blockchain backend using P2P light client Kyoto
Other
9 stars 7 forks source link

Panic when syncing `wallet` #2

Closed rustaceanrob closed 3 months ago

rustaceanrob commented 5 months ago

Two subsequent runs of cargo run --example wallet results in the second call panicking with message: Error: introduced chain cannot connect with the original chain, try include height 200582 error: process didn't exit successfully:target\debug\examples\wallet.exe(exit code: 1). Seems like an error case on the LocalChain wasn't handled?

ValuedMammal commented 5 months ago

This could be caused by the error case "two disjoint chains cannot merge" if the local and remote tip differ but the block at height tip-1 is the same.

       B
---A <
       B'

https://github.com/bitcoindevkit/bdk/blob/05438017876c3338d091ca85e52242b455e2193a/crates/chain/tests/test_local_chain.rs#L98-L105

rustaceanrob commented 5 months ago

That's odd. I can try to reproduce by syncing to the same height with same hash as the last sync. In which case B = B' and something else weird is happening.