mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-23 12:35:50 +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
@@ -397,6 +397,30 @@ Config::loadFromString(std::string const& fileContents)
|
||||
if (getSingleSection(secConfig, SECTION_SSL_VERIFY, strTemp, j_))
|
||||
SSL_VERIFY = beast::lexicalCastThrow<bool>(strTemp);
|
||||
|
||||
if (getSingleSection(secConfig, SECTION_RELAY_VALIDATIONS, strTemp, j_))
|
||||
{
|
||||
if (boost::iequals(strTemp, "all"))
|
||||
RELAY_UNTRUSTED_VALIDATIONS = true;
|
||||
else if (boost::iequals(strTemp, "trusted"))
|
||||
RELAY_UNTRUSTED_VALIDATIONS = false;
|
||||
else
|
||||
Throw<std::runtime_error>(
|
||||
"Invalid value specified in [" SECTION_RELAY_VALIDATIONS
|
||||
"] section");
|
||||
}
|
||||
|
||||
if (getSingleSection(secConfig, SECTION_RELAY_PROPOSALS, strTemp, j_))
|
||||
{
|
||||
if (boost::iequals(strTemp, "all"))
|
||||
RELAY_UNTRUSTED_PROPOSALS = true;
|
||||
else if (boost::iequals(strTemp, "trusted"))
|
||||
RELAY_UNTRUSTED_PROPOSALS = false;
|
||||
else
|
||||
Throw<std::runtime_error>(
|
||||
"Invalid value specified in [" SECTION_RELAY_PROPOSALS
|
||||
"] section");
|
||||
}
|
||||
|
||||
if (exists(SECTION_VALIDATION_SEED) && exists(SECTION_VALIDATOR_TOKEN))
|
||||
Throw<std::runtime_error>("Cannot have both [" SECTION_VALIDATION_SEED
|
||||
"] "
|
||||
|
||||
Reference in New Issue
Block a user