diff --git a/.changeset/kind-kangaroos-leave.md b/.changeset/kind-kangaroos-leave.md new file mode 100644 index 0000000000..a3e00c7a9e --- /dev/null +++ b/.changeset/kind-kangaroos-leave.md @@ -0,0 +1,5 @@ +--- +"@latticexyz/cli": patch +--- + +Fixed a dev runner bug where the state block of a previous deploy was not updated during a redeploy, causing failed deploys due to fetching outdated world state. diff --git a/packages/cli/src/deploy/getWorldDeploy.ts b/packages/cli/src/deploy/getWorldDeploy.ts index af860f2b2f..86982740ff 100644 --- a/packages/cli/src/deploy/getWorldDeploy.ts +++ b/packages/cli/src/deploy/getWorldDeploy.ts @@ -12,7 +12,10 @@ export async function getWorldDeploy(client: Client, worldAddress: Address): Pro let deploy = deploys.get(address); if (deploy != null) { - return deploy; + return { + ...deploy, + stateBlock: (await getBlock(client, { blockTag: "latest" })).number, + }; } debug("looking up world deploy for", address);