docs(esplora): replace misleading tx-cache TODO with explanation - #2261
Open
Arowolokehinde wants to merge 1 commit into
Open
docs(esplora): replace misleading tx-cache TODO with explanation#2261Arowolokehinde wants to merge 1 commit into
Arowolokehinde wants to merge 1 commit into
Conversation
Arowolokehinde
requested review from
luisschwab and
oleonardolima
as code owners
August 18, 2026 14:08
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2261 +/- ##
=======================================
Coverage 78.36% 78.36%
=======================================
Files 30 30
Lines 5945 5945
Branches 281 281
=======================================
Hits 4659 4659
Misses 1210 1210
Partials 76 76
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Description
fetch_txs_with_outpointscarried a misleading// TODO: We should maintain a tx cache (like we do with Electrum).comment in bothasync_ext.rsandblocking_ext.rs. Electrum needs a cache because its history call returns txids only, forcing a follow-up fetch per tx. Esplora's scan endpoint already returns full tx bodies, so there's no equivalent fetch for a cache to skip — andinserted_txsalready dedupes against what the spk phase fetched earlier in the same sync.This PR replaces the TODO with a comment explaining why, and why the obvious "fix" — using
get_tx_statusinstead ofget_tx_infofor cache hits — is unsafe: unknown txids return HTTP 200{"confirmed":false}, indistinguishable from a real unconfirmed tx, so evicted transactions would never be evicted.Fixes #2260
Notes to the reviewers
The TODO already cost a contributor a 600-line PR (#2254, closing #2250) implementing exactly this cache, which was caught in review for the
get_tx_statuseviction bug described above. This comment exists to stop that from being rediscovered a third time.Changelog notice
Removed a misleading TODO in
fetch_txs_with_outpointssuggesting a tx cache be added; replaced with a comment explaining why the Electrum-style cache pattern does not apply to Esplora.Checklists
All Submissions:
I followed the contribution guidelines
I'm linking the issue being fixed by this PR