You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add --check-lcm mode to verify captured LedgerCloseMeta golden data in CI - #5435
Adds a --check-lcm DIRNAME test mode mirroring --check-test-tx-meta: each index.json under test-lcm-{current,next}/ is stamped with the protocol version / rng seed that produced it (validated up front, so a protocol bump without regeneration fails fast), and the LCM captured at each leaf section is compared against the checked-in golden file. Wired into ci-build.sh as an extra make check pass reusing the already-built binary.
The first CI run on this PR is expected to fail the new check — the existing golden data predates the header stamp. A follow-up commit regenerates it under both build configurations.
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds CI verification for captured LedgerCloseMeta golden data.
Changes:
Adds --check-lcm with header validation and semantic comparison.
Stamps captured indexes with protocol and RNG configuration.
Adds CI integration and documentation.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
File
Description
src/test/test.cpp
Implements LCM checking and header validation.
src/test/test.h
Updates LCM tracking documentation.
ci-build.sh
Adds the CI golden-data check.
docs/software/commands.md
Documents --check-lcm.
.github/copilot-instructions.md
Documents CI enforcement.
Suppressed comments (1)
ci-build.sh:226
The repository's required test invocation flags include --abort, but this newly added CI pass omits it. Add the flag so an ordinary Catch failure stops the pass immediately rather than spending the remainder of this expensive [tx] run after the outcome is known.
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 9 out of 1636 changed files in this pull request and generated no new comments.
Suppressed comments (1)
src/test/test.cpp:394
If a leaf previously produced a golden LCM but now produces none, this return treats it as success and leaves the existing golden file unchecked. That allows loss of LCM capture to pass CI; record a failure when the expected file exists.
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 9 out of 1638 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
src/test/test.cpp:394
--check-lcm silently succeeds when a leaf that has a checked-in golden file stops producing any LCM. This early return skips both the existence check and comparison, so a regression that removes a closeLedger/capture call is not detected. If the golden path exists, record a mismatch before returning; leaves that have never had golden data can still be ignored.
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 8 out of 1637 changed files in this pull request and generated 2 comments.
Suppressed comments (1)
docs/software/commands.md:238
This still states that meta is normalized before writing, but writeLcmToFile explicitly preserves original ordering and only normalizes copies for semantic comparison. Update the description so users do not expect the checked-in XDR stream itself to be sorted.
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 8 out of 1637 changed files in this pull request and generated no new comments.
Suppressed comments (1)
src/test/test.cpp:1519
This only reports mismatches for leaves that executed. loadLcmHeaders discards every hash entry, so deleting a captured section/test (or removing its [tx] tag) leaves the old index/XDR entry unconsumed and CI still succeeds. Track expected hashes and fail on leftovers; since make check partitions tests, either aggregate consumption across partitions or run this check unpartitioned.
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 12 out of 1978 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
src/test/test.cpp:1594
When --prune-stale-lcm is not set, this still replaces index.json with only the entries observed in the current run. A filtered capture that touches one test file therefore drops mappings for all unrun leaves in that file and leaves their retained .xdr files orphaned, contrary to the documented non-pruning behavior. Merge existing non-header mappings when pruning is disabled, and rebuild from scratch only when gLcmMayPrune is true.
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 12 out of 1978 changed files in this pull request and generated 3 comments.
Suppressed comments (1)
src/bucket/test/BucketTestUtils.h:92
This only taints the live-bucket setter. setNextArchiveBatchForBucketTesting also injects archive/restored entries directly (BucketTestUtils.cpp:247-248), and the addLiveBatchAndUpdateSnapshot / addHotArchiveBatchAndUpdateSnapshot helpers directly modify bucket state as well. Those paths can still produce golden LCM that omits how its starting state was created, despite the documented automatic exclusion; apply the taint hook to every direct-injection path.
The TxMeta baselines have a section explaining how to re-record them; the
golden LCM data had nothing outside the command reference, which is part of
why it went stale at protocol 27 for a month without anyone noticing.
Both tiers were captured before the protocol 28 bump, so test-lcm-current
held protocol 27 meta and test-lcm-next held protocol 28. Re-captured at 28
and 29 respectively, with the index.json header stamps the check validates.
The regeneration also drops what had accumulated: leaves left behind by
regens at protocol 26 and 27, leaves orphaned by the section renames, and
the CAP-85 vector, whose test injects the executable-reference entry
directly into the bucket list so the meta never showed the entry being
created. Each tier goes from 1131 files to 844.
Reset LCM capture disable state for sectionless tests
src/test/test.cpp:568
gLcmCaptureDisabled is reset only when the implicit root section starts (line 606), so it remains true across sectionless test cases. A sectionless test can call disableLcmCapture() (for example the multi-node [herder][tx] test), after which every later sectionless test silently skips its LCM check/capture in recordOrCheckLcm. Reset this flag in testCaseStarting as well, before handling tests with no sections.
The reason will be displayed to describe this comment to others. Learn more.
I was surprised to learn we already had the capture machinery (mostly) wired up and this was "just" adding checking; but it looks good to me. Thanks for all of this.
…basing onto master
Both tiers re-captured with master's --capture-lcm (stellar#5435) at protocol 29
(current) and 30 (next); --check-lcm passes on both builds.
sisuresh
added a commit
to sisuresh/stellar-core
that referenced
this pull request
Sep 28, 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
added a commit
to SirTyson/stellar-core
that referenced
this pull request
Nov 9, 2026
Master's --capture-lcm/--check-lcm mode (stellar#5435, run by ci-build.sh over
[tx]) makes getTestConfig() enable ENABLE_SOROBAN_DIAGNOSTIC_EVENTS, and
Application rejects that on networked validators. Master's loopback
simulations stay RUN_STANDALONE, but overlay v2's Simulation::addNode
always clears RUN_STANDALONE (its nodes talk through Rust overlay
processes). So every simulation-based [tx] test threw at startup under
--check-lcm, e.g. "network externalizes empty-tx-set on missing value".
Simulations never capture LedgerCloseMeta (the constructor calls
disableLcmCapture()), so their nodes don't need diagnostic events.
Turn them off in addNode. Runs without LCM tracking are unaffected,
since getTestConfig() only enables the events while tracking LCM.
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
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.
Adds a
--check-lcm DIRNAMEtest mode mirroring--check-test-tx-meta: eachindex.jsonundertest-lcm-{current,next}/is stamped with the protocol version / rng seed that produced it (validated up front, so a protocol bump without regeneration fails fast), and the LCM captured at each leaf section is compared against the checked-in golden file. Wired into ci-build.sh as an extramake checkpass reusing the already-built binary.The first CI run on this PR is expected to fail the new check — the existing golden data predates the header stamp. A follow-up commit regenerates it under both build configurations.