Skip to content

feat(config): add chain dependent solc config and support in multichain scripts #9840

@sakulstra

Description

@sakulstra

Component

Forge

Describe the feature you would like

At bgd we rely quite a lot on multichain scripts, which worked fine as long as Aave was only deployed on shanghai compatible blockchains.
With the recent expansion to linea(london) and zksync(zksolc) we're reaching a point where our workarounds no longer work.

Deploying for different chains, we try to solve with profiles.

[profile.bnb]
evm_version = 'shanghai'

[profile.linea]
evm_version = 'london'

One issue we face here is that whenever switching the evm version a complete recompile is needed. It would be great if the cache was per evm_version, so things only have to be recompiled once.


While the above issue is annoying, one more problematic thing is that multichain scripts (single script switching between networks) will always run with a single solc & evm_version. This leads to problematic situations:

  • if you select london (with the goal to unite on the lowest accross chains), the script might fail with not activated when touching sth deployed on shanghai or cancun
  • if you select cancun you will end up deploying non executable code on chains that are stuck on london
  • another caveat is that when you rely on address prediction based on create2, addresses might be different then expected

Currently I don't see any solution for this problem, the workaround we currently use is to no longer use multichain scripts... which ofc is painful.
It would be great if one could configure solc per chainId and dynamically switch based on which network is currently forked. No idea how this could work, but I guess if using forge multichain this would be a must.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions