From 005a85a4d1bbc2a12b90f71bd23596bbb68919d8 Mon Sep 17 00:00:00 2001 From: Nicholas Dudfield Date: Wed, 23 Sep 2026 17:08:20 +0700 Subject: [PATCH] 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. --- src/test/consensus/SteppingExtensions_test.cpp | 13 ++++++++++++- src/test/consensus/ThreadedExtensions_test.cpp | 4 ++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/test/consensus/SteppingExtensions_test.cpp b/src/test/consensus/SteppingExtensions_test.cpp index a7cc55207d..559ee0b251 100644 --- a/src/test/consensus/SteppingExtensions_test.cpp +++ b/src/test/consensus/SteppingExtensions_test.cpp @@ -5134,7 +5134,9 @@ class SteppingExtensions_test : public beast::unit_test::suite << " witness only on node " << n << std::endl; return false; } - auto const ledger = net.ledger(0, net.validSeq(0)); + // Classify against history accepted by every node, not a faster + // node's tip or the intent submission time. Admission can be late. + auto const ledger = net.ledger(0, net.minValidatedSeq()); if (!ledger) return false; auto const latch = @@ -5147,6 +5149,15 @@ class SteppingExtensions_test : public beast::unit_test::suite << " neither witnessed nor retained" << std::endl; return false; } + if (!latch->isFieldPresent(sfLastLedgerSequence) || + ledger->seq() <= latch->getFieldU32(sfLastLedgerSequence)) + { + log << " seeded-mix red " << schedule << " " << tag + << " unwitnessed origin has not passed its publication " + "window" + << std::endl; + return false; + } log << " seeded-mix " << schedule << " " << tag << "=expired" << std::endl; return true; diff --git a/src/test/consensus/ThreadedExtensions_test.cpp b/src/test/consensus/ThreadedExtensions_test.cpp index 21f042389b..6a60904a21 100644 --- a/src/test/consensus/ThreadedExtensions_test.cpp +++ b/src/test/consensus/ThreadedExtensions_test.cpp @@ -822,6 +822,10 @@ class ThreadedExtensions_test : public beast::unit_test::suite << " expired shape=" << shape << std::endl; if (!latch) return fail("latch missing"); + if (!latch->isFieldPresent(sfLastLedgerSequence) || + ledger->seq() <= latch->getFieldU32(sfLastLedgerSequence)) + return fail( + "unwitnessed origin has not passed its publication window"); if (hasSig) return fail("expired latch has a signature hash"); if (hasNode != inDir)