omgnetwork / elixir-omg

OMG-Network repository of Watcher and Watcher Info
https://omg.network
Apache License 2.0
213 stars 59 forks source link

EthereumClientMonitor restarts on every eth block #969

Closed pdobacz closed 5 years ago

pdobacz commented 5 years ago

It should suffice to start omg_eth application from mix to reproduce this. I'm doing:

user@user:~/sources/elixir-omg$ iex -S mix run --no-start
Erlang/OTP 21 [erts-10.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]

Interactive Elixir (1.8.0) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> {:ok, _} = Application.ensure_all_started(:omg_eth)

which yields this after a while:

2019-09-16 09:44:11.435 [info] module=OMG.Bus.Supervisor function=init/1 ⋅Starting OMG.Bus.Supervisor⋅
2019-09-16 09:44:11.470 [info] ⋅[alarm_handler: {:set, {:system_memory_high_watermark, []}}]⋅
2019-09-16 09:44:11.509 [info] module=OMG.Eth.Application function=start/2 ⋅Started OMG.Eth.Application, config used: [authority_addr: nil, contract_addr: nil, txhash_contract: nil]⋅
2019-09-16 09:44:11.510 [info] module=OMG.Eth.Supervisor function=init/1 ⋅Starting OMG.Eth.Supervisor⋅
2019-09-16 09:44:11.512 [info] module=OMG.Eth.EthereumClientMonitor function=init/1 ⋅Starting Ethereum client monitor.⋅
{:ok,
 [:sasl, :omg_utils, :deferred_config, :libsecp256k1, :binary, :keccakf1600,
  :exth_crypto, :ex_abi, :poolboy, :unicode_util_compat, :idna, :mimerl,
  :certifi, :ssl_verify_fun, :metrics, :hackney, :httpoison, :ethereumex,
  :omg_bus, :websockex, :os_mon, :statix, :decorator, :optimal, :spandex,
  :msgpax, :spandex_datadog, :sentry, :omg_status, :omg_eth]}
iex(2)> 2019-09-16 09:44:13.184 [warn] module=OMG.Eth.EthereumClientMonitor function=handle_event/2 ⋅Health check raised :ethereum_client_connection alarm.⋅
2019-09-16 09:44:13.193 [error] module=gen_server function=error_info/7 ⋅GenServer OMG.Eth.EthereumClientMonitor terminating
** (MatchError) no match of right hand side value: {:error, :badarg}
    (omg_eth) lib/omg_eth/ethereum_client_monitor.ex:98: OMG.Eth.EthereumClientMonitor.handle_info/2
    (stdlib) gen_server.erl:637: :gen_server.try_dispatch/4
    (stdlib) gen_server.erl:711: :gen_server.handle_msg/6
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message: {:EXIT, #PID<0.489.0>, {{:badmatch, "000000002000020000000000000000000005400020000000000000000010008000000000000020000400040000\",\"difficulty\":\"0x2\",\"number\":\"0x4dccf5\",\"gasLimit\":\"0x6b1f5d\",\"gasUsed\":\"0x269754\",\"timestamp\":\"0x5d7f3d4d\",\"extraData\":\"0xd883010903846765746888676f312e31322e39856c696e757800000000000000ce1d2b2335d48a57790acc794924b2f5d10bd10114ee3700760fd5a3a2a66e0007d318902e2c526e766e40257cc03325f6b8de10bc598bce153eaaa8cfe8b3d501\",\"mixHash\":\"0x00000"}, [{WebSockex.Frame, :parse_frame, 1, [file: 'lib/websockex/frame.ex', line: 201]}, {WebSockex, :websocket_loop, 3, [file: 'lib/websockex.ex', line: 622]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 249]}]}}⋅
2019-09-16 09:44:13.195 [info] module=OMG.Eth.EthereumClientMonitor function=init/1 ⋅Starting Ethereum client monitor.⋅
InoMurko commented 5 years ago

Did you pull master when you did this? badarg was recently solved.

pdobacz commented 5 years ago

ah, no, I tried master at first but that got leveldb removed, so reverted to v0.2. I'll double check on master and close if it's gone. Thank you!

pdobacz commented 5 years ago

Yeah, master (ff73fd0b6a95823aeb5071d2be35aa3eb1a50f1f) is fine, sorry to not check :bowing_man: