Fix: Resolve Module Address Collisions #690
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why does this PR exist?
I noticed that the original idea - when we switched to create2-based deployments in the factories - was to allow users to deploy workflows at the same address across networks. What we did not think about back then: the
ModuleFactory_v1
is not just called by end users, but mainly be theOrchestratorFactory_v1
, which makes the following salt calculation not unique per user:So essentially, the system only works for
OrchestratorFactory_v1
, where the user calls the contract.How did I fix this?
We decided, that it's enough if we guarantee folks that their Orchestrator can be at the same address across networks, and the modules don't matter really. So to resolve the underlying issue, I added the
chainId
into the salt calculation in theModuleFactory_v1
. This makes it unique at all times and the address can never be griefed (also not on accident).