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

bug: tracer crashing on create2 #7833

Closed
2 tasks done
greged93 opened this issue May 2, 2024 · 3 comments · Fixed by #7838
Closed
2 tasks done

bug: tracer crashing on create2 #7833

greged93 opened this issue May 2, 2024 · 3 comments · Fixed by #7838
Labels
T-bug Type: bug

Comments

@greged93
Copy link
Contributor

greged93 commented May 2, 2024

Component

Forge

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (cafc260 2024-05-02T00:22:11.188280000Z)

What command(s) is the bug in?

forge script path_to_script --broadcast --verify --chain-id xxx xxx --rpc-url xxx --sender xxx

Operating System

macOS (Apple Silicon)

Describe the bug

The below is the output for the script I am running using forge commit forge 0.2.0 (ee47bb0 2024-04-16T00:22:03.703537000Z):

[⠢] Compiling...
No files changed, compilation skipped
Traces:
  [556816] → new SCL_ECDSAB4@0x05eFAC4C53Ec12F11f144d0a0D18Df6dfDf83409
    └─ ← [Return] 2781 bytes of code

  [336073] → new Script_Deploy_SCL@0x5b73C5498c1E3b4dbA84de0F1833c4a029d90519
    └─ ← [Return] 1568 bytes of code

  [35841] Script_Deploy_SCL::run()
    ├─ [0] VM::envOr("PRIVATE_KEY", 0) [staticcall]
    │   └─ ← [Return] <env var value>
    ├─ [0] VM::startBroadcast()
    │   └─ ← [Return]
    ├─ [0] → new <unknown>@0xE745075961a543898E807Dc457ad70D5bd45d678
    │   └─ ← [Revert] 420 bytes of code
    └─ ← [Revert] CREATE2 Deployer (0x4e59b44847b379578588920ca78fbf26c0b4956c) not present on this chain.
For a production environment, you can deploy it using the pre-signed transaction from https://github.com/Arachnid/deterministic-deployment-proxy.
For a test environment, you can use `etch` to place the required bytecode at that address.


Error:
script failed: CREATE2 Deployer (0x4e59b44847b379578588920ca78fbf26c0b4956c) not present on this chain.
For a production environment, you can deploy it using the pre-signed transaction from https://github.com/Arachnid/deterministic-deployment-proxy.
For a test environment, you can use `etch` to place the required bytecode at that address.

This indicates clearly that I am missing the CREATE2 Deployer from the chain.
However, bumping forge to the latest commit crashes with:

[⠢] Compiling...
No files changed, compilation skipped
The application panicked (crashed).
Message:  called `Option::unwrap()` on a `None` value
Location: /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/revm-8.0.0/src/inspector/handler_register.rs:198

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

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 8 frames hidden ⋮
   9: core::panicking::panic::h3131e0868b9f8622
      at <unknown source file>:<unknown line>
  10: core::option::unwrap_failed::hdb518deb484b6610
      at <unknown source file>:<unknown line>
  11: revm::inspector::handler_register::inspector_handle_register::{{closure}}::hc58254a0768dcac7
      at <unknown source file>:<unknown line>
  12: revm::evm::Evm<EXT,DB>::transact::h5f18dc6e06b48bca
      at <unknown source file>:<unknown line>
  13: foundry_evm::executors::Executor::call_raw::hbb3b76ce34c66842
      at <unknown source file>:<unknown line>
  14: forge_script::runner::ScriptRunner::call::hfe8e0abc2f0ab3ad
      at <unknown source file>:<unknown line>
  15: forge_script::execute::PreExecutionState::execute::{{closure}}::hf8f362bc591a0da7
      at <unknown source file>:<unknown line>
  16: forge_script::ScriptArgs::run_script::{{closure}}::hf89b118edd824c49
      at <unknown source file>:<unknown line>
  17: forge::main::h765f0f05a345f80e
      at <unknown source file>:<unknown line>
  18: std::sys_common::backtrace::__rust_begin_short_backtrace::h09ae3530d8a1dd59
      at <unknown source file>:<unknown line>
  19: _main<unknown>
      at <unknown source file>:<unknown line>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.

This seems to indicate that the post insert_create_outcome has an issue and can't find the input stack values. Can't really pinpoint where this happened.

@DaniPopes
Copy link
Member

cc @klkvr

@klkvr
Copy link
Member

klkvr commented May 2, 2024

@greged93 can you provide a repro for this?

@greged93
Copy link
Contributor Author

greged93 commented May 3, 2024

was about to provide a repro but you beat me to fixing it, can confirm issue is fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants