mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 19:15:54 +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:
@@ -30,6 +30,7 @@
|
|||||||
#include <functional>
|
#include <functional>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
|
|
||||||
@@ -141,6 +142,23 @@ public:
|
|||||||
Blob
|
Blob
|
||||||
getSignature() const;
|
getSignature() const;
|
||||||
|
|
||||||
|
std::string
|
||||||
|
render() const
|
||||||
|
{
|
||||||
|
std::stringstream ss;
|
||||||
|
ss << "validation: "
|
||||||
|
<< " ledger_hash: " << getLedgerHash()
|
||||||
|
<< " consensus_hash: " << getConsensusHash()
|
||||||
|
<< " sign_time: " << to_string(getSignTime())
|
||||||
|
<< " seen_time: " << to_string(getSeenTime())
|
||||||
|
<< " signer_public_key: " << getSignerPublic()
|
||||||
|
<< " node_id: " << getNodeID() << " is_valid: " << isValid()
|
||||||
|
<< " is_full: " << isFull() << " is_trusted: " << isTrusted()
|
||||||
|
<< " signing_hash: " << getSigningHash()
|
||||||
|
<< " base58: " << toBase58(TokenType::NodePublic, getSignerPublic());
|
||||||
|
return ss.str();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static SOTemplate const&
|
static SOTemplate const&
|
||||||
validationFormat();
|
validationFormat();
|
||||||
|
|||||||
@@ -77,6 +77,12 @@ struct Peer
|
|||||||
return proposal_.getJson();
|
return proposal_.getJson();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string
|
||||||
|
render() const
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Proposal proposal_;
|
Proposal proposal_;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -97,6 +97,12 @@ public:
|
|||||||
Json::Value
|
Json::Value
|
||||||
getJson() const;
|
getJson() const;
|
||||||
|
|
||||||
|
std::string
|
||||||
|
render() const
|
||||||
|
{
|
||||||
|
return proposal_.render();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PublicKey publicKey_;
|
PublicKey publicKey_;
|
||||||
uint256 suppression_;
|
uint256 suppression_;
|
||||||
|
|||||||
@@ -2353,6 +2353,21 @@ NetworkOPsImp::recvValidation(
|
|||||||
|
|
||||||
pubValidation(val);
|
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
|
// We will always relay trusted validations; if configured, we will
|
||||||
// also relay all untrusted validations.
|
// also relay all untrusted validations.
|
||||||
return app_.config().RELAY_UNTRUSTED_VALIDATIONS == 1 || val->isTrusted();
|
return app_.config().RELAY_UNTRUSTED_VALIDATIONS == 1 || val->isTrusted();
|
||||||
|
|||||||
@@ -704,6 +704,7 @@ Consensus<Adaptor>::peerProposal(
|
|||||||
NetClock::time_point const& now,
|
NetClock::time_point const& now,
|
||||||
PeerPosition_t const& newPeerPos)
|
PeerPosition_t const& newPeerPos)
|
||||||
{
|
{
|
||||||
|
JLOG(j_.debug()) << "PROPOSAL " << newPeerPos.render();
|
||||||
auto const& peerID = newPeerPos.proposal().nodeID();
|
auto const& peerID = newPeerPos.proposal().nodeID();
|
||||||
|
|
||||||
// Always need to store recent positions
|
// Always need to store recent positions
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
#include <xrpl/protocol/jss.h>
|
#include <xrpl/protocol/jss.h>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
/** Represents a proposed position taken during a round of consensus.
|
/** Represents a proposed position taken during a round of consensus.
|
||||||
@@ -194,6 +195,18 @@ public:
|
|||||||
proposeSeq_ = seqLeave;
|
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
|
//! Get JSON representation for debugging
|
||||||
Json::Value
|
Json::Value
|
||||||
getJson() const
|
getJson() const
|
||||||
|
|||||||
Reference in New Issue
Block a user