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

Devnet is failing to run with fork-network in debug mode #530

Open
1 of 2 tasks
mikiw opened this issue Jul 3, 2024 · 12 comments
Open
1 of 2 tasks

Devnet is failing to run with fork-network in debug mode #530

mikiw opened this issue Jul 3, 2024 · 12 comments
Assignees
Labels
bug Something isn't working OnlyDust

Comments

@mikiw
Copy link
Contributor

mikiw commented Jul 3, 2024

Describe the bug (observed vs expected behavior)

Devnet is failing to run with:
cargo run -- --port 1025 --initial-balance 500000000000000000000 --seed 42 --accounts 3 --chain-id TESTNET --fork-network 'http://rpc.pathfinder.equilibrium.co/integration-sepolia/rpc/v0_7'

Not reproducible on testnet

  • This issue is only present on Devnet and cannot be reproduced on the alpha-sepolia testnet (check the box if true).

To Reproduce
Steps to reproduce the behavior:

  1. Run devnet with CLI args:
    cargo run -- --port 1025 --initial-balance 500000000000000000000 --seed 42 --accounts 3 --chain-id TESTNET --fork-network 'http://rpc.pathfinder.equilibrium.co/integration-sepolia/rpc/v0_7'
  2. Get error:
Forking from block: number=35172, hash=0x25a6765ed4756a519b23ba8b83cd11d9480ba4d798b392d74a9f14fd5c22b15
2024-07-03T12:31:59.239105Z  WARN starknet_devnet: Origin chain ID (0x534e5f494e544547524154494f4e5f5345504f4c4941) does not match this Devnet's chain ID (0x534e5f5345504f4c4941).
thread 'main' panicked at /Users/mikiw/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.36.0/src/runtime/blocking/shutdown.rs:51:21:
Cannot drop a runtime in a context where blocking is not allowed. This happens when a runtime is dropped from within an asynchronous context.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2024-07-03T12:31:59.244142Z ERROR reqwest::blocking::client: Failed to communicate successful startup: Ok(())    

Devnet version

  • I am using Devnet version:
  • This happens with a dockerized Devnet (check the box if true).
  • This does not appear on the following Devnet version:

System specifications

  • OS:
@mikiw mikiw self-assigned this Jul 3, 2024
@mikiw
Copy link
Contributor Author

mikiw commented Jul 3, 2024

maybe the problem is with tokio join added recently - checking

@FabijanC
Copy link
Contributor

FabijanC commented Jul 3, 2024

doesn't happen if in release mode (--release)

@mikiw
Copy link
Contributor Author

mikiw commented Jul 3, 2024

right cargo run --release -- --fork-network http://rpc.pathfinder.equilibrium.co/integration-sepolia/rpc/v0_7 works ...

@FabijanC
Copy link
Contributor

FabijanC commented Jul 3, 2024

I deleted my recent comment which was wrong (perhaps I should have just edited).
The error is present even before commit 3ad8145 (immediately before #491 was merged and tokio join introduced).

@mikiw mikiw assigned marioiordanov and unassigned mikiw Jul 5, 2024
@FabijanC
Copy link
Contributor

FabijanC commented Jul 5, 2024

Could be a reqwest issue: mozilla/sccache#1161
Here they mention the same release vs debug mode problem

Here's what chatgpt says about debug-release differences (link to chat):

The difference between debug and release modes can sometimes expose race conditions or timing issues in your code. Optimizations in release mode can inadvertently mask these issues. Running your code with more extensive logging or using a tool like tokio-console can help you understand the runtime behavior in both modes.

@marioiordanov marioiordanov added the wontfix This will not be worked on label Jul 29, 2024
@marioiordanov
Copy link
Contributor

It is working as expected when the fork_config.block_number property is not modified. I dont know what optimisations the compiled does in release mode compared to debug build

@marioiordanov
Copy link
Contributor

Perhaps changing the reqwest::blocking::Client to reqwest::Client will fix it

@ArielTM
Copy link

ArielTM commented Aug 2, 2024

+1
Error in crates/starknet-devnet-core/src/starknet/defaulter.rs:38:43 while calling reqwest::blocking::Client::new()

@FabijanC
Copy link
Contributor

FabijanC commented Aug 2, 2024

@ArielTM Is running in debug mode from source important for your use case? Can you try switching to release mode? Docs: https://0xspaceshard.github.io/starknet-devnet-rs/docs/running/install#run-from-source

@ArielTM
Copy link

ArielTM commented Aug 2, 2024

We're actually trying to use starknet-devnet-core as a library, so developing in debug is easier

@marioiordanov
Copy link
Contributor

@ArielTM If you run devnet without forking feature it should work as expected

@ArielTM
Copy link

ArielTM commented Aug 2, 2024

@marioiordanov we rely on forking :)

@FabijanC FabijanC added bug Something isn't working and removed wontfix This will not be worked on labels Sep 23, 2024
@FabijanC FabijanC changed the title Devnet is failing to run with fork-network Devnet is failing to run with fork-network in debug mode Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working OnlyDust
Projects
Status: 🆕 New
Development

No branches or pull requests

4 participants