0xSpaceShard / starknet-devnet-rs

A local testnet for Starknet... in Rust
https://0xspaceshard.github.io/starknet-devnet-rs/
MIT License
98 stars 55 forks source link

dev: detect chain id on fork #535

Open EvolveArt opened 4 days ago

EvolveArt commented 4 days ago

Describe the bug (observed vs expected behavior)

The chain id should be detected automatically when using a fork network otherwise it can lead to unexpected behavior.

Not reproducible on testnet

To Reproduce Steps to reproduce the behavior:

  1. Run starknet-devnet --fork-network https://starknet-mainnet.public.blastapi.io/rpc/v0_7 --host 127.0.0.1 --port 56126 --accounts 1 --seed 1 for example
  2. Chain ID is not detected automatically

Devnet version

System specifications

FabijanC commented 4 days ago

Thanks for reporting. Currently we only log a warning. In case of a solution that would automatically detect the origin chain ID, we should remove the warning.

Also, we can prevent chain-id from being set via CLI when forking.

Related: #452