foundry-rs / foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
https://getfoundry.sh
Apache License 2.0
8.31k stars 1.75k forks source link

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

Open yash-atreya opened 2 months ago

yash-atreya commented 2 months ago

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 https://github.com/foundry-rs/foundry/issues/8617. In this case you would also want to include a message in the output indicating this difference

Originally posted by @mds1 in https://github.com/foundry-rs/foundry/issues/8510#issuecomment-2278225473

klkvr commented 2 months ago

we could reuse https://github.com/foundry-rs/foundry/blob/c6d342def10db104500e3295b1c2e5582491bd61/crates/common/src/contracts.rs#L148 for this