madara-alliance / madara

Madara is a powerful hybrid Starknet client written in Rust.
https://madara.build
Apache License 2.0
77 stars 30 forks source link

Detecting L1 / L2 chain id mismatch #246

Closed cchudant closed 1 month ago

cchudant commented 1 month ago

Is there an existing issue?

Motivation

@Trantorian1 got this issue when running the node:

Error: Getting initial ethereum state

Caused by:
    0: buffer overrun while deserializing
    1: buffer overrun while deserializing

Stack backtrace:
   0: anyhow::error::<impl core::convert::From<E> for anyhow::Error>::from
             at /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.86/src/error.rs:565:25
   1: <core::result::Result<T,F> as core::ops::try_trait::FromResidual<core::result::Result<core::convert::Infallible,E>>>::from_residual
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/result.rs:1964:27
   2: mc_eth::client::EthereumClient::get_last_verified_block_number::{{closure}}
             at ./crates/client/eth/src/client.rs:104:28

It is cause by the fact that he has put a mainnet l1 rpc endpoint whereas he was running a sepolia node.

The buffer overrun is because the node tries to read the l1 core contract

Request

Detect the network mismatch

Solution

Either:

Are you willing to help with this request?

Yes!