Skip to content

Merge master commit 100cc3816c59357df488b17972aa5e2846ead831 into overlay V2 - #5428

Merged
SirTyson merged 11 commits into
stellar:overlay-v2-sharedfrom
SirTyson:overlay-v2-aug-20-merge
Aug 28, 2026
Merged

SirTyson merged 11 commits into
stellar:overlay-v2-sharedfrom
SirTyson:overlay-v2-aug-20-merge

Conversation

@SirTyson

@SirTyson SirTyson commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Merges 100cc38 into overlay-v2.

Most changes could be applied without issue. The two "conflicts" that we resolved were porting tx apply support back into overlay v2 (which will be useful for the new "end-to-end" apply load tests). I've also reverted overlay-v2 SimpleTimer metrics back to Timer, since master has picked up a significant perf improvement on the original Timer implementation.

Additionally, I cleaned up our unit tests such that we pass CI. This was mostly removing tests that were intentionally broken and fixing a couple topology issues. There were two legitimate bugs though, fixed in 292eed4.

The first was a use after free, which failed a unit test, but was only called when we receive bad quorum set messages, so it wouldn't have shown up in our experiments. The 2nd bug is a race condition, where an SCP message with two unfetched dependencies (i.e. the sender's quorum set and a tx set) could wedge a node if the quorum set message arrives after the tx set. This one could actually occur in our experiments on startup, since our first message will require transmitting qsets with an empty tx set, such that the race could hit. We've seen instability on startup, this may or may not have been a contributing factor in practice. The good news is both of these were caught by "PendingEnvelopes recvSCPEnvelope".

Checklist

  • Reviewed the contributing document
  • Rebased on top of master (no merge commits)
  • Ran clang-format v8.0.0 (via make format or the Visual Studio extension)
  • Compiles
  • Ran all tests
  • If change impacts performance, include supporting evidence per the performance document

@SirTyson
SirTyson requested a review from marta-lokhova August 25, 2026 17:57

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

thanks so much, all helpful changes!

Copilot AI balanced review requested due to automatic review settings August 27, 2026 23:20
@SirTyson
SirTyson force-pushed the overlay-v2-aug-20-merge branch from 20bef27 to 5fd6b4b Compare August 27, 2026 23:20

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

Merges the referenced master changes into overlay V2 while adapting simulation, load generation, metrics, and tests to the Rust overlay.

Changes:

  • Adds Rust-overlay topology wiring, mempool handling, and SCP dependency fixes.
  • Extends apply-load benchmarks with validation-and-consensus timing.
  • Updates tests, CI selection, metrics, and documentation.

Reviewed changes

Copilot reviewed 38 out of 40 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
src/simulation/Topologies.cpp Wires simulation topologies.
src/simulation/test/LoadGeneratorTests.cpp Expands load-generator coverage.
src/simulation/Simulation.h Declares connection helpers.
src/simulation/Simulation.cpp Implements Rust-overlay peer wiring.
src/simulation/LoadGenerator.h Adds account lifecycle tracking.
src/simulation/LoadGenerator.cpp Delays account reuse until apply.
src/simulation/CoreTests.cpp Re-enables adapted simulation tests.
src/simulation/ApplyLoad.h Declares benchmark timing phases.
src/simulation/ApplyLoad.cpp Adds consensus-based timing.
src/overlay/test/OverlayIPCTests.cpp Updates ports, topology, and tags.
src/overlay/RustOverlayManager.h Extends test-peer and mempool APIs.
src/overlay/RustOverlayManager.cpp Implements peer updates and removals.
src/overlay/OverlayMetrics.h Restores transaction receive timer.
src/overlay/OverlayMetrics.cpp Registers the full timer.
src/overlay/OverlayIPC.h Declares transaction removal.
src/overlay/OverlayIPC.cpp Hardens process shutdown and FD handling.
src/main/test/CommandHandlerTests.cpp Adapts asynchronous submission tests.
src/main/test/BannedAccountsPersistorTests.cpp Removes disabled tests.
src/main/test/ApplicationUtilsTests.cpp Fixes watcher topology and timing.
src/main/Config.h Adds apply-load timing configuration.
src/main/Config.cpp Parses timing mode and restricts manual close.
src/main/ApplicationImpl.cpp Skips overlay startup in standalone mode.
src/ledger/test/LedgerCloseMetaStreamTests.cpp Configures explicit watcher peers.
src/ledger/LedgerManagerImpl.cpp Updates timer documentation.
src/herder/PendingEnvelopes.cpp Fixes quorum-set arrival handling.
src/herder/HerderSCPDriver.h Adds tx-set validation timer.
src/herder/HerderSCPDriver.cpp Instruments tx-set validation.
src/herder/HerderImpl.cpp Updates recovery and Rust mempool nomination.
src/database/test/DatabaseTests.cpp Removes obsolete peer migration checks.
docs/stellar-core_example.cfg Documents manual-close restriction.
docs/software/commands.md Documents apply-load timing modes.
docs/metrics.md Updates timer metric definitions.
docs/apply-load-max-sac-tps.cfg Configures apply-only timing.
docs/apply-load-ledger-limits.cfg Documents timing selection.
docs/apply-load-for-meta.cfg Adds timing configuration.
docs/apply-load-benchmark-token.cfg Adds timing configuration.
docs/apply-load-benchmark-sac.cfg Adds timing configuration.
ci-build.sh Revises test partitioning and selection.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/herder/HerderImpl.cpp
Comment on lines +1676 to +1700
// The mempool is fee-ordered and sequence-number-oblivious, so it can
// hand us several transactions from one source account (e.g. a chained
// pair). A tx set may only contain one tx per source account, so keep
// the lowest sequence number per account and let the others wait for a
// later ledger.
auto onePerSourceAccount = [](TxFrameList& txs) {
std::unordered_map<AccountID, size_t> firstBySource;
TxFrameList kept;
for (auto const& tx : txs)
{
auto [it, inserted] =
firstBySource.emplace(tx->getSourceID(), kept.size());
if (inserted)
{
kept.push_back(tx);
}
else if (tx->getSeqNum() < kept[it->second]->getSeqNum())
{
kept[it->second] = tx;
}
}
txs = std::move(kept);
};
onePerSourceAccount(classicTxs);
onePerSourceAccount(sorobanTxs);
Comment thread src/herder/HerderImpl.cpp
Comment on lines +1731 to +1736
auto acc = ledgerView.getAccount(tx->getSourceID());
if (acc &&
tx->getSeqNum() > acc.current().data.account().seqNum + 1)
{
continue;
}
sim->addNode(key, qSetHere);

// connect to core nodes (round-robin)
curCore = (curCore + 1) % coreNodeIDs.size();
auto& herder = mApp.getHerder();
auto const& lcl = mApp.getLedgerManager().getLastClosedLedgerHeader();

uint64_t const closeTime = lcl.header.scpValue.closeTime + 1;
Comment on lines +23 to +24
, mRecvTransactionTimer(
app.getMetrics().NewTimer({"overlay", "recv", "transaction"}))
// ── Recv timers (aggregate) ──
// SimpleTimer: high-frequency TX recv path
SimpleTimer& mRecvTransactionTimer;
medida::Timer& mRecvTransactionTimer;
} // anonymous namespace

TEST_CASE("OverlayIPC connects to Rust overlay", "[overlay-ipc-rust][.]")
TEST_CASE("OverlayIPC connects to Rust overlay", "[overlay-ipc]")
Comment thread src/herder/HerderImpl.cpp
Comment on lines +985 to +989
std::optional<uint64> detachedCheckpoint;
if (slots.size() >= 2 && slots[1] > slots[0] + 1)
{
detachedCheckpoint = slots[0];
}
Comment on lines +403 to +408
auto stateArchivalConfigSettinsgEntry =
ledgerView.load(configSettingKey(CONFIG_SETTING_STATE_ARCHIVAL));
auto& contractExecutionLanesSettings =
contractExecutionLanesSettingsEntry.current().data.configSetting();
auto& stateArchivalSettings =
stateArchivalConfigSettinsgEntry.current().data.configSetting();
cfg.ARTIFICIALLY_GENERATE_LOAD_FOR_TESTING = true;
cfg.UPDATE_SOROBAN_COSTS_DURING_PROTOCOL_UPGRADE_FOR_TESTING = true;
cfg.GENESIS_TEST_ACCOUNT_COUNT = 500;
// Use tight bounds to we can verify storage works properly
@SirTyson

Copy link
Copy Markdown
Contributor Author

CI was failing due to a race condition, so I did another lap. I ended up porting many of the tests in master back into this branch, and fixing a few small issues along the way. Notably, there was some instability in loadgen, which may be causing simulation failures for the non-overlay only tests.

@SirTyson
SirTyson merged commit b90d48e into stellar:overlay-v2-shared Aug 28, 2026
5 of 6 checks passed
SirTyson added a commit to SirTyson/stellar-core that referenced this pull request Nov 9, 2026
Brings overlay-v2-shared up to date with master. The previous master
merge (b90d48e, stellar#5428) was recorded with master's tip 100cc38 missing
from its parents, so this merge used 100cc38 as its base (temporary
graft of b90d48e, removed afterwards).

Notable master changes brought in:
- Protocol 30: CURRENT_LEDGER_PROTOCOL_VERSION follows
  MAX_SUPPORTED_PROTOCOL_VERSION; CAP-0084 and CAP-0087 ungated, p29 and
  p30 Soroban hosts (stellar#5472, stellar#5478, stellar#5484, stellar#5483).
- Millisecond-resolution close times at protocol 30 (stellar#5423):
  ConsensusTime/ApplyTime types, STELLAR_VALUE_SIGNED_MS and
  STELLAR_VALUE_EMPTY_TX_SET_MS.
- Tx set validity hardening (stellar#5481), lower max message size in protocol
  29 (stellar#733), sub-second ledger edge-case fixes.
- Simplified ledger view hierarchy (stellar#5461); the overlay-only-mode
  sequence number skip now lives in TransactionFrame::checkValid.
- Banned accounts deprecated (CAP-0077 is active).
- Apply-path performance work (stellar#5402, stellar#5411, stellar#5414, stellar#5415, stellar#5418, stellar#5421,
  stellar#5436, stellar#5286), apply-load tx set construction mode (stellar#5448), --check-lcm
  (stellar#5435), v29.0.0 release merge.

Conflict resolution:
- Files overlay-v2-shared deleted and master modified (the C++ overlay,
  TransactionQueue, TransactionQueueTests, UpgradesTests, private/Horizon/RPC
  workflows): kept deleted. Master's changes to them are C++ overlay
  peer/flow-control logic, tx queue admission and tests for those.
- Herder: kept the Rust-overlay submission path (recvTransaction returns
  TxSubmitStatus) and dropped the deprecated `force` parameter as master did.
  triggerNextLedger keeps the prepared/built tx set path from the Rust
  mempool, now with ConsensusTime close times and master's apply-time
  close-time offset. The early tx set preparation path (prepareTxSet,
  buildTxSet, setupTriggerNextLedger) takes ConsensusTime. Kept master's
  mNominatedTxSetOverride test hook (applied before the tx set is cached in
  the Rust overlay) and the herder.txset.build timer (now timing
  buildTxSet). Dropped the banned-accounts setup and tx queue maintenance.
- AppConnector: dropped both ov2's maybeUpdateImmutableLedgerView and
  master's C++-overlay getOverlayThreadSnapshot.
- LoadGenerator: master's CachedTestAccountPtr with ov2's TxSubmitStatus.
- Tests: kept ov2's removal of tests that need the C++ overlay, standalone
  mode or the tx queue (standalone, manualclose, flooding, tx queue limits,
  far-future slot cleanup, herderExternalizesValuesWithProtocol, MAX_SAC_TPS,
  custom token, soroswap and noisy binary search apply-load tests). Added
  master's ms close time HerderTests and the non-canonical empty tx set test
  on ov2's Rust-overlay topologies. The tx set size test checks against
  overlay-v2's own tx set allowance. The sub-second
  getUpperBoundCloseTimeOffset test checks the offset directly, since there
  is no C++ tx queue admission. Tests that used CheckValidLedgerViewWrapper
  now use getLCLView().
- Cargo.lock: master's lockfile plus the overlay crate's packages,
  regenerated by cargo; semver-compatible duplicates take the newer
  version.
- Build: Makefile.am keeps the Rust overlay rules and adds tracy
  import-chrome; ci-build.sh keeps ASAN off and takes master's -g1.
- Needed to compile: PendingEnvelopes.cpp includes LedgerManager.h
  (master got it through the C++ OverlayManager.h); ov2's early-nomination
  and checkpoint-slot tests use ConsensusTime/ApplyTimeOffset; OverlayIPC
  tests take ledger views from the LedgerManager.
@SirTyson SirTyson mentioned this pull request Nov 9, 2026
5 of 6 tasks
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.

3 participants