foundry icon indicating copy to clipboard operation
foundry copied to clipboard

`forge script` panicked

Open ryanli-me opened this issue 2 years ago • 6 comments

Component

Forge

Have you ensured that all of these are up to date?

  • [X] Foundry
  • [X] Foundryup

What version of Foundry are you on?

forge 0.2.0 (01325bc 2022-08-03T00:04:48.802271Z)

What command(s) is the bug in?

forge script script/Deploy.s.sol:DeployScript --rpc-url $GOERLI_RPC_URL --private-key $PRIVATE_KEY

Operating System

macOS (Apple Silicon)

Describe the bug

The same deployment script that I used two weeks ago broke when I upgraded to the latest foundry today.

The application panicked (crashed).
Message:  called `Option::unwrap()` on a `None` value
Location: cli/src/cmd/forge/script/executor.rs:34

This is a bug. Consider reporting it at https://github.com/foundry-rs/foundry

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   1: __mh_execute_header<unknown>
      at <unknown source file>:<unknown line>
   2: __mh_execute_header<unknown>
      at <unknown source file>:<unknown line>
   3: __mh_execute_header<unknown>
      at <unknown source file>:<unknown line>
   4: __mh_execute_header<unknown>
      at <unknown source file>:<unknown line>
   5: __mh_execute_header<unknown>
      at <unknown source file>:<unknown line>
   6: __mh_execute_header<unknown>
      at <unknown source file>:<unknown line>
   7: __mh_execute_header<unknown>
      at <unknown source file>:<unknown line>
   8: __mh_execute_header<unknown>
      at <unknown source file>:<unknown line>
   9: __mh_execute_header<unknown>
      at <unknown source file>:<unknown line>
  10: __mh_execute_header<unknown>
      at <unknown source file>:<unknown line>
  11: __mh_execute_header<unknown>
      at <unknown source file>:<unknown line>
  12: __mh_execute_header<unknown>
      at <unknown source file>:<unknown line>
  13: __mh_execute_header<unknown>
      at <unknown source file>:<unknown line>
  14: __mh_execute_header<unknown>
      at <unknown source file>:<unknown line>
  15: __mh_execute_header<unknown>
      at <unknown source file>:<unknown line>

ryanli-me avatar Aug 03 '22 04:08 ryanli-me

Does your contract use libraries by any chance?

cc @joshieDo it seems that the into_bytes unwrap fails, so probably an unlinked artifact somehow. We should also replace the unwrap with an expect so we have more context

onbjerg avatar Aug 03 '22 10:08 onbjerg

yes, we use a linked library for the contract to be deployed.

ryanli-me avatar Aug 03 '22 17:08 ryanli-me

do you have a reproducible repo you can share?

joshieDo avatar Aug 04 '22 19:08 joshieDo

i'm trying to create a reproducible repo to share. but while i was recreating, i found it might be related to deploying a big contract (23.646 KB) thru a create2 deployer.

ryanli-me avatar Aug 09 '22 03:08 ryanli-me

also a separate issue came up as foundry gets updated in our CI, tests that involves deploying a new contract thru create2 starts to break while showing a very large gas consumption.

ryanli-me avatar Aug 09 '22 03:08 ryanli-me

https://github.com/foundry-rs/foundry/issues/2665

ryanli-me avatar Aug 10 '22 00:08 ryanli-me

So is this issue the same as #2665? If it is, we should close this one, as fixing one will fix the other

onbjerg avatar Aug 11 '22 18:08 onbjerg

sorry for the late reply, this is a separate issue than #2665 . also i couldn't reproduce this in a separate repo.

ryanli-me avatar Aug 16 '22 22:08 ryanli-me

Closing as can't reproduce, please feel free to reopen with a reproducible example if it's still an issue :smile:

onbjerg avatar Aug 23 '22 17:08 onbjerg