diff --git a/packages/cli/src/deploy/getWorldDeploy.ts b/packages/cli/src/deploy/getWorldDeploy.ts index 5259a7488f..97e0e7661f 100644 --- a/packages/cli/src/deploy/getWorldDeploy.ts +++ b/packages/cli/src/deploy/getWorldDeploy.ts @@ -13,12 +13,13 @@ export async function getWorldDeploy( deployBlock?: bigint, ): Promise { const address = getAddress(worldAddress); + const stateBlock = await getBlock(client, { blockTag: "latest" }); let deploy = deploys.get(address); if (deploy != null) { return { ...deploy, - stateBlock: (await getBlock(client, { blockTag: "latest" })).number, + stateBlock: stateBlock.number, }; } @@ -26,7 +27,7 @@ export async function getWorldDeploy( const [fromBlock, toBlock] = deployBlock ? [{ number: deployBlock }, { number: deployBlock }] - : await Promise.all([getBlock(client, { blockTag: "earliest" }), getBlock(client, { blockTag: "latest" })]); + : [await getBlock(client, { blockTag: "earliest" }), stateBlock]; const blockLogs = await fetchBlockLogs({ publicClient: client, @@ -43,7 +44,7 @@ export async function getWorldDeploy( deploy = { ...logsToWorldDeploy(blockLogs.flatMap((block) => block.logs)), - stateBlock: toBlock.number, + stateBlock: stateBlock.number, }; deploys.set(address, deploy);