Commit Graph

15109 Commits

Author SHA1 Message Date
Nicholas Dudfield
0ebdb22be2 test(threaded): wait for sim transport quiescence before post-run activity asserts 2026-09-24 04:58:52 +07:00
Nicholas Dudfield
214a3ef50a fix(test): stabilize stepping peer dispatch before fault draws
Sort the weak peer snapshot by ID only in stepping mode before broadcast and relay callbacks consume the injected random engine. Preserve the existing dispatch order outside stepping.

Reserve an unused pair of simulated peer IDs between replays and require the same ledger payload, event fingerprint and count. This exercises allocation history without changing applications, ports or clocks.
2026-09-23 23:24:13 +07:00
Nicholas Dudfield
73594d1bb3 ci: register the detected apple-clang version with conan on macOS
Conan's bundled settings.yml does not yet list apple-clang 21, so the
macOS runner failed at profile validation on every branch.
2026-09-23 21:53:26 +07:00
Nicholas Dudfield
067ad43b36 fix(test): expect config-forced amendments only where the Env forces them
The dev merge brought #765's server_definitions test, whose default-Env
case assumed every supported amendment is config-forced. The jtx fixture
on this lineage deliberately leaves ConsensusEntropy out of the default
set, so enabled is now expected exactly for the Env's configured
features, with ledger_enabled still false. Also formats the include the
merge brought into ServerDefinitions.cpp.
2026-09-23 21:53:22 +07:00
Nicholas Dudfield
d256a77ad3 Merge remote-tracking branch 'origin/feature-export-rng' into feature-export-rng-dsf 2026-09-23 21:41:32 +07:00
Nicholas Dudfield
5e69513d40 ci: allowlist RuntimeFaultRandom.h in the rng tripwire
The fault-injection draws moved from PeerImp.cpp and
ConsensusExtensions.cpp into RuntimeFaultRandom.h; the allowlist still
named the old files, so the tripwire went red on the pushed head.
2026-09-23 20:37:56 +07:00
Nicholas Dudfield
44a8b60c37 test(consensus): correct the dsf golden manifest
Traffic is a 3-validator mesh, and its payload hash covers ledger
hashes plus transaction ids and sequences. The hub pin is five
validators linked only to one non-validator hub.
2026-09-23 20:10:14 +07:00
Nicholas Dudfield
8c6694aa63 test(consensus): observe stale export admission without parsing logs
Replace pre-delivery sampling and formatted-log matching with actual stale-proposal dispatch plus a typed collector commit in the same authenticated proposal job. Capture the round parent even in open phase, require exact carried material, and run with observer trace disabled so enhanced logging cannot change the oracle.
2026-09-23 20:07:43 +07:00
Nicholas Dudfield
991ffdecb9 test(consensus): move dsf stepping goldens into one header
The dispute and fork tables and the traffic and CSF event-order pins
live in goldens/dsf.h. --unittest-arg=goldens=print writes the observed
values. The assertions are unchanged.
2026-09-23 20:00:56 +07:00
Nicholas Dudfield
3f27fbcd5b test(harness): small fixes from the outside review
forkCheckedSeqs counts the sequences validatedForkFree walks. The pinned
2000 is a max consumed beat, Kind weights profiled cost, eventCost rejects
overflow, and fingerprints require a nanosecond clock. Pinned rows unchanged.
2026-09-23 19:50:02 +07:00
Nicholas Dudfield
8794c1e783 fix(test): suffix multi-runner ipc names with the parent pid
Every unittest process, including one job, removes and recreates the
shared-memory object and message queue. Give that pair a parent-pid
suffix and publish the names in the environment so spawned children
and the in-process child open only that pair.
2026-09-23 19:27:18 +07:00
Nicholas Dudfield
34af8667a1 fix(consensus): draw stepping runtime faults from the injected engine
Use the per-node PRNG only in single-threaded stepping mode. Preserve separate per-thread MT engines outside stepping so threaded fault hooks do not race an injected engine. Test all four draw domains and three bit-for-bit RuntimeConfig drop/claim/reveal replays; jitter timer delivery remains out of scope.
2026-09-23 19:26:50 +07:00
Nicholas Dudfield
20932ce87d fix(test): restore current virtual time before threaded node restart
Fix issue 2029: live clocks advance while a stopped node has no TimeKeeper. Keep the threaded runner network-time cursor and apply it before startup on restart or late add, preserving existing per-tick conversion and stepping clock semantics. A 25-second offline regression reconnects through production handshake checks; restoring the old stop-time snapshot makes it fail with the observed clock exception.
2026-09-23 19:22:07 +07:00
Nicholas Dudfield
e694b37e31 test(consensus): prove contention at the extension materialization lock
Closes the catch-up review finding that the before-lock probe was masked by earlier accept-time acquisitions. Rendezvous immediately before onPreBuild and observe a failed try_lock on that same mutex, with bounded waits and captured-job cleanup.
2026-09-23 18:25:17 +07:00
Nicholas Dudfield
e0219cef48 fix(consensus): run the accepted-set sanitizer outside the consensus mutex
The catch-up review found that makeLiveBuildTxSet reads only its immutable argument. Avoid holding C during its transaction-count-sized scan; retain and measure the state-dependent ordering-salt and materialization locks.
2026-09-23 18:25:17 +07:00
Nicholas Dudfield
565f0324a8 style: clang-format ServerDefinitions and regenerate levelization results
CI formats the whole tree; ServerDefinitions.cpp arrived unformatted on
this lineage. loops.txt reflects the merged overlay/app relationship.
2026-09-23 18:12:28 +07:00
Nicholas Dudfield
96181e97a3 test(export): exercise the expiry classifier at the publication boundary
Use one strict predicate in both unwitnessed fallback oracles and the directed held-material scenario. Assert live at deadline-1 and deadline, then a positive expired classification after the deadline on real accepted history.
2026-09-23 18:02:38 +07:00
Nicholas Dudfield
005a85a4d1 test(export): require actual per-origin publication expiry
Closes the catch-up review finding that unwitnessed pending latches could be labeled expired using only submission-based run targets. Require accepted history to pass the latch deadline; equality remains live.
2026-09-23 18:02:38 +07:00
Nicholas Dudfield
bef502f6df fix(test): retain the profiled stop predicate decision
Closes the catch-up review finding in 020db70424: do not call a consuming stop predicate again while classifying the exit. Cover a one-shot predicate and heartbeat/step budgets that never evaluate it.
2026-09-23 18:01:12 +07:00
Nicholas Dudfield
c97f89a94f ci: tripwire for implementation-defined random algorithms 2026-09-23 17:32:41 +07:00
Nicholas Dudfield
020db70424 test(consensus): pin both sides of the K=3 boundary with a recovery check
The profiled dispute takes a seed base. Two K=3 rows: 0x1000000000000001
resolves at beat 54, and the default seed accepts at 10, saturates under
K=3, and recovers in 6 beats at K=0. The profiled loop records its stop
reason. Recovery beats are recorded only on success. No consensus policy
changed.
2026-09-23 16:32:02 +07:00
Nicholas Dudfield
2d2c28e804 Merge remote-tracking branch 'origin/multiple-application-deterministic-tests' into dsf-portable-rng 2026-09-23 16:31:38 +07:00
Nicholas Dudfield
c527e0a721 fix(basics): allow zero-bit groups in random word extraction 2026-09-23 16:12:23 +07:00
Nicholas Dudfield
d7e6be2f59 fix(basics): size randomU64 from the engine range
numeric_limits digits is the storage width, not how many values the
engine emits. A 32-bit engine in a 64-bit result type was treated as
a full word, which biases a range and can reject forever. A full
64-bit range is still one draw. Other power-of-two ranges are
concatenated. The rest follow the standard independent_bits rejection.
2026-09-23 15:46:33 +07:00
Nicholas Dudfield
8591245da6 test(consensus): pin dsf stepping golden fingerprints
The dsf lineage pins its own constants. Its schedule is not the donor
branch, so the #814 fingerprints never held here. These are the macOS
values on this branch.
2026-09-23 13:44:32 +07:00
Nicholas Dudfield
39c83950f5 fix(overlay): draw fault drops through rand_int
The four direct uniform_int_distribution calls on this lineage were still
stdlib-defined. Peer send drop and delay jitter, and the RNG claim and
reveal drops, now use rand_int. A zero jitter adds nothing, because
rand_int rejects a zero-width range.
2026-09-23 13:19:01 +07:00
Nicholas Dudfield
2a3f9ebae2 Merge remote-tracking branch 'origin/multiple-application-deterministic-tests' into dsf-portable-rng
# Conflicts:
#	Builds/levelization/results/ordering.txt
#	src/test/consensus/SteppingController_test.cpp
#	src/test/consensus/SteppingDeterminism_test.cpp
#	src/test/jtx/MultiNode.h
#	src/test/jtx/SteppingController.h
#	src/test/jtx/SteppingNetwork.h
#	src/xrpld/overlay/detail/PeerImp.h
2026-09-23 13:17:36 +07:00
Nicholas Dudfield
c6b0839a25 fix(ledger): sample inbound peers with Knuth's Algorithm S
std::sample is not the same on libstdc++ and libc++, so saturated
acquisition cells diverged on Linux after rand_int was made portable.
Selection-sample the id-sorted peer list with rand_int, and take a
must-keep tail without a zero-width draw.
2026-09-23 13:08:52 +07:00
Nicholas Dudfield
58ff1777fb test(consensus): recapture stepping golden fingerprints
macOS values after the portable rand_int mapping. SteppingTraffic held
and is not in this commit. The hub-network fingerprint held as well.
2026-09-23 12:37:10 +07:00
Nicholas Dudfield
54f722d27d fix(basics): map rand_int without the standard distribution
std::uniform_int_distribution is not the same on libc++ and libstdc++,
so a seeded engine produced different harness event streams on Linux.
Rejection-sample a closed range from the engine's own 64-bit output.
Seeding overloads are unchanged.
2026-09-23 12:37:05 +07:00
Richard Holland
945eb98f96 Merge branch 'dev' into feature-export-rng 2026-09-23 15:35:13 +10:00
Niq Dudfield
2e32b5c6bb feat(server_definitions): distinguish config-forced from ledger-enabled amendments (#765) 2026-09-23 15:33:43 +10:00
Nicholas Dudfield
2c25eed063 test(consensus): judge stale proposals by peer positions, not a removed log line
Validator 2 is absent from node 0's peer positions while its stale
proposals arrive, and present again after the delay is lifted. The wire
count and the later collector commit stay positive.
2026-09-23 10:05:34 +07:00
Nicholas Dudfield
d231beb324 merge fix-accept-consensus-lock: consensus mutex around accept-time extension prep, probe seams, waits-on-lock case 2026-09-23 09:53:03 +07:00
Nicholas Dudfield
edd5ee0f8b test(consensus): show the accept extension block waits on the consensus lock
A heartbeat-side hook holds the mutex while a captured accept job reaches
it, and standalone simulate reenters the same lock.
2026-09-23 09:50:57 +07:00
Nicholas Dudfield
87e3a2cbd6 test(seam): accept-lock probe and hold-time counter
Hooks and the max-hold counter sit on top of the mutex fix so a suite
can show the accept block waiting and report how long the lock is held.
2026-09-23 09:50:48 +07:00
Nicholas Dudfield
915d37cc31 fix(consensus): hold the consensus mutex around accept-time extension prep
doAccept reacquires the consensus mutex for the live-build view, the
ordering salt, and the replay or pre-build block. Ledger building,
open-ledger locks, and endConsensus stay outside it.
2026-09-23 09:48:49 +07:00
Nicholas Dudfield
52e9bc4811 build: regenerate levelization results for the harness edges
No new loops; the core/net loop is resolved into an ordering. New ordering
edges are the test harness including overlay, peerfinder and net.
2026-09-23 09:23:27 +07:00
Nicholas Dudfield
5ca8a0f8b4 style: clang-format the harness and suite sources 2026-09-23 09:22:54 +07:00
Nicholas Dudfield
f63d78ae08 merge upstream feature-export-rng (PR #817: remove testnet scenarios and STARTDIAG logging) 2026-09-23 09:17:11 +07:00
Richard Holland
bc5b90282a export-rng cleanup - remove test infrastructure and STARTDIAG debug logging (#817)
remove python scripts etc from the PR they should live elsewhere.

---------

Co-authored-by: RichardAHBot <bot@xahau.org>
2026-09-23 11:45:32 +10:00
Nicholas Dudfield
998df6e474 test(jtx): drain io threads before destroying a stopped node
Parked. Ordinary proofs passed; the TSAN check was not run because the
bring-up quiescence wedge was taken first.
2026-09-22 16:49:01 +07:00
Nicholas Dudfield
b04bbd1c43 test(jtx): end a threaded drain when the transport stops moving
A self-rescheduling job never lets the queue look quiet, so virtual time
never advanced and bring-up stalled at ledger 7. After a few non-quiet
polls with a frozen pipe and frozen post counters, the drain returns and
the clock moves. The stall clock remains the failure signal.
2026-09-22 16:47:05 +07:00
Nicholas Dudfield
f9a4057206 test(jtx): bound a threaded drain on progress, not a 30s wall budget
A drain that is still advancing validated ledgers or the job token no
longer fails at 30s of wall time. A 10 minute safety cap remains.
2026-09-22 16:21:20 +07:00
Nicholas Dudfield
285fd6df90 fix(consensus): publish the heartbeat busy flag off the consensus lock
The accept job no longer clears extension round state at the end of
onPreBuild. The heartbeat reads a published atomic, updated where a
contributing input changes, under a mutex that covers those fields.
2026-09-22 15:55:42 +07:00
Nicholas Dudfield
556f2bb8ca test(jtx): restore the NetClock across a MultiNode restart 2026-09-22 13:43:51 +07:00
Nicholas Dudfield
db252b4ab1 test(consensus): filter a witness from an accepted partial map 2026-09-22 13:29:10 +07:00
Nicholas Dudfield
ae6a2f6907 test(consensus): stop mutating Config after the app thread starts 2026-09-22 13:18:57 +07:00
Nicholas Dudfield
8b2d92a91f test(consensus): accept a pruned expired Export latch 2026-09-22 13:04:39 +07:00
Nicholas Dudfield
019f74c847 test(consensus): exercise Export on the threaded virtual clock 2026-09-22 12:49:45 +07:00