matter-labs / zksync-era

zkSync era
Apache License 2.0
3.07k stars 2.06k forks source link

Failing to run zkSync using Besu as L1 #2517

Closed freigeistig closed 1 month ago

freigeistig commented 1 month ago

šŸ› Bug Report

šŸ“ Description

I'm trying to run zkSync using local setup with Besu (as I need QBFT consensus instead of Clique). Contracts are being deployed successfully, but there is an error after that.

šŸ”„ Reproduction Steps

To reproduce run Hyperledger Besu with the following configs:

genesis.json

{
  "config" : {
    "chainId" : 9,
    "homesteadBlock": 0,
    "eip150Block": 0,
    "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "eip155Block": 0,
    "eip158Block": 0,
    "daoForkBlock": 0,
    "frontierBlock": 0,
    "byzantiumBlock": 0,
    "constantinopleBlock": 0,
    "petersburgBlock": 0,
    "muirGlacierBlock": 0,
    "istanbulBlock": 0,
    "berlinBlock": 0,
    "londonBlock": 0,
    "mergeNetsplitBlock": 0,
    "shanghaiTime": 0,
    "cancunTime" : 0,
    "zeroBaseFee" : true,
    "qbft" : {
      "blockperiodseconds" : 12,
      "epochlength" : 30000,
      "requesttimeoutseconds" : 4
    }
  },
  "nonce" : "0x0",
  "timestamp" : "0x58ee40ba",
  "gasLimit" : "0x1c9c380",
  "difficulty" : "0x1",
  "mixHash" : "0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365",
  "coinbase" : "0x0000000000000000000000000000000000000000",
  "alloc" : {
    "0000000000000000000000000000000000000000": {
      "balance": "0x1"
    },
    "8a91dc2d28b689474298d91899f0c1baf62cb85b": {
      "balance": "0x4B3B4CA85A86C47A098A224000000000"
    },
    "de03a0b5963f75f1c8485b355ff6d30f3093bde7": {
      "balance": "0x4B3B4CA85A86C47A098A224000000000"
    },
    "52312AD6f01657413b2eaE9287f6B9ADaD93D5FE": {
      "balance": "0x4B3B4CA85A86C47A098A224000000000"
    },
    "36615Cf349d7F6344891B1e7CA7C72883F5dc049": {
      "balance": "0x4B3B4CA85A86C47A098A224000000000"
    },
    "a61464658AfeAf65CccaaFD3a512b69A83B77618": {
      "balance": "0x4B3B4CA85A86C47A098A224000000000"
    },
    "0D43eB5B8a47bA8900d84AA36656c92024e9772e": {
      "balance": "0x4B3B4CA85A86C47A098A224000000000"
    },
    "A13c10C0D5bd6f79041B9835c63f91de35A15883": {
      "balance": "0x4B3B4CA85A86C47A098A224000000000"
    },
    "8002cD98Cfb563492A6fB3E7C8243b7B9Ad4cc92": {
      "balance": "0x4B3B4CA85A86C47A098A224000000000"
    },
    "4F9133D1d3F50011A6859807C837bdCB31Aaab13": {
      "balance": "0x4B3B4CA85A86C47A098A224000000000"
    },
    "bd29A1B981925B94eEc5c4F1125AF02a2Ec4d1cA": {
      "balance": "0x4B3B4CA85A86C47A098A224000000000"
  },
  "extraData" : "0xf87aa00000000000000000000000000000000000000000000000000000000000000000f85494065f139d8a49e9926232cc4435159024cb5064fc940eb968de631abc65322ecdca5dfdf9c6296e52f494543d3796700ee35803a1c43562a69fec08e1e4239420c5edbcf6263cd9e30df395a2b914f6e939b9bac080c0",
  "number": "0x0",
  "gasUsed": "0x0",
  "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "baseFeePerGas": "0x1",
  "excessBlobGas": "0x0",
  "blobGasUsed": "0x0"
}

docker-compose.yml

  validator1:
    image: hyperledger/besu:24.7.0-arm64
    command: [ "--config-file=/opt/besu/common-config.toml",
                "--identity=validator1",
                "--p2p-host=10.42.0.2",
                "--p2p-port=30303"]
    volumes:
      - ./common-config.toml:/opt/besu/common-config.toml:ro
      - ./genesis.json:/opt/besu/genesis.json:ro
      - ./keys/validator1/key:/opt/besu/key:ro
      - validator1-data:/opt/besu/data
    ports:
      - "8545:8545"
      - "30303:30303/tcp"
      - "30303:30303/udp"
    networks:
      qbft_testnet:
        ipv4_address: <address>

common-config.toml

genesis-file="/opt/besu/genesis.json"
data-path="/opt/besu/data"
node-private-key-file="/opt/besu/key"
rpc-http-enabled=true
rpc-http-api=["ETH","QBFT","WEB3", "DEBUG"]
rpc-http-host=["0.0.0.0"]
rpc-http-port="8545"
host-allowlist=["*"]
rpc-http-cors-origins=["*"]
tx-pool="legacy"
tx-pool-limit-by-account-percentage=1.0
tx-pool-max-size="1000000"

šŸ¤” Expected Behavior

The expected behavior would be standard zkSync run.

šŸ˜Æ Current Behavior

It seems the main thing is:

2024-07-27 22:24:15 2024-07-27T19:24:15.166159Z  WARN zksync_core::api_server::web3: Stop signal sender for WS JSON-RPC server was dropped without sending a signal
2024-07-27 22:24:15 2024-07-27T19:24:15.166355Z  WARN zksync_core::api_server::contract_verification: Stop signal sender for contract verification server was dropped without sending a signal
2024-07-27 22:24:15 2024-07-27T19:24:15.166446Z  WARN zksync_core::api_server::web3: Stop signal sender for HTTP JSON-RPC server was dropped without sending a signal

After that services are shutting down.

šŸ–„ļø Environment

macOS v14.1, ARM architecture

šŸ“Ž Log Output

Other logs:

2024-07-27 22:24:15 2024-07-27T19:24:15.110780Z  INFO zksync_core: initialized ETH-Watcher in 85.357542ms
2024-07-27 22:24:15 2024-07-27T19:24:15.111050Z  INFO zksync_core: initializing ETH-TxAggregator
2024-07-27 22:24:15 2024-07-27T19:24:15.122358Z  INFO zksync_db_connection::connection_pool: Created DB pool with parameters ConnectionPoolBuilder { database_url: "postgres://***:***@postgres/zksync_local", max_size: 1, acquire_timeout: 30s, statement_timeout: None, db: "zksync_dal::Core" }
2024-07-27 22:24:15 2024-07-27T19:24:15.122648Z  INFO zksync_eth_client::clients::http::signing: Operator address: 0xde03a0b5963f75f1c8485b355ff6d30f3093bde7
2024-07-27 22:24:15 2024-07-27T19:24:15.135491Z DEBUG loop_iteration: zksync_eth_watch::event_processors::priority_ops: Received priority requests with serial ids: 0 (block 221) - 13 (block 258)
2024-07-27 22:24:15 2024-07-27T19:24:15.166159Z  WARN zksync_core::api_server::web3: Stop signal sender for WS JSON-RPC server was dropped without sending a signal
2024-07-27 22:24:15 2024-07-27T19:24:15.166355Z  WARN zksync_core::api_server::contract_verification: Stop signal sender for contract verification server was dropped without sending a signal
2024-07-27 22:24:15 2024-07-27T19:24:15.166446Z  WARN zksync_core::api_server::web3: Stop signal sender for HTTP JSON-RPC server was dropped without sending a signal
2024-07-27 22:24:15 2024-07-27T19:24:15.167192Z  INFO zksync_core::api_server::contract_verification: Stop signal received, contract verification server is shutting down
2024-07-27 22:24:15 2024-07-27T19:24:15.167720Z DEBUG zksync_health_check: Changed health of `ws_api` from {"status":"ready"} to {"status":"shutting_down"}
2024-07-27 22:24:15 2024-07-27T19:24:15.167730Z  INFO zksync_core::api_server::web3: Stop signal received, WS JSON-RPC server is shutting down
2024-07-27 22:24:15 2024-07-27T19:24:15.167848Z DEBUG zksync_health_check: Changed health of `http_api` from {"status":"ready"} to {"status":"shutting_down"}
2024-07-27 22:24:15 2024-07-27T19:24:15.167864Z  INFO zksync_core::api_server::web3: Stop signal received, HTTP JSON-RPC server is shutting down
2024-07-27 22:24:15 2024-07-27T19:24:15.168500Z  INFO vise_exporter::exporter: Stop signal received, Prometheus metrics exporter is shutting down
2024-07-27 22:24:15 2024-07-27T19:24:15.178942Z DEBUG zksync_health_check: Changed health of `http_api` from {"status":"shutting_down"} to {"status":"shut_down"}
2024-07-27 22:24:15 2024-07-27T19:24:15.179019Z DEBUG zksync_health_check: Changed health of `ws_api` from {"status":"shutting_down"} to {"status":"shut_down"}
2024-07-27 22:24:15 2024-07-27T19:24:15.181795Z  INFO zksync_core::api_server::contract_verification: Contract verification handler server shut down
2024-07-27 22:24:15 2024-07-27T19:24:15.184392Z  INFO vise_exporter::exporter: Prometheus metrics exporter server shut down
2024-07-27 22:24:15 2024-07-27T19:24:15.187735Z DEBUG zksync_health_check: Changed health of `prometheus_exporter` from {"status":"ready"} to {"status":"shut_down"}
2024-07-27 22:24:15 2024-07-27T19:24:15.194491Z  INFO zksync_storage::db: Initialized RocksDB `state_keeper` at `./db/dev/state_keeper` with RocksDBOptions { block_cache_capacity: Some(134217728), include_indices_and_filters_in_block_cache: false, large_memtable_capacity: None, stalled_writes_retries: StalledWritesRetries { max_batch_size: 134217728, timeout: 10s, start_interval: 50ms, max_interval: 2s, scale_factor: 1.5 }, max_open_files: None }
2024-07-27 22:24:15 Error: Unable to start Core actors
2024-07-27 22:24:15 
2024-07-27 22:24:15 Caused by:
2024-07-27 22:24:15     0: Request to ethereum gateway failed: ErrorObject { code: InvalidParams, message: "Invalid params", data: None }
2024-07-27 22:24:15     1: ErrorObject { code: InvalidParams, message: "Invalid params", data: None }
2024-07-27 22:24:15     2: ErrorObject { code: InvalidParams, message: "Invalid params", data: None }
2024-07-27 22:24:15 
2024-07-27 22:24:15 Stack backtrace:
2024-07-27 22:24:15    0: anyhow::error::<impl core::convert::From<E> for anyhow::Error>::from
2024-07-27 22:24:15    1: zksync_core::initialize_components::{{closure}}
2024-07-27 22:24:15    2: zksync_server::main::{{closure}}
2024-07-27 22:24:15    3: tokio::runtime::park::CachedParkThread::block_on
2024-07-27 22:24:15    4: tokio::runtime::context::runtime::enter_runtime
2024-07-27 22:24:15    5: tokio::runtime::runtime::Runtime::block_on
2024-07-27 22:24:15    6: zksync_server::main
2024-07-27 22:24:15    7: std::sys_common::backtrace::__rust_begin_short_backtrace
2024-07-27 22:24:15    8: std::rt::lang_start::{{closure}}
2024-07-27 22:24:15    9: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
2024-07-27 22:24:15              at ./rustc/5c6a7e71cd66705c31c9af94077901a220f0870c/library/core/src/ops/function.rs:284:13
2024-07-27 22:24:15   10: std::panicking::try::do_call
2024-07-27 22:24:15              at ./rustc/5c6a7e71cd66705c31c9af94077901a220f0870c/library/std/src/panicking.rs:524:40
2024-07-27 22:24:15   11: std::panicking::try
2024-07-27 22:24:15              at ./rustc/5c6a7e71cd66705c31c9af94077901a220f0870c/library/std/src/panicking.rs:488:19
2024-07-27 22:24:15   12: std::panic::catch_unwind
2024-07-27 22:24:15              at ./rustc/5c6a7e71cd66705c31c9af94077901a220f0870c/library/std/src/panic.rs:142:14
2024-07-27 22:24:15   13: std::rt::lang_start_internal::{{closure}}
2024-07-27 22:24:15              at ./rustc/5c6a7e71cd66705c31c9af94077901a220f0870c/library/std/src/rt.rs:148:48
2024-07-27 22:24:15   14: std::panicking::try::do_call
2024-07-27 22:24:15              at ./rustc/5c6a7e71cd66705c31c9af94077901a220f0870c/library/std/src/panicking.rs:524:40
2024-07-27 22:24:15   15: std::panicking::try
2024-07-27 22:24:15              at ./rustc/5c6a7e71cd66705c31c9af94077901a220f0870c/library/std/src/panicking.rs:488:19
2024-07-27 22:24:15   16: std::panic::catch_unwind
2024-07-27 22:24:15              at ./rustc/5c6a7e71cd66705c31c9af94077901a220f0870c/library/std/src/panic.rs:142:14
2024-07-27 22:24:15   17: std::rt::lang_start_internal
2024-07-27 22:24:15              at ./rustc/5c6a7e71cd66705c31c9af94077901a220f0870c/library/std/src/rt.rs:148:20
2024-07-27 22:24:15   18: main
2024-07-27 22:24:15   19: <unknown>
2024-07-27 22:24:15   20: __libc_start_main
2024-07-27 22:24:15   21: _start
freigeistig commented 1 month ago

It seems local-node:hyperlocal image is required.