From 4933acb29bef000c7b565340fddea1865962aacc Mon Sep 17 00:00:00 2001 From: Mathieu Hofman Date: Mon, 6 Mar 2023 21:00:50 +0000 Subject: [PATCH] fix(cosmic-swingset): Provide blockTime to bootstrap --- packages/cosmic-swingset/src/launch-chain.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/cosmic-swingset/src/launch-chain.js b/packages/cosmic-swingset/src/launch-chain.js index b0df3e06be3..bab473a6a97 100644 --- a/packages/cosmic-swingset/src/launch-chain.js +++ b/packages/cosmic-swingset/src/launch-chain.js @@ -301,7 +301,10 @@ export async function launch({ inboundQueueMetrics, }); - async function bootstrapBlock() { + async function bootstrapBlock(_blockHeight, blockTime) { + // We need to let bootstrap know of the chain time. The time of the first + // block may be the genesis time, or the block time of the upgrade block. + timer.poll(blockTime); // This is before the initial block, we need to finish processing the // entire bootstrap before opening for business. const policy = neverStop(); @@ -687,7 +690,9 @@ export async function launch({ blockHeight, runNum, }); - await processAction(action.type, bootstrapBlock); + await processAction(action.type, async () => + bootstrapBlock(blockHeight, blockTime), + ); controller.writeSlogObject({ type: 'cosmic-swingset-run-finish', blockHeight,