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

feat(cli): deterministic deployer fallback #2261

Merged
merged 15 commits into from
Feb 27, 2024
Merged

Conversation

holic
Copy link
Member

@holic holic commented Feb 14, 2024

closes #1839

Copy link

changeset-bot bot commented Feb 14, 2024

🦋 Changeset detected

Latest commit: 6688d66

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

This PR includes changesets to release 30 packages
Name Type
@latticexyz/cli Patch
@latticexyz/abi-ts Patch
@latticexyz/block-logs-stream Patch
@latticexyz/common Patch
@latticexyz/config Patch
create-mud Patch
@latticexyz/dev-tools 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-indexer Patch
@latticexyz/store-sync Patch
@latticexyz/store Patch
@latticexyz/utils Patch
@latticexyz/world-modules Patch
@latticexyz/world 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

@holic holic changed the title WIP deterministic deployer fallback feat(cli): deterministic deployer fallback Feb 22, 2024
Copy link
Contributor

Choose a reason for hiding this comment

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

So in the deterministic case, deployed Worlds have the same address for each account + salt, and in the non-deterministic case the address is just different every time?

Copy link
Member Author

Choose a reason for hiding this comment

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

mostly true, yes!

the non-deterministic case deploys a deployer in a non-deterministic way, and that deployer determines the address of all the downstream (reusable) contracts like world factory, systems, modules

Copy link
Member Author

Choose a reason for hiding this comment

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

that reminds me: I meant to add a CLI option for the deployer so you can get deterministic deploys on a chain with only EIP-155 txs

i.e. deploy the deployer once and manually specify it as the deployer to get determinism

readonly worldDeploy: WorldDeploy;
readonly modules: readonly Module[];
}): Promise<readonly Hex[]> {
if (!modules.length) return [];

await ensureContractsDeployed({
client,
contracts: uniqueBy(modules, (mod) => getAddress(mod.address)).map((mod) => ({
deployerAddress,
contracts: uniqueBy(modules, (mod) => getAddress(mod.getAddress(deployerAddress))).map((mod) => ({
Copy link
Contributor

@yonadaaa yonadaaa Feb 22, 2024

Choose a reason for hiding this comment

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

Who called this mod instead of module 🙄

yonadaaa
yonadaaa previously approved these changes Feb 27, 2024
@holic holic merged commit 9c83adc into main Feb 27, 2024
10 of 11 checks passed
@holic holic deleted the holic/deployer-fallback branch February 27, 2024 18:10
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.

deploy: fallback for deterministic deployer for chains without legacy tx support
2 participants