20#include <xrpld/app/misc/HashRouter.h>
21#include <xrpld/app/tx/apply.h>
22#include <xrpld/app/tx/applySteps.h>
24#include <xrpl/basics/Log.h>
25#include <xrpl/protocol/Feature.h>
30#define SF_SIGBAD SF_PRIVATE1
31#define SF_SIGGOOD SF_PRIVATE2
32#define SF_LOCALBAD SF_PRIVATE3
33#define SF_LOCALGOOD SF_PRIVATE4
45 auto const flags = router.
getFlags(
id);
46 if (flags & SF_SIGBAD)
50 if (!(flags & SF_SIGGOOD))
53 auto const requireCanonicalSig =
54 rules.
enabled(featureRequireFullyCanonicalSig)
58 auto const sigVerify = tx.
checkSign(requireCanonicalSig, rules);
68 if (flags & SF_LOCALBAD)
73 if (flags & SF_LOCALGOOD)
96 flags |= SF_LOCALGOOD;
121 auto pcresult =
preclaim(pfresult, app, view);
122 return doApply(pcresult, app, view);
139 << (retryAssured ?
"/retry" :
"/final");
143 auto const result =
apply(app, view, txn, flags, j);
147 <<
"Transaction applied: " <<
transHuman(result.ter);
156 <<
"Transaction failure: " <<
transHuman(result.ter);
165 JLOG(j.
warn()) <<
"Throws: " << ex.
what();
A generic endpoint for log messages.
Routing table for objects identified by hash.
int getFlags(uint256 const &key)
bool setFlags(uint256 const &key, int flags)
Set the flags on a hash.
RAII class to set and restore the Number switchover.
Writable ledger view that accumulates state and tx changes.
Rules const & rules() const override
Returns the tx processing rules.
Rules controlling protocol behavior.
bool enabled(uint256 const &feature) const
Returns true if a feature is enabled.
RAII class to set and restore the STAmount canonicalize switchover.
Expected< void, std::string > checkSign(RequireFullyCanonicalSig requireCanonicalSig, Rules const &rules) const
uint256 getTransactionID() const
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::string transHuman(TER code)
PreflightResult preflight(Application &app, Rules const &rules, STTx const &tx, ApplyFlags flags, beast::Journal j)
Gate a transaction based on static information.
ApplyResult doApply(PreclaimResult const &preclaimResult, Application &app, OpenView &view)
Apply a prechecked transaction to an OpenView.
ApplyTransactionResult
Enum class for return value from applyTransaction
@ Success
Applied to this ledger.
@ Retry
Should be retried in this ledger.
@ Fail
Should not be retried in this ledger.
PreclaimResult preclaim(PreflightResult const &preflightResult, Application &app, OpenView const &view)
Gate a transaction based on static ledger information.
bool isTemMalformed(TER x)
ApplyResult apply(Application &app, OpenView &view, STTx const &tx, ApplyFlags flags, beast::Journal journal)
Apply a transaction to an OpenView.
void forceValidity(HashRouter &router, uint256 const &txid, Validity validity)
Sets the validity of a given transaction in the cache.
bool passesLocalChecks(STObject const &st, std::string &)
Validity
Describes the pre-processing validity of a transaction.
@ SigBad
Signature is bad. Didn't do local checks.
@ Valid
Signature and local checks are good / passed.
@ SigGoodOnly
Signature is good, but local checks fail.
ApplyTransactionResult applyTransaction(Application &app, OpenView &view, STTx const &tx, bool retryAssured, ApplyFlags flags, beast::Journal journal)
Transaction application helper.
std::pair< Validity, std::string > checkValidity(HashRouter &router, STTx const &tx, Rules const &rules, Config const &config)
Checks transaction signature and local checks.