EthBMC icon indicating copy to clipboard operation
EthBMC copied to clipboard

How to use on-chain analysis correctly in EthBMC

Open step-xiaoyu-ka opened this issue 4 years ago • 0 comments

Summary of the problem

Hi, I used EthBMC for on chain contract address list analysis with the command:

/target/release/ethbmc --ip 127.0.0.1 --list -b 1 ./contract_list/contract_list9-4.txt

where contract_list9-4.txt consists of 4 non-self-destructed contracts with real Ethereum account address:

0xaeb960ed44c8a4ce848c50ef451f472a503456b2

0xe2fd97cdd6182c1223ff8bc6344abaf7132b51d5

0x2a103c2023fb2ad490c5ab2a2b05d9fbc301ad34

0xdb404188f3428f80fcac37a2ee7a3391f5d28c48

and a local parity node is created with parity -c config.toml where the contents of config.toml:

[parity]
light=true
base_path="/home/work/parity_light"
[rpc]
cors=["all"]
interface=["local"]
hosts=["all"]
[misc]
logging="sync=debug"
log_file="/home/work/parity_light.log"
color=true

Parity version

Parity-Ethereum/v2.7.2-stable-2662d19-20200206/x86_64-unknown-linux-gnu/rustc1.41.0

OS / Environment

Ubuntu 18.04.6 LTS

Expected behavior

EthBMS successfully analyzes all of contracts and outputs a CSV file.

Actual behavior

The on chain analysis fails to complete. It seems

At the first attempt, the analysis was terminated by the panic:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error(JsonRpcError(Error { code: ServerError(-32065), message: "OnDemand request maximum backoff iterations exceeded", data: None }), State { next_error: None, backtrace: InternalBacktrace { backtrace: None } })', parity_connector/src/lib.rs:58:14

The second attempt came up with another one:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error(JsonRpcError(Error { code: ServerError(-32042), message: "Bad response on request: [ Body ]. Error cause was EmptyResponse, (majority count: 1 / total: 1)", data: None }), State { next_error: None, backtrace: InternalBacktrace { backtrace: None } })', parity_connector/src/lib.rs:58:14

It seems to be blamed on the local Parity node I created instead of ETHBMC, but how do I configure a Parity node to use the on-chain analysis function of EthBMC?

Any relevant logs

EthBMC-master$ RUST_BACKTRACE=1 ./target/release/ethbmc --ip 127.0.0.1 --list -b 1 ./contract_list/contract_list9-4.txt
[2021-12-01][16:52:47][ethbmc][INFO] =========================================================
[2021-12-01][16:52:47][ethbmc][INFO] Analyzing account 1 of 4
[2021-12-01][16:52:47][ethbmc][INFO] =========================================================
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error(JsonRpcError(Error { code: ServerError(-32042), message: "Bad response on request: [ Body ]. Error cause was EmptyResponse, (majority count: 1 / total: 1)", data: None }), State { next_error: None, backtrace: InternalBacktrace { backtrace: Some(   0: error_chain::backtrace::imp::InternalBacktrace::new
   1: <error_chain::State as core::default::Default>::default
   2: <jsonrpc_client_core::Error as core::convert::From<jsonrpc_client_core::ErrorKind>>::from
   3: jsonrpc_client_core::response::parse
   4: <jsonrpc_client_core::RpcRequest<T,F> as futures::future::Future>::poll
   5: futures::task_impl::Spawn<T>::poll_future_notify
   6: std::thread::local::LocalKey<T>::with
   7: parity_connector::ParityConnector::block_by_number
   8: esvm::se::env::Env::from_chain
   9: esvm::se::env::SeEnviroment::from_chain
  10: ethbmc::analysis
  11: ethbmc::main
  12: std::sys_common::backtrace::__rust_begin_short_backtrace
  13: std::rt::lang_start::{{closure}}
  14: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
             at /rustc/6db0a0e9a4a2f55b1a85954e114ada0b45c32e45/library/core/src/ops/function.rs:259:13
      std::panicking::try::do_call
             at /rustc/6db0a0e9a4a2f55b1a85954e114ada0b45c32e45/library/std/src/panicking.rs:406:40
      std::panicking::try
             at /rustc/6db0a0e9a4a2f55b1a85954e114ada0b45c32e45/library/std/src/panicking.rs:370:19
      std::panic::catch_unwind
             at /rustc/6db0a0e9a4a2f55b1a85954e114ada0b45c32e45/library/std/src/panic.rs:133:14
      std::rt::lang_start_internal::{{closure}}
             at /rustc/6db0a0e9a4a2f55b1a85954e114ada0b45c32e45/library/std/src/rt.rs:128:48
      std::panicking::try::do_call
             at /rustc/6db0a0e9a4a2f55b1a85954e114ada0b45c32e45/library/std/src/panicking.rs:406:40
      std::panicking::try
             at /rustc/6db0a0e9a4a2f55b1a85954e114ada0b45c32e45/library/std/src/panicking.rs:370:19
      std::panic::catch_unwind
             at /rustc/6db0a0e9a4a2f55b1a85954e114ada0b45c32e45/library/std/src/panic.rs:133:14
      std::rt::lang_start_internal
             at /rustc/6db0a0e9a4a2f55b1a85954e114ada0b45c32e45/library/std/src/rt.rs:128:20
  15: main
  16: __libc_start_main
             at /build/glibc-S9d2JN/glibc-2.27/csu/../csu/libc-start.c:310
  17: _start
) } })', parity_connector/src/lib.rs:58:14
stack backtrace:
   0: rust_begin_unwind
             at /rustc/6db0a0e9a4a2f55b1a85954e114ada0b45c32e45/library/std/src/panicking.rs:498:5
   1: core::panicking::panic_fmt
             at /rustc/6db0a0e9a4a2f55b1a85954e114ada0b45c32e45/library/core/src/panicking.rs:107:14
   2: core::result::unwrap_failed
             at /rustc/6db0a0e9a4a2f55b1a85954e114ada0b45c32e45/library/core/src/result.rs:1613:5
   3: parity_connector::ParityConnector::block_by_number
   4: esvm::se::env::Env::from_chain
   5: esvm::se::env::SeEnviroment::from_chain
   6: ethbmc::analysis
   7: ethbmc::main

step-xiaoyu-ka avatar Dec 01 '21 09:12 step-xiaoyu-ka