Skip to content

Commit 8a6a60e

Browse files
committed
Log earlier proposal messages received.
1 parent b4cafb3 commit 8a6a60e

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

src/xrpld/overlay/detail/PeerImp.cpp

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1652,6 +1652,11 @@ PeerImp::onMessage(std::shared_ptr<protocol::TMLedgerData> const& m)
16521652
void
16531653
PeerImp::onMessage(std::shared_ptr<protocol::TMProposeSet> const& m)
16541654
{
1655+
auto received = std::chrono::system_clock::now();
1656+
std::stringstream ss;
1657+
ss << "PROPOSAL onMessage received " << to_string(received) << ", id: "
1658+
<< id_ << ". ";
1659+
16551660
protocol::TMProposeSet& set = *m;
16561661

16571662
auto const sig = makeSlice(set.signature());
@@ -1665,6 +1670,8 @@ PeerImp::onMessage(std::shared_ptr<protocol::TMProposeSet> const& m)
16651670
fee_.update(
16661671
Resource::feeInvalidSignature,
16671672
" signature can't be longer than 72 bytes");
1673+
ss << "bad signature length";
1674+
JLOG(p_journal_.debug()) << ss.str();
16681675
return;
16691676
}
16701677

@@ -1673,6 +1680,8 @@ PeerImp::onMessage(std::shared_ptr<protocol::TMProposeSet> const& m)
16731680
{
16741681
JLOG(p_journal_.warn()) << "Proposal: malformed";
16751682
fee_.update(Resource::feeMalformedRequest, "bad hashes");
1683+
ss << "bad hashes";
1684+
JLOG(p_journal_.debug()) << ss.str();
16761685
return;
16771686
}
16781687

@@ -1685,11 +1694,16 @@ PeerImp::onMessage(std::shared_ptr<protocol::TMProposeSet> const& m)
16851694
// If the operator has specified that untrusted proposals be dropped then
16861695
// this happens here I.e. before further wasting CPU verifying the signature
16871696
// of an untrusted key
1688-
if (!isTrusted && app_.config().RELAY_UNTRUSTED_PROPOSALS == -1)
1697+
if (!isTrusted && app_.config().RELAY_UNTRUSTED_PROPOSALS == -1) {
1698+
ss << "untrusted";
1699+
JLOG(p_journal_.debug()) << ss.str();
16891700
return;
1701+
}
16901702

16911703
uint256 const proposeHash{set.currenttxhash()};
16921704
uint256 const prevLedger{set.previousledger()};
1705+
ss << "hash: " << proposeHash << ", seq: " << set.proposeseq()
1706+
<< ", previous ledger: " << prevLedger << ". ";
16931707

16941708
NetClock::time_point const closeTime{NetClock::duration{set.closetime()}};
16951709

@@ -1712,6 +1726,8 @@ PeerImp::onMessage(std::shared_ptr<protocol::TMProposeSet> const& m)
17121726
overlay_.updateSlotAndSquelch(
17131727
suppression, publicKey, id_, protocol::mtPROPOSE_LEDGER);
17141728
JLOG(p_journal_.trace()) << "Proposal: duplicate";
1729+
ss << "duplicate";
1730+
JLOG(p_journal_.debug()) << ss.str();
17151731
return;
17161732
}
17171733

@@ -1721,18 +1737,23 @@ PeerImp::onMessage(std::shared_ptr<protocol::TMProposeSet> const& m)
17211737
{
17221738
JLOG(p_journal_.debug())
17231739
<< "Proposal: Dropping untrusted (peer divergence)";
1740+
ss << "diverged";
1741+
JLOG(p_journal_.debug()) << ss.str();
17241742
return;
17251743
}
17261744

17271745
if (!cluster() && app_.getFeeTrack().isLoadedLocal())
17281746
{
17291747
JLOG(p_journal_.debug()) << "Proposal: Dropping untrusted (load)";
1748+
ss << "load";
1749+
JLOG(p_journal_.debug()) << ss.str();
17301750
return;
17311751
}
17321752
}
17331753

17341754
JLOG(p_journal_.trace())
17351755
<< "Proposal: " << (isTrusted ? "trusted" : "untrusted");
1756+
ss << (isTrusted ? "trusted" : "untrusted") << ". ";
17361757

17371758
auto proposal = RCLCxPeerPos(
17381759
publicKey,
@@ -1754,6 +1775,8 @@ PeerImp::onMessage(std::shared_ptr<protocol::TMProposeSet> const& m)
17541775
if (auto peer = weak.lock())
17551776
peer->checkPropose(isTrusted, m, proposal);
17561777
});
1778+
ss << "added job";
1779+
JLOG(p_journal_.debug()) << ss.str();
17571780
}
17581781

17591782
void

0 commit comments

Comments
 (0)