Repository navigation
Conversation
|
I've assigned @tankyleo as a reviewer! |
tnull
force-pushed
the
2026-10-mempool-eviction-timestamp
branch
from
October 5, 2026 09:33
a1b3a67 to
7cf257c
Compare
The bitcoind chain source dated a transaction's absence from the mempool with the newest mempool entry time it had seen since startup. That watermark restarts at zero while the transaction's `last_seen` persists with the wallet, and BDK keeps an evicted transaction canonical until its eviction catches up with `last_seen`, so a transaction that vanished while we were down kept its input marked spent and its change counted as ours. Date the observations we hand BDK with our local clock instead, as the Esplora and Electrum sources and upstream `bdk_bitcoind_rpc` do, and keep the entry-time watermark for emission deduplication only. This only bites after a restart, and only while the mempool holds nothing newer than the transaction: otherwise the first poll re-emits the whole mempool and advances the watermark before that same poll reports any eviction. In practice that means an empty mempool on signet or regtest, or a similarly idle backend, and the next transaction to arrive resolves it anyway. Co-Authored-By: HAL 9000
tnull
force-pushed
the
2026-10-mempool-eviction-timestamp
branch
from
October 5, 2026 09:35
7cf257c to
4c3b31c
Compare
tankyleo
reviewed
Oct 9, 2026
Contributor
There was a problem hiding this comment.
I raise this point after a chat with codex: this patch can cause the BDK last_seen to be equal to evcited_at in case two polls happen within the same second, and the first poll observes an eviction, while the second poll observes the transaction's return. In this case BDK keeps the transaction evicted, and subsequent polls never bump last_seen again because the entry is now at or below the monotically increasing latest_mempool_timestamp.
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.
Uh oh!
There was an error while loading. Please reload this page.