fix(consensus): preserve export state without rng

This commit is contained in:
Nicholas Dudfield
2026-04-27 20:34:58 +07:00
parent 625419eab7
commit ea413873b2
2 changed files with 11 additions and 5 deletions

View File

@@ -192,6 +192,11 @@ Export sig convergence runs in parallel with RNG. An export-side convergence
failure must not change RNG semantics; an RNG fallback must not make export
unsafe. Each feature has its own gate and fallback.
Accept-time cleanup must preserve Export state through `buildLCL` whenever
`featureExport` is enabled. RNG-disabled does not mean extensions-disabled:
`ttEXPORT` still needs the round's export sidecar convergence state when it
applies.
CSF consensus tests model the export sidecar gate directly. Testnet scenarios
under `.testnet/scenarios/export/` cover live-node Export+CE behavior and the
Export-only unanimity mode.

View File

@@ -587,13 +587,14 @@ RCLConsensus::Adaptor::doAccept(
}
//@@start auxiliary-pre-build-injection
// Inject consensus entropy pseudo-transaction (if amendment enabled)
// This must happen before buildLCL so the entropy tx is in the ledger
// Inject consensus entropy pseudo-transaction (if amendment enabled).
// Export-only rounds still need extension state preserved through buildLCL
// so ttEXPORT can observe exportSigSetHash convergence at apply time.
//@@start accept-time-cleanup-disabled
if (prevLedger.ledger_->rules().enabled(featureConsensusEntropy))
if (ce().rngEnabled())
ce().onPreBuild(retriableTxs, prevLedger.seq() + 1);
else
ce().clearRngState(); // CE disabled — clear extension state now
else if (!ce().exportEnabled())
ce().clearRngState();
//@@end accept-time-cleanup-disabled
auto built = buildLCL(