Skip to content

Add HAVE_TX_SET overlay message for targeted tx set fetching#5379

Open
bboston7 wants to merge 1 commit into
stellar:masterfrom
bboston7:have-tx-set
Open

Add HAVE_TX_SET overlay message for targeted tx set fetching#5379
bboston7 wants to merge 1 commit into
stellar:masterfrom
bboston7:have-tx-set

Conversation

@bboston7

Copy link
Copy Markdown
Contributor

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.

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.
Comment thread src/protocol-curr/xdr

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Update this submodule reference once stellar/stellar-xdr#309 merges

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_SET messages.
  • 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
Comment thread src/overlay/Tracker.cpp
// 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants