Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cosmic-swingset): Provide blockTime to bootstrap #7125

Merged
merged 1 commit into from
Mar 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions packages/cosmic-swingset/src/launch-chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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,
Expand Down