mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-03 09:25:51 +00:00
Enforce validation quorum. Default to quorum of 2 if started with --net.
This commit is contained in:
@@ -151,7 +151,7 @@ void Application::setup()
|
|||||||
else
|
else
|
||||||
startNewLedger();
|
startNewLedger();
|
||||||
|
|
||||||
mOrderBookDB.setup(theApp->getLedgerMaster().getCurrentLedger()); // TODO: We need to update this if the ledger jumps
|
mOrderBookDB.setup(theApp->getLedgerMaster().getCurrentLedger());
|
||||||
|
|
||||||
//
|
//
|
||||||
// Begin validation and ip maintenance.
|
// Begin validation and ip maintenance.
|
||||||
@@ -168,6 +168,7 @@ void Application::setup()
|
|||||||
mValidations.tune(theConfig.getSize(siValidationsSize), theConfig.getSize(siValidationsAge));
|
mValidations.tune(theConfig.getSize(siValidationsSize), theConfig.getSize(siValidationsAge));
|
||||||
mHashedObjectStore.tune(theConfig.getSize(siNodeCacheSize), theConfig.getSize(siNodeCacheAge));
|
mHashedObjectStore.tune(theConfig.getSize(siNodeCacheSize), theConfig.getSize(siNodeCacheAge));
|
||||||
mLedgerMaster.tune(theConfig.getSize(siLedgerSize), theConfig.getSize(siLedgerAge));
|
mLedgerMaster.tune(theConfig.getSize(siLedgerSize), theConfig.getSize(siLedgerAge));
|
||||||
|
mLedgerMaster.setMinValidations(theConfig.VALIDATION_QUORUM);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Allow peer connections.
|
// Allow peer connections.
|
||||||
|
|||||||
@@ -77,6 +77,9 @@ public:
|
|||||||
|
|
||||||
TER doTransaction(SerializedTransaction::ref txn, TransactionEngineParams params, bool& didApply);
|
TER doTransaction(SerializedTransaction::ref txn, TransactionEngineParams params, bool& didApply);
|
||||||
|
|
||||||
|
int getMinValidations() { return mMinValidations; }
|
||||||
|
void setMinValidations(int v) { mMinValidations = v; }
|
||||||
|
|
||||||
void pushLedger(Ledger::ref newLedger);
|
void pushLedger(Ledger::ref newLedger);
|
||||||
void pushLedger(Ledger::ref newLCL, Ledger::ref newOL, bool fromConsensus);
|
void pushLedger(Ledger::ref newLCL, Ledger::ref newOL, bool fromConsensus);
|
||||||
void storeLedger(Ledger::ref);
|
void storeLedger(Ledger::ref);
|
||||||
|
|||||||
@@ -1189,6 +1189,8 @@ Json::Value NetworkOPs::getServerInfo(bool human, bool admin)
|
|||||||
if (mNeedNetworkLedger)
|
if (mNeedNetworkLedger)
|
||||||
info["network_ledger"] = "waiting";
|
info["network_ledger"] = "waiting";
|
||||||
|
|
||||||
|
info["validation_quorum"] = mLedgerMaster->getMinValidations();
|
||||||
|
|
||||||
if (admin)
|
if (admin)
|
||||||
{
|
{
|
||||||
if (theConfig.VALIDATION_PUB.isValid())
|
if (theConfig.VALIDATION_PUB.isValid())
|
||||||
|
|||||||
@@ -227,7 +227,12 @@ int main(int argc, char* argv[])
|
|||||||
{
|
{
|
||||||
theConfig.START_UP = Config::LOAD;
|
theConfig.START_UP = Config::LOAD;
|
||||||
}
|
}
|
||||||
else if (vm.count("net")) theConfig.START_UP = Config::NETWORK;
|
else if (vm.count("net"))
|
||||||
|
{
|
||||||
|
theConfig.START_UP = Config::NETWORK;
|
||||||
|
if (theConfig.VALIDATION_QUORUM < 2)
|
||||||
|
theConfig.VALIDATION_QUORUM = 2;
|
||||||
|
}
|
||||||
|
|
||||||
if (iResult)
|
if (iResult)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user