Skip to content

Commit af2c821

Browse files
committed
Merge master (362dbc5) into overlay-v2-shared
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.
2 parents 87201aa + 362dbc5 commit af2c821

3,946 files changed

Lines changed: 322223 additions & 204460 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/PULL_REQUEST_TEMPLATE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Describe what this pull request does, which issue it's resolving (usually applic
99
--->
1010

1111
# Checklist
12-
- [ ] Reviewed the [contributing](https://github.com/stellar/stellar-core/blob/master/CONTRIBUTING.md#submitting-changes) document
12+
- [ ] Reviewed the [contributing](https://github.com/stellar/stellar-core/blob/master/CONTRIBUTING.md#opening-a-pull-request) document
1313
- [ ] Rebased on top of master (no merge commits)
1414
- [ ] Ran `clang-format` v8.0.0 (via `make format` or the Visual Studio extension)
1515
- [ ] Compiles

‎.github/workflows/build.yml‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,24 @@ jobs:
9797
# mkdir -p build-static-checks
9898
# echo "${{ github.sha }}" > "build-static-checks/.last-tested-commit-sha"
9999

100+
protocol-version-check:
101+
# Check that a bump of MAX_SUPPORTED_PROTOCOL_VERSION is accompanied by
102+
# a bump of OVERLAY_PROTOCOL_VERSION. Only runs on events that have a
103+
# base revision to compare against (not on branch pushes). Not yet in
104+
# `complete`'s needs, so a failure doesn't block merging.
105+
if: github.event.repository.visibility != 'private' && github.event_name != 'push'
106+
runs-on:
107+
- namespace-profile-noble-24-04-stellar-core-x64-small
108+
steps:
109+
- uses: namespacelabs/nscloud-checkout-action@v7
110+
with:
111+
fetch-depth: 0
112+
113+
- name: Check protocol bump is accompanied by an overlay version bump
114+
run: |
115+
BASE_SHA='${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha }}'
116+
./scripts/check-protocol-overlay-versions.sh "$BASE_SHA"
117+
100118
build-linux:
101119
if: github.event.repository.visibility != 'private'
102120
runs-on:
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Overlay min version
2+
3+
# Once pubnet has upgraded to a new ledger protocol, opens a PR raising
4+
# OVERLAY_PROTOCOL_MIN_VERSION to the lowest overlay version of the releases
5+
# that support that protocol (see scripts/check-overlay-min-version.sh).
6+
7+
on:
8+
schedule:
9+
- cron: '0 15 * * *'
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: write
14+
pull-requests: write
15+
16+
concurrency:
17+
group: ${{ github.workflow }}
18+
cancel-in-progress: false
19+
20+
jobs:
21+
bump-overlay-min-version:
22+
if: github.repository == 'stellar/stellar-core'
23+
runs-on: ubuntu-24.04
24+
env:
25+
BRANCH: bot/bump-overlay-min-version
26+
steps:
27+
- uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Get pubnet ledger protocol version
32+
id: pubnet
33+
run: |
34+
PROTOCOL=$(curl -sSf --retry 3 https://horizon.stellar.org/ | jq -er '.current_protocol_version | numbers')
35+
echo "Pubnet is on protocol $PROTOCOL"
36+
echo "protocol=$PROTOCOL" >> "$GITHUB_OUTPUT"
37+
38+
- name: Raise OVERLAY_PROTOCOL_MIN_VERSION if possible
39+
env:
40+
PROTOCOL: ${{ steps.pubnet.outputs.protocol }}
41+
run: |
42+
set -o pipefail
43+
./scripts/check-overlay-min-version.sh --apply "$PROTOCOL" | tee "$RUNNER_TEMP/check.txt"
44+
45+
- name: Open or update PR
46+
env:
47+
GH_TOKEN: ${{ github.token }}
48+
PROTOCOL: ${{ steps.pubnet.outputs.protocol }}
49+
BASE: ${{ github.ref_name }}
50+
run: |
51+
if git diff --quiet
52+
then
53+
echo "OVERLAY_PROTOCOL_MIN_VERSION is up to date"
54+
exit 0
55+
fi
56+
MIN=$(sed -n 's/^[[:space:]]*OVERLAY_PROTOCOL_MIN_VERSION[[:space:]]*=[[:space:]]*\([0-9][0-9]*\).*/\1/p' src/main/Config.cpp)
57+
58+
# Leave an open PR alone if it already makes the same change.
59+
OPEN_PR=$(gh pr list --head "$BRANCH" --base "$BASE" --state open --json number --jq '.[].number')
60+
if [ -n "$OPEN_PR" ] &&
61+
git fetch --depth=1 origin "$BRANCH" 2>/dev/null &&
62+
git diff --quiet FETCH_HEAD -- src/main/Config.cpp
63+
then
64+
echo "$BRANCH already raises OVERLAY_PROTOCOL_MIN_VERSION to $MIN"
65+
exit 0
66+
fi
67+
68+
git config user.name 'github-actions[bot]'
69+
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
70+
git checkout -B "$BRANCH"
71+
git commit -qam "Bump OVERLAY_PROTOCOL_MIN_VERSION to $MIN" \
72+
-m "Pubnet is on protocol $PROTOCOL, and no release supporting it has an overlay version below $MIN."
73+
git push -f origin "$BRANCH"
74+
75+
BODY="$RUNNER_TEMP/body.md"
76+
{
77+
echo "Pubnet is on protocol $PROTOCOL, and no release supporting it has an overlay version below $MIN, so this raises \`OVERLAY_PROTOCOL_MIN_VERSION\` to $MIN. Opened by the \`${{ github.workflow }}\` workflow."
78+
echo
79+
echo "**Reviewer:** before merging, verify that pubnet is on protocol $PROTOCOL and that every release supporting it, including any not tagged in this repo, has \`OVERLAY_PROTOCOL_VERSION\` of at least $MIN. Nodes below $MIN will be disconnected."
80+
echo
81+
echo '```'
82+
cat "$RUNNER_TEMP/check.txt"
83+
echo '```'
84+
} > "$BODY"
85+
if [ -z "$OPEN_PR" ]
86+
then
87+
gh pr create --base "$BASE" --head "$BRANCH" \
88+
--title "Bump OVERLAY_PROTOCOL_MIN_VERSION to $MIN" --body-file "$BODY"
89+
else
90+
gh pr edit "$OPEN_PR" \
91+
--title "Bump OVERLAY_PROTOCOL_MIN_VERSION to $MIN" --body-file "$BODY"
92+
fi

‎.github/workflows/socket-scan.yml‎

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Socket reachability scan for stellar-core.
2+
# For general Socket reachability documentation, see https://docs.socket.dev/docs/full-application-reachability
3+
# Multi-ecosystem: Rust (Cargo) + Python (scripts/pyproject.toml).
4+
#
5+
# --reach-ecosystems=cargo,pypi explicitly lists the ecosystems that get full Tier 1 reachability analysis. This repo's Coana-supported ecosystems are cargo (Cargo.toml) and pypi (scripts/pyproject.toml). The explicit list also excludes Coana's phantom NUGET detection: the repo has Builds/VisualStudio/stellar-core.sln (no actual C# code), which Coana otherwise mis-detects as a .NET project and aborts the scan demanding `dotnet`. Listing only cargo,pypi sidesteps that.
6+
#
7+
# >>> DEVELOPERS: if this repo adds a NEW Coana-supported ecosystem (e.g. an >>> npm package.json, a go.mod, a Gemfile), you MUST add that ecosystem to >>> this --reach-ecosystems list to get full Tier 1 reachability for it. >>> Supported ecosystem names: npm, pypi, cargo, golang, maven, gem, nuget. >>> Ecosystems NOT listed here still receive Tier 2 (precomputed) >>> reachability from Socket's backend automatically — but Tier 1 (the more >>> precise, your-code-aware analysis) only runs for the ecosystems listed.
8+
#
9+
# Schedule: Sun 12:24 UTC weekly. Use workflow_dispatch to run on demand.
10+
#
11+
# ============================================================================
12+
# Socket scan — reading the job status. (The scan step below produces this: an
13+
# exit code + an optional ::warning:: annotation, which GitHub Actions renders
14+
# as the job's state.)
15+
# ============================================================================
16+
# GREEN (exit 0, no warning): scan completed and every analyzed vulnerability
17+
# got full Tier 1 reachability (precise, your-code-aware). Nothing to do.
18+
# YELLOW (exit 0 + "::warning:: Socket scan completed with Tier 2 fallbacks"):
19+
# scan completed, but Tier 1 could NOT be computed for some/all
20+
# vulnerabilities, which fell back to Tier 2 (precomputed) reachability.
21+
# You still get CVE detection + Tier 2 results, just reduced precision
22+
# for the affected CVEs. The job is NOT failing.
23+
# RED (non-zero exit): scan did not complete. Do not assume any part
24+
# succeeded — could be reachability hard-failing, a missing language
25+
# toolchain, the runner out of memory, a network/API error, or even the
26+
# underlying CVE/SBOM detection failing. Check the logs and fix before
27+
# relying on results.
28+
# ----------------------------------------------------------------------------
29+
# THIS REPO STARTS YELLOW — a KNOWN upstream Coana bug, NOT your code or this
30+
# scan setup:
31+
# Coana's Rust analyzer hits "Maximum call stack size exceeded" on the cargo
32+
# root + src/rust (4 CVEs) -> Tier 2 fallback.
33+
# Reported to Socket; may be fixed upstream over time. Do NOT let this baseline
34+
# yellow train the team to ignore yellow — a *new* yellow (a different Tier 2
35+
# fallback that appears later) is a real signal worth investigating. After the
36+
# initial rollout, the team may resolve the baseline yellow at its discretion
37+
# (once Coana ships a fix, or by adjusting the scan) so GREEN becomes the
38+
# normal state and any future yellow stands out.
39+
# ============================================================================
40+
41+
name: Socket reachability scan
42+
43+
on:
44+
schedule:
45+
- cron: '24 12 * * 0'
46+
workflow_dispatch:
47+
48+
permissions:
49+
contents: read
50+
51+
jobs:
52+
socket-scan:
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
56+
- run: rustup update
57+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
58+
with:
59+
python-version: "3.14.6"
60+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
61+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
62+
with:
63+
node-version: "24.18.0"
64+
65+
- name: Install Socket CLI
66+
run: npm install -g socket
67+
68+
- name: Run Socket reachability scan
69+
env:
70+
SOCKET_SECURITY_API_TOKEN: ${{ secrets.SOCKET_SECURITY_API_TOKEN }}
71+
run: |
72+
# Stream the scan output through tee so the run log captures it AND
73+
# we can grep it for Tier-2-fallback markers; capture the scan's
74+
# exit code via ${PIPESTATUS[0]} (tee always exits 0). If the scan
75+
# succeeded but logged a Tier 2 fallback, emit a ::warning::
76+
# annotation that GitHub Actions renders as a yellow run-level
77+
# warning without failing the job.
78+
set +e
79+
socket scan create --reach \
80+
--org=stellar \
81+
--no-interactive \
82+
--reach-continue-on-no-source-files \
83+
--reach-continue-on-analysis-errors \
84+
--reach-continue-on-install-errors \
85+
--reach-continue-on-missing-lock-files \
86+
--reach-ecosystems=cargo,pypi \
87+
. 2>&1 | tee /tmp/scan.log
88+
rc=${PIPESTATUS[0]}
89+
if [ $rc -eq 0 ] && grep -qE "Reachability falls back to Tier 2|fallback to the results from the pre-computed|Reachability falls back to precomputed" /tmp/scan.log; then
90+
echo "::warning::Socket scan completed with Tier 2 fallbacks - some vulnerabilities used precomputed reachability instead of full Tier 1"
91+
fi
92+
exit $rc

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ compile_commands.json
100100
# tracy binaries
101101
/tracy-capture
102102
/tracy-gui
103+
/tracy-import-chrome
103104

104105
# test output
105106
stellar-core-test-*

‎.gitmodules‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@
5252
[submodule "src/rust/soroban/p28"]
5353
path = src/rust/soroban/p28
5454
url = https://github.com/stellar/rs-soroban-env.git
55+
[submodule "src/rust/soroban/p29"]
56+
path = src/rust/soroban/p29
57+
url = https://github.com/stellar/rs-soroban-env.git
58+
branch = release/v29.0.0-internal
59+
[submodule "src/rust/soroban/p30"]
60+
path = src/rust/soroban/p30
61+
url = https://github.com/stellar/rs-soroban-env.git
5562
[submodule "lib/gperftools"]
5663
path = lib/gperftools
5764
url = https://github.com/gperftools/gperftools.git

‎Builds/VisualStudio/stellar-core.vcxproj‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,7 @@ exit /b 0
908908
<ClCompile Include="..\..\src\util\test\Uint128Tests.cpp" />
909909
<ClCompile Include="..\..\src\util\test\XDRStreamTests.cpp" />
910910
<ClCompile Include="..\..\src\util\TarjanSCCCalculator.cpp" />
911+
<ClCompile Include="..\..\src\util\TcmallocConfig.cpp" />
911912
<ClCompile Include="..\..\src\util\Thread.cpp" />
912913
<ClCompile Include="..\..\src\util\TmpDir.cpp" />
913914
<ClCompile Include="..\..\src\util\Timer.cpp" />
@@ -1280,6 +1281,7 @@ exit /b 0
12801281
<ClInclude Include="..\..\src\util\SociNoWarnings.h" />
12811282
<ClInclude Include="..\..\src\util\StatusManager.h" />
12821283
<ClInclude Include="..\..\src\util\TarjanSCCCalculator.h" />
1284+
<ClInclude Include="..\..\src\util\TcmallocConfig.h" />
12831285
<ClInclude Include="..\..\src\util\Thread.h" />
12841286
<ClInclude Include="..\..\src\util\TmpDir.h" />
12851287
<ClInclude Include="..\..\src\util\Timer.h" />

‎Builds/VisualStudio/stellar-core.vcxproj.filters‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,9 @@
489489
<ClCompile Include="..\..\src\util\TarjanSCCCalculator.cpp">
490490
<Filter>util</Filter>
491491
</ClCompile>
492+
<ClCompile Include="..\..\src\util\TcmallocConfig.cpp">
493+
<Filter>util</Filter>
494+
</ClCompile>
492495
<ClCompile Include="..\..\src\util\Thread.cpp">
493496
<Filter>util</Filter>
494497
</ClCompile>
@@ -1737,6 +1740,9 @@
17371740
<ClInclude Include="..\..\src\util\TarjanSCCCalculator.h">
17381741
<Filter>util</Filter>
17391742
</ClInclude>
1743+
<ClInclude Include="..\..\src\util\TcmallocConfig.h">
1744+
<Filter>util</Filter>
1745+
</ClInclude>
17401746
<ClInclude Include="..\..\src\util\Thread.h">
17411747
<Filter>util</Filter>
17421748
</ClInclude>

‎CONTRIBUTING.md‎

Lines changed: 95 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,53 @@ Guide](https://github.com/stellar/.github/blob/master/CONTRIBUTING.md) for detai
77
to stellar-core and Stellar's other repositories, especially with regard to our code of conduct and
88
contributor license agreement.
99

10-
## Submitting Changes
10+
The repository-specific requirements below take precedence where they are more restrictive than the
11+
general Stellar Contribution Guide.
1112

12-
Fork the `stellar/stellar-core` repo on github and submit a pull request from a branch in your fork.
13-
Key things to keep in mind:
14-
* Keep your branch up-to-date by rebasing on `stellar/stellar-core` `master`
15-
* Ensure your branch focuses on a single issue at a time
16-
* Before merging, squash your commits and ensure you have a descriptive commit message
13+
## Before Contributing
14+
15+
Stellar Core processes live financial transactions. Correctness is critical, and maintainer and
16+
reviewer time is limited. We welcome contributions that address a demonstrated, material problem or
17+
advance work that maintainers have agreed is a priority.
18+
19+
### Start With an Issue
20+
21+
Before creating an issue, search the existing issues and join a relevant discussion if an existing issue is present.
22+
When creating a new issue, you should establish:
23+
24+
* The concrete problem that needs solving.
25+
* For a bug, include a minimal reproducer with the expected and actual behavior whenever possible.
26+
* Relevant alternatives, if any, and their tradeoffs.
27+
* For a performance change, measurements that show the current problem and provide a baseline for evaluating a solution.
28+
29+
Personally verify findings before reporting them. Do not submit speculative findings or generated lists of possible issues.
30+
31+
Opening an issue does not reserve the work or mean that a code change is wanted.
32+
An issue with the `help wanted` label is available for implementation, but contributors should
33+
still discuss their proposed approach on the issue before starting substantial work.
34+
35+
### Participation and Review
36+
37+
Keep your participation to issues and do not post comments on pull requests. Issue comments should be specific and evidence-based.
38+
Comments must not be about implementation strategies unless explicitly invited to do so.
39+
Maintainers will delete issue comments that are irrelevant to the issue.
40+
Proceed with a pull request only when invited by the maintainers, including for issues with the `help wanted` label.
41+
42+
## Opening a Pull Request
43+
44+
We are currently only accepting pull requests for issues with the `help wanted` label.
45+
Unsolicited pull requests will be closed without an explanation and reported as spam.
46+
Making changes to stellar-core requires deep architectural knowledge, a good understanding of system constraints, and
47+
an idea about the project roadmap. External contributors often do not have this context, and their pull requests
48+
typically focus on lower-priority issues. Reviewing those changes takes the maintainers' focus away from higher-priority work.
49+
50+
Key things to keep in mind when creating a pull request:
51+
52+
* Fork the `stellar/stellar-core` repository and submit the pull request from a branch in your fork.
53+
* Link the approved issue and keep the pull request within the agreed scope.
54+
* Keep your branch up-to-date by rebasing on `stellar/stellar-core` `master`.
55+
* Ensure your branch focuses on a single issue at a time.
56+
* Before merging, squash your commits and ensure you have a descriptive commit message.
1757

1858
## Stellar Core Contribution Specifics
1959

@@ -294,6 +334,55 @@ files. You should then inspect to see that only the transactions you expected to
294334
see change did so. If so, commit the changes as a new set of baselines for
295335
future tests.
296336

337+
## Running and updating LedgerCloseMeta checks
338+
339+
Alongside the TxMeta hashes above, the unit tests can capture the full
340+
`LedgerCloseMeta` XDR of every ledger they close, and check it against golden
341+
data stored in the repository. Where the TxMeta baselines record a hash per
342+
transaction, this records the complete binary meta, so the files also serve as
343+
test data for downstream consumers such as Horizon and RPC. The two modes are:
344+
345+
* `--capture-lcm` which writes golden files, and
346+
* `--check-lcm <dirname>` which checks against them, where `<dirname>` is the
347+
directory holding the golden trees (the source tree root).
348+
349+
The golden data lives in `test-lcm-current` (for the current protocol) and
350+
`test-lcm-next` (for the next protocol), one subdirectory per test file, one
351+
file per leaf section, named by a truncated hash of the test and section names.
352+
Each subdirectory's `index.json` maps those hashes back to the names (test case
353+
and sections joined with `|`, as in the TxMeta baselines) and
354+
records the protocol version and rng seed that produced the data. Continuous
355+
integration runs `--check-lcm`, which fails fast if those headers do not match
356+
the running binary — so a protocol version bump requires re-capturing the
357+
data, even when no transaction semantics changed.
358+
359+
To re-capture after an intentional change, after a protocol bump, or after
360+
merging in a `master` that changed the golden data, run from the source tree
361+
root:
362+
363+
stellar-core test [tx] --rng-seed 12345 --capture-lcm
364+
365+
for a build with only the current protocol enabled, and the same command for a
366+
build configured with `--enable-next-protocol-version-unsafe-for-production`,
367+
which writes the `next` tier instead. Note there is no `--all-versions` here:
368+
the golden data is captured at the default (latest) protocol version only.
369+
370+
Capture is a full-corpus operation: after a clean run it rebuilds each visited
371+
test file's `index.json` from what it captured and deletes golden files the run
372+
did not write, so leaves that are no longer produced do not accumulate. This is
373+
the same behaviour as `--record-test-tx-meta`. A run filtered to a subset of
374+
tests therefore deletes the goldens of sibling tests in the same file; that is
375+
fine while iterating locally, but always finish with the full `[tx]` run above
376+
before committing.
377+
378+
Some tests are automatically skipped because their meta cannot serve as
379+
golden data: those that inject ledger entries straight
380+
into the bucket list (the meta never shows the entries being created), those
381+
that run a multi-node `Simulation`, and those using a config whose ledger
382+
content depends on thread scheduling or randomized nomination. If you add a
383+
test that needs a golden vector, close its ledgers through the ordinary
384+
single-node path.
385+
297386
## Fastdev and non-unified Rust builds
298387

299388
As of protocol 20, some components of stellar-core are written in Rust (notably

0 commit comments

Comments
 (0)