]> Untitled Git - bdk/commit
docs(chain): document that MTP needs a contiguous 11-block window
author志宇 <hello@evanlinjin.me>
Thu, 10 Sep 2026 10:57:35 +0000 (10:57 +0000)
committer志宇 <hello@evanlinjin.me>
Fri, 11 Sep 2026 02:00:24 +0000 (02:00 +0000)
commitd8f625248bfe2b8e48dcc10014bc800db6ebda98
treefd7a0455b20c21bdb12190fb2d38298a94f37c76
parentd2e49cc5f59786e511c7426407c884505ecd7f7f
docs(chain): document that MTP needs a contiguous 11-block window

An MTP at height `h` medians the timestamps at `h-10..=h`, so any height
in that window the driver cannot resolve makes the whole result `None` —
silently, since a gap is indistinguishable from a reorged-out block.

This is the normal case for a `LocalChain` built by syncing: electrum and
esplora insert a handful of checkpoints, not every height, so such a
chain yields `None` for both `prev_mtp` and `tip_mtp` until those clients
fetch the preceding window for each confirmed height.

Document the requirement on `with_mtp` and pin the behaviour with a test
over a chain holding only heights {0, 50, 100}, which also shows that the
gaps do not affect canonicalization itself.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NND8BhEmYTYdLRv4dbUUro
crates/chain/src/canonical_view_task.rs
crates/chain/tests/test_canonical_view_mtp.rs