mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-03 17:05:50 +00:00
experimental large ledgers with no txq
This commit is contained in:
@@ -212,6 +212,7 @@ LedgerMaster::getCurrentLedgerIndex()
|
|||||||
LedgerIndex
|
LedgerIndex
|
||||||
LedgerMaster::getValidLedgerIndex()
|
LedgerMaster::getValidLedgerIndex()
|
||||||
{
|
{
|
||||||
|
std::cout << "getValidLedgerIndex: " << mValidLedgerSeq << "\n";
|
||||||
return mValidLedgerSeq;
|
return mValidLedgerSeq;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -745,7 +745,6 @@ TxQ::apply(
|
|||||||
// See if the transaction paid a high enough fee that it can go straight
|
// See if the transaction paid a high enough fee that it can go straight
|
||||||
// into the ledger.
|
// into the ledger.
|
||||||
|
|
||||||
/* RHTEST
|
|
||||||
view.getAndResetKeysTouched();
|
view.getAndResetKeysTouched();
|
||||||
if (auto directApplied = tryDirectApply(app, view, tx, flags, j))
|
if (auto directApplied = tryDirectApply(app, view, tx, flags, j))
|
||||||
{
|
{
|
||||||
@@ -753,7 +752,8 @@ TxQ::apply(
|
|||||||
transactionID, view.getAndResetKeysTouched());
|
transactionID, view.getAndResetKeysTouched());
|
||||||
return *directApplied;
|
return *directApplied;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
return {telCAN_NOT_QUEUE, false};
|
||||||
|
|
||||||
// If we get past tryDirectApply() without returning then we expect
|
// If we get past tryDirectApply() without returning then we expect
|
||||||
// one of the following to occur:
|
// one of the following to occur:
|
||||||
@@ -1930,13 +1930,15 @@ TxQ::tryDirectApply(
|
|||||||
const bool isFirstImport = !sleAccount &&
|
const bool isFirstImport = !sleAccount &&
|
||||||
view.rules().enabled(featureImport) && tx->getTxnType() == ttIMPORT;
|
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.
|
// Don't attempt to direct apply if the account is not in the ledger.
|
||||||
if (!sleAccount && !isFirstImport)
|
if (!sleAccount && !isFirstImport && !isReplayNetwork)
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
std::optional<SeqProxy> txSeqProx;
|
std::optional<SeqProxy> txSeqProx;
|
||||||
|
|
||||||
if (!isFirstImport)
|
if (!isFirstImport && !isReplayNetwork)
|
||||||
{
|
{
|
||||||
SeqProxy const acctSeqProx =
|
SeqProxy const acctSeqProx =
|
||||||
SeqProxy::sequence((*sleAccount)[sfSequence]);
|
SeqProxy::sequence((*sleAccount)[sfSequence]);
|
||||||
@@ -1949,7 +1951,7 @@ TxQ::tryDirectApply(
|
|||||||
}
|
}
|
||||||
|
|
||||||
FeeLevel64 const requiredFeeLevel =
|
FeeLevel64 const requiredFeeLevel =
|
||||||
isFirstImport ? FeeLevel64{0} : [this, &view, flags]() {
|
(isFirstImport || isReplayNetwork) ? FeeLevel64{0} : [this, &view, flags]() {
|
||||||
std::lock_guard lock(mutex_);
|
std::lock_guard lock(mutex_);
|
||||||
return getRequiredFeeLevel(
|
return getRequiredFeeLevel(
|
||||||
view, flags, feeMetrics_.getSnapshot(), lock);
|
view, flags, feeMetrics_.getSnapshot(), lock);
|
||||||
@@ -1959,7 +1961,7 @@ TxQ::tryDirectApply(
|
|||||||
// transaction straight into the ledger.
|
// transaction straight into the ledger.
|
||||||
FeeLevel64 const feeLevelPaid = getFeeLevelPaid(view, *tx);
|
FeeLevel64 const feeLevelPaid = getFeeLevelPaid(view, *tx);
|
||||||
|
|
||||||
if (feeLevelPaid >= requiredFeeLevel)
|
if (feeLevelPaid >= requiredFeeLevel || isReplayNetwork)
|
||||||
{
|
{
|
||||||
// Attempt to apply the transaction directly.
|
// Attempt to apply the transaction directly.
|
||||||
auto const transactionID = tx->getTransactionID();
|
auto const transactionID = tx->getTransactionID();
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ LogicError(std::string const& s) noexcept
|
|||||||
{
|
{
|
||||||
JLOG(debugLog().fatal()) << s;
|
JLOG(debugLog().fatal()) << s;
|
||||||
std::cerr << "Logic error: " << s << std::endl;
|
std::cerr << "Logic error: " << s << std::endl;
|
||||||
detail::accessViolation();
|
//detail::accessViolation();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace ripple
|
||||||
|
|||||||
@@ -263,6 +263,9 @@ OpenView::rawTxInsert(
|
|||||||
std::shared_ptr<Serializer const> const& txn,
|
std::shared_ptr<Serializer const> const& txn,
|
||||||
std::shared_ptr<Serializer const> const& metaData)
|
std::shared_ptr<Serializer const> const& metaData)
|
||||||
{
|
{
|
||||||
|
if (txExists(key))
|
||||||
|
return;
|
||||||
|
|
||||||
auto const result = txs_.emplace(
|
auto const result = txs_.emplace(
|
||||||
std::piecewise_construct,
|
std::piecewise_construct,
|
||||||
std::forward_as_tuple(key),
|
std::forward_as_tuple(key),
|
||||||
|
|||||||
Reference in New Issue
Block a user