mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Control transaction dispatch rate:
Do not dispatch a transaction received from a peer for
processing, if it has already been dispatched within the
past ten seconds.
Increase the number of transaction handlers that can be in
flight in the job queue and decrease the relative cost for
peers to share transaction and ledger data.
Additionally, make better use of resources by adjusting the
number of threads we initialize, by reverting commit
68b8ffdb63.
This commit is contained in:
committed by
Nikolaos D. Bougalis
parent
6dc79c23ed
commit
fbfb4bd74e
@@ -1055,8 +1055,9 @@ PeerImp::onMessage (std::shared_ptr <protocol::TMTransaction> const& m)
|
||||
|
||||
int flags;
|
||||
|
||||
if (! app_.getHashRouter ().addSuppressionPeer (
|
||||
txID, id_, flags))
|
||||
constexpr std::chrono::seconds tx_interval = 10s;
|
||||
if (! app_.getHashRouter ().shouldProcess (
|
||||
txID, id_, flags, clock_type::now(), tx_interval))
|
||||
{
|
||||
// we have seen this transaction recently
|
||||
if (flags & SF_BAD)
|
||||
@@ -1064,8 +1065,9 @@ PeerImp::onMessage (std::shared_ptr <protocol::TMTransaction> const& m)
|
||||
fee_ = Resource::feeInvalidSignature;
|
||||
JLOG(p_journal_.debug()) << "Ignoring known bad tx " <<
|
||||
txID;
|
||||
return;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
JLOG(p_journal_.debug()) << "Got tx " << txID;
|
||||
@@ -1088,7 +1090,9 @@ PeerImp::onMessage (std::shared_ptr <protocol::TMTransaction> const& m)
|
||||
}
|
||||
}
|
||||
|
||||
if (app_.getJobQueue().getJobCount(jtTRANSACTION) > 100)
|
||||
// The maximum number of transactions to have in the job queue.
|
||||
constexpr int max_transactions = 250;
|
||||
if (app_.getJobQueue().getJobCount(jtTRANSACTION) > max_transactions)
|
||||
{
|
||||
JLOG(p_journal_.info()) << "Transaction queue is full";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user