mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Log proposals and validations (#5291)
Adds detailed log messages for each validation and proposal received from the network.
This commit is contained in:
@@ -77,6 +77,12 @@ struct Peer
|
||||
return proposal_.getJson();
|
||||
}
|
||||
|
||||
std::string
|
||||
render() const
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
private:
|
||||
Proposal proposal_;
|
||||
};
|
||||
|
||||
@@ -97,6 +97,12 @@ public:
|
||||
Json::Value
|
||||
getJson() const;
|
||||
|
||||
std::string
|
||||
render() const
|
||||
{
|
||||
return proposal_.render();
|
||||
}
|
||||
|
||||
private:
|
||||
PublicKey publicKey_;
|
||||
uint256 suppression_;
|
||||
|
||||
@@ -2353,6 +2353,21 @@ NetworkOPsImp::recvValidation(
|
||||
|
||||
pubValidation(val);
|
||||
|
||||
JLOG(m_journal.debug()) << [this, &val]() -> auto {
|
||||
std::stringstream ss;
|
||||
ss << "VALIDATION: " << val->render() << " master_key: ";
|
||||
auto master = app_.validators().getTrustedKey(val->getSignerPublic());
|
||||
if (master)
|
||||
{
|
||||
ss << toBase58(TokenType::NodePublic, *master);
|
||||
}
|
||||
else
|
||||
{
|
||||
ss << "none";
|
||||
}
|
||||
return ss.str();
|
||||
}();
|
||||
|
||||
// We will always relay trusted validations; if configured, we will
|
||||
// also relay all untrusted validations.
|
||||
return app_.config().RELAY_UNTRUSTED_VALIDATIONS == 1 || val->isTrusted();
|
||||
|
||||
@@ -704,6 +704,7 @@ Consensus<Adaptor>::peerProposal(
|
||||
NetClock::time_point const& now,
|
||||
PeerPosition_t const& newPeerPos)
|
||||
{
|
||||
JLOG(j_.debug()) << "PROPOSAL " << newPeerPos.render();
|
||||
auto const& peerID = newPeerPos.proposal().nodeID();
|
||||
|
||||
// Always need to store recent positions
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <xrpl/protocol/jss.h>
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <sstream>
|
||||
|
||||
namespace ripple {
|
||||
/** Represents a proposed position taken during a round of consensus.
|
||||
@@ -194,6 +195,18 @@ public:
|
||||
proposeSeq_ = seqLeave;
|
||||
}
|
||||
|
||||
std::string
|
||||
render() const
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "proposal: previous_ledger: " << previousLedger_
|
||||
<< " proposal_seq: " << proposeSeq_ << " position: " << position_
|
||||
<< " close_time: " << to_string(closeTime_)
|
||||
<< " now: " << to_string(time_) << " is_bow_out:" << isBowOut()
|
||||
<< " node_id: " << nodeID_;
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
//! Get JSON representation for debugging
|
||||
Json::Value
|
||||
getJson() const
|
||||
|
||||
Reference in New Issue
Block a user