experimental large ledgers with no txq

This commit is contained in:
Richard Holland
2025-07-05 10:14:20 +10:00
parent 8256c5f22f
commit 8db3c270fb
4 changed files with 13 additions and 7 deletions

View File

@@ -212,6 +212,7 @@ LedgerMaster::getCurrentLedgerIndex()
LedgerIndex
LedgerMaster::getValidLedgerIndex()
{
std::cout << "getValidLedgerIndex: " << mValidLedgerSeq << "\n";
return mValidLedgerSeq;
}

View File

@@ -745,7 +745,6 @@ TxQ::apply(
// See if the transaction paid a high enough fee that it can go straight
// into the ledger.
/* RHTEST
view.getAndResetKeysTouched();
if (auto directApplied = tryDirectApply(app, view, tx, flags, j))
{
@@ -753,7 +752,8 @@ TxQ::apply(
transactionID, view.getAndResetKeysTouched());
return *directApplied;
}
*/
return {telCAN_NOT_QUEUE, false};
// If we get past tryDirectApply() without returning then we expect
// one of the following to occur:
@@ -1930,13 +1930,15 @@ TxQ::tryDirectApply(
const bool isFirstImport = !sleAccount &&
view.rules().enabled(featureImport) && tx->getTxnType() == ttIMPORT;
bool const isReplayNetwork = (app.config().NETWORK_ID == 65534);
// Don't attempt to direct apply if the account is not in the ledger.
if (!sleAccount && !isFirstImport)
if (!sleAccount && !isFirstImport && !isReplayNetwork)
return {};
std::optional<SeqProxy> txSeqProx;
if (!isFirstImport)
if (!isFirstImport && !isReplayNetwork)
{
SeqProxy const acctSeqProx =
SeqProxy::sequence((*sleAccount)[sfSequence]);
@@ -1949,7 +1951,7 @@ TxQ::tryDirectApply(
}
FeeLevel64 const requiredFeeLevel =
isFirstImport ? FeeLevel64{0} : [this, &view, flags]() {
(isFirstImport || isReplayNetwork) ? FeeLevel64{0} : [this, &view, flags]() {
std::lock_guard lock(mutex_);
return getRequiredFeeLevel(
view, flags, feeMetrics_.getSnapshot(), lock);
@@ -1959,7 +1961,7 @@ TxQ::tryDirectApply(
// transaction straight into the ledger.
FeeLevel64 const feeLevelPaid = getFeeLevelPaid(view, *tx);
if (feeLevelPaid >= requiredFeeLevel)
if (feeLevelPaid >= requiredFeeLevel || isReplayNetwork)
{
// Attempt to apply the transaction directly.
auto const transactionID = tx->getTransactionID();

View File

@@ -49,7 +49,7 @@ LogicError(std::string const& s) noexcept
{
JLOG(debugLog().fatal()) << s;
std::cerr << "Logic error: " << s << std::endl;
detail::accessViolation();
//detail::accessViolation();
}
} // namespace ripple

View File

@@ -263,6 +263,9 @@ OpenView::rawTxInsert(
std::shared_ptr<Serializer const> const& txn,
std::shared_ptr<Serializer const> const& metaData)
{
if (txExists(key))
return;
auto const result = txs_.emplace(
std::piecewise_construct,
std::forward_as_tuple(key),