Skip to content

fix(evm): align local create2 setup with configured deployer#14016

Open
ArshLabs wants to merge 2 commits intofoundry-rs:masterfrom
ArshLabs:fix/custom-create2-deployer-setup-alignment
Open

fix(evm): align local create2 setup with configured deployer#14016
ArshLabs wants to merge 2 commits intofoundry-rs:masterfrom
ArshLabs:fix/custom-create2-deployer-setup-alignment

Conversation

@ArshLabs
Copy link
Copy Markdown

Motivation

When create2_deployer is customized, local setup currently checks or deploys only the default deployer address, while CREATE2 execution uses the inspector-configured address. This can make setup and runtime target different addresses and lead to missing CREATE2 deployer reverts even though setup already ran.

Solution

deploy_create2_deployer now resolves the deployer address from the executor inspector, so setup and runtime CREATE2 execution use the same address.

Behavior by case:

  • Default deployer address: keep existing deployment path via the signed deployer transaction flow.
  • Custom deployer address: if empty, install the expected deployer runtime bytecode directly at the configured address for local execution.

A regression test is added for forge script no-endpoint execution with --create2-deployer to verify custom deployer setup aligns with runtime behavior.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@zerosnacks
Copy link
Copy Markdown
Member

Hi @ArshLabs, thanks for your fix!

This is a sensitive code path so I would like to see additional tests for it for forge test as the current PR only covers forge script. I would also like to see a test covering a forking scenario.

@ArshLabs
Copy link
Copy Markdown
Author

Hi @ArshLabs, thanks for your fix!

This is a sensitive code path so I would like to see additional tests for it for forge test as the current PR only covers forge script. I would also like to see a test covering a forking scenario.

Added the requested forge test coverage for custom CREATE2 deployer in both local and forked paths, and pushed the update. Both new tests pass locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants