Skip to content

Commit 55956bc

Browse files
committed
Switch trigger timer on p8 boundary
1 parent 350acec commit 55956bc

8 files changed

Lines changed: 297 additions & 77 deletions

File tree

‎docs/metrics.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ scp.timing.externalized | timer | time spent in ballot pro
201201
scp.timing.first-to-self-externalize-lag | timer | delay between first externalize message and local node externalizing
202202
scp.timing.self-to-others-externalize-lag | timer | delay between local node externalizing and later externalize messages from other nodes
203203
scp.timing.ballot-blocked-on-txset | timer | time balloting was blocked waiting for a txset download (milliseconds)
204-
scp.trigger.prepare-start-fallback | meter | experimental trigger timer fell back from the network-close-time anchor to the local prepare-start anchor
204+
scp.trigger.prepare-start-fallback | meter | trigger timer fell back from the network-close-time anchor to the local prepare-start anchor
205205
scp.value.invalid | meter | SCP value is invalid
206206
scp.value.valid | meter | SCP value is valid
207207
scp.slot.values-referenced | histogram | number of values referenced per consensus round

‎src/herder/HerderImpl.cpp‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1441,8 +1441,18 @@ HerderImpl::setupTriggerNextLedger()
14411441

14421442
auto now = mApp.getClock().now();
14431443

1444+
// Starting from protocol 28 the trigger timer is anchored on the
1445+
// network-agreed consensus close time.
1446+
// FORCE_OLD_STYLE_PREPARE_START_TRIGGER_TIMER forces the older
1447+
// prepare-start anchor as an emergency fallback.
1448+
bool const useConsensusCloseTimeAnchor =
1449+
protocolVersionStartsFrom(
1450+
lcl.header.ledgerVersion,
1451+
CONSENSUS_CLOSE_TIME_TRIGGER_PROTOCOL_VERSION) &&
1452+
!mApp.getConfig().FORCE_OLD_STYLE_PREPARE_START_TRIGGER_TIMER;
1453+
14441454
auto lastLedgerStartingPoint =
1445-
mApp.getConfig().EXPERIMENTAL_TRIGGER_TIMER
1455+
useConsensusCloseTimeAnchor
14461456
? triggerAnchorFromConsensusCloseTime(lastIndex, now, milliseconds)
14471457
: triggerAnchorFromPrepareStart(lastIndex, now, milliseconds);
14481458

‎src/herder/HerderImpl.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ class HerderImpl : public Herder
358358
medida::Meter& mEnvelopeValidSig;
359359
medida::Meter& mEnvelopeInvalidSig;
360360

361-
// Marked when the experimental trigger timer falls back from the
361+
// Marked when the trigger timer falls back from the
362362
// network-close-time anchor to the local prepare-start anchor.
363363
medida::Meter& mTriggerPrepareStartFallback;
364364

0 commit comments

Comments
 (0)