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(verify-bytecode): ignore immutable refs during runtime check #8849

Open
yash-atreya opened this issue Sep 12, 2024 · 1 comment · May be fixed by #8850
Open

feat(verify-bytecode): ignore immutable refs during runtime check #8849

yash-atreya opened this issue Sep 12, 2024 · 1 comment · May be fixed by #8850
Assignees
Labels
C-forge Command: forge Cmd-forge-vb Command: forge verify-bytecode T-feature Type: feature T-post-V1 Area: to tackle after V1

Comments

@yash-atreya
Copy link
Member

yash-atreya commented Sep 12, 2024

By skipping immutables, do you mean we don't check the immutables that are embedded in the runtime code?
If yes, then NO; we do check them. Runtime codes are compared entirely.

Got it, in general I think that's the better and stronger approach. To take a step further, you can do: if no constructor arguments are passed AND no API key is passed (so forge has no constructor args), then it skips checking immutables. That would help cases like #8617. In this case you would also want to include a message in the output indicating this difference

Originally posted by @mds1 in #8510 (comment)

@yash-atreya yash-atreya self-assigned this Sep 12, 2024
@yash-atreya yash-atreya added C-forge Command: forge Cmd-forge-verify Command: forge verify-contract/check Cmd-forge-vb Command: forge verify-bytecode and removed Cmd-forge-verify Command: forge verify-contract/check labels Sep 12, 2024
@yash-atreya yash-atreya linked a pull request Sep 12, 2024 that will close this issue
2 tasks
@yash-atreya yash-atreya changed the title feat(verify-bytecode): ignore immutables refs in runtime check feat(verify-bytecode): ignore immutable refs in runtime check Sep 12, 2024
@yash-atreya yash-atreya changed the title feat(verify-bytecode): ignore immutable refs in runtime check feat(verify-bytecode): ignore immutable refs during runtime check Sep 12, 2024
@zerosnacks zerosnacks added the T-feature Type: feature label Sep 12, 2024
@klkvr
Copy link
Member

klkvr commented Sep 12, 2024

we could reuse

pub fn find_by_deployed_code_exact(&self, code: &[u8]) -> Option<ArtifactWithContractRef<'_>> {
for this

@yash-atreya yash-atreya added this to the v1.0.0 milestone Sep 13, 2024
@grandizzy grandizzy added this to Foundry Oct 1, 2024
@github-project-automation github-project-automation bot moved this to Todo in Foundry Oct 1, 2024
@grandizzy grandizzy moved this from Todo to In Progress in Foundry Oct 1, 2024
@yash-atreya yash-atreya moved this from In Progress to Todo in Foundry Oct 21, 2024
@grandizzy grandizzy removed this from the v1.0.0 milestone Nov 5, 2024
@grandizzy grandizzy added the T-post-V1 Area: to tackle after V1 label Nov 7, 2024
@yash-atreya yash-atreya removed this from Foundry Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-forge Command: forge Cmd-forge-vb Command: forge verify-bytecode T-feature Type: feature T-post-V1 Area: to tackle after V1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@grandizzy @yash-atreya @klkvr @zerosnacks and others