fix(script): skip unused library deployments#15862
Conversation
2655d84 to
b3daaa7
Compare
mattsse
left a comment
There was a problem hiding this comment.
the candidate reruns the script with cloned wallets, but the rerun-unsafe selector list doesn't include wallet-backed vm.sign/vm.signCompact. this can prompt hardware, browser, or remote signers twice. can we add sign(bytes32), sign(address,bytes32), signCompact(bytes32), and signCompact(address,bytes32) to SIGNATURES and cover that they skip the optimization?
228a5c5 to
ffae0da
Compare
| | foundry_config::fs_permissions::FsAccessPermission::ReadWrite | ||
| ) | ||
| }) | ||
| || self.used_rerun_unsafe_cheatcode() |
There was a problem hiding this comment.
This gate only sees unsafe cheatcodes reached by the baseline run. Nondeterministic control flow can reach vm.rpc, prompting/signing, or another side effect only in the speculative rerun, before equivalence rejects that candidate. I reproduced this with a candidate-only vm.rpc("anvil_setBalance", ...): the RPC mutation escaped even though the deploy-all baseline was retained. Please hard-disable side-effecting cheatcodes during the candidate execution (an error can safely fall back to the baseline).
Avoid deploying unused libraries when
forge scriptbroadcasts direct contract creations. Required libraries are determined from the created artifacts, while omitted libraries remain available during local execution. Unsupported transaction shapes retain the existing deploy-all behavior.Closes #6215