Skip to content

Enable downloading of transaction sets in parallel with early SCP stages - #5209

Merged
sisuresh merged 1 commit into
stellar:masterfrom
bboston7:skip-ledgers-p25
May 29, 2026
Merged

Enable downloading of transaction sets in parallel with early SCP stages#5209
sisuresh merged 1 commit into
stellar:masterfrom
bboston7:skip-ledgers-p25

Conversation

@bboston7

@bboston7 bboston7 commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

This PR adds support for CAP-0083 and enables downloading of transactions sets in parallel with SCP up until setting c during balloting.

@bboston7

Copy link
Copy Markdown
Contributor Author

I just rebased this on master and force pushed up so we can get a CI run. Ignore the terrible branch name; this is built on top of protocol 26, not 25.

Comment thread src/herder/PendingEnvelopes.cpp Outdated
Comment thread src/scp/BallotProtocol.cpp Outdated
Comment thread src/scp/BallotProtocol.cpp Outdated
Comment thread src/scp/BallotProtocol.cpp Outdated
Comment thread src/herder/HerderImpl.cpp Outdated
Comment thread src/herder/HerderImpl.cpp Outdated
Comment thread src/scp/BallotProtocol.cpp Outdated
@bboston7
bboston7 force-pushed the skip-ledgers-p25 branch 2 times, most recently from 2af1efe to c68cf84 Compare May 26, 2026 22:59
@bboston7 bboston7 changed the title WIP: Enable downloading of transaction sets in parallel with early SCP stages Enable downloading of transaction sets in parallel with early SCP stages May 26, 2026
@bboston7
bboston7 marked this pull request as ready for review May 26, 2026 23:01
Copilot AI review requested due to automatic review settings May 26, 2026 23:01

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

Note

Copilot was unable to run its full agentic suite in this review.

This PR introduces support for parallel transaction-set downloading in SCP, including CAP-0083 empty-tx-set values, and extends tests/metrics/configuration to validate and observe the new behavior.

Changes:

  • Extend SCPDriver/SCP protocols to distinguish fully-validated vs structurally-valid values and to support parallel tx-set download readiness.
  • Add empty-tx-set value handling (hash sentinel, creation/validation, replacement on timeout) across Herder/SCP/Ballot/Nomination.
  • Add config knobs, overlay fetch wait-time reporting, and substantial new tests + metrics for the new flow.

Reviewed changes

Copilot reviewed 35 out of 35 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/util/ProtocolVersion.h Defines protocol gating constant for empty-tx-set values.
src/scp/test/SCPUnitTests.cpp Updates test driver interface conformance for new SCPDriver methods.
src/scp/test/SCPTests.cpp Adds test hooks for structurally-valid values, tx-set download timing, and new CAP tests.
src/scp/SCPDriver.h Adds new driver APIs for download-wait/timeout, envelope readiness, empty-tx-set support, and new validation levels.
src/scp/NominationProtocol.cpp Allows nomination flow to consider structurally-valid values.
src/scp/BallotProtocol.h Renames/clarifies statement validation + adds empty-tx-set replacement and confirm-commit invariant check.
src/scp/BallotProtocol.cpp Implements structurally-valid envelope handling, timeout-to-empty-tx-set replacement, and confirm-commit invariant enforcement.
src/protocol-curr/xdr Updates protocol XDR submodule pointer.
src/overlay/Peer.cpp Adjusts getTxSet handling to new TxSetResult type.
src/overlay/ItemFetcher.h Adds API to query fetch waiting time for an item.
src/overlay/ItemFetcher.cpp Implements fetch waiting time lookup.
src/main/Config.h Adds experimental parallel tx-set download flag and timeout config.
src/main/Config.cpp Implements defaults and config parsing for new parallel download settings.
src/ledger/test/LedgerCloseMetaStreamTests.cpp Enables parallel tx-set download in test configuration.
src/ledger/LedgerManagerImpl.cpp Allows EMPTY_TX_SET_HASH through txset hash mismatch checks.
src/herder/test/PendingEnvelopesTests.cpp Expands tests for envelope readiness w/ parallel download and empty-tx-set gating.
src/herder/test/HerderTests.cpp Updates tests for new TxSetResult and adds validation coverage for missing tx sets.
src/herder/TxSetFrame.h Adds makeEmpty(previousLedgerHash, previousLedgerVersion) overload.
src/herder/TxSetFrame.cpp Implements new makeEmpty overload while preserving existing API.
src/herder/PendingEnvelopes.h Moves txset access to TxSetResult and adds readiness/wait-time helpers.
src/herder/PendingEnvelopes.cpp Adds EMPTY_TX_SET_HASH handling, wrapper update hook, readiness logic, and waiting-time plumbing.
src/herder/LedgerCloseData.cpp Allows EMPTY_TX_SET_HASH in constructor invariant and improves StellarValue string formatting.
src/herder/HerderUtils.h Adds throwing toStellarValueOrThrow helper.
src/herder/HerderUtils.cpp Implements throwing conversion with diagnostics.
src/herder/HerderSCPDriver.h Adds empty-tx-set APIs, readiness, onTxSetReceived wrapper updates, and metrics hooks.
src/herder/HerderSCPDriver.cpp Implements wrapper registries, readiness logic, empty-tx-set value creation, and tx-set-block metrics.
src/herder/HerderImpl.h Changes getTxSet return type to TxSetResult and updates comment.
src/herder/HerderImpl.cpp Handles EMPTY_TX_SET_HASH on externalization and updates txset/signature logic for new value types.
src/herder/Herder.h Introduces EmptyTxSet/TxSetResult and EMPTY_TX_SET_HASH sentinel.
src/herder/Herder.cpp Defines EMPTY_TX_SET_HASH constant.
src/Makefile.am Adds CAP_0083 define plumbing for XDR generation.
docs/stellar-core_example.cfg Documents new config settings.
docs/metrics.md Documents new empty-tx-set and blocked-on-txset metrics.
configure.ac Adds conditional for enabling CAP_0083 builds.
common.mk Adds CAP_0083 define plumbing for compilation.
Comments suppressed due to low confidence (4)

src/scp/BallotProtocol.cpp:1

  • case SCPDriver::kStructurallyValidValue: currently falls through to default: without an explicit break/annotation. This can trigger implicit-fallthrough warnings and obscures intent. Add an explicit break; at the end of the kStructurallyValidValue case (or mark it [[fallthrough]] if intentional, though a break seems correct here since the case already completed its checks).
// Copyright 2014 Stellar Development Foundation and contributors. Licensed

src/scp/test/SCPUnitTests.cpp:1

  • These non-void overrides call releaseAssert(false) but do not return a value, which can fail compilation under -Werror=return-type or similar settings. Add an explicit return after the assertion (e.g., return {}; / return false;) to satisfy the compiler even in non-asserting builds/configurations.
    src/scp/test/SCPUnitTests.cpp:1
  • These non-void overrides call releaseAssert(false) but do not return a value, which can fail compilation under -Werror=return-type or similar settings. Add an explicit return after the assertion (e.g., return {}; / return false;) to satisfy the compiler even in non-asserting builds/configurations.
    src/herder/PendingEnvelopes.cpp:1
  • This log message is now potentially misleading: the predicate can drop envelopes not only for "value not signed" but also for disallowed empty-tx-set values (and potentially other unsupported types). Update the message to reflect the real reason (e.g., "unsupported or unsigned StellarValue type") so operators can diagnose configuration/protocol gating correctly.
#include "PendingEnvelopes.h"

Comment thread src/herder/HerderSCPDriver.cpp
Comment thread src/herder/PendingEnvelopes.cpp
Comment thread src/herder/HerderSCPDriver.h Outdated
Comment thread src/herder/Herder.cpp
Comment thread common.mk Outdated

@marta-lokhova marta-lokhova 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.

Looks good to me overall, thanks for all the cleanups! I just left a couple of clarifying questions. I think we also need to rebase the change.

Comment thread src/scp/BallotProtocol.cpp Outdated
Comment thread src/herder/HerderImpl.cpp
Comment thread src/herder/HerderSCPDriver.cpp
Comment thread src/herder/PendingEnvelopes.cpp
Comment thread src/scp/BallotProtocol.cpp
Comment thread src/herder/PendingEnvelopes.cpp
@bboston7
bboston7 force-pushed the skip-ledgers-p25 branch from ebdbe5a to fdde3ab Compare May 28, 2026 19:02
marta-lokhova
marta-lokhova previously approved these changes May 28, 2026

@marta-lokhova marta-lokhova 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.

Change looks good to me! The remaining questions I have are around test plan and invariance.

Comment thread src/scp/BallotProtocol.cpp
Comment thread src/herder/PendingEnvelopes.cpp
@bboston7
bboston7 force-pushed the skip-ledgers-p25 branch 2 times, most recently from bc94f35 to 37e9d85 Compare May 28, 2026 23:51
@marta-lokhova
marta-lokhova enabled auto-merge May 28, 2026 23:58
marta-lokhova
marta-lokhova previously approved these changes May 28, 2026
auto-merge was automatically disabled May 29, 2026 16:16

Head branch was pushed to by a user without write access

@bboston7
bboston7 force-pushed the skip-ledgers-p25 branch from 2f35aa0 to 3813e64 Compare May 29, 2026 16:16
@bboston7

Copy link
Copy Markdown
Contributor Author

The failing test is a binary fuse filter test that is also failing on master. In the meantime, I ran the acceptance tests locally and caught a spot where I failed to properly update the expected checkValue cache hit rate when adding ifdef guards, so I fixed that up.

This change adds support for CAP-0083 empty-tx-set values, as well as a
new flag `EXPERMENTAL_PARALLEL_TX_SET_DOWNLOAD` that allows validators
to download transaction sets in parallel with early SCP rounds.
@bboston7
bboston7 force-pushed the skip-ledgers-p25 branch from b4a81f9 to 6bd15f5 Compare May 29, 2026 20:08
@sisuresh
sisuresh added this pull request to the merge queue May 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 29, 2026
@sisuresh
sisuresh added this pull request to the merge queue May 29, 2026
Merged via the queue into stellar:master with commit 9082f57 May 29, 2026
54 checks passed
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.

4 participants