foundry icon indicating copy to clipboard operation
foundry copied to clipboard

perf(script): run contract verifications in parallel

Open avorylli opened this issue 3 weeks ago • 5 comments

Replace sequential await loop with join_all to execute all contract verifications concurrently. This improves performance when verifyingmultiple contracts, especially for large deployments.

The change maintains the same error handling behavior while allowing all verification futures to run in parallel instead of waiting for each one to complete before starting the next.

avorylli avatar Dec 07 '25 12:12 avorylli

@grandizzy thanks for review, did changes that you requested, is it going in the right direction?

avorylli avatar Dec 07 '25 14:12 avorylli

@grandizzy thanks for review, did changes that you requested, is it going in the right direction?

@avorylli yep, thank you, that's going in the right direction! Some things to fix

  • let's display details near each contract that is verified (like chain, evm version, compiler, constructor args, verifier)
  • let's display progress messages inline as the last entry - rn they are displayed inline and makes progress bar flaky

smth like instead gg

to have

⡀ Mail (0xE51e8ae776431114628fD12E037044A2eE1ddec6)  
    - chain: 1111
    - EVM version: prague
    - Compiler version: 0.8.30
    - Constructor args: 00000000000000000000000020c00000000000000000000000000000000005aa
    - verifier: Sourcify
    - Submitted contract for verification:
	Verification Job ID: `56ead4aa-76c3-4b04-a1ff-9cf125d2d661`
	URL:                                                                                                                                                   
⡀ SimpleMail (0xB3Cf7142C78947281EdC6d634bB265B587300D81)
    - chain: 2222
    - EVM version: osaka
    - Compiler version: 0.8.18
    - verifier: Etherscan
    - Failed to deserialize response: data did not match any variant of untagged enum ResponseData res="{\"message\":\"unsupported media type application/x-www-form-urlencoded\",\"errors\":[{\"path\":\"/verify\",\"message\":\"unsupported media type application/x-www-form-urlencoded\"}]}"

grandizzy avatar Dec 08 '25 06:12 grandizzy

ref part of https://github.com/foundry-rs/foundry/issues/10593 CC @zerosnacks

grandizzy avatar Dec 08 '25 06:12 grandizzy

@grandizzy wow, thanks for detailed explanation,

I hope my implementation includes what you asked for

avorylli avatar Dec 08 '25 18:12 avorylli

@avorylli oh, yes, I tested and def the right direction, there's still a little flakiness to figure it out, will get on review it asap

grandizzy avatar Dec 09 '25 13:12 grandizzy