Add HAVE_TX_SET overlay message for targeted tx set fetching#5379
Open
bboston7 wants to merge 1 commit into
Open
Add HAVE_TX_SET overlay message for targeted tx set fetching#5379bboston7 wants to merge 1 commit into
bboston7 wants to merge 1 commit into
Conversation
This PR adds a new message type `HAVE_TX_SET` to allow nodes to communicate that they possess a given transaction set. This improves transaction set fetching with parallel transaction set downloading, as parallel transaction set downloading breaks the assumption that SCP message relayers possess all transaction sets referenced in a given SCP message.
bboston7
commented
Jul 25, 2026
Contributor
Author
There was a problem hiding this comment.
TODO: Update this submodule reference once stellar/stellar-xdr#309 merges
Contributor
There was a problem hiding this comment.
Pull request overview
Adds HAVE_TX_SET handling to target transaction-set downloads toward peers that advertise possession.
Changes:
- Tracks and prioritizes peer tx-set claims with a bounded grace period.
- Sends, receives, rate-limits, and measures
HAVE_TX_SETmessages. - Adds simulation coverage for claims, compatibility, throttling, and fallback behavior.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/overlay/Tracker.h |
Defines fetch kinds and claim state. |
src/overlay/Tracker.cpp |
Implements claim-aware peer selection and grace timing. |
src/overlay/test/TrackerTests.cpp |
Updates tracker construction. |
src/overlay/test/ItemFetcherTests.cpp |
Tests claims, throttling, compatibility, and fallback. |
src/overlay/Peer.h |
Declares message capability and admission state. |
src/overlay/Peer.cpp |
Handles and meters HAVE_TX_SET. |
src/overlay/OverlayMetrics.h |
Declares claim metrics. |
src/overlay/OverlayMetrics.cpp |
Registers claim metrics. |
src/overlay/ItemFetcher.h |
Adds claim buffering and fetch-kind configuration. |
src/overlay/ItemFetcher.cpp |
Routes and buffers peer claims. |
src/herder/PendingEnvelopes.h |
Declares claim announcement APIs. |
src/herder/PendingEnvelopes.cpp |
Announces and consumes tx-set claims. |
src/herder/HerderImpl.h |
Adds claim-handling overrides. |
src/herder/HerderImpl.cpp |
Integrates claims with SCP state exchange. |
src/herder/Herder.h |
Extends the Herder interface. |
docs/metrics.md |
Documents claim metrics. |
| auto const& iter = mTrackers.find(itemHash); | ||
| if (iter != mTrackers.end()) | ||
| { | ||
| iter->second->peerClaims(peer); |
| /** | ||
| * A peer announced that it has the tx set identified by @p hash. Records | ||
| * the claim with the tx set fetcher so an active fetch can target that | ||
| * peer. No-op if the tx set is not being fetched. |
| addVote(unheldHash); | ||
| addVote(Herder::EMPTY_TX_SET_HASH); | ||
|
|
||
| // Only the held set is claimed: the unheld set and the emtpy-tx-set are |
| // grace period has expired we fall through to the relayer/random tiers as | ||
| // usual. | ||
| auto const now = mApp.getClock().now(); | ||
| if (claimingPeers.empty() && mGraceEnabled && now < mGraceDeadline) |
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.
This PR adds a new message type
HAVE_TX_SETto allow nodes to communicate that they possess a given transaction set. This improves transaction set fetching with parallel transaction set downloading, as parallel transaction set downloading breaks the assumption that SCP message relayers possess all transaction sets referenced in a given SCP message.