Skip to content

Commit

Permalink
Adding a few loggings to track phases
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiax851 committed Apr 15, 2024
1 parent 4bcbf70 commit 46c5ea4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/ripple/consensus/Consensus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ shouldCloseLedger(
if ((proposersClosed + proposersValidated) > (prevProposers / 2))
{
// If more than half of the network has closed, we close
JLOG(j.trace()) << "Others have closed";
JLOG(j.debug()) << "Others have closed"
<< " Prop: proposersClosed: " << proposersClosed
<< " Prop: proposersValidated: " << proposersValidated
<< " TimeSincePreClose: " << timeSincePrevClose
<< " openTime: " << openTime;
return true;
}

Expand Down
7 changes: 5 additions & 2 deletions src/ripple/consensus/Consensus.h
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ Consensus<Adaptor>::startRound(
hash_set<NodeID_t> const& nowUntrusted,
bool proposing)
{
JLOG(j_.debug()) << "StartRound is called ";
if (firstRound_)
{
// take our initial view of closeTime_ from the seed ledger
Expand Down Expand Up @@ -657,7 +658,7 @@ Consensus<Adaptor>::startRound(
JLOG(j_.info()) << "Correct LCL is: " << prevLedgerID;
}
}

startRoundInternal(now, prevLedgerID, prevLedger, startMode);
}
template <class Adaptor>
Expand Down Expand Up @@ -817,10 +818,12 @@ template <class Adaptor>
void
Consensus<Adaptor>::timerEntry(NetClock::time_point const& now)
{
JLOG(j_.debug()) << "timerEntry is called ";
// Nothing to do if we are currently working on a ledger
if (phase_ == ConsensusPhase::accepted)
{ JLOG(j_.debug()) << "timerEntry: still in accepted phase, can't switch phase "
return;

}
now_ = now;

// Check we are on the proper ledger (this may change phase_)
Expand Down

0 comments on commit 46c5ea4

Please sign in to comment.