@@ -480,6 +480,15 @@ HerderImpl::valueExternalized(uint64 slotIndex, StellarValue const& value,
480
480
481
481
// Check to see if quorums have changed and we need to reanalyze.
482
482
checkAndMaybeReanalyzeQuorumMap ();
483
+
484
+ // heart beat *after* doing all the work (ensures that we do not include
485
+ // the overhead of externalization in the way we track SCP)
486
+ // Note: this only makes sense in the context of synchronous ledger
487
+ // application on the main thread.
488
+ if (!mApp .getConfig ().parallelLedgerClose ())
489
+ {
490
+ trackingHeartBeat ();
491
+ }
483
492
}
484
493
else
485
494
{
@@ -1156,7 +1165,7 @@ HerderImpl::lastClosedLedgerIncreased(bool latest, TxSetXDRFrameConstPtr txSet)
1156
1165
{
1157
1166
// Re-start heartbeat tracking _after_ applying the most up-to-date
1158
1167
// ledger. This guarantees out-of-sync timer won't fire while we have
1159
- // ledgers to apply.
1168
+ // ledgers to apply (applicable during parallel ledger close) .
1160
1169
trackingHeartBeat ();
1161
1170
1162
1171
// Ensure out of sync recovery did not get triggered while we were
@@ -1369,6 +1378,8 @@ HerderImpl::triggerNextLedger(uint32_t ledgerSeqToTrigger,
1369
1378
// If applying, the next ledger will trigger voting
1370
1379
if (mLedgerManager .isApplying ())
1371
1380
{
1381
+ // This can only happen when closing ledgers in parallel
1382
+ releaseAssert (mApp .getConfig ().parallelLedgerClose ());
1372
1383
CLOG_DEBUG (Herder, " triggerNextLedger: skipping (applying) : {}" ,
1373
1384
mApp .getStateHuman ());
1374
1385
return ;
@@ -1560,7 +1571,7 @@ HerderImpl::getUpgradesJson()
1560
1571
void
1561
1572
HerderImpl::forceSCPStateIntoSyncWithLastClosedLedger ()
1562
1573
{
1563
- auto header = mLedgerManager .getLastClosedLedgerHeader ().header ;
1574
+ auto const & header = mLedgerManager .getLastClosedLedgerHeader ().header ;
1564
1575
setTrackingSCPState (header.ledgerSeq , header.scpValue ,
1565
1576
/* isTrackingNetwork */ true );
1566
1577
}
@@ -2360,7 +2371,7 @@ HerderImpl::herderOutOfSync()
2360
2371
// are no ledgers queued to be applied. If there are ledgers queued, it's
2361
2372
// possible the rest of the network is waiting for this node to vote. In
2362
2373
// this case we should _still_ remain in tracking and emit nomination; If
2363
- // the nodes does not hear anything from the network after that, then node
2374
+ // the node does not hear anything from the network after that, then node
2364
2375
// can go into out of sync recovery.
2365
2376
releaseAssert (threadIsMain ());
2366
2377
releaseAssert (!mLedgerManager .isApplying ());
0 commit comments