Optimize Esplora witness resolution - #20
Merged
zoedberg merged 2 commits intoAug 27, 2026
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Jainakin
marked this pull request as ready for review
August 20, 2026 17:47
zoedberg
requested changes
Aug 25, 2026
Resolve transaction data and confirmation status through one Esplora tx-info request. Add deterministic confirmed, unconfirmed, missing, invalid-height, and malformed-response coverage.
Jainakin
force-pushed
the
hardik/esplora-single-call-witness-resolution
branch
from
August 27, 2026 17:19
f7ff867 to
b5edb2f
Compare
zoedberg
force-pushed
the
hardik/esplora-single-call-witness-resolution
branch
from
August 27, 2026 18:14
00cc158 to
650370c
Compare
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.
Summary
get_tx()andget_tx_status()calls with oneget_tx_info()requestCheckedWitnessResolverboundary for transaction-identity validation instead of duplicating that policy in the transport adapterCurrent head:
650370c6603d9d7f2810b91489f41444acfc867f. The branch contains the focused resolver commit plus maintainer commit650370cfixing the current nightlyInfallibleconversion build. Both commits have verified signatures, and the current head is reviewer-approved.Motivation
Each RGB witness resolution previously performed two sequential Esplora round trips: one for the raw transaction and one for its status. High-history consignments repeat this operation across validation and acceptance, making wall time proportional to both witness count and network latency.
The combined Esplora
/tx/{txid}response contains both transaction and status data. This reduces each resolution from two HTTP requests to one without adding cache, concurrency, persistence, or protocol-state semantics.Controlled 88-history result
The same 88-witness consignment was replayed through the RGB validation/import/acceptance path behind a deterministic Signet-like latency proxy:
This is a 1.94x speedup, or a 48.5% wall-time reduction, in the controlled latency model. It is not a production Signet SLA claim. The benefit is removal of one network round trip per resolution, not lower payload bandwidth.
Correctness coverage
Deterministic tests cover:
/tx/{txid}request/tx/{txid}requestUnresolvedInvalidResolverDataThe reviewer-requested helper names are applied, and the redundant adapter-level txid checks were removed. The focused resolver behavior is covered by deterministic tests, and the aggregate Codecov check passes on the current head.
Validation
Scope
This PR is intentionally Esplora-only. It adds no cache, worker pool, persistent state, Electrum behavior, WASM transport, RGB acceptance change, or Lightning funding change.
This change does not parallelize witness resolution or remove repeated validation/acceptance passes. It only makes each Esplora resolution one request so subsequent parallel resolution does not retain the current two-request cost per witness.