omgnetwork / elixir-omg

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

Invalid `fee_specs.json` causes Erlang to die #815

Closed 0x234 closed 5 years ago

0x234 commented 5 years ago

Best description of the work remained @InoMurko:

If the fee file is corrupt at boot - die immediately. If the file is changed on run time and it's corrupt, continue working but alarm.

Original @jbunce message goes :point_down:


childchain-samrong-0 childchain 2019-06-28 06:58:27.534 [info] module=Phoenix.Endpoint.CowboyAdapter function=start_link/3 ⋅Running OMG.ChildChainRPC.Web.Endpoint with cowboy 1.1.2 at :::9656 (http)⋅
childchain-samrong-0 childchain 2019-06-28 06:58:27.543 [info] module=Phoenix.Endpoint.Supervisor function=log_access_info/2 ⋅Access OMG.ChildChainRPC.Web.Endpoint at http://example.com⋅
childchain-samrong-0 childchain 2019-06-28 06:58:27.619 [info] module=OMG.Eth.Application function=start/2 ⋅Started OMG.Eth.Application, config used: [txhash_contract: "0x29f8cd44b4b94a148f779105f0e09e06f762b411ebef6c499281b74d45818c1c", authority_addr: "0x41863dafbdf8cfc2a33fc38c0b525b6343d857b3", contract_addr: "0x740ecec4c0ee99c285945de8b44e9f5bfb71eea7"]⋅
childchain-samrong-0 childchain 2019-06-28 06:58:27.629 [info] module=OMG.Supervisor function=init/1 ⋅Starting OMG.Supervisor⋅
childchain-samrong-0 childchain 2019-06-28 06:58:27.631 [info] module=OMG.EthereumClientMonitor function=init/1 ⋅Starting Ethereum client monitor.⋅
childchain-samrong-0 childchain 2019-06-28 06:58:27.632 [warn] module=OMG.EthereumClientMonitor function=handle_event/2 ⋅Health check raised :ethereum_client_connection alarm.⋅
childchain-samrong-0 childchain 2019-06-28 06:58:27.632 [warn] module=OMG.ChildChainRPC.Plugs.Health function=handle_event/2 ⋅Alarm ethereum_client_connection was raised.⋅
childchain-samrong-0 childchain 2019-06-28 06:58:27.828 [warn] module=OMG.EthereumClientMonitor function=handle_event/2 ⋅Health check established connection to the client. :ethereum_client_connection alarm clearead.⋅
childchain-samrong-0 childchain 2019-06-28 06:58:27.828 [warn] module=OMG.ChildChainRPC.Plugs.Health function=handle_event/2 ⋅Alarm ethereum_client_connection was cleared.⋅
childchain-samrong-0 childchain 2019-06-28 06:58:27.830 [info] module=OMG.ChildChain.Application function=start/2 ⋅Starting OMG.ChildChain.Application⋅
childchain-samrong-0 childchain 2019-06-28 06:58:27.834 [info] module=OMG.EthereumClientMonitor function=handle_event/2 ⋅Eth client monitor got event: {:set_alarm, {:boot_in_progress, %{node: :"childchain@childchain-samrong-0", reporter: OMG.ChildChain.Application}}}. Ignoring.⋅
childchain-samrong-0 childchain 2019-06-28 06:58:27.834 [warn] module=OMG.ChildChainRPC.Plugs.Health function=handle_event/2 ⋅Alarm boot_in_progress was raised.⋅
childchain-samrong-0 childchain 2019-06-28 06:58:27.836 [info] module=OMG.ChildChain.Supervisor function=init/1 ⋅Starting OMG.ChildChain.Supervisor⋅
childchain-samrong-0 childchain 2019-06-28 06:58:27.867 [info] module=OMG.DB.LevelDB function=utxos/1 ⋅Reading UTXO set, this might take a while. Allowing 600000 ms⋅
childchain-samrong-0 childchain 2019-06-28 06:58:27.984 [info] module=application_controller function=info_exited/3 ⋅Application omg_child_chain exited: OMG.ChildChain.Application.start(:normal, []) returned an error: shutdown: failed to start child: OMG.ChildChain.FeeServer
childchain-samrong-0 childchain     ** (EXIT) an exception was raised:
childchain-samrong-0 childchain         ** (MatchError) no match of right hand side value: {:error, %Jason.DecodeError{data: "[\n  {\n    \"token\": \"0x0000000000000000000000000000000000000000\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x070fb0a42f61df2db440f15cc75becb97cad9c26\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x4df0dc27347671b55d44474a8eef094fcc7e9c4f\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x874ad6217760bb782405a77caf71a4c101d6c98c\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x5d9a6710ee14e9d03dad2ff4edbd78c5e321222a\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xca26d5b5204d37d4f029ddb5b2e93b3ecc717115\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x540b98b9a36ddcbb44b8f31b332ea9a18fe9384e\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xa50c1d6b29f3cf2fa89eac80c75b8d18bdadb59b\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x8cb5420899d1e09488073bc67bc1304d4723e513\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x967e2d6380f932e96810af5d249b9f47e5e1d2ca\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x577b19eadddd3c97cf5255f75dd0c46ae900f6b5\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x09c74fd39870d8c44a0f6c704b910698a6e74586\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xf073c03e76b6d09dde5fb5c8e4ba04b0baf2ee3a\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x3ad5c33ec6a5fd01e48a94cf97e93fbb45880111\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x88412a45e732c3324ba1eaa5ba28f645b3c08573\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xe899666b037d8beb4ec8b2c691a6636fda7f23db\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x5bd2bd8679ae8bc3482f000752cbf8c553543086\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xc719aeb9cb6f153f45010ba8432073c3d5ad8e0e\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xc931d92e9f845f280a5d61fe9151271a7c4021c3\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x7392e123cce27d398b0da836b3fe42a533e6428c\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xeec84f9fa87122c8f4beba10778b003473055626\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x564f8b221d064b6b932ccff846b36b5f0696391f\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x81c6806a9ce15ba763bd9f28aae51837b8a64fd8\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x6330b9fab1e104ec60e77035ad548bb22f349fe6\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x2f106f542ffe439a68a9e2602f933919b8d61e14\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x2902185c4bc0ec38d91d66e1a7d3e027db3493ac\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xb6c158f3c7f3a23e94a102ab8e01085ce0ff8115\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x33d77d217b892e40a0f4d136c8cfb51c615ad800\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x6bec5ba1d70504264093ab9fe7783cae817610c2\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xa68be925cac33736b5c7429f55a728b00dd4141b\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x2f53eea42769cf3f33289fb45d7308de9dcde9d1\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xdc8b8b12e42999981476b7c9ee39ef9fcef71dc3\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xfecbb01dffa5a27bbe572d6bcf80d8bec720f77f\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x0580330f6adea34b1ecf71868085825bd74b3eca\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x248d93c8528a6850b7ca784f4570a1db82025d61\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x6137f4dfa800d790c878f7b5601f60bd2d72c35e\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x1eaec783936bb5897d39a1c76009b601ee260ac9\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xf75aa12043aa80a89a0da31103a7de7ea305b4be\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x3d7a69b5a8557dc5865acfaaeae3252426f15378\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xc27d9a7f1ded0fffa1029cd1d0735d6da6be3a95\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x6d790c833b9a105496c217e2c4e5cd0437cff338\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x5c214e1346b5cf83c1d880cd5409fbe5a99f92bf\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xa54589d9b199a71c8e52afb187cee622f50214ea\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xa0925de387d9124179ead8ffa3c2dd155b1d02d2\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x0c17552716d3d76e73f409beeb01b33dd78ee399\",\n    \"flat_fee\": 0\n  },\n   {\n    \"token\": \"0xb1ef4c58e363b1ee40a05d7767f109875a6d32e8\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x3e32ccc141bdc14285f3020805744f5fba31226c\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xd113580d465972a2977306cfe340191" <> ..., position: 4991, token: nil}}
childchain-samrong-0 childchain             (omg) lib/omg/fees.ex:68: OMG.Fees.parse_file_content/1
childchain-samrong-0 childchain             (omg_child_chain) lib/omg_child_chain/fee_server.ex:69: OMG.ChildChain.FeeServer.update_fee_spec/0
childchain-samrong-0 childchain             (omg_child_chain) lib/omg_child_chain/fee_server.ex:43: OMG.ChildChain.FeeServer.init/1
childchain-samrong-0 childchain             (stdlib) gen_server.erl:374: :gen_server.init_it/2
childchain-samrong-0 childchain             (stdlib) gen_server.erl:342: :gen_server.init_it/6
childchain-samrong-0 childchain             (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3⋅
childchain-samrong-0 childchain 2019-06-28 06:58:27.985 [info] module=application_controller function=info_exited/3 ⋅Application omg exited: :stopped⋅
childchain-samrong-0 childchain 2019-06-28 06:58:27.986 [info] module=application_controller function=info_exited/3 ⋅Application merkle_tree exited: :stopped⋅
childchain-samrong-0 childchain 2019-06-28 06:58:27.986 [info] module=application_controller function=info_exited/3 ⋅Application omg_eth exited: :stopped⋅
childchain-samrong-0 childchain 2019-06-28 06:58:27.987 [info] module=application_controller function=info_exited/3 ⋅Application ethereumex exited: :stopped⋅
childchain-samrong-0 childchain 2019-06-28 06:58:27.987 [info] module=application_controller function=info_exited/3 ⋅Application poolboy exited: :stopped⋅
childchain-samrong-0 childchain 2019-06-28 06:58:27.987 [info] module=application_controller function=info_exited/3 ⋅Application ex_abi exited: :stopped⋅
childchain-samrong-0 childchain 2019-06-28 06:58:27.987 [info] module=application_controller function=info_exited/3 ⋅Application exth_crypto exited: :stopped⋅
childchain-samrong-0 childchain 2019-06-28 06:58:27.987 [info] module=application_controller function=info_exited/3 ⋅Application keccakf1600 exited: :stopped⋅
childchain-samrong-0 childchain 2019-06-28 06:58:27.988 [info] module=application_controller function=info_exited/3 ⋅Application binary exited: :stopped⋅
childchain-samrong-0 childchain 2019-06-28 06:58:27.988 [info] module=application_controller function=info_exited/3 ⋅Application libsecp256k1 exited: :stopped⋅
childchain-samrong-0 childchain 2019-06-28 06:58:27.993 [info] module=application_controller function=info_exited/3 ⋅Application omg_db exited: :stopped⋅
childchain-samrong-0 childchain 2019-06-28 06:58:27.994 [info] module=application_controller function=info_exited/3 ⋅Application exleveldb exited: :stopped⋅
childchain-samrong-0 childchain 2019-06-28 06:58:27.994 [info] module=application_controller function=info_exited/3 ⋅Application eleveldb exited: :stopped⋅
childchain-samrong-0 childchain 2019-06-28 06:58:27.994 [info] module=application_controller function=info_exited/3 ⋅Application rocksdb exited: :stopped⋅
childchain-samrong-0 childchain 2019-06-28 06:58:27.994 [info] module=application_controller function=info_exited/3 ⋅Application ex_rlp exited: :stopped⋅
childchain-samrong-0 childchain ** (MatchError) no match of right hand side value: {:error, {:omg_child_chain, {{:shutdown, {:failed_to_start_child, OMG.ChildChain.FeeServer, {{:badmatch, {:error, %Jason.DecodeError{data: "[\n  {\n    \"token\": \"0x0000000000000000000000000000000000000000\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x070fb0a42f61df2db440f15cc75becb97cad9c26\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x4df0dc27347671b55d44474a8eef094fcc7e9c4f\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x874ad6217760bb782405a77caf71a4c101d6c98c\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x5d9a6710ee14e9d03dad2ff4edbd78c5e321222a\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xca26d5b5204d37d4f029ddb5b2e93b3ecc717115\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x540b98b9a36ddcbb44b8f31b332ea9a18fe9384e\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xa50c1d6b29f3cf2fa89eac80c75b8d18bdadb59b\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x8cb5420899d1e09488073bc67bc1304d4723e513\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x967e2d6380f932e96810af5d249b9f47e5e1d2ca\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x577b19eadddd3c97cf5255f75dd0c46ae900f6b5\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x09c74fd39870d8c44a0f6c704b910698a6e74586\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xf073c03e76b6d09dde5fb5c8e4ba04b0baf2ee3a\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x3ad5c33ec6a5fd01e48a94cf97e93fbb45880111\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x88412a45e732c3324ba1eaa5ba28f645b3c08573\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xe899666b037d8beb4ec8b2c691a6636fda7f23db\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x5bd2bd8679ae8bc3482f000752cbf8c553543086\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xc719aeb9cb6f153f45010ba8432073c3d5ad8e0e\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xc931d92e9f845f280a5d61fe9151271a7c4021c3\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x7392e123cce27d398b0da836b3fe42a533e6428c\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xeec84f9fa87122c8f4beba10778b003473055626\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x564f8b221d064b6b932ccff846b36b5f0696391f\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x81c6806a9ce15ba763bd9f28aae51837b8a64fd8\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x6330b9fab1e104ec60e77035ad548bb22f349fe6\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x2f106f542ffe439a68a9e2602f933919b8d61e14\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x2902185c4bc0ec38d91d66e1a7d3e027db3493ac\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xb6c158f3c7f3a23e94a102ab8e01085ce0ff8115\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x33d77d217b892e40a0f4d136c8cfb51c615ad800\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x6bec5ba1d70504264093ab9fe7783cae817610c2\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xa68be925cac33736b5c7429f55a728b00dd4141b\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x2f53eea42769cf3f33289fb45d7308de9dcde9d1\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xdc8b8b12e42999981476b7c9ee39ef9fcef71dc3\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xfecbb01dffa5a27bbe572d6bcf80d8bec720f77f\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x0580330f6adea34b1ecf71868085825bd74b3eca\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x248d93c8528a6850b7ca784f4570a1db82025d61\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x6137f4dfa800d790c878f7b5601f60bd2d72c35e\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x1eaec783936bb5897d39a1c76009b601ee260ac9\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xf75aa12043aa80a89a0da31103a7de7ea305b4be\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x3d7a69b5a8557dc5865acfaaeae3252426f15378\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xc27d9a7f1ded0fffa1029cd1d0735d6da6be3a95\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x6d790c833b9a105496c217e2c4e5cd0437cff338\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x5c214e1346b5cf83c1d880cd5409fbe5a99f92bf\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xa54589d9b199a71c8e52afb187cee622f50214ea\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xa0925de387d9124179ead8ffa3c2dd155b1d02d2\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x0c17552716d3d76e73f409beeb01b33dd78ee399\",\n    \"flat_fee\": 0\n  },\n   {\n    \"token\": \"0xb1ef4c58e363b1ee40a05d7767f109875a6d32e8\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0x3e32ccc141bdc14285f3020805744f5fba31226c\",\n    \"flat_fee\": 0\n  },\n  {\n    \"token\": \"0xd113580d465972a2977306cfe340191" <> ..., position: 4991, token: nil}}}, [{OMG.Fees, :parse_file_content, 1, [file: 'lib/omg/fees.ex', line: 68]}, {OMG.ChildChain.FeeServer, :update_fee_spec, 0, [file: 'lib/omg_child_chain/fee_server.ex', line: 69]}, {OMG.ChildChain.FeeServer, :init, 1, [file: 'lib/omg_child_chain/fee_server.ex', line: 43]}, {:gen_server, :init_it, 2, [file: 'gen_server.erl', line: 374]}, {:gen_server, :init_it, 6, [file: 'gen_server.erl', line: 342]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 249]}]}}}, {OMG.ChildChain.Application, :start, [:normal, []]}}}}
childchain-samrong-0 childchain     lib/utils.ex:28: anonymous fn/1 in XomgTasks.Utils.generic_run/2
childchain-samrong-0 childchain     (elixir) lib/enum.ex:769: Enum."-each/2-lists^foreach/1-0-"/2
childchain-samrong-0 childchain     (elixir) lib/enum.ex:769: Enum.each/2
childchain-samrong-0 childchain     lib/utils.ex:27: XomgTasks.Utils.generic_run/2
childchain-samrong-0 childchain     (mix) lib/mix/task.ex:331: Mix.Task.run_task/3
childchain-samrong-0 childchain     (mix) lib/mix/cli.ex:79: Mix.CLI.run_task/2
childchain-samrong-0 childchain [os_mon] cpu supervisor port (cpu_sup): Erlang has closed
childchain-samrong-0 childchain [os_mon] memory supervisor port (memsup): Erlang has closed
pdobacz commented 5 years ago

:+1: At first I thought that's good to fail loud and early, but then realized we're only warning on other errors in the json file, so we can sweep json encoding errors under the same handler there, around the line mentioned in the upper stacktrace.

InoMurko commented 5 years ago

Hmmm... the json is falsely encoded. What else should have happened?

pdobacz commented 5 years ago

@InoMurko see my comment, we're more forgiving when json is correct but something inside is not. I think extending that forgivingness to the case of bad json makes sense. If not, then for consistency, we'd probably like to crash also on these other types of errors.

InoMurko commented 5 years ago

It might be better to limit ourselves to handling correct inputs and throw a fit otherwise. It quickly gets exponential trying to handle everything.

pdobacz commented 5 years ago

hm, crashing on a typo in the fee specs file sounds a bit severe. Also, note that in case of a warning-only-inducing-error, the old fee specs are in effect.

Normally I'd opt for crashing on any erroroneous input/config from the operator's part. But now, as we're after the HA, I'd opt for letting it run + old fees + warnings (alert maybe, in the future?)

pnowosie commented 5 years ago

I'm ready to start on it, let's summarize what will be done here.

Operator has an option to switch off fee checker entirely with config :omg_child_chain, :ignore_fees. When this isn't the case, fee checker needs to deal with possible file format errors or input errors.

Fee checker periodically checks for fee file updates, whenever any previous file was loaded, if last version has issues it will:

InoMurko commented 5 years ago

My opinion is, that until we don't have a very good alarming and reporting system in place we shouldn't continue working if fees file is corrupt.

Or let's say it otherwise: if the fee file is corrupt at boot - die immediately. If the file is changed on run time and it's corrupt, continue working but alarm.

pdobacz commented 5 years ago

if last version has issues it will:

... or will ignore the fees otherwise

The alternative is "or will work off of an empty fee specs", i.e. not allow any tx through at all.

I think what you propose is better after all - it feels it is slightly better to run the child chain with no fees than to halt txs altogether, at least in current circumstances.

What could be added is an alarm being fired when the Fee checker encounters issues.

My opinion is, that until we don't have a very good alarming and reporting system in place we shouldn't continue working if fees file is corrupt.

considering that when the fee file is corrupt, the old one is in effect. The change from old to new is most likely adding a new token or altering the fee, not fixing a critical issue mandating dying.

I still opt to continue working.

EDIT: I've just noticed your comment update :joy:

Or let's say it otherwise: if the fee file is corrupt at boot - die immediately. If the file is changed on run time and it's corrupt, continue working but alarm.

this is very good actually, let's do this!