File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ static constexpr uint64_t SNAPSHOT_WAIT_TIMEOUT_MS = 20000;
4444static constexpr uint64_t SNAPSHOT_POLL_INTERVAL_MS = 250 ;
4545static constexpr uint64_t POST_PATCH_SETTLE_MS = 1500 ;
4646static constexpr uint64_t REPLAY_WAIT_TIMEOUT_MS = 10000 ;
47+ static constexpr uint64_t MAX_PRE_RESTART_BLOCKS = 100 ;
4748
4849struct BlockSnapshot {
4950 uint64_t blockId = 0 ;
@@ -180,6 +181,12 @@ std::vector< BlockSnapshot > waitForCommittedSnapshots(
180181 auto lastId = (uint64_t ) _engine.getLargestCommittedBlockIDInDb ();
181182 auto elapsedMs = Time::getCurrentTimeMs () - startTimeMs;
182183
184+ // set max limit of blocks - consensus limits max skaled-consensus delay to be
185+ // 128 blocks
186+ if ( lastId >= MAX_PRE_RESTART_BLOCKS ) {
187+ return buildSnapshots ( _engine, MAX_PRE_RESTART_BLOCKS );
188+ }
189+
183190 // if passed minimum wait time
184191 if ( elapsedMs >= _minWaitMs && lastId > 0 ) {
185192 auto snapshots = buildSnapshots ( _engine, lastId );
You can’t perform that action at this time.
0 commit comments