mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-01 08:25:51 +00:00
Tune relaying of untrusted proposals & validations:
In deciding whether to relay a proposal or validation, a server would consider whether it was issued by a validator on that server's UNL. While both trusted proposals and validations were always relayed, the code prioritized relaying of untrusted proposals over untrusted validations. While not technically incorrect, validations are generally more "valuable" because they are required during the consensus process, whereas proposals are not, strictly, required. The commit introduces two new configuration options, allowing server operators to fine-tune the relaying behavior: The `[relay_proposals]` option controls the relaying behavior for proposals received by this server. It has two settings: "trusted" and "all" and the default is "trusted". The `[relay_validations]` options controls the relaying behavior for validations received by this server. It has two settings: "trusted" and "all" and the default is "all". This change does not require an amendment as it does not affect transaction processing.
This commit is contained in:
committed by
manojsdoshi
parent
ca664b17d3
commit
268e28a278
@@ -356,10 +356,8 @@ public:
|
||||
Json::Value& jvResult) override;
|
||||
|
||||
// Ledger proposal/close functions.
|
||||
void
|
||||
processTrustedProposal(
|
||||
RCLCxPeerPos proposal,
|
||||
std::shared_ptr<protocol::TMProposeSet> set) override;
|
||||
bool
|
||||
processTrustedProposal(RCLCxPeerPos proposal) override;
|
||||
|
||||
bool
|
||||
recvValidation(
|
||||
@@ -1780,17 +1778,10 @@ NetworkOPsImp::getConsensusLCL()
|
||||
return mConsensus.prevLedgerID();
|
||||
}
|
||||
|
||||
void
|
||||
NetworkOPsImp::processTrustedProposal(
|
||||
RCLCxPeerPos peerPos,
|
||||
std::shared_ptr<protocol::TMProposeSet> set)
|
||||
bool
|
||||
NetworkOPsImp::processTrustedProposal(RCLCxPeerPos peerPos)
|
||||
{
|
||||
if (mConsensus.peerProposal(app_.timeKeeper().closeTime(), peerPos))
|
||||
{
|
||||
app_.overlay().relay(*set, peerPos.suppressionID());
|
||||
}
|
||||
else
|
||||
JLOG(m_journal.info()) << "Not relaying trusted proposal";
|
||||
return mConsensus.peerProposal(app_.timeKeeper().closeTime(), peerPos);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -2481,8 +2472,14 @@ NetworkOPsImp::recvValidation(
|
||||
{
|
||||
JLOG(m_journal.debug())
|
||||
<< "recvValidation " << val->getLedgerHash() << " from " << source;
|
||||
|
||||
handleNewValidation(app_, val, source);
|
||||
|
||||
pubValidation(val);
|
||||
return handleNewValidation(app_, val, source);
|
||||
|
||||
// We will always relay trusted validations; if configured, we will
|
||||
// also relay all untrusted validations.
|
||||
return app_.config().RELAY_UNTRUSTED_VALIDATIONS || val->isTrusted();
|
||||
}
|
||||
|
||||
Json::Value
|
||||
|
||||
Reference in New Issue
Block a user