From b9b87ba51f3fea83028eff1ce3d05a87f2dbe8ab Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Fri, 11 Dec 2020 11:08:39 +0300 Subject: [PATCH] Master v2 (new events) (#1799) * add new events * remove eip normalizer * move eip55 logic to elixir-omg * remove enriching * completely remove call_data * remove eip55 from mix.lock * update snapshots * Update apps/omg_watcher_info/lib/omg_watcher_info/db/eth_event.ex Co-authored-by: Ino Murko * fix typespec Co-authored-by: Ino Murko --- .circleci/config.yml | 25 +++++++-- Makefile | 23 ++++---- apps/omg/lib/omg/state/core.ex | 8 +-- apps/omg/lib/omg/typed_data_hash/config.ex | 4 +- apps/omg/test/omg/state/core_test.exs | 6 +- .../test/omg/state/transaction/fee_test.exs | 1 - .../support/integration/deposit_helper.ex | 2 +- .../merkle_proof_property_test.exs | 2 +- .../conformance/merkle_proof_test.exs | 2 +- .../conformance/signatures_hashes_case.ex | 2 +- apps/omg_eth/lib/eth.ex | 6 +- apps/omg_eth/lib/omg_eth/encoding.ex | 4 +- .../lib/omg_eth/release_tasks/set_contract.ex | 23 +++++++- .../release_tasks/set_contract/eip55.ex | 48 ++++++++++++++++ apps/omg_eth/lib/omg_eth/root_chain.ex | 6 +- .../omg_eth/root_chain/abi_event_selector.ex | 38 +++++++++---- apps/omg_eth/lib/omg_eth/root_chain/event.ex | 20 ++++--- apps/omg_eth/lib/omg_eth/root_chain/fields.ex | 14 ++++- apps/omg_eth/lib/omg_eth/root_chain/rpc.ex | 9 --- apps/omg_eth/test/fixtures.exs | 2 +- apps/omg_eth/test/omg_eth/eth_test.exs | 2 +- .../release_tasks/set_contract_test.exs | 43 +++++++++------ .../test/omg_eth/root_chain/abi_test.exs | 52 +++++++++++------- .../test/omg_eth/root_chain/event_test.exs | 4 +- apps/omg_eth/test/omg_eth/root_chain_test.exs | 2 +- .../omg_eth/test/support/root_chain_helper.ex | 36 ++++++------ .../lib/omg_utils/http_rpc/encoding.ex | 2 +- .../omg_watcher/ethereum_event_aggregator.ex | 25 +-------- .../lib/omg_watcher/exit_processor.ex | 6 +- .../exit_processor/competitor_info.ex | 2 +- .../omg_watcher/exit_processor/exit_info.ex | 4 +- .../exit_processor/in_flight_exit_info.ex | 10 ++-- .../lib/omg_watcher/exit_processor/tools.ex | 8 +-- .../lib/omg_watcher/sync_supervisor.ex | 28 +++++----- .../ethereum_event_aggregator_test.exs | 55 +++++-------------- .../exit_processor/persistence_test.exs | 14 ++--- .../omg_watcher/exit_processor/tools_test.exs | 20 +++---- .../integration/block_getter_test.exs | 4 +- .../support/exit_processor/test_helper.ex | 22 +++----- .../test/support/integration/fixtures.exs | 2 +- .../lib/omg_watcher_info/db/eth_event.ex | 51 ++++++++++------- .../omg_watcher_info/db/eth_event_test.exs | 16 +++--- .../omg_watcher_info/exit_consumer_test.exs | 19 ++++--- priv/cabbage | 2 +- priv/perf/mix.lock | 37 +++++++------ snapshots.env | 11 ++-- 46 files changed, 403 insertions(+), 319 deletions(-) create mode 100644 apps/omg_eth/lib/omg_eth/release_tasks/set_contract/eip55.ex diff --git a/.circleci/config.yml b/.circleci/config.yml index 88785fdf4b..330deda117 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -80,6 +80,19 @@ commands: steps: # otherwise docker compose down errors with ERROR: Couldn't find env file - run: touch localchain_contract_addresses.env + - restore_cache: + key: v2-asdf-install + - run: + name: Install Erlang and Elixir + command: | + [ -d ~/.asdf-vm ] || git clone https://github.com/asdf-vm/asdf.git ~/.asdf-vm --branch v0.8.0 + echo 'source ~/.asdf-vm/asdf.sh' >> $BASH_ENV + source $BASH_ENV + asdf plugin-add erlang || asdf plugin-update erlang + asdf plugin-add elixir || asdf plugin-update elixir + asdf install + no_output_timeout: 2400 + - run: make install-hex-rebar - run: docker-compose down - run: sudo rm -rf data/ - run: @@ -605,6 +618,7 @@ jobs: parallelism: 4 steps: - checkout + - install_elixir - run: name: "Pull Submodules" command: | @@ -620,14 +634,13 @@ jobs: name: Start daemon services command: | make init_test - cp ./localchain_contract_addresses.env ./priv/cabbage/apps/itest/localchain_contract_addresses.env + cp ./localchain_contract_addresses.env ./priv/cabbage/localchain_contract_addresses.env docker-compose -f docker-compose.yml -f docker-compose.feefeed.yml -f docker-compose.specs.yml up -d || (START_RESULT=$?; docker-compose logs; exit $START_RESULT;) - run: name: Log daemon services command: make cabbage-logs background: true - check_docker_status - - install_elixir - run: sh .circleci/status.sh - run: name: Run specs @@ -650,6 +663,7 @@ jobs: STATIX_TAG: "env:perf_circleci" steps: - checkout + - install_elixir - run: name: Setup data dir command: | @@ -659,7 +673,6 @@ jobs: - run: name: Build perf docker image command: make docker-perf IMAGE_NAME=$PERF_IMAGE_NAME - - install_elixir - run: name: Start daemon services command: | @@ -717,6 +730,7 @@ jobs: REORG: true steps: - checkout + - install_elixir - run: name: "Pull Submodules" command: | @@ -734,14 +748,13 @@ jobs: name: Start daemon services command: | make init_test_reorg - cp ./localchain_contract_addresses.env ./priv/cabbage/apps/itest/localchain_contract_addresses.env + cp ./localchain_contract_addresses.env ./priv/cabbage/localchain_contract_addresses.env docker-compose -f docker-compose.yml -f docker-compose.feefeed.yml -f docker-compose.reorg.yml -f docker-compose.specs.yml up -d || (START_RESULT=$?; docker-compose logs; exit $START_RESULT;) - run: name: Log daemon services command: make cabbage-logs-reorg background: true - check_docker_status - - install_elixir - run: sh .circleci/status.sh - run: name: Print watcher logs @@ -780,6 +793,7 @@ jobs: TERM: xterm-256color steps: - checkout + - install_elixir - run: name: "Pull Submodules" command: | @@ -792,7 +806,6 @@ jobs: command: make start-services background: true - run: echo 'export PATH=~/.cargo/bin:$PATH' >> $BASH_ENV - - install_elixir - install_deps - run: make install-hex-rebar - restore_cache: diff --git a/Makefile b/Makefile index 425cb6aa93..cbdeaddfac 100644 --- a/Makefile +++ b/Makefile @@ -190,19 +190,20 @@ init-contracts: clean-contracts cd data && \ tar --strip-components 1 -zxvf snapshot.tar.gz data/geth && \ tar --exclude=data/* -xvzf snapshot.tar.gz && \ - AUTHORITY_ADDRESS=$$(cat plasma-contracts/build/authority_address) && \ - ETH_VAULT=$$(cat plasma-contracts/build/eth_vault) && \ - ERC20_VAULT=$$(cat plasma-contracts/build/erc20_vault) && \ - PAYMENT_EXIT_GAME=$$(cat plasma-contracts/build/payment_exit_game) && \ - PLASMA_FRAMEWORK_TX_HASH=$$(cat plasma-contracts/build/plasma_framework_tx_hash) && \ - PLASMA_FRAMEWORK=$$(cat plasma-contracts/build/plasma_framework) && \ - PAYMENT_EIP712_LIBMOCK=$$(cat plasma-contracts/build/paymentEip712LibMock) && \ - MERKLE_WRAPPER=$$(cat plasma-contracts/build/merkleWrapper) && \ - ERC20_MINTABLE=$$(cat plasma-contracts/build/erc20Mintable) && \ - sh ../bin/generate-localchain-env AUTHORITY_ADDRESS=$$AUTHORITY_ADDRESS ETH_VAULT=$$ETH_VAULT \ + AUTHORITY_ADDRESS=$$(cat plasma-contracts/build/authority_address) \ + ETH_VAULT=$$(cat plasma-contracts/build/eth_vault) \ + ERC20_VAULT=$$(cat plasma-contracts/build/erc20_vault) \ + PAYMENT_EXIT_GAME=$$(cat plasma-contracts/build/payment_exit_game) \ + PLASMA_FRAMEWORK_TX_HASH=$$(cat plasma-contracts/build/plasma_framework_tx_hash) \ + PLASMA_FRAMEWORK=$$(cat plasma-contracts/build/plasma_framework) \ + PAYMENT_EIP712_LIBMOCK=$$(cat plasma-contracts/build/paymentEip712LibMock) \ + MERKLE_WRAPPER=$$(cat plasma-contracts/build/merkleWrapper) \ + ERC20_MINTABLE=$$(cat plasma-contracts/build/erc20Mintable) \ ERC20_VAULT=$$ERC20_VAULT PAYMENT_EXIT_GAME=$$PAYMENT_EXIT_GAME \ PLASMA_FRAMEWORK_TX_HASH=$$PLASMA_FRAMEWORK_TX_HASH PLASMA_FRAMEWORK=$$PLASMA_FRAMEWORK \ - PAYMENT_EIP712_LIBMOCK=$$PAYMENT_EIP712_LIBMOCK MERKLE_WRAPPER=$$MERKLE_WRAPPER ERC20_MINTABLE=$$ERC20_MINTABLE + PAYMENT_EIP712_LIBMOCK=$$PAYMENT_EIP712_LIBMOCK MERKLE_WRAPPER=$$MERKLE_WRAPPER ERC20_MINTABLE=$$ERC20_MINTABLE \ + sh ../bin/generate-localchain-env + init-contracts-reorg: clean-contracts mkdir data1/ || true && \ diff --git a/apps/omg/lib/omg/state/core.ex b/apps/omg/lib/omg/state/core.ex index ad6d169add..48fca22358 100644 --- a/apps/omg/lib/omg/state/core.ex +++ b/apps/omg/lib/omg/state/core.ex @@ -291,20 +291,16 @@ defmodule OMG.State.Core do def extract_exiting_utxo_positions([%{utxo_pos: _} | _] = utxo_position_events, state), do: utxo_position_events |> Enum.map(& &1.utxo_pos) |> extract_exiting_utxo_positions(state) - # list of full exit events (from ethereum listeners) - def extract_exiting_utxo_positions([%{call_data: %{utxo_pos: _}} | _] = utxo_position_events, state), - do: utxo_position_events |> Enum.map(& &1.call_data) |> extract_exiting_utxo_positions(state) - # list of utxo positions (encoded) def extract_exiting_utxo_positions([encoded_utxo_pos | _] = encoded_utxo_positions, %Core{}) when is_integer(encoded_utxo_pos), do: Enum.map(encoded_utxo_positions, &Utxo.Position.decode!/1) # list of IFE input/output piggybacked events - def extract_exiting_utxo_positions([%{call_data: %{in_flight_tx: _}} | _] = start_ife_events, %Core{}) do + def extract_exiting_utxo_positions([%{in_flight_tx: _} | _] = start_ife_events, %Core{}) do _ = Logger.info("Recognized exits from IFE starts #{inspect(start_ife_events)}") - Enum.flat_map(start_ife_events, fn %{call_data: %{in_flight_tx: tx_bytes}} -> + Enum.flat_map(start_ife_events, fn %{in_flight_tx: tx_bytes} -> {:ok, tx} = Transaction.decode(tx_bytes) Transaction.get_inputs(tx) end) diff --git a/apps/omg/lib/omg/typed_data_hash/config.ex b/apps/omg/lib/omg/typed_data_hash/config.ex index 80da07a661..bc3037dfdc 100644 --- a/apps/omg/lib/omg/typed_data_hash/config.ex +++ b/apps/omg/lib/omg/typed_data_hash/config.ex @@ -29,7 +29,9 @@ defmodule OMG.TypedDataHash.Config do @spec domain_data_from_config() :: Tools.eip712_domain_t() def domain_data_from_config() do verifying_contract_addr = - Application.get_env(:omg_eth, :contract_addr) |> Access.get(:plasma_framework) |> Encoding.from_hex() + Application.get_env(:omg_eth, :contract_addr) + |> Access.get(:plasma_framework) + |> Encoding.from_hex(:mixed) Application.fetch_env!(:omg, :eip_712_domain) |> Map.new() diff --git a/apps/omg/test/omg/state/core_test.exs b/apps/omg/test/omg/state/core_test.exs index a3ba5cecb4..68bc83077a 100644 --- a/apps/omg/test/omg/state/core_test.exs +++ b/apps/omg/test/omg/state/core_test.exs @@ -615,7 +615,7 @@ defmodule OMG.State.CoreTest do assert utxo_pos_exits == utxo_pos_exits - |> Enum.map(&%{call_data: %{utxo_pos: Utxo.Position.encode(&1)}}) + |> Enum.map(&%{utxo_pos: Utxo.Position.encode(&1)}) |> Core.extract_exiting_utxo_positions(state_empty) assert utxo_pos_exits == @@ -695,7 +695,7 @@ defmodule OMG.State.CoreTest do state = state |> Core.exec(tx, @fee) |> success? - utxo_pos_exits_in_flight = [%{call_data: %{in_flight_tx: Transaction.raw_txbytes(tx)}}] + utxo_pos_exits_in_flight = [%{in_flight_tx: Transaction.raw_txbytes(tx)}] utxo_pos_exits_piggyback = [ %{tx_hash: Transaction.raw_txhash(tx), output_index: 0, omg_data: %{piggyback_type: :output}} @@ -731,7 +731,7 @@ defmodule OMG.State.CoreTest do tx = create_recovered([{@blknum1, 0, 0, alice}], @eth, [{alice, 2}, {alice, 3}]) - utxo_pos_exits_in_flight = [%{call_data: %{in_flight_tx: Transaction.raw_txbytes(tx)}}] + utxo_pos_exits_in_flight = [%{in_flight_tx: Transaction.raw_txbytes(tx)}] expected_position = Utxo.position(@blknum1, 0, 0) exiting_utxos = Core.extract_exiting_utxo_positions(utxo_pos_exits_in_flight, state) diff --git a/apps/omg/test/omg/state/transaction/fee_test.exs b/apps/omg/test/omg/state/transaction/fee_test.exs index cfea93720e..41754b1cfc 100644 --- a/apps/omg/test/omg/state/transaction/fee_test.exs +++ b/apps/omg/test/omg/state/transaction/fee_test.exs @@ -18,7 +18,6 @@ defmodule OMG.State.Transaction.FeeTest do use ExUnitFixtures use ExUnit.Case, async: true - alias OMG.Output alias OMG.State.Transaction @eth OMG.Eth.zero_address() diff --git a/apps/omg/test/support/integration/deposit_helper.ex b/apps/omg/test/support/integration/deposit_helper.ex index 3b362d835a..26d31f34f4 100644 --- a/apps/omg/test/support/integration/deposit_helper.ex +++ b/apps/omg/test/support/integration/deposit_helper.ex @@ -39,7 +39,7 @@ defmodule Support.Integration.DepositHelper do end def deposit_to_child_chain(to, value, token_addr) when is_binary(token_addr) and byte_size(token_addr) == 20 do - contract_addr = Encoding.from_hex(Configuration.contracts().erc20_vault) + contract_addr = Encoding.from_hex(Configuration.contracts().erc20_vault, :mixed) {:ok, _} = Eth.Token.approve(to, contract_addr, value, token_addr) |> DevHelper.transact_sync!() diff --git a/apps/omg_conformance/test/omg_conformance/conformance/merkle_proof_property_test.exs b/apps/omg_conformance/test/omg_conformance/conformance/merkle_proof_property_test.exs index 5585671389..fee51e32cf 100644 --- a/apps/omg_conformance/test/omg_conformance/conformance/merkle_proof_property_test.exs +++ b/apps/omg_conformance/test/omg_conformance/conformance/merkle_proof_property_test.exs @@ -38,7 +38,7 @@ defmodule OMG.Conformance.MerkleProofPropertyTest do on_exit(exit_fn) - [contract: OMG.Eth.Encoding.from_hex(merkle_wrapper_address_hex)] + [contract: OMG.Eth.Encoding.from_hex(merkle_wrapper_address_hex, :mixed)] end property "any root hash and proof created by the Elixir implementation validates in the contract, for all leaves", diff --git a/apps/omg_conformance/test/omg_conformance/conformance/merkle_proof_test.exs b/apps/omg_conformance/test/omg_conformance/conformance/merkle_proof_test.exs index d6e2433f8f..74992dd778 100644 --- a/apps/omg_conformance/test/omg_conformance/conformance/merkle_proof_test.exs +++ b/apps/omg_conformance/test/omg_conformance/conformance/merkle_proof_test.exs @@ -39,7 +39,7 @@ defmodule OMG.Conformance.MerkleProofTest do on_exit(exit_fn) - [contract: OMG.Eth.Encoding.from_hex(merkle_wrapper_address_hex)] + [contract: OMG.Eth.Encoding.from_hex(merkle_wrapper_address_hex, :mixed)] end test "a simple, 3-leaf merkle proof validates fine", %{contract: contract} do diff --git a/apps/omg_conformance/test/support/conformance/signatures_hashes_case.ex b/apps/omg_conformance/test/support/conformance/signatures_hashes_case.ex index 104a86c1df..548a9ee999 100644 --- a/apps/omg_conformance/test/support/conformance/signatures_hashes_case.ex +++ b/apps/omg_conformance/test/support/conformance/signatures_hashes_case.ex @@ -44,6 +44,6 @@ defmodule Support.Conformance.SignaturesHashesCase do exit_fn.() end) - [contract: OMG.Eth.Encoding.from_hex(signtest_addr_hex)] + [contract: OMG.Eth.Encoding.from_hex(signtest_addr_hex, :mixed)] end end diff --git a/apps/omg_eth/lib/eth.ex b/apps/omg_eth/lib/eth.ex index 2c9e87f006..d754fb0110 100644 --- a/apps/omg_eth/lib/eth.ex +++ b/apps/omg_eth/lib/eth.ex @@ -32,7 +32,7 @@ defmodule OMG.Eth do alias OMG.Eth.RootChain.SubmitBlock require Logger - import OMG.Eth.Encoding, only: [from_hex: 1, to_hex: 1, int_from_hex: 1] + import OMG.Eth.Encoding, only: [from_hex: 2, to_hex: 1, int_from_hex: 1] @type address :: <<_::160>> @type hash :: <<_::256>> @@ -58,8 +58,8 @@ defmodule OMG.Eth do @spec submit_block(binary(), pos_integer(), pos_integer()) :: {:error, binary() | atom() | map()} | {:ok, <<_::256>>} def submit_block(hash, nonce, gas_price) do - contract = from_hex(Configuration.contracts().plasma_framework) - from = from_hex(Configuration.authority_address()) + contract = from_hex(Configuration.contracts().plasma_framework, :mixed) + from = from_hex(Configuration.authority_address(), :mixed) backend = Configuration.eth_node() SubmitBlock.submit(backend, hash, nonce, gas_price, from, contract) end diff --git a/apps/omg_eth/lib/omg_eth/encoding.ex b/apps/omg_eth/lib/omg_eth/encoding.ex index 5a07c2ebcd..71b34d1e1a 100644 --- a/apps/omg_eth/lib/omg_eth/encoding.ex +++ b/apps/omg_eth/lib/omg_eth/encoding.ex @@ -39,8 +39,8 @@ defmodule OMG.Eth.Encoding do """ # because https://github.com/rrrene/credo/issues/583, we need to: # credo:disable-for-next-line Credo.Check.Consistency.SpaceAroundOperators - @spec from_hex(<<_::16, _::_*8>>) :: binary - def from_hex("0x" <> encoded), do: Base.decode16!(encoded, case: :lower) + @spec from_hex(<<_::16, _::_*8>>, atom()) :: binary + def from_hex("0x" <> encoded, format \\ :lower), do: Base.decode16!(encoded, case: format) @doc """ Decodes to an integer, see `to_hex` diff --git a/apps/omg_eth/lib/omg_eth/release_tasks/set_contract.ex b/apps/omg_eth/lib/omg_eth/release_tasks/set_contract.ex index 62d497f0f5..4ef2b5b1d8 100644 --- a/apps/omg_eth/lib/omg_eth/release_tasks/set_contract.ex +++ b/apps/omg_eth/lib/omg_eth/release_tasks/set_contract.ex @@ -18,6 +18,7 @@ defmodule OMG.Eth.ReleaseTasks.SetContract do require Logger alias OMG.Eth.Encoding + alias OMG.Eth.ReleaseTasks.SetContract.EIP55 alias OMG.Eth.RootChain.Abi alias OMG.Eth.RootChain.Rpc @@ -120,12 +121,18 @@ defmodule OMG.Eth.ReleaseTasks.SetContract do when is_binary(txhash_contract) and is_binary(authority_address) and is_map(contract_addresses) and is_integer(min_exit_period_seconds) and is_binary(contract_semver) and is_binary(network) do - contract_addresses = Enum.into(contract_addresses, %{}, fn {name, addr} -> {name, String.downcase(addr)} end) + contract_addresses = + Enum.into(contract_addresses, %{}, fn {name, addr} -> + value = encode_eip55(addr) + {name, value} + end) + + authority_address_formatted = encode_eip55(authority_address) Config.Reader.merge(config, omg_eth: [ - txhash_contract: String.downcase(txhash_contract), - authority_address: String.downcase(authority_address), + txhash_contract: txhash_contract, + authority_address: authority_address_formatted, contract_addr: contract_addresses, min_exit_period_seconds: min_exit_period_seconds, contract_semver: contract_semver, @@ -210,4 +217,14 @@ defmodule OMG.Eth.ReleaseTasks.SetContract do {:ok, _} = Application.ensure_all_started(:logger) {:ok, _} = Application.ensure_all_started(:ethereumex) end + + defp encode_eip55(value) do + case value do + "" -> + "" + + other -> + EIP55.encode!(other) + end + end end diff --git a/apps/omg_eth/lib/omg_eth/release_tasks/set_contract/eip55.ex b/apps/omg_eth/lib/omg_eth/release_tasks/set_contract/eip55.ex new file mode 100644 index 0000000000..aa83ebbba6 --- /dev/null +++ b/apps/omg_eth/lib/omg_eth/release_tasks/set_contract/eip55.ex @@ -0,0 +1,48 @@ +defmodule OMG.Eth.ReleaseTasks.SetContract.EIP55 do + @moduledoc """ + Implements EIP 55 + """ + + @spec encode!(String.t() | binary()) :: String.t() + def encode!("0x" <> address) when byte_size(address) == 40 do + address = String.downcase(address) + + hash = + address + |> :keccakf1600.sha3_256() + |> Base.encode16(case: :lower) + |> String.graphemes() + + encoded = + address + |> String.graphemes() + |> Enum.zip(hash) + |> Enum.map_join(fn + {"0", _} -> "0" + {"1", _} -> "1" + {"2", _} -> "2" + {"3", _} -> "3" + {"4", _} -> "4" + {"5", _} -> "5" + {"6", _} -> "6" + {"7", _} -> "7" + {"8", _} -> "8" + {"9", _} -> "9" + {c, "8"} -> String.upcase(c) + {c, "9"} -> String.upcase(c) + {c, "a"} -> String.upcase(c) + {c, "b"} -> String.upcase(c) + {c, "c"} -> String.upcase(c) + {c, "d"} -> String.upcase(c) + {c, "e"} -> String.upcase(c) + {c, "f"} -> String.upcase(c) + {c, _} -> c + end) + + "0x" <> encoded + end + + def encode!(address) when byte_size(address) == 20 do + encode!("0x" <> Base.encode16(address, case: :lower)) + end +end diff --git a/apps/omg_eth/lib/omg_eth/root_chain.ex b/apps/omg_eth/lib/omg_eth/root_chain.ex index f47928da75..af3297b59b 100644 --- a/apps/omg_eth/lib/omg_eth/root_chain.ex +++ b/apps/omg_eth/lib/omg_eth/root_chain.ex @@ -22,7 +22,7 @@ defmodule OMG.Eth.RootChain do """ require Logger - import OMG.Eth.Encoding, only: [from_hex: 1, int_from_hex: 1] + import OMG.Eth.Encoding, only: [from_hex: 2, int_from_hex: 1] alias OMG.Eth alias OMG.Eth.Configuration @@ -56,7 +56,7 @@ defmodule OMG.Eth.RootChain do Returns lists of block submissions from Ethereum logs """ def get_block_submitted_events(from_height, to_height) do - contract = from_hex(Configuration.contracts().plasma_framework) + contract = from_hex(Configuration.contracts().plasma_framework, :mixed) signature = "BlockSubmitted(uint256)" {:ok, logs} = Rpc.get_ethereum_events(from_height, to_height, signature, contract) @@ -98,7 +98,7 @@ defmodule OMG.Eth.RootChain do @spec get_root_deployment_height() :: {:ok, integer()} | Ethereumex.HttpClient.error() def get_root_deployment_height() do - plasma_framework = Configuration.contracts().plasma_framework + plasma_framework = String.downcase(Configuration.contracts().plasma_framework) txhash = Configuration.txhash_contract() case Ethereumex.HttpClient.eth_get_transaction_receipt(txhash) do diff --git a/apps/omg_eth/lib/omg_eth/root_chain/abi_event_selector.ex b/apps/omg_eth/lib/omg_eth/root_chain/abi_event_selector.ex index f0bd53190e..85c250a18b 100644 --- a/apps/omg_eth/lib/omg_eth/root_chain/abi_event_selector.ex +++ b/apps/omg_eth/lib/omg_eth/root_chain/abi_event_selector.ex @@ -23,12 +23,12 @@ defmodule OMG.Eth.RootChain.AbiEventSelector do def exit_started() do %ABI.FunctionSelector{ function: "ExitStarted", - input_names: ["owner", "exitId"], - inputs_indexed: [true, false], - method_id: <<87, 9, 33, 214>>, + input_names: ["owner", "exit_id", "utxo_pos"], + inputs_indexed: [true, false, false], + method_id: <<224, 255, 194, 231>>, returns: [], type: :event, - types: [:address, {:uint, 168}] + types: [:address, {:uint, 168}, {:uint, 256}] } end @@ -36,12 +36,18 @@ defmodule OMG.Eth.RootChain.AbiEventSelector do def in_flight_exit_started() do %ABI.FunctionSelector{ function: "InFlightExitStarted", - input_names: ["initiator", "txHash"], - inputs_indexed: [true, true], - method_id: <<213, 241, 254, 157>>, + input_names: ["initiator", "tx_hash", "in_flight_tx", "input_utxos_pos", "in_flight_tx_witnesses"], + inputs_indexed: [true, true, false, false, false], + method_id: <<37, 74, 99, 78>>, returns: [], type: :event, - types: [:address, {:bytes, 32}] + types: [ + :address, + {:bytes, 32}, + :bytes, + {:array, {:uint, 256}}, + {:array, :bytes} + ] } end @@ -62,12 +68,20 @@ defmodule OMG.Eth.RootChain.AbiEventSelector do def in_flight_exit_challenged() do %ABI.FunctionSelector{ function: "InFlightExitChallenged", - input_names: ["challenger", "txHash", "challengeTxPosition"], - inputs_indexed: [true, true, false], - method_id: <<104, 116, 1, 150>>, + input_names: [ + "challenger", + "txHash", + "challengeTxPosition", + "inFlightTxInputIndex", + "challengeTx", + "challengeTxInputIndex", + "challengeTxWitness" + ], + inputs_indexed: [true, true, false, false, false, false, false], + method_id: <<141, 128, 235, 79>>, returns: [], type: :event, - types: [:address, {:bytes, 32}, {:uint, 256}] + types: [:address, {:bytes, 32}, {:uint, 256}, {:uint, 16}, :bytes, {:uint, 16}, :bytes] } end diff --git a/apps/omg_eth/lib/omg_eth/root_chain/event.ex b/apps/omg_eth/lib/omg_eth/root_chain/event.ex index b311e27bf1..b9dda01d46 100644 --- a/apps/omg_eth/lib/omg_eth/root_chain/event.ex +++ b/apps/omg_eth/lib/omg_eth/root_chain/event.ex @@ -47,20 +47,24 @@ defmodule OMG.Eth.RootChain.Event do defp build_types_string(types), do: build_types_string(types, "") defp build_types_string([], string), do: string - defp build_types_string([{type, size} | [] = types], string) do - build_types_string(types, string <> "#{type}" <> "#{size}") + defp build_types_string([type | [] = types], string) do + build_types_string(types, string <> build_type(type)) end - defp build_types_string([{type, size} | types], string) do - build_types_string(types, string <> "#{type}" <> "#{size}" <> ",") + defp build_types_string([type | types], string) do + build_types_string(types, string <> build_type(type) <> ",") end - defp build_types_string([type | [] = types], string) do - build_types_string(types, string <> "#{type}") + defp build_type({base, number}) when is_integer(number) do + "#{base}" <> "#{number}" end - defp build_types_string([type | types], string) do - build_types_string(types, string <> "#{type}" <> ",") + defp build_type({:array, child}) do + build_type(child) <> "[]" + end + + defp build_type(type) do + to_string(type) end def get_event(events, wanted_event_name, acc) do diff --git a/apps/omg_eth/lib/omg_eth/root_chain/fields.ex b/apps/omg_eth/lib/omg_eth/root_chain/fields.ex index b6650b301c..0e65f3a50c 100644 --- a/apps/omg_eth/lib/omg_eth/root_chain/fields.ex +++ b/apps/omg_eth/lib/omg_eth/root_chain/fields.ex @@ -84,7 +84,11 @@ defmodule OMG.Eth.RootChain.Fields do contracts_naming = [ {"challenger", :challenger}, {"challengeTxPosition", :competitor_position}, - {"txHash", :tx_hash} + {"txHash", :tx_hash}, + {"inFlightTxInputIndex", :in_flight_tx_input_index}, + {"challengeTx", :challenge_tx}, + {"challengeTxInputIndex", :challenge_tx_input_index}, + {"challengeTxWitness", :challenge_tx_sig} ] reduce_naming(data, contracts_naming) @@ -141,7 +145,10 @@ defmodule OMG.Eth.RootChain.Fields do def rename(data, %ABI.FunctionSelector{function: "InFlightExitStarted"}) do contracts_naming = [ {"initiator", :initiator}, - {"txHash", :tx_hash} + {"tx_hash", :tx_hash}, + {"in_flight_tx", :in_flight_tx}, + {"input_utxos_pos", :input_utxos_pos}, + {"in_flight_tx_witnesses", :in_flight_tx_sigs} ] reduce_naming(data, contracts_naming) @@ -150,7 +157,8 @@ defmodule OMG.Eth.RootChain.Fields do def rename(data, %ABI.FunctionSelector{function: "ExitStarted"}) do contracts_naming = [ {"owner", :owner}, - {"exitId", :exit_id} + {"exit_id", :exit_id}, + {"utxo_pos", :utxo_pos} ] reduce_naming(data, contracts_naming) diff --git a/apps/omg_eth/lib/omg_eth/root_chain/rpc.ex b/apps/omg_eth/lib/omg_eth/root_chain/rpc.ex index 027d0e3404..faa83397a4 100644 --- a/apps/omg_eth/lib/omg_eth/root_chain/rpc.ex +++ b/apps/omg_eth/lib/omg_eth/root_chain/rpc.ex @@ -57,15 +57,6 @@ defmodule OMG.Eth.RootChain.Rpc do get_ethereum_events(block_from, block_to, [signature], [contract]) end - def get_call_data(root_chain_txhash) do - {:ok, %{"input" => input}} = - root_chain_txhash - |> Encoding.to_hex() - |> Ethereumex.HttpClient.eth_get_transaction_by_hash() - - {:ok, input} - end - defp event_topic_for_signature(signature) do signature |> ExthCrypto.Hash.hash(ExthCrypto.Hash.kec()) diff --git a/apps/omg_eth/test/fixtures.exs b/apps/omg_eth/test/fixtures.exs index ed0019f39b..3a52862a5d 100644 --- a/apps/omg_eth/test/fixtures.exs +++ b/apps/omg_eth/test/fixtures.exs @@ -72,7 +72,7 @@ defmodule OMG.Eth.Fixtures do defp has_exit_queue(vault_id, token) do plasma_framework = Configuration.contracts().plasma_framework - token = Encoding.from_hex(token) + token = Encoding.from_hex(token, :mixed) call_contract(plasma_framework, "hasExitQueue(uint256,address)", [vault_id, token], [:bool]) end diff --git a/apps/omg_eth/test/omg_eth/eth_test.exs b/apps/omg_eth/test/omg_eth/eth_test.exs index 4d19b3efa9..f1fbc1da2a 100644 --- a/apps/omg_eth/test/omg_eth/eth_test.exs +++ b/apps/omg_eth/test/omg_eth/eth_test.exs @@ -43,7 +43,7 @@ defmodule OMG.EthTest do end test "submit_block/1 submits a block to the contract" do - response = Eth.submit_block(<<234::256>>, 1, 20_000_000_000) + response = Eth.submit_block(<<234::256>>, 0, 20_000_000_000) assert {:ok, _} = DevHelper.transact_sync!(response) end diff --git a/apps/omg_eth/test/omg_eth/release_tasks/set_contract_test.exs b/apps/omg_eth/test/omg_eth/release_tasks/set_contract_test.exs index 9919d7f260..ae24cde0ba 100644 --- a/apps/omg_eth/test/omg_eth/release_tasks/set_contract_test.exs +++ b/apps/omg_eth/test/omg_eth/release_tasks/set_contract_test.exs @@ -16,6 +16,7 @@ defmodule OMG.Eth.ReleaseTasks.SetContractTest do use ExUnit.Case, async: true alias OMG.Eth.ReleaseTasks.SetContract + alias OMG.Eth.ReleaseTasks.SetContract.EIP55 setup_all do plasma_framework = Support.SnapshotContracts.parse_contracts()["CONTRACT_ADDRESS_PLASMA_FRAMEWORK"] @@ -52,7 +53,7 @@ defmodule OMG.Eth.ReleaseTasks.SetContractTest do :ok = System.put_env("ETHEREUM_NETWORK", "RINKEBY") config = SetContract.load([], rpc_api: __MODULE__.Rpc) authority_address = config |> Keyword.fetch!(:omg_eth) |> Keyword.fetch!(:authority_address) - assert authority_address == "authority_address_value" + assert authority_address == "0x4e3Aeff70F022A6d4CC5947423887E7152826Cf9" plasma_framework = config |> Keyword.get(:omg_eth) |> Keyword.fetch!(:contract_addr) |> Map.get(:plasma_framework) assert plasma_framework == contract_addresses_value.plasma_framework @@ -86,13 +87,15 @@ defmodule OMG.Eth.ReleaseTasks.SetContractTest do plasma_framework: plasma_framework, contract_addresses_value: contract_addresses_value } do + authority_address = "0x4e3aeff70f022a6d4cc5947423887e7152826cf7" :ok = System.put_env("ETHEREUM_NETWORK", "rinkeby") :ok = System.put_env("TXHASH_CONTRACT", "txhash_contract_value") - :ok = System.put_env("AUTHORITY_ADDRESS", "authority_address_value") + :ok = System.put_env("AUTHORITY_ADDRESS", authority_address) :ok = System.put_env("CONTRACT_ADDRESS_PLASMA_FRAMEWORK", plasma_framework) config = SetContract.load([], rpc_api: __MODULE__.Rpc) - authority_address = config |> Keyword.fetch!(:omg_eth) |> Keyword.fetch!(:authority_address) - assert authority_address == "authority_address_value" + found_authority_address = config |> Keyword.fetch!(:omg_eth) |> Keyword.fetch!(:authority_address) + eip55_address = EIP55.encode!(authority_address) + assert found_authority_address == eip55_address plasma_framework = config |> Keyword.get(:omg_eth) |> Keyword.fetch!(:contract_addr) |> Map.get(:plasma_framework) assert plasma_framework == contract_addresses_value.plasma_framework @@ -105,34 +108,38 @@ defmodule OMG.Eth.ReleaseTasks.SetContractTest do plasma_framework: plasma_framework, contract_addresses_value: contract_addresses_value } do + authority_address = "0x4e3aeff70f022a6d4cc5947423887e7152826cf8" :ok = System.put_env("ETHEREUM_NETWORK", "rinkeby") :ok = System.put_env("TXHASH_CONTRACT", "Txhash_contract_value") - :ok = System.put_env("AUTHORITY_ADDRESS", "Authority_address_value") + :ok = System.put_env("AUTHORITY_ADDRESS", authority_address) :ok = System.put_env("CONTRACT_ADDRESS_PLASMA_FRAMEWORK", plasma_framework) config = SetContract.load([], rpc_api: __MODULE__.Rpc) - authority_address = config |> Keyword.fetch!(:omg_eth) |> Keyword.fetch!(:authority_address) - assert authority_address == "authority_address_value" + found_authority_address = config |> Keyword.fetch!(:omg_eth) |> Keyword.fetch!(:authority_address) + eip55_address = EIP55.encode!(authority_address) + assert found_authority_address == eip55_address plasma_framework = config |> Keyword.get(:omg_eth) |> Keyword.fetch!(:contract_addr) |> Map.get(:plasma_framework) assert plasma_framework == contract_addresses_value.plasma_framework txhash_contract_value = config |> Keyword.get(:omg_eth) |> Keyword.fetch!(:txhash_contract) - assert txhash_contract_value == "txhash_contract_value" + assert txhash_contract_value == "Txhash_contract_value" end test "contract details from env for localchain", %{ plasma_framework: plasma_framework, contract_addresses_value: contract_addresses_value } do + authority_address = "0x4e3aeff70f022a6d4cc5947423887e7152826cf9" :ok = System.put_env("ETHEREUM_NETWORK", "localchain") :ok = System.put_env("TXHASH_CONTRACT", "txhash_contract_value") - :ok = System.put_env("AUTHORITY_ADDRESS", "authority_address_value") + :ok = System.put_env("AUTHORITY_ADDRESS", authority_address) :ok = System.put_env("CONTRACT_ADDRESS_PLASMA_FRAMEWORK", plasma_framework) config = SetContract.load([], rpc_api: __MODULE__.Rpc) - authority_address = config |> Keyword.fetch!(:omg_eth) |> Keyword.fetch!(:authority_address) - assert authority_address == "authority_address_value" + found_authority_address = config |> Keyword.fetch!(:omg_eth) |> Keyword.fetch!(:authority_address) + eip55_address = EIP55.encode!(authority_address) + assert found_authority_address == eip55_address plasma_framework = config |> Keyword.get(:omg_eth) |> Keyword.fetch!(:contract_addr) |> Map.get(:plasma_framework) assert plasma_framework == contract_addresses_value.plasma_framework @@ -146,7 +153,7 @@ defmodule OMG.Eth.ReleaseTasks.SetContractTest do } do :ok = System.put_env("ETHEREUM_NETWORK", "rinkeby") :ok = System.put_env("TXHASH_CONTRACT", "txhash_contract_value") - :ok = System.put_env("AUTHORITY_ADDRESS", "authority_address_value") + :ok = System.put_env("AUTHORITY_ADDRESS", "0x4e3aeff70f022a6d4cc5947423887e7152826cf1") :ok = System.put_env("CONTRACT_ADDRESS_PLASMA_FRAMEWORK", plasma_framework) config = SetContract.load([], rpc_api: __MODULE__.Rpc) @@ -158,17 +165,19 @@ defmodule OMG.Eth.ReleaseTasks.SetContractTest do plasma_framework: plasma_framework, contract_addresses_value: contract_addresses_value } do + authority_address = "0x4e3aeff70f022a6d4cc5947423887e7152826cf5" :ok = System.put_env("ETHEREUM_NETWORK", "rinkeby") :ok = System.put_env("TXHASH_CONTRACT", "txhash_contract_value") - :ok = System.put_env("AUTHORITY_ADDRESS", "authority_address_value") + :ok = System.put_env("AUTHORITY_ADDRESS", authority_address) :ok = System.put_env("CONTRACT_ADDRESS_PLASMA_FRAMEWORK", plasma_framework) config = SetContract.load([], rpc_api: __MODULE__.Rpc) min_exit_period_seconds = config |> Keyword.get(:omg_eth) |> Keyword.fetch!(:min_exit_period_seconds) assert min_exit_period_seconds == 20 - authority_address = config |> Keyword.fetch!(:omg_eth) |> Keyword.fetch!(:authority_address) - assert authority_address == "authority_address_value" + found_authority_address = config |> Keyword.fetch!(:omg_eth) |> Keyword.fetch!(:authority_address) + eip55_address = EIP55.encode!(authority_address) + assert found_authority_address == eip55_address plasma_framework = config |> Keyword.get(:omg_eth) |> Keyword.fetch!(:contract_addr) |> Map.get(:plasma_framework) assert plasma_framework == contract_addresses_value.plasma_framework @@ -222,10 +231,12 @@ defmodule OMG.Eth.ReleaseTasks.SetContractTest do defp handle(conn) do plasma_framework = Support.SnapshotContracts.parse_contracts()["CONTRACT_ADDRESS_PLASMA_FRAMEWORK"] + authority_address = EIP55.encode!("0x4e3aeff70f022a6d4cc5947423887e7152826cf9") + exchanger_body = %{ plasma_framework_tx_hash: "txhash_contract_value", plasma_framework: nil, - authority_address: "authority_address_value" + authority_address: authority_address } body = exchanger_body |> Map.put(:plasma_framework, plasma_framework) |> Jason.encode!() diff --git a/apps/omg_eth/test/omg_eth/root_chain/abi_test.exs b/apps/omg_eth/test/omg_eth/root_chain/abi_test.exs index c9255dcb08..2bbeccd7a4 100644 --- a/apps/omg_eth/test/omg_eth/root_chain/abi_test.exs +++ b/apps/omg_eth/test/omg_eth/root_chain/abi_test.exs @@ -182,15 +182,16 @@ defmodule OMG.Eth.RootChain.AbiTest do test "if in flight exit challanged can be decoded" do in_flight_exit_challanged_log = %{ - :event_signature => "InFlightExitChallenged(address,bytes32,uint256)", + :event_signature => "InFlightExitChallenged(address,bytes32,uint256,uint16,bytes,uint16,bytes)", "address" => "0x92ce4d7773c57d96210c46a07b89acf725057f21", "blockHash" => "0xcfffb9645dc8d73acc4c825b67ba62924c62402cc125564b655f469e0adeef32", "blockNumber" => "0x196", - "data" => "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "data" => + "0x000000000000000000000000000000000000000000000000000000000000000b000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000003686579000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000036865790000000000000000000000000000000000000000000000000000000000", "logIndex" => "0x0", "removed" => false, "topics" => [ - "0x687401968e501bda2d2d6f880dd1a0a56ff50b1787185ee0b6f4c3fb9fc417ab", + "0x8d80eb4f245f436d007299a3a1ba7abf25588af9cdcf918b697a8b6455272d58", "0x0000000000000000000000007ae8190d9968cbb3b52e56a56b2cd4cd5e15a44f", "0x7532528ec22439a9a1ed5f4fce6cd66d71625add6202cefb970c10d04f2d5091" ], @@ -200,17 +201,20 @@ defmodule OMG.Eth.RootChain.AbiTest do assert Abi.decode_log(in_flight_exit_challanged_log) == %{ challenger: <<122, 232, 25, 13, 153, 104, 203, 179, 181, 46, 86, 165, 107, 44, 212, 205, 94, 21, 164, 79>>, - competitor_position: - 115_792_089_237_316_195_423_570_985_008_687_907_853_269_984_665_640_564_039_457_584_007_913_129_639_935, + competitor_position: 11, eth_height: 406, - event_signature: "InFlightExitChallenged(address,bytes32,uint256)", + event_signature: "InFlightExitChallenged(address,bytes32,uint256,uint16,bytes,uint16,bytes)", log_index: 0, root_chain_txhash: <<217, 227, 179, 170, 255, 129, 86, 218, 184, 176, 4, 136, 45, 59, 206, 131, 75, 168, 66, 201, 93, 239, 247, 236, 151, 218, 143, 148, 47, 135, 10, 180>>, tx_hash: <<117, 50, 82, 142, 194, 36, 57, 169, 161, 237, 95, 79, 206, 108, 214, 109, 113, 98, 90, 221, 98, 2, 206, - 251, 151, 12, 16, 208, 79, 45, 80, 145>> + 251, 151, 12, 16, 208, 79, 45, 80, 145>>, + challenge_tx: "hey", + challenge_tx_input_index: 12, + challenge_tx_sig: "hey", + in_flight_tx_input_index: 10 } end @@ -375,15 +379,16 @@ defmodule OMG.Eth.RootChain.AbiTest do test "if in flight exit started can be decoded" do in_flight_exit_started_log = %{ - :event_signature => "InFlightExitStarted(address,bytes32)", + :event_signature => "InFlightExitStarted(address,bytes32,bytes,uint256[],bytes[])", "address" => "0x92ce4d7773c57d96210c46a07b89acf725057f21", "blockHash" => "0xc8d61620144825f38394feb2c9c1d721a161ed67c123c3cb1af787fb366866c1", "blockNumber" => "0x2d6", - "data" => "0x", + "data" => + "0x000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000368657900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000b00000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000047465737400000000000000000000000000000000000000000000000000000000", "logIndex" => "0x0", "removed" => false, "topics" => [ - "0xd5f1fe9d48880b57daa227004b16d320c0eb885d6c49d472d54c16a05fa3179e", + "0x254a634e2edb606f4eb11675bef950159020723005e1c1c60a4199c68640d7c2", "0x0000000000000000000000002c6a9f42318025cd6627baf21c468201622020df", "0x4f46053b5df585094cc652ddd8c365962a3889c2053592f18331b95a7dff620e" ], @@ -393,7 +398,7 @@ defmodule OMG.Eth.RootChain.AbiTest do assert Abi.decode_log(in_flight_exit_started_log) == %{ eth_height: 726, - event_signature: "InFlightExitStarted(address,bytes32)", + event_signature: "InFlightExitStarted(address,bytes32,bytes,uint256[],bytes[])", initiator: <<44, 106, 159, 66, 49, 128, 37, 205, 102, 39, 186, 242, 28, 70, 130, 1, 98, 32, 32, 223>>, log_index: 0, root_chain_txhash: @@ -401,7 +406,10 @@ defmodule OMG.Eth.RootChain.AbiTest do 116, 18, 181, 234, 13, 252, 178, 241, 161, 51>>, tx_hash: <<79, 70, 5, 59, 93, 245, 133, 9, 76, 198, 82, 221, 216, 195, 101, 150, 42, 56, 137, 194, 5, 53, 146, - 241, 131, 49, 185, 90, 125, 255, 98, 14>> + 241, 131, 49, 185, 90, 125, 255, 98, 14>>, + in_flight_tx: "hey", + in_flight_tx_sigs: ["test"], + input_utxos_pos: [11, 22] } end @@ -535,15 +543,16 @@ defmodule OMG.Eth.RootChain.AbiTest do test "if exit started can be decoded" do exit_started_log = %{ - :event_signature => "ExitStarted(address,uint168)", + :event_signature => "ExitStarted(address,uint168,uint256)", "address" => "0x92ce4d7773c57d96210c46a07b89acf725057f21", "blockHash" => "0x1bee6f75c74ceeb4817dc160e2fb56dd1337a9fc2980a2b013252cf1e620f246", - "blockNumber" => "0x2f7", - "data" => "0x000000000000000000000037a26a7116a84365892bb31bea5819301a2ba85b34", + "blockNumber" => "0x" <> Integer.to_string(726, 16), + "data" => + "0x000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000b", "logIndex" => "0x1", "removed" => false, "topics" => [ - "0x570921d6b65091f346909e31e89c2dfb6e742cc37e36d747be92c170d29e383e", + "0xe0ffc2e7d623cb04e12318e11dd2c9df46dbfba8ac0c429dd49885f35785cf63", "0x00000000000000000000000008858124b3b880c68b360fd319cc61da27545e9a" ], "transactionHash" => "0x4a8248b88a17b2be4c6086a1984622de1a60dda3c9dd9ece1ef97ed18efa028c", @@ -551,14 +560,15 @@ defmodule OMG.Eth.RootChain.AbiTest do } assert Abi.decode_log(exit_started_log) == %{ - eth_height: 759, - event_signature: "ExitStarted(address,uint168)", - exit_id: 81_309_820_288_462_349_357_922_495_476_773_313_169_175_330_970_420, + eth_height: 726, + event_signature: "ExitStarted(address,uint168,uint256)", log_index: 1, - owner: <<8, 133, 129, 36, 179, 184, 128, 198, 139, 54, 15, 211, 25, 204, 97, 218, 39, 84, 94, 154>>, root_chain_txhash: <<74, 130, 72, 184, 138, 23, 178, 190, 76, 96, 134, 161, 152, 70, 34, 222, 26, 96, 221, 163, 201, 221, - 158, 206, 30, 249, 126, 209, 142, 250, 2, 140>> + 158, 206, 30, 249, 126, 209, 142, 250, 2, 140>>, + exit_id: 10, + owner: <<8, 133, 129, 36, 179, 184, 128, 198, 139, 54, 15, 211, 25, 204, 97, 218, 39, 84, 94, 154>>, + utxo_pos: 11 } end diff --git a/apps/omg_eth/test/omg_eth/root_chain/event_test.exs b/apps/omg_eth/test/omg_eth/root_chain/event_test.exs index 295426408b..6e0b91d467 100644 --- a/apps/omg_eth/test/omg_eth/root_chain/event_test.exs +++ b/apps/omg_eth/test/omg_eth/root_chain/event_test.exs @@ -22,8 +22,8 @@ defmodule OMG.RootChain.EventTest do test "that order of returned events is preserved" do assert Event.get_events([:deposit_created, :in_flight_exit_challenged, :in_flight_exit_started]) == [ "DepositCreated(address,uint256,address,uint256)", - "InFlightExitChallenged(address,bytes32,uint256)", - "InFlightExitStarted(address,bytes32)" + "InFlightExitChallenged(address,bytes32,uint256,uint16,bytes,uint16,bytes)", + "InFlightExitStarted(address,bytes32,bytes,uint256[],bytes[])" ] end end diff --git a/apps/omg_eth/test/omg_eth/root_chain_test.exs b/apps/omg_eth/test/omg_eth/root_chain_test.exs index 63f94a4fc8..6d8910d772 100644 --- a/apps/omg_eth/test/omg_eth/root_chain_test.exs +++ b/apps/omg_eth/test/omg_eth/root_chain_test.exs @@ -62,7 +62,7 @@ defmodule OMG.Eth.RootChainTest do end defp deposit_then_start_exit(owner, amount, currency) do - owner = Encoding.from_hex(owner) + owner = Encoding.from_hex(owner, :mixed) {:ok, deposit} = ExPlasma.Transaction.Deposit.new(owner: owner, currency: currency, amount: amount) rlp = ExPlasma.Transaction.encode(deposit) diff --git a/apps/omg_eth/test/support/root_chain_helper.ex b/apps/omg_eth/test/support/root_chain_helper.ex index a9e3a1a0ab..d7c3d8417c 100644 --- a/apps/omg_eth/test/support/root_chain_helper.ex +++ b/apps/omg_eth/test/support/root_chain_helper.ex @@ -16,7 +16,7 @@ defmodule Support.RootChainHelper do @moduledoc """ Helper functions for RootChain. """ - import OMG.Eth.Encoding, only: [to_hex: 1, from_hex: 1] + import OMG.Eth.Encoding, only: [to_hex: 1, from_hex: 2] alias OMG.Eth.Blockchain.BitHelper alias OMG.Eth.Configuration @@ -50,7 +50,7 @@ defmodule Support.RootChainHelper do |> Keyword.put(:gas, @gas_start_exit) |> Keyword.put(:value, @standard_exit_bond) - contract = from_hex(Configuration.contracts().payment_exit_game) + contract = from_hex(Configuration.contracts().payment_exit_game, :mixed) backend = :geth TransactionHelper.contract_transact( @@ -69,7 +69,7 @@ defmodule Support.RootChainHelper do |> Keyword.put(:gas, @gas_piggyback) |> Keyword.put(:value, @piggyback_bond) - contract = from_hex(Configuration.contracts().payment_exit_game) + contract = from_hex(Configuration.contracts().payment_exit_game, :mixed) signature = "piggybackInFlightExitOnInput((bytes,uint16))" args = [{in_flight_tx, input_index}] backend = Configuration.eth_node() @@ -83,7 +83,7 @@ defmodule Support.RootChainHelper do |> Keyword.put(:gas, @gas_piggyback) |> Keyword.put(:value, @piggyback_bond) - contract = from_hex(Configuration.contracts().payment_exit_game) + contract = from_hex(Configuration.contracts().payment_exit_game, :mixed) signature = "piggybackInFlightExitOnOutput((bytes,uint16))" args = [{in_flight_tx, output_index}] @@ -100,14 +100,14 @@ defmodule Support.RootChainHelper do |> Keyword.merge(opts) |> Keyword.put(:value, value) - contract = from_hex(Configuration.contracts().eth_vault) + contract = from_hex(Configuration.contracts().eth_vault, :mixed) backend = Configuration.eth_node() TransactionHelper.contract_transact(backend, from, contract, "deposit(bytes)", [tx_bytes], opts) end def deposit_from(tx, from) do opts = Keyword.put(@tx_defaults, :gas, @gas_deposit_from) - contract = from_hex(Configuration.contracts().erc20_vault) + contract = from_hex(Configuration.contracts().erc20_vault, :mixed) backend = Configuration.eth_node() TransactionHelper.contract_transact(backend, from, contract, "deposit(bytes)", [tx], opts) end @@ -115,14 +115,14 @@ defmodule Support.RootChainHelper do def add_exit_queue(vault_id, token) do opts = Keyword.put(@tx_defaults, :gas, @gas_add_exit_queue) - contract = from_hex(Configuration.contracts().plasma_framework) - token = from_hex(token) + contract = from_hex(Configuration.contracts().plasma_framework, :mixed) + token = from_hex(token, :mixed) {:ok, [from | _]} = Ethereumex.HttpClient.eth_accounts() backend = Configuration.eth_node() TransactionHelper.contract_transact( backend, - from_hex(from), + from_hex(from, :mixed), contract, "addExitQueue(uint256, address)", [vault_id, token], @@ -134,7 +134,7 @@ defmodule Support.RootChainHelper do opts = Keyword.put(@tx_defaults, :gas, @gas_challenge_exit) sender_data = BitHelper.kec(from) - contract = from_hex(Configuration.contracts().payment_exit_game) + contract = from_hex(Configuration.contracts().payment_exit_game, :mixed) signature = "challengeStandardExit((uint168,bytes,bytes,uint16,bytes,bytes32))" args = [{exit_id, exiting_tx, challenge_tx, input_index, challenge_tx_sig, sender_data}] @@ -145,7 +145,7 @@ defmodule Support.RootChainHelper do def activate_child_chain(from \\ nil) do opts = Keyword.put(@tx_defaults, :gas, @gas_init) contract = Configuration.contracts().plasma_framework - from = from || from_hex(Configuration.authority_address()) + from = from || from_hex(Configuration.authority_address(), :mixed) backend = Configuration.eth_node() TransactionHelper.contract_transact(backend, from, contract, "activateChildChain()", [], opts) @@ -164,7 +164,7 @@ defmodule Support.RootChainHelper do |> Keyword.put(:value, @ife_bond) |> Keyword.put(:gas, @gas_start_in_flight_exit) - contract = from_hex(Configuration.contracts().payment_exit_game) + contract = from_hex(Configuration.contracts().payment_exit_game, :mixed) signature = "startInFlightExit((bytes,bytes[],uint256[],bytes[],bytes[]))" args = [{in_flight_tx, input_txs, input_utxos_pos, input_txs_inclusion_proofs, in_flight_tx_sigs}] @@ -176,8 +176,8 @@ defmodule Support.RootChainHelper do def process_exits(vault_id, token, top_exit_id, exits_to_process, from) do opts = @tx_defaults - token = from_hex(token) - contract = from_hex(Configuration.contracts().plasma_framework) + token = from_hex(token, :mixed) + contract = from_hex(Configuration.contracts().plasma_framework, :mixed) signature = "processExits(uint256,address,uint168,uint256)" args = [vault_id, token, top_exit_id, exits_to_process] backend = Configuration.eth_node() @@ -200,7 +200,7 @@ defmodule Support.RootChainHelper do ) do opts = Keyword.put(@tx_defaults, :gas, @gas_challenge_in_flight_exit_not_canonical) - contract = from_hex(Configuration.contracts().payment_exit_game) + contract = from_hex(Configuration.contracts().payment_exit_game, :mixed) signature = "challengeInFlightExitNotCanonical((bytes,uint256,bytes,uint16,bytes,uint16,uint256,bytes,bytes))" @@ -222,7 +222,7 @@ defmodule Support.RootChainHelper do ) do opts = Keyword.put(@tx_defaults, :gas, @gas_respond_to_non_canonical_challenge) - contract = from_hex(Configuration.contracts().payment_exit_game) + contract = from_hex(Configuration.contracts().payment_exit_game, :mixed) signature = "respondToNonCanonicalChallenge(bytes,uint256,bytes)" args = [in_flight_tx, in_flight_tx_pos, in_flight_tx_inclusion_proof] @@ -244,7 +244,7 @@ defmodule Support.RootChainHelper do ) do opts = @tx_defaults - contract = from_hex(Configuration.contracts().payment_exit_game) + contract = from_hex(Configuration.contracts().payment_exit_game, :mixed) signature = "challengeInFlightExitInputSpent((bytes,uint16,bytes,uint16,bytes,bytes,uint256))" args = [ @@ -268,7 +268,7 @@ defmodule Support.RootChainHelper do from ) do opts = @tx_defaults - contract = from_hex(Configuration.contracts().payment_exit_game) + contract = from_hex(Configuration.contracts().payment_exit_game, :mixed) signature = "challengeInFlightExitOutputSpent((bytes,bytes,uint256,bytes,uint16,bytes))" args = [ diff --git a/apps/omg_utils/lib/omg_utils/http_rpc/encoding.ex b/apps/omg_utils/lib/omg_utils/http_rpc/encoding.ex index f973e986f7..27c490d02d 100644 --- a/apps/omg_utils/lib/omg_utils/http_rpc/encoding.ex +++ b/apps/omg_utils/lib/omg_utils/http_rpc/encoding.ex @@ -37,5 +37,5 @@ defmodule OMG.Utils.HttpRPC.Encoding do # credo:disable-for-next-line Credo.Check.Consistency.SpaceAroundOperators @spec from_hex!(<<_::16, _::_*8>>) :: binary - def from_hex!("0x" <> encoded), do: Base.decode16!(encoded, case: :lower) + def from_hex!("0x" <> encoded), do: Base.decode16!(encoded, case: :mixed) end diff --git a/apps/omg_watcher/lib/omg_watcher/ethereum_event_aggregator.ex b/apps/omg_watcher/lib/omg_watcher/ethereum_event_aggregator.ex index 8dbf846e65..6bfd425d9d 100644 --- a/apps/omg_watcher/lib/omg_watcher/ethereum_event_aggregator.ex +++ b/apps/omg_watcher/lib/omg_watcher/ethereum_event_aggregator.ex @@ -204,7 +204,6 @@ defmodule OMG.Watcher.EthereumEventAggregator do defp retrieve_and_store_logs(from_block, to_block, state) do from_block |> get_logs(to_block, state) - |> enrich_logs_with_call_data(state) |> store_logs(from_block, to_block, state) end @@ -213,28 +212,6 @@ defmodule OMG.Watcher.EthereumEventAggregator do Enum.map(logs, &Abi.decode_log(&1)) end - # we get the logs from RPC and we cross check with the event definition if we need to enrich them - defp enrich_logs_with_call_data(decoded_logs, state) do - events = state.events - rpc = state.rpc - - Enum.map(decoded_logs, fn decoded_log -> - decoded_log_signature = decoded_log.event_signature - - event = Enum.find(events, fn event -> Keyword.fetch!(event, :signature) == decoded_log_signature end) - - case Keyword.fetch!(event, :enrich) do - true -> - {:ok, enriched_data} = rpc.get_call_data(decoded_log.root_chain_txhash) - enriched_data_decoded = enriched_data |> from_hex |> Abi.decode_function() - Map.put(decoded_log, :call_data, enriched_data_decoded) - - _ -> - decoded_log - end - end) - end - defp store_logs(decoded_logs, from_block, to_block, state) do event_signatures = state.event_signatures @@ -345,5 +322,5 @@ defmodule OMG.Watcher.EthereumEventAggregator do end end - defp from_hex("0x" <> encoded), do: Base.decode16!(encoded, case: :lower) + defp from_hex("0x" <> encoded), do: Base.decode16!(encoded, case: :mixed) end diff --git a/apps/omg_watcher/lib/omg_watcher/exit_processor.ex b/apps/omg_watcher/lib/omg_watcher/exit_processor.ex index 96add01900..f6ae72149c 100644 --- a/apps/omg_watcher/lib/omg_watcher/exit_processor.ex +++ b/apps/omg_watcher/lib/omg_watcher/exit_processor.ex @@ -352,14 +352,14 @@ defmodule OMG.Watcher.ExitProcessor do _ = if not Enum.empty?(exits), do: Logger.info("Recognized #{Enum.count(exits)} in-flight exits: #{inspect(exits)}") contract_ife_ids = - Enum.map(exits, fn %{call_data: %{in_flight_tx: txbytes}} -> + Enum.map(exits, fn %{in_flight_tx: txbytes} -> ExPlasma.InFlightExit.txbytes_to_id(txbytes) end) # Prepare events data for internal bus :ok = exits - |> Enum.map(fn %{call_data: %{input_utxos_pos: inputs}} = event -> + |> Enum.map(fn %{input_utxos_pos: inputs} = event -> {event, inputs} end) |> Tools.to_bus_events_data() @@ -742,7 +742,7 @@ defmodule OMG.Watcher.ExitProcessor do @spec put_timestamp_and_sft(map(), pos_integer(), pos_integer()) :: map() defp put_timestamp_and_sft( - %{eth_height: eth_height, call_data: %{utxo_pos: utxo_pos_enc}} = exit_event, + %{eth_height: eth_height, utxo_pos: utxo_pos_enc} = exit_event, min_exit_period_seconds, child_block_interval ) do diff --git a/apps/omg_watcher/lib/omg_watcher/exit_processor/competitor_info.ex b/apps/omg_watcher/lib/omg_watcher/exit_processor/competitor_info.ex index 608153d9a5..d81a5c29ac 100644 --- a/apps/omg_watcher/lib/omg_watcher/exit_processor/competitor_info.ex +++ b/apps/omg_watcher/lib/omg_watcher/exit_processor/competitor_info.ex @@ -72,7 +72,7 @@ defmodule OMG.Watcher.ExitProcessor.CompetitorInfo do {tx_hash, struct!(__MODULE__, competitor_map)} end - def new(%{call_data: %{competing_tx: tx_bytes, competing_tx_input_index: index, competing_tx_sig: sig}}), + def new(%{competing_tx: tx_bytes, competing_tx_input_index: index, competing_tx_sig: sig}), do: do_new(tx_bytes, index, sig) defp do_new(tx_bytes, competing_input_index, competing_input_signature) do diff --git a/apps/omg_watcher/lib/omg_watcher/exit_processor/exit_info.ex b/apps/omg_watcher/lib/omg_watcher/exit_processor/exit_info.ex index 9e06c8fc80..d6120e863d 100644 --- a/apps/omg_watcher/lib/omg_watcher/exit_processor/exit_info.ex +++ b/apps/omg_watcher/lib/omg_watcher/exit_processor/exit_info.ex @@ -63,7 +63,7 @@ defmodule OMG.Watcher.ExitProcessor.ExitInfo do contract_status, %{ eth_height: eth_height, - call_data: %{output_tx: txbytes}, + output_tx: txbytes, exit_id: exit_id, root_chain_txhash: root_chain_txhash, scheduled_finalization_time: scheduled_finalization_time, @@ -91,7 +91,7 @@ defmodule OMG.Watcher.ExitProcessor.ExitInfo do def new_key(_contract_status, exit_info), do: utxo_pos_for(exit_info) - defp utxo_pos_for(%{call_data: %{utxo_pos: utxo_pos_enc}} = _exit_info), + defp utxo_pos_for(%{utxo_pos: utxo_pos_enc} = _exit_info), do: Utxo.Position.decode!(utxo_pos_enc) @spec do_new(map(), list(keyword())) :: t() diff --git a/apps/omg_watcher/lib/omg_watcher/exit_processor/in_flight_exit_info.ex b/apps/omg_watcher/lib/omg_watcher/exit_processor/in_flight_exit_info.ex index 9b654de9cd..5ec26609a7 100644 --- a/apps/omg_watcher/lib/omg_watcher/exit_processor/in_flight_exit_info.ex +++ b/apps/omg_watcher/lib/omg_watcher/exit_processor/in_flight_exit_info.ex @@ -102,12 +102,10 @@ defmodule OMG.Watcher.ExitProcessor.InFlightExitInfo do def new_kv( %{ eth_height: eth_height, - call_data: %{ - in_flight_tx: tx_bytes, - in_flight_tx_sigs: signatures, - input_txs: input_txs, - input_utxos_pos: input_utxos_pos - } + in_flight_tx: tx_bytes, + in_flight_tx_sigs: signatures, + input_txs: input_txs, + input_utxos_pos: input_utxos_pos }, {contract_status, contract_ife_id} ) do diff --git a/apps/omg_watcher/lib/omg_watcher/exit_processor/tools.ex b/apps/omg_watcher/lib/omg_watcher/exit_processor/tools.ex index 2f1694b355..ac8de253b5 100644 --- a/apps/omg_watcher/lib/omg_watcher/exit_processor/tools.ex +++ b/apps/omg_watcher/lib/omg_watcher/exit_processor/tools.ex @@ -94,7 +94,6 @@ defmodule OMG.Watcher.ExitProcessor.Tools do """ @spec to_bus_events_data(list(eth_event_with_exiting_positions_t())) :: list(%{ - call_data: map(), root_chain_txhash: charlist(), log_index: non_neg_integer(), eth_height: pos_integer() @@ -115,7 +114,7 @@ defmodule OMG.Watcher.ExitProcessor.Tools do utxo_positions |> Enum.map( &%{ - call_data: %{utxo_pos: utxo_pos_transform.(&1)}, + utxo_pos: utxo_pos_transform.(&1), root_chain_txhash: root_chain_txhash, eth_height: eth_height, log_index: log_index @@ -144,10 +143,11 @@ defmodule OMG.Watcher.ExitProcessor.Tools do # If transaction was included in plasma block, output is created and could be spend by this event [ %{ - call_data: %{txhash: txhash, oindex: oindex}, root_chain_txhash: root_chain_txhash, log_index: log_index, - eth_height: eth_height + eth_height: eth_height, + txhash: txhash, + oindex: oindex } | bus_events ] diff --git a/apps/omg_watcher/lib/omg_watcher/sync_supervisor.ex b/apps/omg_watcher/lib/omg_watcher/sync_supervisor.ex index 9397d20297..5fe5defaf2 100644 --- a/apps/omg_watcher/lib/omg_watcher/sync_supervisor.ex +++ b/apps/omg_watcher/lib/omg_watcher/sync_supervisor.ex @@ -109,20 +109,20 @@ defmodule OMG.Watcher.SyncSupervisor do contracts: contracts, ets_bucket: events_bucket(), events: [ - [name: :deposit_created, enrich: false], - [name: :exit_started, enrich: true], - [name: :exit_finalized, enrich: false], - [name: :exit_challenged, enrich: false], - [name: :in_flight_exit_started, enrich: true], - [name: :in_flight_exit_deleted, enrich: false], - [name: :in_flight_exit_input_piggybacked, enrich: false], - [name: :in_flight_exit_output_piggybacked, enrich: false], - [name: :in_flight_exit_challenged, enrich: true], - [name: :in_flight_exit_challenge_responded, enrich: false], - [name: :in_flight_exit_input_blocked, enrich: false], - [name: :in_flight_exit_output_blocked, enrich: false], - [name: :in_flight_exit_input_withdrawn, enrich: false], - [name: :in_flight_exit_output_withdrawn, enrich: false] + [name: :deposit_created], + [name: :exit_started], + [name: :exit_finalized], + [name: :exit_challenged], + [name: :in_flight_exit_started], + [name: :in_flight_exit_deleted], + [name: :in_flight_exit_input_piggybacked], + [name: :in_flight_exit_output_piggybacked], + [name: :in_flight_exit_challenged], + [name: :in_flight_exit_challenge_responded], + [name: :in_flight_exit_input_blocked], + [name: :in_flight_exit_output_blocked], + [name: :in_flight_exit_input_withdrawn], + [name: :in_flight_exit_output_withdrawn] ]}, EthereumEventListener.prepare_child( metrics_collection_interval: metrics_collection_interval, diff --git a/apps/omg_watcher/test/omg_watcher/ethereum_event_aggregator_test.exs b/apps/omg_watcher/test/omg_watcher/ethereum_event_aggregator_test.exs index 0fb1360a17..2cb3627ea3 100644 --- a/apps/omg_watcher/test/omg_watcher/ethereum_event_aggregator_test.exs +++ b/apps/omg_watcher/test/omg_watcher/ethereum_event_aggregator_test.exs @@ -28,10 +28,10 @@ defmodule OMG.Watcher.EthereumEventAggregatorTest do ets_bucket: table, events: [ [name: :deposit_created, enrich: false], - [name: :exit_started, enrich: true], + [name: :exit_started, enrich: false], [name: :in_flight_exit_input_piggybacked, enrich: false], [name: :in_flight_exit_output_piggybacked, enrich: false], - [name: :in_flight_exit_started, enrich: true], + [name: :in_flight_exit_started, enrich: false], [name: :in_flight_exit_deleted, enrich: false] ]} ) @@ -52,10 +52,6 @@ defmodule OMG.Watcher.EthereumEventAggregatorTest do deposits = for n <- 1..10_000, do: EthereumEventAggregatorTest.deposit_created_log(n) {:ok, [EthereumEventAggregatorTest.in_flight_exit_input_piggybacked_log(to_block) | deposits]} end - - def get_call_data(_tx_hash) do - {:ok, EthereumEventAggregatorTest.start_standard_exit_log()} - end end from_block = 1 @@ -77,9 +73,9 @@ defmodule OMG.Watcher.EthereumEventAggregatorTest do enrich: false ], [ - signature: "InFlightExitStarted(address,bytes32)", + signature: "InFlightExitStarted(address,bytes32,bytes,uint256[],bytes[])", name: :in_flight_exit_started, - enrich: true + enrich: false ], [ signature: "InFlightExitOutputPiggybacked(address,bytes32,uint16)", @@ -92,9 +88,9 @@ defmodule OMG.Watcher.EthereumEventAggregatorTest do enrich: false ], [ - signature: "ExitStarted(address,uint168)", + signature: "ExitStarted(address,uint168,uint256)", name: :exit_started, - enrich: true + enrich: false ], [ signature: "DepositCreated(address,uint256,address,uint256)", @@ -109,12 +105,12 @@ defmodule OMG.Watcher.EthereumEventAggregatorTest do } do assert event_fetcher_name |> :sys.get_state() |> Map.get(:event_signatures) |> Enum.sort() == Enum.sort([ - "InFlightExitStarted(address,bytes32)", - "InFlightExitOutputPiggybacked(address,bytes32,uint16)", - "InFlightExitInputPiggybacked(address,bytes32,uint16)", - "ExitStarted(address,uint168)", + "DepositCreated(address,uint256,address,uint256)", + "ExitStarted(address,uint168,uint256)", "InFlightExitDeleted(uint168)", - "DepositCreated(address,uint256,address,uint256)" + "InFlightExitInputPiggybacked(address,bytes32,uint16)", + "InFlightExitOutputPiggybacked(address,bytes32,uint16)", + "InFlightExitStarted(address,bytes32,bytes,uint256[],bytes[])" ]) end end @@ -139,10 +135,6 @@ defmodule OMG.Watcher.EthereumEventAggregatorTest do EthereumEventAggregatorTest.in_flight_exit_input_piggybacked_log(to_block) ]} end - - def get_call_data(_tx_hash) do - {:ok, EthereumEventAggregatorTest.start_standard_exit_log()} - end end from_block = 1 @@ -159,7 +151,6 @@ defmodule OMG.Watcher.EthereumEventAggregatorTest do to_block |> exit_started_log() |> Abi.decode_log() - |> Map.put(:call_data, start_standard_exit_log() |> from_hex |> Abi.decode_function()) in_flight_exit_output_piggybacked_log = from_block |> in_flight_exit_output_piggybacked_log() |> Abi.decode_log() in_flight_exit_input_piggybacked_log = to_block |> in_flight_exit_input_piggybacked_log() |> Abi.decode_log() @@ -236,10 +227,6 @@ defmodule OMG.Watcher.EthereumEventAggregatorTest do EthereumEventAggregatorTest.in_flight_exit_deleted_log(from_block) ]} end - - def get_call_data(_tx_hash) do - {:ok, EthereumEventAggregatorTest.start_standard_exit_log()} - end end # we need to set the RPC module with our mocked implementation @@ -259,7 +246,6 @@ defmodule OMG.Watcher.EthereumEventAggregatorTest do to_block |> exit_started_log() |> Abi.decode_log() - |> Map.put(:call_data, start_standard_exit_log() |> from_hex |> Abi.decode_function()) in_flight_exit_output_piggybacked_log = from_block |> in_flight_exit_output_piggybacked_log() |> Abi.decode_log() in_flight_exit_input_piggybacked_log = to_block |> in_flight_exit_input_piggybacked_log() |> Abi.decode_log() @@ -321,10 +307,6 @@ defmodule OMG.Watcher.EthereumEventAggregatorTest do EthereumEventAggregatorTest.in_flight_exit_input_piggybacked_log(to_block) ]} end - - def get_call_data(_tx_hash) do - {:ok, EthereumEventAggregatorTest.start_standard_exit_log()} - end end :sys.replace_state(event_fetcher_name, fn state -> Map.put(state, :rpc, test_name) end) @@ -339,7 +321,6 @@ defmodule OMG.Watcher.EthereumEventAggregatorTest do to_block |> exit_started_log() |> Abi.decode_log() - |> Map.put(:call_data, start_standard_exit_log() |> from_hex |> Abi.decode_function()) assert EthereumEventAggregator.exit_started(event_fetcher_name, from_block, to_block) == {:ok, [exit_started_log]} @@ -381,10 +362,6 @@ defmodule OMG.Watcher.EthereumEventAggregatorTest do EthereumEventAggregatorTest.deposit_created_log(2) ]} end - - def get_call_data(_tx_hash) do - {:ok, EthereumEventAggregatorTest.start_standard_exit_log()} - end end from_block = 1 @@ -403,7 +380,6 @@ defmodule OMG.Watcher.EthereumEventAggregatorTest do to_block |> exit_started_log() |> Abi.decode_log() - |> Map.put(:call_data, start_standard_exit_log() |> from_hex |> Abi.decode_function()) in_flight_exit_output_piggybacked_log = from_block |> in_flight_exit_output_piggybacked_log() |> Abi.decode_log() in_flight_exit_input_piggybacked_log = to_block |> in_flight_exit_input_piggybacked_log() |> Abi.decode_log() @@ -492,15 +468,16 @@ defmodule OMG.Watcher.EthereumEventAggregatorTest do def exit_started_log(block_number) do %{ - :event_signature => "ExitStarted(address,uint168)", + :event_signature => "ExitStarted(address,uint168,uint256)", "address" => "0x92ce4d7773c57d96210c46a07b89acf725057f21", "blockHash" => "0x1bee6f75c74ceeb4817dc160e2fb56dd1337a9fc2980a2b013252cf1e620f246", "blockNumber" => "0x" <> Integer.to_string(block_number, 16), - "data" => "0x000000000000000000000037a26a7116a84365892bb31bea5819301a2ba85b34", + "data" => + "0x000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000b", "logIndex" => "0x1", "removed" => false, "topics" => [ - "0x570921d6b65091f346909e31e89c2dfb6e742cc37e36d747be92c170d29e383e", + "0xe0ffc2e7d623cb04e12318e11dd2c9df46dbfba8ac0c429dd49885f35785cf63", "0x00000000000000000000000008858124b3b880c68b360fd319cc61da27545e9a" ], "transactionHash" => "0x4a8248b88a17b2be4c6086a1984622de1a60dda3c9dd9ece1ef97ed18efa028c", @@ -568,8 +545,6 @@ defmodule OMG.Watcher.EthereumEventAggregatorTest do "0x70e014620000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000001d1e4e4ea00000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000005df85b01c0f6f501f39408858124b3b880c68b360fd319cc61da27545e9a940000000000000000000000000000000000000000880de0b6b3a764000080a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200f39a869f62e75cf5f0bf914688a6b289caf2049435d8e68c5c5e6d05e44913f34ed5c02d6d48c8932486c99d3ad999e5d8949dc3be3b3058cc2979690c3e3a621c792b14bf66f82af36f00f5fba7014fa0c1e2ff3c7c273bfe523c1acf67dc3f5fa080a686a5a0d05c3d4822fd54d632dc9cc04b1616046eba2ce499eb9af79f5eb949690a0404abf4cebafc7cfffa382191b7dd9e7df778581e6fb78efab35fd364c9d5dadad4569b6dd47f7feabafa3571f842434425548335ac6e690dd07168d8bc5b77979c1a6702334f529f5783f79e942fd2cd03f6e55ac2cf496e849fde9c446fab46a8d27db1e3100f275a777d385b44e3cbc045cabac9da36cae040ad516082324c96127cf29f4535eb5b7ebacfe2a1d6d3aab8ec0483d32079a859ff70f9215970a8beebb1c164c474e82438174c8eeb6fbc8cb4594b88c9448f1d40b09beaecac5b45db6e41434a122b695c5a85862d8eae40b3268f6f37e414337be38eba7ab5bbf303d01f4b7ae07fd73edc2f3be05e43948a34418a3272509c43c2811a821e5c982ba51874ac7dc9dd79a80cc2f05f6f664c9dbb2e454435137da06ce44de45532a56a3a7007a2d0c6b435f726f95104bfa6e707046fc154bae91898d03a1a0ac6f9b45e471646e2555ac79e3fe87eb1781e26f20500240c379274fe91096e60d1545a8045571fdab9b530d0d6e7e8746e78bf9f20f4e86f06" end - defp from_hex("0x" <> encoded), do: Base.decode16!(encoded, case: :lower) - defp get_signature_from_event(events, name) do events |> Enum.find(fn event -> Keyword.get(event, :name) == name end) diff --git a/apps/omg_watcher/test/omg_watcher/exit_processor/persistence_test.exs b/apps/omg_watcher/test/omg_watcher/exit_processor/persistence_test.exs index 5346f71914..28c787b750 100644 --- a/apps/omg_watcher/test/omg_watcher/exit_processor/persistence_test.exs +++ b/apps/omg_watcher/test/omg_watcher/exit_processor/persistence_test.exs @@ -63,7 +63,8 @@ defmodule OMG.Watcher.ExitProcessor.PersistenceTest do owner: alice.addr, eth_height: 2, exit_id: 1, - call_data: %{utxo_pos: Utxo.Position.encode(@utxo_pos1), output_tx: txbytes1}, + utxo_pos: Utxo.Position.encode(@utxo_pos1), + output_tx: txbytes1, root_chain_txhash: <<1::256>>, block_timestamp: 1, scheduled_finalization_time: 2 @@ -72,7 +73,8 @@ defmodule OMG.Watcher.ExitProcessor.PersistenceTest do owner: alice.addr, eth_height: 4, exit_id: 2, - call_data: %{utxo_pos: Utxo.Position.encode(@utxo_pos2), output_tx: txbytes2}, + utxo_pos: Utxo.Position.encode(@utxo_pos2), + output_tx: txbytes2, root_chain_txhash: <<2::256>>, block_timestamp: 3, scheduled_finalization_time: 4 @@ -143,11 +145,9 @@ defmodule OMG.Watcher.ExitProcessor.PersistenceTest do challenge = %{ tx_hash: hash, competitor_position: Utxo.Position.encode(@utxo_pos2), - call_data: %{ - competing_tx: Transaction.raw_txbytes(competing_tx), - competing_tx_input_index: 0, - competing_tx_sig: @zero_sig - } + competing_tx: Transaction.raw_txbytes(competing_tx), + competing_tx_input_index: 0, + competing_tx_sig: @zero_sig } piggybacks1 = [ diff --git a/apps/omg_watcher/test/omg_watcher/exit_processor/tools_test.exs b/apps/omg_watcher/test/omg_watcher/exit_processor/tools_test.exs index 04b9a8066b..14e60e407d 100644 --- a/apps/omg_watcher/test/omg_watcher/exit_processor/tools_test.exs +++ b/apps/omg_watcher/test/omg_watcher/exit_processor/tools_test.exs @@ -47,7 +47,7 @@ defmodule OMG.Watcher.ExitProcessor.ToolsTest do utxo_pos = Utxo.Position.encode(utxo_1) assert [ - %{log_index: 1, root_chain_txhash: <<1::256>>, call_data: %{utxo_pos: ^utxo_pos}} + %{log_index: 1, root_chain_txhash: <<1::256>>, utxo_pos: ^utxo_pos} ] = Tools.to_bus_events_data([{f1, [utxo_1]}]) end @@ -56,9 +56,9 @@ defmodule OMG.Watcher.ExitProcessor.ToolsTest do [utxo_pos_1, utxo_pos_2, utxo_pos_3 | _] = Enum.map(utxos, &Utxo.Position.encode/1) assert [ - %{log_index: 2, root_chain_txhash: <<2::256>>, eth_height: 2, call_data: %{utxo_pos: ^utxo_pos_2}}, - %{log_index: 2, root_chain_txhash: <<2::256>>, eth_height: 2, call_data: %{utxo_pos: ^utxo_pos_3}}, - %{log_index: 1, root_chain_txhash: <<1::256>>, eth_height: 1, call_data: %{utxo_pos: ^utxo_pos_1}} + %{log_index: 2, root_chain_txhash: <<2::256>>, eth_height: 2, utxo_pos: ^utxo_pos_2}, + %{log_index: 2, root_chain_txhash: <<2::256>>, eth_height: 2, utxo_pos: ^utxo_pos_3}, + %{log_index: 1, root_chain_txhash: <<1::256>>, eth_height: 1, utxo_pos: ^utxo_pos_1} ] = Tools.to_bus_events_data([{f1, [utxo_1]}, {f2, [utxo_2, utxo_3]}]) end @@ -67,7 +67,7 @@ defmodule OMG.Watcher.ExitProcessor.ToolsTest do utxo_pos = Utxo.Position.encode(utxo_1) assert [ - %{log_index: 2, root_chain_txhash: <<2::256>>, call_data: %{utxo_pos: ^utxo_pos}} + %{log_index: 2, root_chain_txhash: <<2::256>>, utxo_pos: ^utxo_pos} ] = Tools.to_bus_events_data([{f1, []}, {f2, [utxo_1]}]) end @@ -88,9 +88,9 @@ defmodule OMG.Watcher.ExitProcessor.ToolsTest do ] assert [ - %{log_index: 2, root_chain_txhash: <<12::256>>, eth_height: 111, call_data: %{utxo_pos: ^utxo_pos_3}}, - %{log_index: 1, root_chain_txhash: <<11::256>>, eth_height: 110, call_data: %{utxo_pos: ^utxo_pos_1}}, - %{log_index: 1, root_chain_txhash: <<11::256>>, eth_height: 110, call_data: %{utxo_pos: ^utxo_pos_2}} + %{log_index: 2, root_chain_txhash: <<12::256>>, eth_height: 111, utxo_pos: ^utxo_pos_3}, + %{log_index: 1, root_chain_txhash: <<11::256>>, eth_height: 110, utxo_pos: ^utxo_pos_1}, + %{log_index: 1, root_chain_txhash: <<11::256>>, eth_height: 110, utxo_pos: ^utxo_pos_2} ] = Tools.to_bus_events_data(events_with_utxos) end @@ -126,8 +126,8 @@ defmodule OMG.Watcher.ExitProcessor.ToolsTest do # Note: Piggyback to input in log_index: 2 is ignored assert [ - %{log_index: 3, root_chain_txhash: <<13::256>>, call_data: %{txhash: ^txhash, oindex: 3}}, - %{log_index: 1, root_chain_txhash: <<11::256>>, call_data: %{txhash: ^txhash, oindex: 1}} + %{log_index: 3, root_chain_txhash: <<13::256>>, txhash: ^txhash, oindex: 3}, + %{log_index: 1, root_chain_txhash: <<11::256>>, txhash: ^txhash, oindex: 1} ] = Tools.to_bus_events_data(piggyback_events) end end diff --git a/apps/omg_watcher/test/omg_watcher/integration/block_getter_test.exs b/apps/omg_watcher/test/omg_watcher/integration/block_getter_test.exs index e14b4bab47..d8d1f5de89 100644 --- a/apps/omg_watcher/test/omg_watcher/integration/block_getter_test.exs +++ b/apps/omg_watcher/test/omg_watcher/integration/block_getter_test.exs @@ -63,7 +63,7 @@ defmodule OMG.Watcher.Integration.BlockGetterTest do # checking if both machines and humans learn about the byzantine condition assert WatcherHelper.capture_log(fn -> - {:ok, _txhash} = Eth.submit_block(different_hash, 1, 20_000_000_000) + {:ok, _txhash} = Eth.submit_block(different_hash, 0, 20_000_000_000) IntegrationTest.wait_for_byzantine_events([%Event.InvalidBlock{}.name], @timeout) end) =~ inspect({:error, :incorrect_hash}) end @@ -94,7 +94,7 @@ defmodule OMG.Watcher.Integration.BlockGetterTest do # checking if both machines and humans learn about the byzantine condition assert WatcherHelper.capture_log(fn -> - {:ok, _txhash} = Eth.submit_block(invalid_block_hash, 1, 20_000_000_000) + {:ok, _txhash} = Eth.submit_block(invalid_block_hash, 0, 20_000_000_000) IntegrationTest.wait_for_byzantine_events([%Event.InvalidBlock{}.name], @timeout) end) =~ inspect(:tx_execution) end diff --git a/apps/omg_watcher/test/support/exit_processor/test_helper.ex b/apps/omg_watcher/test/support/exit_processor/test_helper.ex index 9e3d5ad496..9adcf0a71f 100644 --- a/apps/omg_watcher/test/support/exit_processor/test_helper.ex +++ b/apps/omg_watcher/test/support/exit_processor/test_helper.ex @@ -41,16 +41,16 @@ defmodule OMG.Watcher.ExitProcessor.TestHelper do owner = tx |> Transaction.get_outputs() |> Enum.at(oindex) |> Map.get(:owner) eth_height = Keyword.get(opts, :eth_height, 2) exit_id = Keyword.get(opts, :exit_id, @exit_id) - call_data = %{utxo_pos: enc_pos, output_tx: txbytes} root_chain_txhash = <<1::256>> block_timestamp = :os.system_time(:second) scheduled_finalization_time = block_timestamp + 100 event = %{ + utxo_pos: enc_pos, + output_tx: txbytes, owner: owner, eth_height: eth_height, exit_id: exit_id, - call_data: call_data, root_chain_txhash: root_chain_txhash, block_timestamp: block_timestamp, scheduled_finalization_time: scheduled_finalization_time @@ -104,12 +104,10 @@ defmodule OMG.Watcher.ExitProcessor.TestHelper do eth_height = Keyword.get(opts, :eth_height, 2) %{ - call_data: %{ - in_flight_tx: Transaction.raw_txbytes(tx), - input_txs: input_txs, - input_utxos_pos: input_utxos_pos, - in_flight_tx_sigs: sigs - }, + in_flight_tx: Transaction.raw_txbytes(tx), + input_txs: input_txs, + input_utxos_pos: input_utxos_pos, + in_flight_tx_sigs: sigs, eth_height: eth_height } end @@ -128,11 +126,9 @@ defmodule OMG.Watcher.ExitProcessor.TestHelper do %{ tx_hash: Transaction.raw_txhash(tx), competitor_position: competitor_position, - call_data: %{ - competing_tx: txbytes(comp), - competing_tx_input_index: Keyword.get(opts, :competing_tx_input_index, 0), - competing_tx_sig: Keyword.get(opts, :competing_tx_sig, sig(comp)) - } + competing_tx: txbytes(comp), + competing_tx_input_index: Keyword.get(opts, :competing_tx_input_index, 0), + competing_tx_sig: Keyword.get(opts, :competing_tx_sig, sig(comp)) } end diff --git a/apps/omg_watcher/test/support/integration/fixtures.exs b/apps/omg_watcher/test/support/integration/fixtures.exs index 3d6dbaf853..efa5abcc31 100644 --- a/apps/omg_watcher/test/support/integration/fixtures.exs +++ b/apps/omg_watcher/test/support/integration/fixtures.exs @@ -35,7 +35,7 @@ defmodule OMG.Watcher.Integration.Fixtures do {:ok, _} = DevHelper.import_unlock_fund(alice) deposit_blknum = DepositHelper.deposit_to_child_chain(alice.addr, some_value) - token_addr = Encoding.from_hex(token_addr) + token_addr = Encoding.from_hex(token_addr, :mixed) {:ok, _} = Eth.Token.mint(alice.addr, some_value, token_addr) |> DevHelper.transact_sync!() token_deposit_blknum = DepositHelper.deposit_to_child_chain(alice.addr, some_value, token_addr) diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/db/eth_event.ex b/apps/omg_watcher_info/lib/omg_watcher_info/db/eth_event.ex index 51930e1a23..9a7a832a93 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/db/eth_event.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/db/eth_event.ex @@ -32,7 +32,28 @@ defmodule OMG.WatcherInfo.DB.EthEvent do require Utxo @typep available_event_type_t() :: :standard_exit | :in_flight_exit - @typep output_pointer_t() :: %{utxo_pos: pos_integer()} | %{txhash: Crypto.hash_t(), oindex: non_neg_integer()} + + @typep exit_event() :: + %{ + utxo_pos: non_neg_integer(), + root_chain_txhash: charlist(), + log_index: non_neg_integer(), + eth_height: pos_integer() + } + | %{ + oindex: non_neg_integer(), + txhash: binary(), + root_chain_txhash: charlist(), + log_index: non_neg_integer(), + eth_height: pos_integer() + } + + @typep utxo_exit() :: %{ + root_chain_txhash: binary(), + log_index: non_neg_integer(), + eth_height: pos_integer(), + output_pointer: tuple() + } @primary_key false schema "ethevents" do @@ -170,28 +191,18 @@ defmodule OMG.WatcherInfo.DB.EthEvent do |> Paginator.set_data(paginator) end - @spec utxo_exit_from_exit_event(%{ - call_data: output_pointer_t(), - root_chain_txhash: charlist(), - log_index: non_neg_integer(), - eth_height: pos_integer() - }) :: - %{ - root_chain_txhash: binary(), - log_index: non_neg_integer(), - eth_height: pos_integer(), - output_pointer: tuple() - } - defp utxo_exit_from_exit_event(%{ - call_data: output_pointer, - root_chain_txhash: root_chain_txhash, - log_index: log_index, - eth_height: eth_height - }) do + @spec utxo_exit_from_exit_event(exit_event()) :: utxo_exit() + defp utxo_exit_from_exit_event(event) do + %{ + root_chain_txhash: root_chain_txhash, + log_index: log_index, + eth_height: eth_height + } = event + %{ root_chain_txhash: root_chain_txhash, log_index: log_index, - output_pointer: transform_output_pointer(output_pointer), + output_pointer: transform_output_pointer(event), eth_height: eth_height } end diff --git a/apps/omg_watcher_info/test/omg_watcher_info/db/eth_event_test.exs b/apps/omg_watcher_info/test/omg_watcher_info/db/eth_event_test.exs index e5f29b2844..4a4e39b22d 100644 --- a/apps/omg_watcher_info/test/omg_watcher_info/db/eth_event_test.exs +++ b/apps/omg_watcher_info/test/omg_watcher_info/db/eth_event_test.exs @@ -258,7 +258,7 @@ defmodule OMG.WatcherInfo.DB.EthEventTest do DB.EthEvent.insert_exits!( [ %{ - call_data: %{utxo_pos: expected_utxo_encoded_position}, + utxo_pos: expected_utxo_encoded_position, root_chain_txhash: expected_exit_root_chain_txhash, log_index: expected_log_index, eth_height: expected_exit_eth_height @@ -291,13 +291,13 @@ defmodule OMG.WatcherInfo.DB.EthEventTest do %{ root_chain_txhash: Crypto.hash(<<1000::256>>), log_index: 1, - call_data: %{utxo_pos: Utxo.Position.encode(Utxo.position(1, 0, 0))}, + utxo_pos: Utxo.Position.encode(Utxo.position(1, 0, 0)), eth_height: 2 }, %{ root_chain_txhash: Crypto.hash(<<1000::256>>), log_index: 1, - call_data: %{utxo_pos: Utxo.Position.encode(Utxo.position(1, 0, 0))}, + utxo_pos: Utxo.Position.encode(Utxo.position(1, 0, 0)), eth_height: 2 } ] @@ -327,13 +327,13 @@ defmodule OMG.WatcherInfo.DB.EthEventTest do root_chain_txhash: expected_eth_txhash, log_index: expected_log_index, eth_height: expected_eth_height, - call_data: %{utxo_pos: Utxo.Position.encode(utxo_pos1)} + utxo_pos: Utxo.Position.encode(utxo_pos1) }, %{ root_chain_txhash: expected_eth_txhash, log_index: expected_log_index, eth_height: expected_eth_height, - call_data: %{utxo_pos: Utxo.Position.encode(utxo_pos2)} + utxo_pos: Utxo.Position.encode(utxo_pos2) } ] @@ -387,13 +387,15 @@ defmodule OMG.WatcherInfo.DB.EthEventTest do root_chain_txhash: expected_eth_txhash1, log_index: expected_log_index1, eth_height: expected_eth_height1, - call_data: %{txhash: txhash1, oindex: oindex1} + txhash: txhash1, + oindex: oindex1 }, %{ root_chain_txhash: expected_eth_txhash2, log_index: expected_log_index2, eth_height: expected_eth_height2, - call_data: %{txhash: txhash2, oindex: oindex2} + txhash: txhash2, + oindex: oindex2 } ] diff --git a/apps/omg_watcher_info/test/omg_watcher_info/exit_consumer_test.exs b/apps/omg_watcher_info/test/omg_watcher_info/exit_consumer_test.exs index 6cbc9baad5..58cf22efe1 100644 --- a/apps/omg_watcher_info/test/omg_watcher_info/exit_consumer_test.exs +++ b/apps/omg_watcher_info/test/omg_watcher_info/exit_consumer_test.exs @@ -52,8 +52,8 @@ defmodule OMG.WatcherInfo.ExitConsumerTest do txhash = Crypto.hash(<>) event_data = [ - %{log_index: 2, eth_height: 2, root_chain_txhash: @root_chain_txhash2, call_data: %{utxo_pos: pos_1}}, - %{log_index: 1, eth_height: 1, root_chain_txhash: @root_chain_txhash1, call_data: %{txhash: txhash, oindex: 1}} + %{log_index: 2, eth_height: 2, root_chain_txhash: @root_chain_txhash2, utxo_pos: pos_1}, + %{log_index: 1, eth_height: 1, root_chain_txhash: @root_chain_txhash1, txhash: txhash, oindex: 1} ] send_events_and_wait_until_processed(event_data) @@ -68,8 +68,8 @@ defmodule OMG.WatcherInfo.ExitConsumerTest do # Note: event data is the same for InFlightExitStarted and InFlightExitOutputWithdrawn events event_data = [ - %{log_index: 2, eth_height: 2, root_chain_txhash: @root_chain_txhash2, call_data: %{utxo_pos: pos_2}}, - %{log_index: 1, eth_height: 1, root_chain_txhash: @root_chain_txhash1, call_data: %{utxo_pos: pos_1}} + %{log_index: 2, eth_height: 2, root_chain_txhash: @root_chain_txhash2, utxo_pos: pos_2}, + %{log_index: 1, eth_height: 1, root_chain_txhash: @root_chain_txhash1, utxo_pos: pos_1} ] send_events_and_wait_until_processed(event_data) @@ -87,7 +87,8 @@ defmodule OMG.WatcherInfo.ExitConsumerTest do log_index: 2, eth_height: 2, root_chain_txhash: @root_chain_txhash2, - call_data: %{txhash: txhash, oindex: oindex} + txhash: txhash, + oindex: oindex } ] @@ -106,7 +107,8 @@ defmodule OMG.WatcherInfo.ExitConsumerTest do log_index: 2, eth_height: 2, root_chain_txhash: @root_chain_txhash2, - call_data: %{txhash: txhash, oindex: oindex} + txhash: txhash, + oindex: oindex } ] @@ -130,7 +132,8 @@ defmodule OMG.WatcherInfo.ExitConsumerTest do log_index: expected_log_index, eth_height: expected_eth_height, root_chain_txhash: expected_root_hash, - call_data: %{txhash: txhash, oindex: oindex} + txhash: txhash, + oindex: oindex } ]) @@ -149,7 +152,7 @@ defmodule OMG.WatcherInfo.ExitConsumerTest do log_index: 2, root_chain_txhash: @root_chain_txhash2, eth_height: expected_eth_height, - call_data: %{utxo_pos: Position.encode(txo_pos)} + utxo_pos: Position.encode(txo_pos) } ] diff --git a/priv/cabbage b/priv/cabbage index c2d4feef7a..ee6dcf38ea 160000 --- a/priv/cabbage +++ b/priv/cabbage @@ -1 +1 @@ -Subproject commit c2d4feef7adce7b08daaab76dacf69ddc5fe86f6 +Subproject commit ee6dcf38ea1a31791974b1e8cc0d97a8853f9779 diff --git a/priv/perf/mix.lock b/priv/perf/mix.lock index fb198d4914..47a4b1ef28 100644 --- a/priv/perf/mix.lock +++ b/priv/perf/mix.lock @@ -1,45 +1,50 @@ %{ - "basic_auth": {:hex, :basic_auth, "2.2.4", "d8c748237870dd1df3bc5c0f1ab4f1fad6270c75472d7e62b19302ec59e92a79", [:mix], [{:plug, "~> 0.14 or ~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "a595b5f2a07e94cbde7be3dfeba24573e18655c88e74c8eb118364f856642e62"}, + "basic_auth": {:hex, :basic_auth, "2.2.5", "ec2c934e4943b63cfc7d6b01c6f3fa51ade2a518ca36c9c0caee18a90bf98c4e", [:mix], [{:plug, "~> 0.14 or ~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "8b5f067bcfe48d7dc02d43c18ad9e9b54e630c2da720667ac8ed46979b54b7cb"}, "binary": {:hex, :binary, "0.0.5", "20d816f7274ea34f1b673b4cff2fdb9ebec9391a7a68c349070d515c66b1b2cf", [:mix], [], "hexpm", "ee1e9ebcab703a4e24db554957fbb540642fe9327eb9e295cb3f07dd7c11ddb2"}, + "briefly": {:hex, :briefly, "0.3.0", "16e6b76d2070ebc9cbd025fa85cf5dbaf52368c4bd896fb482b5a6b95a540c2f", [:mix], [], "hexpm", "c6ebf8fc3dcd4950dd10c03e953fb4f553a8bcf0ff4c8c40d71542434cd7e046"}, "bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"}, "certifi": {:hex, :certifi, "2.5.1", "867ce347f7c7d78563450a18a6a28a8090331e77fa02380b4a21962a65d36ee5", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm", "805abd97539caf89ec6d4732c91e62ba9da0cda51ac462380bbd28ee697a8c42"}, - "chaperon": {:hex, :chaperon, "0.3.1", "505a6f4c3ee396d6b33750d24ba46f437b3714700c2c9434199da38ca1af174f", [:mix], [{:basic_auth, "~> 2.2", [hex: :basic_auth, repo: "hexpm", optional: false]}, {:cowboy, "~> 2.6", [hex: :cowboy, repo: "hexpm", optional: false]}, {:deep_merge, "~> 1.0", [hex: :deep_merge, repo: "hexpm", optional: false]}, {:e_q, "~> 1.0.0", [hex: :e_q, repo: "hexpm", optional: false]}, {:ex_aws, "~> 2.0", [hex: :ex_aws, repo: "hexpm", optional: false]}, {:ex_aws_s3, "~> 2.0", [hex: :ex_aws_s3, repo: "hexpm", optional: false]}, {:histogrex, "~> 0.0.5", [hex: :histogrex, repo: "hexpm", optional: false]}, {:httpoison, "~> 1.5", [hex: :httpoison, repo: "hexpm", optional: false]}, {:instream, "~> 0.21.0", [hex: :instream, repo: "hexpm", optional: false]}, {:plug, "~> 1.8", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.0", [hex: :plug_cowboy, repo: "hexpm", optional: false]}, {:poison, "~> 3.0", [hex: :poison, repo: "hexpm", optional: false]}, {:uuid, "~> 1.1", [hex: :uuid, repo: "hexpm", optional: false]}, {:websockex, "~> 0.4.1", [hex: :websockex, repo: "hexpm", optional: false]}], "hexpm", "dbcf477fe177b9ea91a5f838d5df99cbed1ea4e634f5070a718bbea1767a82ce"}, - "cowboy": {:hex, :cowboy, "2.7.0", "91ed100138a764355f43316b1d23d7ff6bdb0de4ea618cb5d8677c93a7a2f115", [:rebar3], [{:cowlib, "~> 2.8.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "~> 1.7.1", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "04fd8c6a39edc6aaa9c26123009200fc61f92a3a94f3178c527b70b767c6e605"}, - "cowlib": {:hex, :cowlib, "2.8.0", "fd0ff1787db84ac415b8211573e9a30a3ebe71b5cbff7f720089972b2319c8a4", [:rebar3], [], "hexpm", "79f954a7021b302186a950a32869dbc185523d99d3e44ce430cd1f3289f41ed4"}, - "credo": {:hex, :credo, "1.3.2", "08d456dcf3c24da162d02953fb07267e444469d8dad3a2ae47794938ea467b3a", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "b11d28cce1f1f399dddffd42d8e21dcad783309e230f84b70267b1a5546468b6"}, + "chaperon": {:hex, :chaperon, "0.3.1", "505a6f4c3ee396d6b33750d24ba46f437b3714700c2c9434199da38ca1af174f", [:mix], [{:basic_auth, "~> 2.2", [hex: :basic_auth, repo: "hexpm", optional: false]}, {:cowboy, "~> 2.6", [hex: :cowboy, repo: "hexpm", optional: false]}, {:deep_merge, "~> 1.0", [hex: :deep_merge, repo: "hexpm", optional: false]}, {:e_q, "~> 1.0.0", [hex: :e_q, repo: "hexpm", optional: false]}, {:ex_aws, "~> 2.0", [hex: :ex_aws, repo: "hexpm", optional: false]}, {:ex_aws_s3, "~> 2.0", [hex: :ex_aws_s3, repo: "hexpm", optional: false]}, {:histogrex, "~> 0.0.5", [hex: :histogrex, repo: "hexpm", optional: false]}, {:httpoison, "~> 1.5", [hex: :httpoison, repo: "hexpm", optional: false]}, {:instream, "~> 0.21.0", [hex: :instream, repo: "hexpm", optional: false]}, {:plug, "~> 1.8", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.0", [hex: :plug_cowboy, repo: "hexpm", optional: false]}, {:poison, "~> 3.0", [hex: :poison, repo: "hexpm", optional: false]}, {:uuid, "~> 1.1", [hex: :uuid, repo: "hexpm", optional: false]}, {:websockex, "~> 0.4", [hex: :websockex, repo: "hexpm", optional: false]}], "hexpm", "dbcf477fe177b9ea91a5f838d5df99cbed1ea4e634f5070a718bbea1767a82ce"}, + "cowboy": {:hex, :cowboy, "2.8.0", "f3dc62e35797ecd9ac1b50db74611193c29815401e53bac9a5c0577bd7bc667d", [:rebar3], [{:cowlib, "~> 2.9.1", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "~> 1.7.1", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "4643e4fba74ac96d4d152c75803de6fad0b3fa5df354c71afdd6cbeeb15fac8a"}, + "cowboy_telemetry": {:hex, :cowboy_telemetry, "0.3.1", "ebd1a1d7aff97f27c66654e78ece187abdc646992714164380d8a041eda16754", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3a6efd3366130eab84ca372cbd4a7d3c3a97bdfcfb4911233b035d117063f0af"}, + "cowlib": {:hex, :cowlib, "2.9.1", "61a6c7c50cf07fdd24b2f45b89500bb93b6686579b069a89f88cb211e1125c78", [:rebar3], [], "hexpm", "e4175dc240a70d996156160891e1c62238ede1729e45740bdd38064dad476170"}, + "credo": {:hex, :credo, "1.5.1", "4fe303cc828412b9d21eed4eab60914c401e71f117f40243266aafb66f30d036", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "0b219ca4dcc89e4e7bc6ae7e6539c313e738e192e10b85275fa1e82b5203ecd7"}, "deep_merge": {:hex, :deep_merge, "1.0.0", "b4aa1a0d1acac393bdf38b2291af38cb1d4a52806cf7a4906f718e1feb5ee961", [:mix], [], "hexpm", "ce708e5f094b9cd4e8f2be4f00d2f4250c4095be93f8cd6d018c753894885430"}, "e_q": {:hex, :e_q, "1.0.0", "7b4dab148b8f482fac6be0e3b5ecf5b4ca86d6148b33b96ee7ca9f2e2fcf2fb7", [:mix], [], "hexpm", "23dbb293640ba24a38c6b56bfa81a569b8a6654b85e0ccbedf89c740e2b91937"}, - "ethereumex": {:hex, :ethereumex, "0.6.0", "6c3a8f7ac09aa390db5c7d79678c1833948725c4c157946e86a7f4a1a6d03ce2", [:mix], [{:httpoison, "~> 1.4.0", [hex: :httpoison, repo: "hexpm", optional: false]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:poolboy, "~> 1.5.1", [hex: :poolboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "b221e989962a3a9e9d8d40af212ca86d3ee72800493a432a54426c807517f237"}, + "ethereumex": {:hex, :ethereumex, "0.6.4", "58e998acb13b45a2b76b954b1d503f2f5f0e8118c0a14769c59264ef3ee4c301", [:mix], [{:httpoison, "~> 1.6", [hex: :httpoison, repo: "hexpm", optional: false]}, {:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: false]}, {:poolboy, "~> 1.5.1", [hex: :poolboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "abc0bed1ba691645700f55bc843be7d08a23284e20ad889cabe6279e13debb32"}, "ex_abi": {:hex, :ex_abi, "0.2.2", "805c19edccb98ecd02a2eee1851d49f625ae036953ae45b3349468333b19870e", [:mix], [{:exth_crypto, "~> 0.1.6", [hex: :exth_crypto, repo: "hexpm", optional: false]}], "hexpm", "649688a53dde9c676f6a760cc0c1e43cb246010a7f83b13b9e5bd75aa04cc409"}, - "ex_aws": {:hex, :ex_aws, "2.1.1", "1e4de2106cfbf4e837de41be41cd15813eabc722315e388f0d6bb3732cec47cd", [:mix], [{:configparser_ex, "~> 4.0", [hex: :configparser_ex, repo: "hexpm", optional: true]}, {:hackney, "1.6.3 or 1.6.5 or 1.7.1 or 1.8.6 or ~> 1.9", [hex: :hackney, repo: "hexpm", optional: true]}, {:jsx, "~> 2.8", [hex: :jsx, repo: "hexpm", optional: true]}, {:poison, ">= 1.2.0", [hex: :poison, repo: "hexpm", optional: true]}, {:sweet_xml, "~> 0.6", [hex: :sweet_xml, repo: "hexpm", optional: true]}], "hexpm", "06b6fde12b33bb6d65d5d3493e903ba5a56d57a72350c15285a4298338089e10"}, - "ex_aws_s3": {:hex, :ex_aws_s3, "2.0.2", "c0258bbdfea55de4f98f0b2f0ca61fe402cc696f573815134beb1866e778f47b", [:mix], [{:ex_aws, "~> 2.0", [hex: :ex_aws, repo: "hexpm", optional: false]}, {:sweet_xml, ">= 0.0.0", [hex: :sweet_xml, repo: "hexpm", optional: true]}], "hexpm", "0569f5b211b1a3b12b705fe2a9d0e237eb1360b9d76298028df2346cad13097a"}, - "ex_plasma": {:git, "https://github.com/omisego/ex_plasma.git", "8efb48a2283984e8fcb4ab0398c922f4c8ed014c", []}, + "ex_aws": {:hex, :ex_aws, "2.1.6", "41ab8b4caa48035c96d07faa035d2d9de6df480e7e084c054e662ac888dcd4d4", [:mix], [{:configparser_ex, "~> 4.0", [hex: :configparser_ex, repo: "hexpm", optional: true]}, {:hackney, "~> 1.9", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: true]}, {:jsx, "~> 2.8", [hex: :jsx, repo: "hexpm", optional: true]}, {:sweet_xml, "~> 0.6", [hex: :sweet_xml, repo: "hexpm", optional: true]}], "hexpm", "a541bd042c1ee26412bb1e749ddf2a1c327e4fb7e382b1cd227e1b00eed3d469"}, + "ex_aws_s3": {:hex, :ex_aws_s3, "2.1.0", "4db576e1036e554acdc2f03041ae16651a00307a69a377369fdc0e3d7f2e41e9", [:mix], [{:ex_aws, "~> 2.0", [hex: :ex_aws, repo: "hexpm", optional: false]}, {:sweet_xml, ">= 0.0.0", [hex: :sweet_xml, repo: "hexpm", optional: true]}], "hexpm", "7b6867d326251f3f3c1a6f5e70ef084c6ae75a933d3fc373d1e10fd4ae1e1483"}, + "ex_plasma": {:git, "https://github.com/omisego/ex_plasma.git", "8efb48a2283984e8fcb4ab0398c922f4c8ed014c", [branch: "master-v2"]}, "ex_rlp": {:hex, :ex_rlp, "0.5.3", "9055bddade545ee3e734aaad62c4b4d08211834da3beb43ae269b75785909e5e", [:mix], [], "hexpm", "a755a5f8f9f66079f3ecbe021536b949077fac0df963d9e59a20321bab28722d"}, "exth_crypto": {:hex, :exth_crypto, "0.1.6", "8e636a9bcb75d8e32451be96e547a495121ed2178d078db294edb0f81f7cf2e8", [:mix], [{:binary, "~> 0.0.4", [hex: :binary, repo: "hexpm", optional: false]}, {:keccakf1600, "~> 2.0.0", [hex: :keccakf1600_orig, repo: "hexpm", optional: false]}, {:libsecp256k1, "~> 0.1.9", [hex: :libsecp256k1, repo: "hexpm", optional: false]}], "hexpm", "45d6faf4b889f8fc526deba059e0c7947423784ab1e7fa85be8db4c46cf4416b"}, + "fake_server": {:hex, :fake_server, "2.1.0", "aefed08a587e2498fdb39ac9de6f9eabbe7bd83da9801d08d3574d61b7eb03d5", [:mix], [{:cowboy, "~> 2.5", [hex: :cowboy, repo: "hexpm", optional: false]}, {:poison, ">= 1.0.0", [hex: :poison, repo: "hexpm", optional: false]}], "hexpm", "3200d57a523b27d2c8ebfc1a80b76697b3c8a06bf9d678d82114f5f98d350c75"}, + "file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"}, "hackney": {:hex, :hackney, "1.15.2", "07e33c794f8f8964ee86cebec1a8ed88db5070e52e904b8f12209773c1036085", [:rebar3], [{:certifi, "2.5.1", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "6.0.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.5", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm", "e0100f8ef7d1124222c11ad362c857d3df7cb5f4204054f9f0f4a728666591fc"}, "histogrex": {:hex, :histogrex, "0.0.5", "2e92ce1690bd304e5e5b683c51951f7376dd2cc379f0575d45951a2a82c2edd2", [:mix], [], "hexpm", "5eb03f7d802defa4cce11f130211bdefe2d21817439e0bb37a7ceaf7e6d43340"}, "httpoison": {:hex, :httpoison, "1.6.2", "ace7c8d3a361cebccbed19c283c349b3d26991eff73a1eaaa8abae2e3c8089b6", [:mix], [{:hackney, "~> 1.15 and >= 1.15.2", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "aa2c74bd271af34239a3948779612f87df2422c2fdcfdbcec28d9c105f0773fe"}, "idna": {:hex, :idna, "6.0.0", "689c46cbcdf3524c44d5f3dde8001f364cd7608a99556d8fbd8239a5798d4c10", [:rebar3], [{:unicode_util_compat, "0.4.1", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "4bdd305eb64e18b0273864920695cb18d7a2021f31a11b9c5fbcd9a253f936e2"}, "influxql": {:hex, :influxql, "0.2.1", "71bfd5c0d81bf870f239baf3357bf5226b44fce16e1b9399ba1368203ca71245", [:mix], [], "hexpm", "75faf04960d6830ca0827869eaac1ba092655041c5e96deb2a588bafb601205c"}, "instream": {:hex, :instream, "0.21.0", "9660449133120cb19851d92173c92164cf3f70deb32c4b7ee2a772b575fa7df8", [:mix], [{:hackney, "~> 1.1", [hex: :hackney, repo: "hexpm", optional: false]}, {:influxql, "~> 0.2.0", [hex: :influxql, repo: "hexpm", optional: false]}, {:poison, "~> 3.0", [hex: :poison, repo: "hexpm", optional: false]}, {:poolboy, "~> 1.5", [hex: :poolboy, repo: "hexpm", optional: false]}], "hexpm", "bbc6f1c53679df6deb78806ec24259413219b2c9a7c2dbdd6289f3544f065111"}, - "jason": {:hex, :jason, "1.1.2", "b03dedea67a99223a2eaf9f1264ce37154564de899fd3d8b9a21b1a6fd64afe7", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fdf843bca858203ae1de16da2ee206f53416bbda5dc8c9e78f43243de4bc3afe"}, + "jason": {:hex, :jason, "1.2.2", "ba43e3f2709fd1aa1dce90aaabfd039d000469c05c56f0b8e31978e03fa39052", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "18a228f5f0058ee183f29f9eae0805c6e59d61c3b006760668d8d18ff0d12179"}, "keccakf1600": {:hex, :keccakf1600_orig, "2.0.0", "0a7217ddb3ee8220d449bbf7575ec39d4e967099f220a91e3dfca4dbaef91963", [:rebar3], [], "hexpm", "bdbbb02d67bea35605f95d4e3de48203347374e414da7945c4f2f7fd13ffe632"}, "libsecp256k1": {:git, "https://github.com/omisego/libsecp256k1.git", "83d4c91b7b5ad79fdd3c020be8c57ff6e2212780", [branch: "elixir-only"]}, "libsecp256k1_source": {:git, "https://github.com/bitcoin-core/secp256k1.git", "d33352151699bd7598b868369dace092f7855740", [ref: "d33352151699bd7598b868369dace092f7855740"]}, "merkle_tree": {:hex, :merkle_tree, "2.0.0", "84a9cbfd3d8fab545d69c320460ff713ddea2f64ec4c14edfcc4f8eba899d5ab", [:mix], [], "hexpm", "351a764e385ce75bd782a972fc9597d99bed4d692631903e4a08936d4939c895"}, "metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"}, - "mime": {:hex, :mime, "1.3.1", "30ce04ab3175b6ad0bdce0035cba77bba68b813d523d1aac73d9781b4d193cf8", [:mix], [], "hexpm", "6cbe761d6a0ca5a31a0931bf4c63204bceb64538e664a8ecf784a9a6f3b875f1"}, + "mime": {:hex, :mime, "1.5.0", "203ef35ef3389aae6d361918bf3f952fa17a09e8e43b5aa592b93eba05d0fb8d", [:mix], [], "hexpm", "55a94c0f552249fc1a3dd9cd2d3ab9de9d3c89b559c2bd01121f824834f24746"}, "mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"}, "parse_trans": {:hex, :parse_trans, "3.3.0", "09765507a3c7590a784615cfd421d101aec25098d50b89d7aa1d66646bc571c1", [:rebar3], [], "hexpm", "17ef63abde837ad30680ea7f857dd9e7ced9476cdd7b0394432af4bfc241b960"}, - "plug": {:hex, :plug, "1.9.0", "8d7c4e26962283ff9f8f3347bd73838e2413fbc38b7bb5467d5924f68f3a5a4a", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.1", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "9902eda2c52ada2a096434682e99a2493f5d06a94d6ac6bcfff9805f952350f1"}, - "plug_cowboy": {:hex, :plug_cowboy, "2.1.2", "8b0addb5908c5238fac38e442e81b6fcd32788eaa03246b4d55d147c47c5805e", [:mix], [{:cowboy, "~> 2.5", [hex: :cowboy, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "7d722581ce865a237e14da6d946f92704101740a256bd13ec91e63c0b122fc70"}, - "plug_crypto": {:hex, :plug_crypto, "1.1.2", "bdd187572cc26dbd95b87136290425f2b580a116d3fb1f564216918c9730d227", [:mix], [], "hexpm", "6b8b608f895b6ffcfad49c37c7883e8df98ae19c6a28113b02aa1e9c5b22d6b5"}, + "plug": {:hex, :plug, "1.11.0", "f17217525597628298998bc3baed9f8ea1fa3f1160aa9871aee6df47a6e4d38e", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "2d9c633f0499f9dc5c2fd069161af4e2e7756890b81adcbb2ceaa074e8308876"}, + "plug_cowboy": {:hex, :plug_cowboy, "2.4.1", "779ba386c0915027f22e14a48919a9545714f849505fa15af2631a0d298abf0f", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "d72113b6dff7b37a7d9b2a5b68892808e3a9a752f2bf7e503240945385b70507"}, + "plug_crypto": {:hex, :plug_crypto, "1.2.0", "1cb20793aa63a6c619dd18bb33d7a3aa94818e5fd39ad357051a67f26dfa2df6", [:mix], [], "hexpm", "a48b538ae8bf381ffac344520755f3007cc10bd8e90b240af98ea29b69683fc2"}, "poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], [], "hexpm", "fec8660eb7733ee4117b85f55799fd3833eb769a6df71ccf8903e8dc5447cfce"}, "poolboy": {:hex, :poolboy, "1.5.2", "392b007a1693a64540cead79830443abf5762f5d30cf50bc95cb2c1aaafa006b", [:rebar3], [], "hexpm", "dad79704ce5440f3d5a3681c8590b9dc25d1a561e8f5a9c995281012860901e3"}, "ranch": {:hex, :ranch, "1.7.1", "6b1fab51b49196860b733a49c07604465a47bdb78aa10c1c16a3d199f7f8c881", [:rebar3], [], "hexpm", "451d8527787df716d99dc36162fca05934915db0b6141bbdac2ea8d3c7afc7d7"}, "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.5", "6eaf7ad16cb568bb01753dbbd7a95ff8b91c7979482b95f38443fe2c8852a79b", [:make, :mix, :rebar3], [], "hexpm", "13104d7897e38ed7f044c4de953a6c28597d1c952075eb2e328bc6d6f2bfc496"}, - "telemetry": {:hex, :telemetry, "0.4.1", "ae2718484892448a24470e6aa341bc847c3277bfb8d4e9289f7474d752c09c7f", [:rebar3], [], "hexpm", "4738382e36a0a9a2b6e25d67c960e40e1a2c95560b9f936d8e29de8cd858480f"}, - "tesla": {:hex, :tesla, "1.3.2", "deb92c5c9ce35e747a395ba413ca78593a4f75bf0e1545630ee2e3d34264021e", [:mix], [{:castore, "~> 0.1", [hex: :castore, repo: "hexpm", optional: true]}, {:exjsx, ">= 3.0.0", [hex: :exjsx, repo: "hexpm", optional: true]}, {:fuse, "~> 2.4", [hex: :fuse, repo: "hexpm", optional: true]}, {:gun, "~> 1.3", [hex: :gun, repo: "hexpm", optional: true]}, {:hackney, "~> 1.6", [hex: :hackney, repo: "hexpm", optional: true]}, {:ibrowse, "~> 4.4.0", [hex: :ibrowse, repo: "hexpm", optional: true]}, {:jason, ">= 1.0.0", [hex: :jason, repo: "hexpm", optional: true]}, {:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mint, "~> 1.0", [hex: :mint, repo: "hexpm", optional: true]}, {:poison, ">= 1.0.0", [hex: :poison, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.3", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "7567704c4790e21bd9a961b56d0b6a988ff68cc4dacfe6b2106e258da1d5cdda"}, + "statix": {:hex, :statix, "1.4.0", "c822abd1e60e62828e8460e932515d0717aa3c089b44cc3f795d43b94570b3a8", [:mix], [], "hexpm", "507373cc80925a9b6856cb14ba17f6125552434314f6613c907d295a09d1a375"}, + "telemetry": {:hex, :telemetry, "0.4.2", "2808c992455e08d6177322f14d3bdb6b625fbcfd233a73505870d8738a2f4599", [:rebar3], [], "hexpm", "2d1419bd9dda6a206d7b5852179511722e2b18812310d304620c7bd92a13fcef"}, + "tesla": {:hex, :tesla, "1.3.3", "26ae98627af5c406584aa6755ab5fc96315d70d69a24dd7f8369cfcb75094a45", [:mix], [{:castore, "~> 0.1", [hex: :castore, repo: "hexpm", optional: true]}, {:exjsx, ">= 3.0.0", [hex: :exjsx, repo: "hexpm", optional: true]}, {:fuse, "~> 2.4", [hex: :fuse, repo: "hexpm", optional: true]}, {:gun, "~> 1.3", [hex: :gun, repo: "hexpm", optional: true]}, {:hackney, "~> 1.6", [hex: :hackney, repo: "hexpm", optional: true]}, {:ibrowse, "~> 4.4.0", [hex: :ibrowse, repo: "hexpm", optional: true]}, {:jason, ">= 1.0.0", [hex: :jason, repo: "hexpm", optional: true]}, {:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mint, "~> 1.0", [hex: :mint, repo: "hexpm", optional: true]}, {:poison, ">= 1.0.0", [hex: :poison, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "2648f1c276102f9250299e0b7b57f3071c67827349d9173f34c281756a1b124c"}, "unicode_util_compat": {:hex, :unicode_util_compat, "0.4.1", "d869e4c68901dd9531385bb0c8c40444ebf624e60b6962d95952775cac5e90cd", [:rebar3], [], "hexpm", "1d1848c40487cdb0b30e8ed975e34e025860c02e419cb615d255849f3427439d"}, "uuid": {:hex, :uuid, "1.1.8", "e22fc04499de0de3ed1116b770c7737779f226ceefa0badb3592e64d5cfb4eb9", [:mix], [], "hexpm", "c790593b4c3b601f5dc2378baae7efaf5b3d73c4c6456ba85759905be792f2ac"}, "websockex": {:hex, :websockex, "0.4.2", "9a3b7dc25655517ecd3f8ff7109a77fce94956096b942836cdcfbc7c86603ecc", [:mix], [], "hexpm", "803cd76e91544b56f0e655e36790be797fa6436db9224f7c303db9b9df2a3df4"}, diff --git a/snapshots.env b/snapshots.env index c33e447b14..4291ba0010 100644 --- a/snapshots.env +++ b/snapshots.env @@ -1,4 +1,7 @@ -SNAPSHOT_MIX_EXIT_PERIOD_SECONDS_20=https://storage.googleapis.com/circleci-docker-artifacts/data-elixir-omg-tester-plasma-deployer-dev-ba4d320-MIN_EXIT_PERIOD-20-PLASMA_CONTRACTS_SHA-33bb21c16dfa5e33926f5aa7f7b7fb66d3633c1f.tar.gz -SNAPSHOT_MIX_EXIT_PERIOD_SECONDS_120=https://storage.googleapis.com/circleci-docker-artifacts/data-elixir-omg-tester-plasma-deployer-dev-ba4d320-MIN_EXIT_PERIOD-120-PLASMA_CONTRACTS_SHA-33bb21c16dfa5e33926f5aa7f7b7fb66d3633c1f.tar.gz -SNAPSHOT_MIX_EXIT_PERIOD_SECONDS_240=https://storage.googleapis.com/circleci-docker-artifacts/data-elixir-omg-tester-plasma-deployer-dev-ba4d320-MIN_EXIT_PERIOD-240-PLASMA_CONTRACTS_SHA-33bb21c16dfa5e33926f5aa7f7b7fb66d3633c1f.tar.gz -CONTRACT_SHA=33bb21c16dfa5e33926f5aa7f7b7fb66d3633c1f +SNAPSHOT_MIX_EXIT_PERIOD_SECONDS_20=https://storage.googleapis.com/circleci-docker-artifacts/data-elixir-omg-tester-plasma-deployer-dev-6b9e25f-MIN_EXIT_PERIOD-20-PLASMA_CONTRACTS_SHA-3646712275164482eea35b2b623df30d272de12c-VAULT-false.tar.gz +SNAPSHOT_MIX_EXIT_PERIOD_SECONDS_120=https://storage.googleapis.com/circleci-docker-artifacts/data-elixir-omg-tester-plasma-deployer-dev-6b9e25f-MIN_EXIT_PERIOD-120-PLASMA_CONTRACTS_SHA-3646712275164482eea35b2b623df30d272de12c-VAULT-false.tar.gz +SNAPSHOT_MIX_EXIT_PERIOD_SECONDS_240=https://storage.googleapis.com/circleci-docker-artifacts/data-elixir-omg-tester-plasma-deployer-dev-6b9e25f-MIN_EXIT_PERIOD-240-PLASMA_CONTRACTS_SHA-3646712275164482eea35b2b623df30d272de12c-VAULT-false.tar.gz +VAULT_SNAPSHOT_MIX_EXIT_PERIOD_SECONDS_20=https://storage.googleapis.com/circleci-docker-artifacts/data-elixir-omg-tester-plasma-deployer-dev-6b9e25f-MIN_EXIT_PERIOD-20-PLASMA_CONTRACTS_SHA-3646712275164482eea35b2b623df30d272de12c-VAULT-true.tar.gz +VAULT_SNAPSHOT_MIX_EXIT_PERIOD_SECONDS_120=https://storage.googleapis.com/circleci-docker-artifacts/data-elixir-omg-tester-plasma-deployer-dev-6b9e25f-MIN_EXIT_PERIOD-120-PLASMA_CONTRACTS_SHA-3646712275164482eea35b2b623df30d272de12c-VAULT-true.tar.gz +VAULT_SNAPSHOT_MIX_EXIT_PERIOD_SECONDS_240=https://storage.googleapis.com/circleci-docker-artifacts/data-elixir-omg-tester-plasma-deployer-dev-6b9e25f-MIN_EXIT_PERIOD-240-PLASMA_CONTRACTS_SHA-3646712275164482eea35b2b623df30d272de12c-VAULT-true.tar.gz +CONTRACT_SHA=3646712275164482eea35b2b623df30d272de12c \ No newline at end of file