Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/xrpld/app/consensus/RCLConsensus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <xrpld/consensus/LedgerTiming.h>
#include <xrpld/overlay/Overlay.h>
#include <xrpld/overlay/predicates.h>
#include <xrpld/telemetry/TracingInstrumentation.h>

#include <xrpl/basics/random.h>
#include <xrpl/beast/core/LexicalCast.h>
Expand Down Expand Up @@ -173,6 +174,9 @@ RCLConsensus::Adaptor::share(RCLCxTx const& tx)
void
RCLConsensus::Adaptor::propose(RCLCxPeerPos::Proposal const& proposal)
{
XRPL_TRACE_CONSENSUS(app_.getTelemetry(), "consensus.proposal.send");
XRPL_TRACE_SET_ATTR("xrpl.consensus.round", static_cast<int64_t>(proposal.proposeSeq()));

JLOG(j_.trace()) << (proposal.isBowOut() ? "We bow out: " : "We propose: ")
<< xrpl::to_string(proposal.prevLedger()) << " -> "
<< xrpl::to_string(proposal.position());
Expand Down Expand Up @@ -275,6 +279,11 @@ RCLConsensus::Adaptor::onClose(
NetClock::time_point const& closeTime,
ConsensusMode mode) -> Result
{
XRPL_TRACE_CONSENSUS(app_.getTelemetry(), "consensus.ledger_close");
XRPL_TRACE_SET_ATTR(
"xrpl.consensus.ledger.seq", static_cast<int64_t>(ledger.ledger_->header().seq + 1));
XRPL_TRACE_SET_ATTR("xrpl.consensus.mode", to_string(mode).c_str());

bool const wrongLCL = mode == ConsensusMode::wrongLedger;
bool const proposing = mode == ConsensusMode::proposing;

Expand Down Expand Up @@ -383,6 +392,11 @@ RCLConsensus::Adaptor::onAccept(
Json::Value&& consensusJson,
bool const validating)
{
XRPL_TRACE_CONSENSUS(app_.getTelemetry(), "consensus.accept");
XRPL_TRACE_SET_ATTR("xrpl.consensus.proposers", static_cast<int64_t>(result.proposers));
XRPL_TRACE_SET_ATTR(
"xrpl.consensus.round_time_ms", static_cast<int64_t>(result.roundTime.read().count()));

app_.getJobQueue().addJob(
jtACCEPT, "AcceptLedger", [=, this, cj = std::move(consensusJson)]() mutable {
// Note that no lock is held or acquired during this job.
Expand Down Expand Up @@ -736,6 +750,10 @@ RCLConsensus::Adaptor::buildLCL(
void
RCLConsensus::Adaptor::validate(RCLCxLedger const& ledger, RCLTxSet const& txns, bool proposing)
{
XRPL_TRACE_CONSENSUS(app_.getTelemetry(), "consensus.validation.send");
XRPL_TRACE_SET_ATTR("xrpl.consensus.ledger.seq", static_cast<int64_t>(ledger.seq()));
XRPL_TRACE_SET_ATTR("xrpl.consensus.proposing", proposing);

using namespace std::chrono_literals;

auto validationTime = app_.timeKeeper().closeTime();
Expand Down
Loading