mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Improve the Byzantine validator detector:
This commit expands the detection capabilities of the Byzantine validation detector. Prior to this commit, only validators that were on a server's UNL were monitored. Now, all the validations that a server receives are passed through the detector.
This commit is contained in:
@@ -2240,8 +2240,6 @@ PeerImp::onMessage(
|
||||
void
|
||||
PeerImp::onMessage(std::shared_ptr<protocol::TMValidation> const& m)
|
||||
{
|
||||
auto const closeTime = app_.timeKeeper().closeTime();
|
||||
|
||||
if (m->validation().size() < 50)
|
||||
{
|
||||
JLOG(p_journal_.warn()) << "Validation: Too small";
|
||||
@@ -2251,6 +2249,8 @@ PeerImp::onMessage(std::shared_ptr<protocol::TMValidation> const& m)
|
||||
|
||||
try
|
||||
{
|
||||
auto const closeTime = app_.timeKeeper().closeTime();
|
||||
|
||||
std::shared_ptr<STValidation> val;
|
||||
{
|
||||
SerialIter sit(makeSlice(m->validation()));
|
||||
@@ -2683,16 +2683,16 @@ PeerImp::checkValidation(
|
||||
std::shared_ptr<STValidation> const& val,
|
||||
std::shared_ptr<protocol::TMValidation> const& packet)
|
||||
{
|
||||
if (!cluster() && !val->isValid())
|
||||
{
|
||||
JLOG(p_journal_.debug()) << "Validation forwarded by peer is invalid";
|
||||
charge(Resource::feeInvalidRequest);
|
||||
return;
|
||||
}
|
||||
|
||||
// FIXME it should be safe to remove this try/catch. Investigate codepaths.
|
||||
try
|
||||
{
|
||||
// VFALCO Which functions throw?
|
||||
if (!cluster() && !val->isValid())
|
||||
{
|
||||
JLOG(p_journal_.warn()) << "Validation is invalid";
|
||||
charge(Resource::feeInvalidRequest);
|
||||
return;
|
||||
}
|
||||
|
||||
if (app_.getOPs().recvValidation(val, std::to_string(id())) ||
|
||||
cluster())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user