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(world): prevent initialising the world multiple times [L-05] #2170

Merged
merged 7 commits into from Jan 22, 2024

Conversation

yonadaaa
Copy link
Contributor

Prevents the world from being initialised multiple times. Pulled out from #2168

Copy link

changeset-bot bot commented Jan 22, 2024

🦋 Changeset detected

Latest commit: 78336aa

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 30 packages
Name Type
@latticexyz/world Patch
@latticexyz/cli Patch
@latticexyz/dev-tools Patch
@latticexyz/store-sync Patch
@latticexyz/world-modules Patch
@latticexyz/store-indexer Patch
@latticexyz/abi-ts Patch
@latticexyz/block-logs-stream Patch
@latticexyz/common Patch
@latticexyz/config Patch
create-mud Patch
@latticexyz/ecs-browser Patch
@latticexyz/faucet Patch
@latticexyz/gas-report Patch
@latticexyz/network Patch
@latticexyz/noise Patch
@latticexyz/phaserx Patch
@latticexyz/protocol-parser Patch
@latticexyz/react Patch
@latticexyz/recs Patch
@latticexyz/schema-type Patch
@latticexyz/services Patch
@latticexyz/solecs Patch
solhint-config-mud Patch
solhint-plugin-mud Patch
@latticexyz/std-client Patch
@latticexyz/std-contracts Patch
@latticexyz/store-cache Patch
@latticexyz/store Patch
@latticexyz/utils Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

revert World_AlreadyInitialized();
}

WorldInitialized.set(true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we store the core module's address here? Almost the same cost (since it's one storage write) but might be interesting to know which core module was used to init the world

Copy link
Contributor Author

@yonadaaa yonadaaa Jan 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, that seems like a reasonable thing to keep around. It kind of "enshrines" the core module differently to the other modules, but we are already writing to storage for it.

packages/world/mud.config.ts Outdated Show resolved Hide resolved
yonadaaa and others added 3 commits January 22, 2024 19:07
Co-authored-by: alvarius <alvarius@lattice.xyz>
Co-authored-by: alvarius <alvarius@lattice.xyz>
@yonadaaa yonadaaa requested a review from alvrs January 22, 2024 19:14
@yonadaaa yonadaaa changed the title fix(world): add WorldInitialized flag [L-05] fix(world): prevent initialising the world multiple times [L-05] Jan 22, 2024
Copy link
Member

@alvrs alvrs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! 🚢

@yonadaaa yonadaaa merged commit 2bfee92 into main Jan 22, 2024
12 checks passed
@yonadaaa yonadaaa deleted the yonadaaa/world-initialized branch January 22, 2024 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants