mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-30 16:05:51 +00:00
If load is high, put load level in validations.
This commit is contained in:
@@ -75,6 +75,7 @@ void LedgerConsensus::checkOurValidation ()
|
||||
uint256 signingHash;
|
||||
SerializedValidation::pointer v = boost::make_shared<SerializedValidation>
|
||||
(mPreviousLedger->getHash (), getApp().getOPs ().getValidationTimeNC (), mValPublic, false);
|
||||
addLoad(v);
|
||||
v->setTrusted ();
|
||||
v->sign (signingHash, mValPrivate);
|
||||
getApp().getHashRouter ().addSuppression (signingHash);
|
||||
@@ -1247,6 +1248,7 @@ void LedgerConsensus::accept (SHAMap::ref set, LoadEvent::pointer)
|
||||
SerializedValidation::pointer v = boost::make_shared<SerializedValidation>
|
||||
(newLCLHash, getApp().getOPs ().getValidationTimeNC (), mValPublic, mProposing);
|
||||
v->setFieldU32 (sfLedgerSequence, newLCL->getLedgerSeq ());
|
||||
addLoad(v);
|
||||
|
||||
if (((newLCL->getLedgerSeq () + 1) % 256) == 0) // next ledger is flag ledger
|
||||
{
|
||||
@@ -1333,6 +1335,16 @@ void LedgerConsensus::endConsensus ()
|
||||
getApp().getOPs ().endConsensus (mHaveCorrectLCL);
|
||||
}
|
||||
|
||||
void LedgerConsensus::addLoad(SerializedValidation::ref val)
|
||||
{
|
||||
uint32 fee = std::max(
|
||||
getApp().getFeeTrack().getLocalFee(),
|
||||
getApp().getFeeTrack().getClusterFee());
|
||||
uint32 ref = getApp().getFeeTrack().getLoadBase();
|
||||
if (fee > ref)
|
||||
val->setFieldU32(sfLoadFee, fee);
|
||||
}
|
||||
|
||||
void LedgerConsensus::simulate ()
|
||||
{
|
||||
WriteLog (lsINFO, LedgerConsensus) << "Simulating consensus";
|
||||
|
||||
@@ -108,6 +108,8 @@ private:
|
||||
void beginAccept (bool synchronous);
|
||||
void endConsensus ();
|
||||
|
||||
void addLoad (SerializedValidation::ref val);
|
||||
|
||||
private:
|
||||
// VFALCO TODO Rename these to look pretty
|
||||
enum LCState
|
||||
|
||||
Reference in New Issue
Block a user