refactor(export): remove retired witness threshold

This commit is contained in:
Nicholas Dudfield
2026-07-16 16:46:34 +07:00
parent e7330acbbe
commit 59697f5ae7
4 changed files with 7 additions and 28 deletions

View File

@@ -1193,8 +1193,6 @@ class ConsensusExtensions_test : public beast::unit_test::suite
entropyTierConsensusFallback);
BEAST_EXPECT(
ConsensusExtensions::exportRootAlignmentThreshold(cappedView) == 6);
BEAST_EXPECT(
ConsensusExtensions::exportWitnessThreshold(cappedView) == 6);
}
void
@@ -4174,7 +4172,6 @@ class ConsensusExtensions_test : public beast::unit_test::suite
auto const ledger = env.app().getLedgerMaster().getClosedLedger();
ce.cacheUNLReport(ledger);
BEAST_EXPECT(ce.exportRootAlignmentThreshold() == 1);
BEAST_EXPECT(ce.exportWitnessThreshold() == 1);
ce.setExportSigConvergenceFailed();
BEAST_EXPECT(ce.exportSigConvergenceFailed());

View File

@@ -32,6 +32,7 @@
#include <xrpl/basics/base_uint.h>
#include <xrpl/beast/utility/WrappedSink.h>
#include <xrpl/protocol/EntropyTier.h>
#include <xrpl/protocol/ExportLimits.h>
#include <xrpl/protocol/PublicKey.h>
#include <boost/container/flat_map.hpp>
#include <algorithm>
@@ -482,13 +483,16 @@ struct Peer
}
std::size_t
exportWitnessThreshold() const
exportCommitteeThreshold() const
{
if (!enableExportConsensus_)
return (std::numeric_limits<std::size_t>::max)() / 4;
// CSF models the full simulated UNL as the configured Export
// committee. Production reads this threshold from each intent's
// ledger-anchored committee instead of the active validation view.
auto const base =
unlNodes_.empty() ? std::size_t{1} : unlNodes_.size();
return calculateQuorumThreshold(base);
return ExportLimits::committeeQuorumThreshold(base);
}
std::size_t
@@ -1023,7 +1027,7 @@ struct Peer
});
}
lastExportSucceeded_ = activeSigCount >= exportWitnessThreshold();
lastExportSucceeded_ = activeSigCount >= exportCommitteeThreshold();
lastExportRetried_ = !lastExportSucceeded_;
if (lastExportSucceeded_ && acceptedExportSigSetHash_)
lastExportWitnessEffect_ = *acceptedExportSigSetHash_;

View File

@@ -1012,22 +1012,6 @@ ConsensusExtensions::exportRootAlignmentThreshold(
return safeQuorumThreshold(base);
}
std::size_t
ConsensusExtensions::exportWitnessThreshold() const
{
return exportWitnessThreshold(*activeValidatorView());
}
std::size_t
ConsensusExtensions::exportWitnessThreshold(
ActiveValidatorView const& validatorView)
{
// The full active view is also the witness authority today. Keep this
// authorization threshold separate from root alignment so a bounded
// committee can replace the witness authority without weakening qV.
return safeQuorumThreshold(validatorView.size());
}
std::size_t
ConsensusExtensions::tier2Threshold() const
{

View File

@@ -278,12 +278,6 @@ public:
static std::size_t
exportRootAlignmentThreshold(ActiveValidatorView const& validatorView);
std::size_t
exportWitnessThreshold() const;
static std::size_t
exportWitnessThreshold(ActiveValidatorView const& validatorView);
/// Tier 2 (participant_aligned) alignment floor: the smallest cohort whose
/// pairwise intersection exceeds the tolerated Byzantine count (~0.6 of the
/// ORIGINAL pre-nUNL view; exact value from calculateParticipantThreshold).