Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat(verify-bytecode) - Support predeploy contracts that do not have a creation code #8549

Closed
blmalone opened this issue Jul 28, 2024 · 3 comments
Assignees
Labels
A-verification Area: verification C-forge Command: forge Cmd-forge-verify Command: forge verify-contract/check T-feature Type: feature
Milestone

Comments

@blmalone
Copy link

Component

Forge

Describe the feature you would like

For the Op-Stack, when deploying a new L2 rollup, customers define many predeploy contracts in their genesis file. These predeploy contracts do not have creation/init code. The screenshot below illustrates what a predeploy contract looks like in a chain's genesis file. The code property contains the runtime bytecode that is deployed on the L2 chain.

Screenshot 2024-07-28 at 18 01 12

Now that we're looking for a creation transaction as part of forge verify-bytecode, see: #8547; when trying to verify predeploy contracts with forge verify-bytecode, this command will fail because the creation transaction does not exist.

For this reason, it would be useful if users of forge verify-bytecode could instruct the command to ignore either a creation or runtime code check.

For example:

forge verify-bytecode 0xC0d3c0d3c0D3c0d3C0D3c0D3C0d3C0D3C0D30010 L2StandardBridge --rpc-url https://mainnet.mode.network/ --json --ignore <bytecode_type>

where bytecode_type is either creation or runtime. When the ignore flag is not supplied, the command defaults to checking both bytecode_type's. This may not be the exact implementation approach, but hopefully it conveys the feature request clearly.

Additional context

This feature request is based on a conversation from a previous thread: #8482 (comment).

Additionally, the following PR #8547 aims to start using creation transactions to derive constructor args.

@blmalone blmalone added the T-feature Type: feature label Jul 28, 2024
@zerosnacks zerosnacks added this to the v1.0.0 milestone Jul 29, 2024
@zerosnacks zerosnacks added Cmd-forge-verify Command: forge verify-contract/check A-verification Area: verification C-forge Command: forge labels Jul 29, 2024
@mds1
Copy link
Collaborator

mds1 commented Aug 5, 2024

This makes sense to me. I would suggest shrinking the scope and making the flag --skip-initcode only—skipping initcode verification is useful for this case of verifying predeploys, but you don't really need to ever skip runtime verification code (since initicode can be dynamic)

@zerosnacks How large of a lift do you think this is? This would be a really big help for us and would love to get it in soon if possible 🙏

@yash-atreya
Copy link
Member

This makes sense to me. I would suggest shrinking the scope and making the flag --skip-initcode only—skipping initcode verification is useful for this case of verifying predeploys, but you don't really need to ever skip runtime verification code (since initicode can be dynamic)

@zerosnacks How large of a lift do you think this is? This would be a really big help for us and would love to get it in soon if possible 🙏

@mds1 I've added it in #8510 (comment).

Ptal, seems to be working.

@yash-atreya
Copy link
Member

Addressed in #8510

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-verification Area: verification C-forge Command: forge Cmd-forge-verify Command: forge verify-contract/check T-feature Type: feature
Projects
None yet
Development

No branches or pull requests

4 participants