Apply transaction batches in periodic intervals (#4504)

Add new transaction submission API field, "sync", which
determines behavior of the server while submitting transactions:
1) sync (default): Process transactions in a batch immediately,
   and return only once the transaction has been processed.
2) async: Put transaction into the batch for the next processing
   interval and return immediately.
3) wait: Put transaction into the batch for the next processing
   interval and return only after it is processed.
This commit is contained in:
Mark Travis
2023-09-11 15:47:40 -07:00
committed by GitHub
parent 1d9db1bfdd
commit 002893f280
24 changed files with 398 additions and 163 deletions

View File

@@ -19,6 +19,7 @@
#include <ripple/app/misc/LoadFeeTrack.h>
#include <ripple/app/misc/TxQ.h>
#include <ripple/basics/SubmitSync.h>
#include <ripple/basics/contract.h>
#include <ripple/beast/unit_test.h>
#include <ripple/core/ConfigSections.h>
@@ -2384,7 +2385,7 @@ public:
fakeProcessTransaction(
std::shared_ptr<Transaction>&,
bool,
bool,
SubmitSync,
NetworkOPs::FailHard)
{
;
@@ -2432,7 +2433,8 @@ public:
Role role,
std::chrono::seconds validatedLedgerAge,
Application & app,
ProcessTransactionFn const& processTransaction);
ProcessTransactionFn const& processTransaction,
RPC::SubmitSync sync);
using TestStuff =
std::tuple<signFunc, submitFunc, char const*, unsigned int>;
@@ -2485,7 +2487,8 @@ public:
testRole,
1s,
env.app(),
processTxn);
processTxn,
RPC::SubmitSync::sync);
}
std::string errStr;