From 86a66a2c077af63382119cae032b3790126ad5eb Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Wed, 13 Mar 2019 13:49:06 +0300 Subject: [PATCH 01/14] change v column type --- .../20190313103912_change_transactions_v_column_type.exs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 apps/explorer/priv/repo/migrations/20190313103912_change_transactions_v_column_type.exs diff --git a/apps/explorer/priv/repo/migrations/20190313103912_change_transactions_v_column_type.exs b/apps/explorer/priv/repo/migrations/20190313103912_change_transactions_v_column_type.exs new file mode 100644 index 0000000000..a36a1be4dc --- /dev/null +++ b/apps/explorer/priv/repo/migrations/20190313103912_change_transactions_v_column_type.exs @@ -0,0 +1,9 @@ +defmodule Explorer.Repo.Migrations.ChangeTransactionsVColumnType do + use Ecto.Migration + + def change do + alter table(:transactions) do + modify(:v, :numeric, precision: 100, null: false) + end + end +end From 089e1619975ce548395b3a3dcdbeb03da8c5bc95 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Wed, 13 Mar 2019 14:45:51 +0300 Subject: [PATCH 02/14] fix tests --- .../test/block_scout_web/schema/query/address_test.exs | 2 +- .../test/block_scout_web/schema/query/transaction_test.exs | 2 +- apps/explorer/lib/explorer/chain/transaction.ex | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/block_scout_web/test/block_scout_web/schema/query/address_test.exs b/apps/block_scout_web/test/block_scout_web/schema/query/address_test.exs index 471401f7b6..1865e0ca74 100644 --- a/apps/block_scout_web/test/block_scout_web/schema/query/address_test.exs +++ b/apps/block_scout_web/test/block_scout_web/schema/query/address_test.exs @@ -215,7 +215,7 @@ defmodule BlockScoutWeb.Schema.Query.AddressTest do "r" => to_string(transaction.r), "s" => to_string(transaction.s), "status" => nil, - "v" => transaction.v, + "v" => to_string(transaction.v), "value" => to_string(transaction.value.value), "from_address_hash" => to_string(transaction.from_address_hash), "to_address_hash" => to_string(transaction.to_address_hash), diff --git a/apps/block_scout_web/test/block_scout_web/schema/query/transaction_test.exs b/apps/block_scout_web/test/block_scout_web/schema/query/transaction_test.exs index e76ca54e43..b647e69de6 100644 --- a/apps/block_scout_web/test/block_scout_web/schema/query/transaction_test.exs +++ b/apps/block_scout_web/test/block_scout_web/schema/query/transaction_test.exs @@ -55,7 +55,7 @@ defmodule BlockScoutWeb.Schema.Query.TransactionTest do "r" => to_string(transaction.r), "s" => to_string(transaction.s), "status" => transaction.status |> to_string() |> String.upcase(), - "v" => transaction.v, + "v" => to_string(transaction.v), "value" => to_string(transaction.value.value), "from_address_hash" => to_string(transaction.from_address_hash), "to_address_hash" => to_string(transaction.to_address_hash), diff --git a/apps/explorer/lib/explorer/chain/transaction.ex b/apps/explorer/lib/explorer/chain/transaction.ex index d3ccd8ab49..1cf9c8f116 100644 --- a/apps/explorer/lib/explorer/chain/transaction.ex +++ b/apps/explorer/lib/explorer/chain/transaction.ex @@ -202,7 +202,7 @@ defmodule Explorer.Chain.Transaction do field(:r, :decimal) field(:s, :decimal) field(:status, Status) - field(:v, :integer) + field(:v, :decimal) field(:value, Wei) timestamps() From 5b2ea55c0ee372b68467b07064a90b4e25ac363c Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Thu, 14 Mar 2019 11:31:23 +0300 Subject: [PATCH 03/14] modify migration --- .../20190313103912_change_transactions_v_column_type.exs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/explorer/priv/repo/migrations/20190313103912_change_transactions_v_column_type.exs b/apps/explorer/priv/repo/migrations/20190313103912_change_transactions_v_column_type.exs index a36a1be4dc..73aaaad672 100644 --- a/apps/explorer/priv/repo/migrations/20190313103912_change_transactions_v_column_type.exs +++ b/apps/explorer/priv/repo/migrations/20190313103912_change_transactions_v_column_type.exs @@ -1,9 +1,15 @@ defmodule Explorer.Repo.Migrations.ChangeTransactionsVColumnType do use Ecto.Migration - def change do + def up do alter table(:transactions) do modify(:v, :numeric, precision: 100, null: false) end end + + def down do + alter table(:transactions) do + modify(:v, :integer, null: false) + end + end end From 75b558b5000bc2b0a53c42f9d2101a97c1bfcb60 Mon Sep 17 00:00:00 2001 From: zachdaniel Date: Thu, 14 Mar 2019 13:39:51 -0400 Subject: [PATCH 04/14] feat: allow setting different configuration just for realtime fetcher --- apps/indexer/config/dev/parity.exs | 17 +++++++++++++++++ apps/indexer/lib/indexer/block/supervisor.ex | 15 ++++++++++++--- .../lib/indexer/shrinkable/supervisor.ex | 3 ++- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/apps/indexer/config/dev/parity.exs b/apps/indexer/config/dev/parity.exs index bdda087359..d6e300f077 100644 --- a/apps/indexer/config/dev/parity.exs +++ b/apps/indexer/config/dev/parity.exs @@ -16,6 +16,23 @@ config :indexer, ], variant: EthereumJSONRPC.Parity ], + # Example configuration to override json_rpc_named_arguments for just the realtime block fetcher + # realtime_overrides: [ + # json_rpc_named_arguments: [ + # transport: EthereumJSONRPC.HTTP, + # transport_options: [ + # http: EthereumJSONRPC.HTTP.HTTPoison, + # url: System.get_env("ETHEREUM_JSONRPC_REALTIME_HTTP_URL") || "http://localhost:8545", + # method_to_url: [ + # eth_getBalance: System.get_env("ETHEREUM_JSONRPC_REALTIME_TRACE_URL") || "http://localhost:8545", + # trace_block: System.get_env("ETHEREUM_JSONRPC_REALTIME_TRACE_URL") || "http://localhost:8545", + # trace_replayTransaction: System.get_env("ETHEREUM_JSONRPC_REALTIME_TRACE_URL") || "http://localhost:8545" + # ], + # http_options: [recv_timeout: :timer.minutes(1), timeout: :timer.minutes(1), hackney: [pool: :ethereum_jsonrpc]] + # ], + # variant: EthereumJSONRPC.Parity + # ] + # ], subscribe_named_arguments: [ transport: EthereumJSONRPC.WebSocket, transport_options: [ diff --git a/apps/indexer/lib/indexer/block/supervisor.ex b/apps/indexer/lib/indexer/block/supervisor.ex index 6365aba2d7..d77960c503 100644 --- a/apps/indexer/lib/indexer/block/supervisor.ex +++ b/apps/indexer/lib/indexer/block/supervisor.ex @@ -18,14 +18,23 @@ defmodule Indexer.Block.Supervisor do %{ block_interval: block_interval, json_rpc_named_arguments: json_rpc_named_arguments, - subscribe_named_arguments: subscribe_named_arguments + subscribe_named_arguments: subscribe_named_arguments, + realtime_overrides: realtime_overrides } = named_arguments ) do block_fetcher = named_arguments - |> Map.drop(~w(block_interval memory_monitor subscribe_named_arguments)a) + |> Map.drop(~w(block_interval memory_monitor subscribe_named_arguments realtime_overrides)a) |> Block.Fetcher.new() + realtime_block_fetcher = + named_arguments + |> Map.drop(~w(block_interval memory_monitor subscribe_named_arguments realtime_overrides)a) + |> Map.merge(Enum.into(realtime_overrides, %{})) + |> Block.Fetcher.new() + + realtime_subscribe_named_arguments = realtime_overrides[:subscribe_named_arguments] || subscribe_named_arguments + memory_monitor = Map.get(named_arguments, :memory_monitor) Supervisor.init( @@ -38,7 +47,7 @@ defmodule Indexer.Block.Supervisor do {InvalidConsensus.Supervisor, [[], [name: InvalidConsensus.Supervisor]]}, {Realtime.Supervisor, [ - %{block_fetcher: block_fetcher, subscribe_named_arguments: subscribe_named_arguments}, + %{block_fetcher: realtime_block_fetcher, subscribe_named_arguments: realtime_subscribe_named_arguments}, [name: Realtime.Supervisor] ]}, {Uncle.Supervisor, [[block_fetcher: block_fetcher, memory_monitor: memory_monitor], [name: Uncle.Supervisor]]}, diff --git a/apps/indexer/lib/indexer/shrinkable/supervisor.ex b/apps/indexer/lib/indexer/shrinkable/supervisor.ex index e4b6693c40..6135b7f9e0 100644 --- a/apps/indexer/lib/indexer/shrinkable/supervisor.ex +++ b/apps/indexer/lib/indexer/shrinkable/supervisor.ex @@ -48,10 +48,11 @@ defmodule Indexer.Shrinkable.Supervisor do |> Application.get_all_env() |> Keyword.take( ~w(blocks_batch_size blocks_concurrency block_interval json_rpc_named_arguments receipts_batch_size - receipts_concurrency subscribe_named_arguments)a + receipts_concurrency subscribe_named_arguments realtime_overrides)a ) |> Enum.into(%{}) |> Map.put(:memory_monitor, memory_monitor) + |> Map.put_new(:realtime_overrides, %{}) Supervisor.init( [ From d9387ae495040b9cd7755aee66797a47e2652153 Mon Sep 17 00:00:00 2001 From: nervehammer Date: Fri, 15 Mar 2019 15:28:43 +0530 Subject: [PATCH 05/14] add option to disable block rewards --- apps/indexer/config/config.exs | 1 + apps/indexer/lib/indexer/block/reward/fetcher.ex | 7 ++++++- apps/indexer/lib/indexer/block/reward/supervisor.ex | 10 +++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/apps/indexer/config/config.exs b/apps/indexer/config/config.exs index a0f9662ef7..10dfd691a0 100644 --- a/apps/indexer/config/config.exs +++ b/apps/indexer/config/config.exs @@ -36,6 +36,7 @@ config :indexer, memory_limit: 1 <<< 30 # config :indexer, Indexer.ReplacedTransaction.Supervisor, disabled?: true +# config :indexer, Indexer.Block.Reward.Supervisor, disabled?: true config :indexer, Indexer.Tracer, service: :indexer, diff --git a/apps/indexer/lib/indexer/block/reward/fetcher.ex b/apps/indexer/lib/indexer/block/reward/fetcher.ex index f480021545..88a9f9391d 100644 --- a/apps/indexer/lib/indexer/block/reward/fetcher.ex +++ b/apps/indexer/lib/indexer/block/reward/fetcher.ex @@ -18,6 +18,7 @@ defmodule Indexer.Block.Reward.Fetcher do alias Explorer.Chain.{Block, Wei} alias Indexer.Address.CoinBalances alias Indexer.{AddressExtraction, BufferedTask, CoinBalance, Tracer} + alias Indexer.Block.Reward.Supervisor, as: BlockRewardSupervisor @behaviour BufferedTask @@ -34,7 +35,11 @@ defmodule Indexer.Block.Reward.Fetcher do """ @spec async_fetch([Block.block_number()]) :: :ok def async_fetch(block_numbers) when is_list(block_numbers) do - BufferedTask.buffer(__MODULE__, block_numbers) + if BlockRewardSupervisor.disabled?() do + :ok + else + BufferedTask.buffer(__MODULE__, block_numbers) + end end @doc false diff --git a/apps/indexer/lib/indexer/block/reward/supervisor.ex b/apps/indexer/lib/indexer/block/reward/supervisor.ex index de222dd328..9dab2269a2 100644 --- a/apps/indexer/lib/indexer/block/reward/supervisor.ex +++ b/apps/indexer/lib/indexer/block/reward/supervisor.ex @@ -22,7 +22,15 @@ defmodule Indexer.Block.Reward.Supervisor do end def start_link(arguments, gen_server_options \\ []) do - Supervisor.start_link(__MODULE__, arguments, Keyword.put_new(gen_server_options, :name, __MODULE__)) + if disabled?() do + :ignore + else + Supervisor.start_link(__MODULE__, arguments, Keyword.put_new(gen_server_options, :name, __MODULE__)) + end + end + + def disabled?() do + Application.get_env(:indexer, __MODULE__, [])[:disabled?] == true end @impl Supervisor From c6edba10a4e8cda30c9bbe381a21226c2b9adc21 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Fri, 15 Mar 2019 17:34:19 +0300 Subject: [PATCH 06/14] Add changelog.md, update cintributing template --- CHANGELOG.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ CONTRIBUTING.md | 1 + 2 files changed, 49 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000000..fa8f304e35 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,48 @@ +## Current + +### Features + +### Fixes + +### Chore + +## 1.3.5-beta + +### Features + + - [#1560](https://github.com/poanetwork/blockscout/pull/1560) - Allow executing smart contract functions in arbitrarily sized batches + - [#1543](https://github.com/poanetwork/blockscout/pull/1543) - Use trace_replayBlockTransactions API for faster tracing + - [#1558](https://github.com/poanetwork/blockscout/pull/1558) - Allow searching by token symbol + - [https://github.com/poanetwork/blockscout/pull/1551](https://github.com/poanetwork/blockscout/pull/1551) Exact date and time for Transaction details page + - [https://github.com/poanetwork/blockscout/pull/1547](https://github.com/poanetwork/blockscout/pull/1547) - Verify smart contracts with evm versions + - [https://github.com/poanetwork/blockscout/pull/1540](https://github.com/poanetwork/blockscout/pull/1540) - Fetch ERC721 token balances if sender is '0x0..0' + - [https://github.com/poanetwork/blockscout/pull/1539](https://github.com/poanetwork/blockscout/pull/1539) - Add the link to release in the footer +- [https://github.com/poanetwork/blockscout/pull/1519](https://github.com/poanetwork/blockscout/pull/1519) - Create contract methods + - [https://github.com/poanetwork/blockscout/pull/1496](https://github.com/poanetwork/blockscout/pull/1496) - Remove dropped/replaced transactions in pending transactions list + - [https://github.com/poanetwork/blockscout/pull/1492](https://github.com/poanetwork/blockscout/pull/1492) - Disable usd value for an empty exchange rate + - [https://github.com/poanetwork/blockscout/pull/1466](https://github.com/poanetwork/blockscout/pull/1466) - Decoding candidates for unverified contracts + +### Fixes + - [https://github.com/poanetwork/blockscout/pull/1545](https://github.com/poanetwork/blockscout/pull/1545) - Fix scheduling of latest block polling in Realtime Fetcher + - [https://github.com/poanetwork/blockscout/pull/1554](https://github.com/poanetwork/blockscout/pull/1554) - Encode integer parameters when calling smart contract functions +- [https://github.com/poanetwork/blockscout/pull/1537](https://github.com/poanetwork/blockscout/pull/1537) - Fix test that depended on date +- [https://github.com/poanetwork/blockscout/pull/1534](https://github.com/poanetwork/blockscout/pull/1534) - Render a nicer error when creator cannot be determined +- [https://github.com/poanetwork/blockscout/pull/1527](https://github.com/poanetwork/blockscout/pull/1527) - Add index to value_fetched_at +- [https://github.com/poanetwork/blockscout/pull/1518](https://github.com/poanetwork/blockscout/pull/1518) - Select only distinct failed transactions + - [https://github.com/poanetwork/blockscout/pull/1516](https://github.com/poanetwork/blockscout/pull/1516) - Fix coin balance params reducer for pending transaction + - [https://github.com/poanetwork/blockscout/pull/1511](https://github.com/poanetwork/blockscout/pull/1511) - Set correct log level for production + - [https://github.com/poanetwork/blockscout/pull/1510](https://github.com/poanetwork/blockscout/pull/1510) - Fix test that fails every 1st day of the month +- [https://github.com/poanetwork/blockscout/pull/1509](https://github.com/poanetwork/blockscout/pull/1509) - Add index to blocks' consensus + - [https://github.com/poanetwork/blockscout/pull/1508](https://github.com/poanetwork/blockscout/pull/1508) - Remove duplicated indexes + - [https://github.com/poanetwork/blockscout/pull/1505](https://github.com/poanetwork/blockscout/pull/1505) - Use https instead of ssh for absinthe libs + - [https://github.com/poanetwork/blockscout/pull/1501](https://github.com/poanetwork/blockscout/pull/1501) - Constructor_arguments must be type `text` + - [https://github.com/poanetwork/blockscout/pull/1498](https://github.com/poanetwork/blockscout/pull/1498) - Add index for created_contract_address_hash in transactions + - [https://github.com/poanetwork/blockscout/pull/1493](https://github.com/poanetwork/blockscout/pull/1493) - Do not do work in process initialization + - [https://github.com/poanetwork/blockscout/pull/1487](https://github.com/poanetwork/blockscout/pull/1487) - Limit geth sync to 128 blocks + - [https://github.com/poanetwork/blockscout/pull/1484](https://github.com/poanetwork/blockscout/pull/1484) - Allow decoding input as utf-8 + - [https://github.com/poanetwork/blockscout/pull/1479](https://github.com/poanetwork/blockscout/pull/1479) - Remove smoothing from coin balance chart + +### Chore + - [https://github.com/poanetwork/blockscout/pull/1532](https://github.com/poanetwork/blockscout/pull/1532) - Upgrade elixir to 1.8.1 +- [https://github.com/poanetwork/blockscout/pull/1553](https://github.com/poanetwork/blockscout/pull/1553) - Dockerfile: remove 1.7.1 version pin FROM bitwalker/alpine-elixir-phoenix +- [https://github.com/poanetwork/blockscout/pull/1465](https://github.com/poanetwork/blockscout/pull/1465) - Resolve lodash security alert \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7d91bacfed..c76045b35a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,6 +6,7 @@ 4. Commit your changes (`git commit -am 'Add some feature'`) 5. Push to the branch (`git push origin my-new-feature`) 6. Create a new Pull Request +7. Update CHANGELOG.md with the link to PR and description of the changes ### General From ad530135891956b57ace089aadc80d5407ed43c9 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Fri, 15 Mar 2019 17:41:00 +0300 Subject: [PATCH 07/14] Update CHANGELOG.md links to PRs --- CHANGELOG.md | 57 ++++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa8f304e35..dd02ff334f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,6 @@ ### Fixes -### Chore ## 1.3.5-beta @@ -13,36 +12,36 @@ - [#1560](https://github.com/poanetwork/blockscout/pull/1560) - Allow executing smart contract functions in arbitrarily sized batches - [#1543](https://github.com/poanetwork/blockscout/pull/1543) - Use trace_replayBlockTransactions API for faster tracing - [#1558](https://github.com/poanetwork/blockscout/pull/1558) - Allow searching by token symbol - - [https://github.com/poanetwork/blockscout/pull/1551](https://github.com/poanetwork/blockscout/pull/1551) Exact date and time for Transaction details page - - [https://github.com/poanetwork/blockscout/pull/1547](https://github.com/poanetwork/blockscout/pull/1547) - Verify smart contracts with evm versions - - [https://github.com/poanetwork/blockscout/pull/1540](https://github.com/poanetwork/blockscout/pull/1540) - Fetch ERC721 token balances if sender is '0x0..0' - - [https://github.com/poanetwork/blockscout/pull/1539](https://github.com/poanetwork/blockscout/pull/1539) - Add the link to release in the footer -- [https://github.com/poanetwork/blockscout/pull/1519](https://github.com/poanetwork/blockscout/pull/1519) - Create contract methods - - [https://github.com/poanetwork/blockscout/pull/1496](https://github.com/poanetwork/blockscout/pull/1496) - Remove dropped/replaced transactions in pending transactions list - - [https://github.com/poanetwork/blockscout/pull/1492](https://github.com/poanetwork/blockscout/pull/1492) - Disable usd value for an empty exchange rate - - [https://github.com/poanetwork/blockscout/pull/1466](https://github.com/poanetwork/blockscout/pull/1466) - Decoding candidates for unverified contracts + - [#1551](https://github.com/poanetwork/blockscout/pull/1551) Exact date and time for Transaction details page + - [#1547](https://github.com/poanetwork/blockscout/pull/1547) - Verify smart contracts with evm versions + - [#1540](https://github.com/poanetwork/blockscout/pull/1540) - Fetch ERC721 token balances if sender is '0x0..0' + - [#1539](https://github.com/poanetwork/blockscout/pull/1539) - Add the link to release in the footer + - [#1519](https://github.com/poanetwork/blockscout/pull/1519) - Create contract methods + - [#1496](https://github.com/poanetwork/blockscout/pull/1496) - Remove dropped/replaced transactions in pending transactions list + - [#1492](https://github.com/poanetwork/blockscout/pull/1492) - Disable usd value for an empty exchange rate + - [#1466](https://github.com/poanetwork/blockscout/pull/1466) - Decoding candidates for unverified contracts ### Fixes - - [https://github.com/poanetwork/blockscout/pull/1545](https://github.com/poanetwork/blockscout/pull/1545) - Fix scheduling of latest block polling in Realtime Fetcher - - [https://github.com/poanetwork/blockscout/pull/1554](https://github.com/poanetwork/blockscout/pull/1554) - Encode integer parameters when calling smart contract functions -- [https://github.com/poanetwork/blockscout/pull/1537](https://github.com/poanetwork/blockscout/pull/1537) - Fix test that depended on date -- [https://github.com/poanetwork/blockscout/pull/1534](https://github.com/poanetwork/blockscout/pull/1534) - Render a nicer error when creator cannot be determined -- [https://github.com/poanetwork/blockscout/pull/1527](https://github.com/poanetwork/blockscout/pull/1527) - Add index to value_fetched_at -- [https://github.com/poanetwork/blockscout/pull/1518](https://github.com/poanetwork/blockscout/pull/1518) - Select only distinct failed transactions - - [https://github.com/poanetwork/blockscout/pull/1516](https://github.com/poanetwork/blockscout/pull/1516) - Fix coin balance params reducer for pending transaction - - [https://github.com/poanetwork/blockscout/pull/1511](https://github.com/poanetwork/blockscout/pull/1511) - Set correct log level for production - - [https://github.com/poanetwork/blockscout/pull/1510](https://github.com/poanetwork/blockscout/pull/1510) - Fix test that fails every 1st day of the month -- [https://github.com/poanetwork/blockscout/pull/1509](https://github.com/poanetwork/blockscout/pull/1509) - Add index to blocks' consensus - - [https://github.com/poanetwork/blockscout/pull/1508](https://github.com/poanetwork/blockscout/pull/1508) - Remove duplicated indexes - - [https://github.com/poanetwork/blockscout/pull/1505](https://github.com/poanetwork/blockscout/pull/1505) - Use https instead of ssh for absinthe libs - - [https://github.com/poanetwork/blockscout/pull/1501](https://github.com/poanetwork/blockscout/pull/1501) - Constructor_arguments must be type `text` - - [https://github.com/poanetwork/blockscout/pull/1498](https://github.com/poanetwork/blockscout/pull/1498) - Add index for created_contract_address_hash in transactions - - [https://github.com/poanetwork/blockscout/pull/1493](https://github.com/poanetwork/blockscout/pull/1493) - Do not do work in process initialization - - [https://github.com/poanetwork/blockscout/pull/1487](https://github.com/poanetwork/blockscout/pull/1487) - Limit geth sync to 128 blocks - - [https://github.com/poanetwork/blockscout/pull/1484](https://github.com/poanetwork/blockscout/pull/1484) - Allow decoding input as utf-8 - - [https://github.com/poanetwork/blockscout/pull/1479](https://github.com/poanetwork/blockscout/pull/1479) - Remove smoothing from coin balance chart + - [#1545](https://github.com/poanetwork/blockscout/pull/1545) - Fix scheduling of latest block polling in Realtime Fetcher + - [#1554](https://github.com/poanetwork/blockscout/pull/1554) - Encode integer parameters when calling smart contract functions + - [#1537](https://github.com/poanetwork/blockscout/pull/1537) - Fix test that depended on date + - [#1534](https://github.com/poanetwork/blockscout/pull/1534) - Render a nicer error when creator cannot be determined + - [#1527](https://github.com/poanetwork/blockscout/pull/1527) - Add index to value_fetched_at + - [#1518](https://github.com/poanetwork/blockscout/pull/1518) - Select only distinct failed transactions + - [#1516](https://github.com/poanetwork/blockscout/pull/1516) - Fix coin balance params reducer for pending transaction + - [#1511](https://github.com/poanetwork/blockscout/pull/1511) - Set correct log level for production + - [#1510](https://github.com/poanetwork/blockscout/pull/1510) - Fix test that fails every 1st day of the month + - [#1509](https://github.com/poanetwork/blockscout/pull/1509) - Add index to blocks' consensus + - [#1508](https://github.com/poanetwork/blockscout/pull/1508) - Remove duplicated indexes + - [#1505](https://github.com/poanetwork/blockscout/pull/1505) - Use https instead of ssh for absinthe libs + - [#1501](https://github.com/poanetwork/blockscout/pull/1501) - Constructor_arguments must be type `text` + - [#1498](https://github.com/poanetwork/blockscout/pull/1498) - Add index for created_contract_address_hash in transactions + - [#1493](https://github.com/poanetwork/blockscout/pull/1493) - Do not do work in process initialization + - [#1487](https://github.com/poanetwork/blockscout/pull/1487) - Limit geth sync to 128 blocks + - [#1484](https://github.com/poanetwork/blockscout/pull/1484) - Allow decoding input as utf-8 + - [#1479](https://github.com/poanetwork/blockscout/pull/1479) - Remove smoothing from coin balance chart ### Chore - [https://github.com/poanetwork/blockscout/pull/1532](https://github.com/poanetwork/blockscout/pull/1532) - Upgrade elixir to 1.8.1 -- [https://github.com/poanetwork/blockscout/pull/1553](https://github.com/poanetwork/blockscout/pull/1553) - Dockerfile: remove 1.7.1 version pin FROM bitwalker/alpine-elixir-phoenix -- [https://github.com/poanetwork/blockscout/pull/1465](https://github.com/poanetwork/blockscout/pull/1465) - Resolve lodash security alert \ No newline at end of file + - [https://github.com/poanetwork/blockscout/pull/1553](https://github.com/poanetwork/blockscout/pull/1553) - Dockerfile: remove 1.7.1 version pin FROM bitwalker/alpine-elixir-phoenix + - [https://github.com/poanetwork/blockscout/pull/1465](https://github.com/poanetwork/blockscout/pull/1465) - Resolve lodash security alert \ No newline at end of file From a8efa47ad2467dc168b0a1afdc3b1e72a72820db Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Mon, 18 Mar 2019 13:08:05 +0300 Subject: [PATCH 08/14] Exclude exact timestamp from tiles and fix path mask for showing of exact timestamp --- apps/block_scout_web/assets/js/lib/from_now.js | 3 ++- .../templates/internal_transaction/_tile.html.eex | 2 +- .../lib/block_scout_web/templates/transaction/_tile.html.eex | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/block_scout_web/assets/js/lib/from_now.js b/apps/block_scout_web/assets/js/lib/from_now.js index f4bad344cb..8a00fefd80 100644 --- a/apps/block_scout_web/assets/js/lib/from_now.js +++ b/apps/block_scout_web/assets/js/lib/from_now.js @@ -21,7 +21,8 @@ function tryUpdateAge (el) { function updateAge (el, timestamp) { let fromNow = timestamp.fromNow() // show the exact time only for transaction details page. Otherwise, short entry - if (window.location.pathname.startsWith('/tx/')) { + const elInTile = el.hasAttribute('in-tile') + if (window.location.pathname.includes('/tx/') && !elInTile) { const offset = moment().utcOffset() / 60 const sign = offset && Math.sign(offset) ? '+' : '-' const formatDate = `MMMM-DD-YYYY hh:mm:ss A ${sign}${offset} UTC` diff --git a/apps/block_scout_web/lib/block_scout_web/templates/internal_transaction/_tile.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/internal_transaction/_tile.html.eex index 9a0630e97d..2265a397be 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/internal_transaction/_tile.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/internal_transaction/_tile.html.eex @@ -23,7 +23,7 @@ to: block_path(BlockScoutWeb.Endpoint, :show, @internal_transaction.block_number) ) %> - + <%= if assigns[:current_address] do %> <%= if assigns[:current_address].hash == @internal_transaction.from_address_hash do %> diff --git a/apps/block_scout_web/lib/block_scout_web/templates/transaction/_tile.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/transaction/_tile.html.eex index a254d02c04..da3884b417 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/transaction/_tile.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/transaction/_tile.html.eex @@ -35,7 +35,7 @@ <%= @transaction |> block_number() |> BlockScoutWeb.RenderHelpers.render_partial() %> - + <%= if from_or_to_address?(@transaction, assigns[:current_address]) do %> <%= if @transaction.from_address_hash == assigns[:current_address].hash do %> From 0bd202eda590b67e40e1acd1a97ca9d8abc53e0f Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Mon, 18 Mar 2019 15:40:23 +0300 Subject: [PATCH 09/14] fix usd value on address page --- .../templates/address/_balance_card.html.eex | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address/_balance_card.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address/_balance_card.html.eex index 09c0427982..3a2cbedff1 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address/_balance_card.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address/_balance_card.html.eex @@ -4,17 +4,13 @@

<%= gettext "Balance" %>

<%= balance(@address) %>

- <%= unless match?({:pending, _}, @coin_balance_status) do %> + <%= if !match?({:pending, _}, @coin_balance_status) && !empty_exchange_rate?(@exchange_rate) do %> data-usd-exchange-rate="<%= @exchange_rate.usd_value %>"> - <% end %> - <% if !empty_exchange_rate?(@exchange_rate) do %> (@ /<%= gettext("Ether") %>) - <% end %>
<% end %> From 539621759f7a7f18e966cb11b62f565bd3d37ec6 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Mon, 18 Mar 2019 15:41:00 +0300 Subject: [PATCH 10/14] update gettext --- apps/block_scout_web/priv/gettext/default.pot | 6 +++--- apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index 64a3077a6b..8a0837b6a0 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -372,7 +372,7 @@ msgid "Enter the Solidity Contract Code below" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address/_balance_card.html.eex:32 +#: lib/block_scout_web/templates/address/_balance_card.html.eex:28 msgid "Error trying to fetch balances." msgstr "" @@ -387,7 +387,7 @@ msgid "Error: (Awaiting internal transactions for reason)" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address/_balance_card.html.eex:16 +#: lib/block_scout_web/templates/address/_balance_card.html.eex:13 #: lib/block_scout_web/templates/internal_transaction/_tile.html.eex:16 #: lib/block_scout_web/templates/layout/app.html.eex:51 #: lib/block_scout_web/templates/transaction/_pending_tile.html.eex:20 @@ -408,7 +408,7 @@ msgid "Execute" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address/_balance_card.html.eex:28 +#: lib/block_scout_web/templates/address/_balance_card.html.eex:24 msgid "Fetching tokens..." msgstr "" diff --git a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po index 06b429ab2c..76ae98b8ac 100644 --- a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po +++ b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po @@ -372,7 +372,7 @@ msgid "Enter the Solidity Contract Code below" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address/_balance_card.html.eex:32 +#: lib/block_scout_web/templates/address/_balance_card.html.eex:28 msgid "Error trying to fetch balances." msgstr "" @@ -387,7 +387,7 @@ msgid "Error: (Awaiting internal transactions for reason)" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address/_balance_card.html.eex:16 +#: lib/block_scout_web/templates/address/_balance_card.html.eex:13 #: lib/block_scout_web/templates/internal_transaction/_tile.html.eex:16 #: lib/block_scout_web/templates/layout/app.html.eex:51 #: lib/block_scout_web/templates/transaction/_pending_tile.html.eex:20 @@ -408,7 +408,7 @@ msgid "Execute" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address/_balance_card.html.eex:28 +#: lib/block_scout_web/templates/address/_balance_card.html.eex:24 msgid "Fetching tokens..." msgstr "" From ddb275aa8f54b92b82fbb8f5c43661966a195b7c Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Mon, 18 Mar 2019 16:03:12 +0300 Subject: [PATCH 11/14] update node cache --- .circleci/config.yml | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b7abfd3058..b0485f612e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,30 +31,30 @@ jobs: - restore_cache: keys: - - v7-mix-compile-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.lock" }} - - v7-mix-compile-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.exs" }} - - v7-mix-compile-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }} + - v8-mix-compile-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.lock" }} + - v8-mix-compile-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.exs" }} + - v8-mix-compile-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }} - run: mix deps.get - restore_cache: keys: - - v7-npm-install-{{ .Branch }}-{{ checksum "apps/block_scout_web/assets/package-lock.json" }} - - v7-npm-install-{{ .Branch }} - - v7-npm-install + - v8-npm-install-{{ .Branch }}-{{ checksum "apps/block_scout_web/assets/package-lock.json" }} + - v8-npm-install-{{ .Branch }} + - v8-npm-install - run: command: npm install working_directory: "apps/explorer" - save_cache: - key: v3-npm-install-{{ .Branch }}-{{ checksum "apps/explorer/package-lock.json" }} + key: v4-npm-install-{{ .Branch }}-{{ checksum "apps/explorer/package-lock.json" }} paths: "apps/explorer/node_modules" - save_cache: - key: v3-npm-install-{{ .Branch }} + key: v4-npm-install-{{ .Branch }} paths: "apps/explorer/node_modules" - save_cache: - key: v3-npm-install + key: v4-npm-install paths: "apps/explorer/node_modules" - run: @@ -62,13 +62,13 @@ jobs: working_directory: "apps/block_scout_web/assets" - save_cache: - key: v7-npm-install-{{ .Branch }}-{{ checksum "apps/block_scout_web/assets/package-lock.json" }} + key: v8-npm-install-{{ .Branch }}-{{ checksum "apps/block_scout_web/assets/package-lock.json" }} paths: "apps/block_scout_web/assets/node_modules" - save_cache: - key: v7-npm-install-{{ .Branch }} + key: v8-npm-install-{{ .Branch }} paths: "apps/block_scout_web/assets/node_modules" - save_cache: - key: v7-npm-install + key: v8-npm-install paths: "apps/block_scout_web/assets/node_modules" - run: mix compile @@ -81,17 +81,17 @@ jobs: # `deps` needs to be cached with `_build` because `_build` will symlink into `deps` - save_cache: - key: v7-mix-compile-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.lock" }} + key: v8-mix-compile-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.lock" }} paths: - deps - _build - save_cache: - key: v7-mix-compile-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.exs" }} + key: v8-mix-compile-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.exs" }} paths: - deps - _build - save_cache: - key: v7-mix-compile-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }} + key: v8-mix-compile-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }} paths: - deps - _build @@ -189,9 +189,9 @@ jobs: - restore_cache: keys: - - v7-mix-dailyzer-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.lock" }} - - v7-mix-dialyzer-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.exs" }} - - v7-mix-dialyzer-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }} + - v8-mix-dailyzer-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.lock" }} + - v8-mix-dialyzer-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.exs" }} + - v8-mix-dialyzer-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }} - run: name: Unpack PLT cache @@ -211,15 +211,15 @@ jobs: cp ~/.mix/dialyxir*.plt plts/ - save_cache: - key: v7-mix-dialyzer-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.lock" }} + key: v8-mix-dialyzer-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.lock" }} paths: - plts - save_cache: - key: v7-mix-dialyzer-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.exs" }} + key: v8-mix-dialyzer-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.exs" }} paths: - plts - save_cache: - key: v7-mix-dialyzer-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }} + key: v8-mix-dialyzer-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }} paths: - plts From d516330d22e52efab6207195f0aeb59cc7fde53b Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Mon, 18 Mar 2019 16:35:16 +0300 Subject: [PATCH 12/14] fix tests --- .../features/viewing_addresses_test.exs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/apps/block_scout_web/test/block_scout_web/features/viewing_addresses_test.exs b/apps/block_scout_web/test/block_scout_web/features/viewing_addresses_test.exs index 6ab23555bb..7f42b4cbcc 100644 --- a/apps/block_scout_web/test/block_scout_web/features/viewing_addresses_test.exs +++ b/apps/block_scout_web/test/block_scout_web/features/viewing_addresses_test.exs @@ -487,10 +487,9 @@ defmodule BlockScoutWeb.ViewingAddressesTest do |> AddressPage.visit_page(lincoln) |> AddressPage.click_balance_dropdown_toggle() |> AddressPage.fill_balance_dropdown_search("ato") - |> assert_has(AddressPage.token_balance(count: 1)) - |> assert_has(AddressPage.token_type(count: 1)) + |> assert_has(AddressPage.token_balance(count: 2)) + |> assert_has(AddressPage.token_type(count: 2)) |> assert_has(AddressPage.token_type_count(type: "ERC-721", text: "1")) - |> assert_has(AddressPage.token_balance_counter("1")) end test "filter token balances by token symbol", %{session: session, lincoln: lincoln} do @@ -498,10 +497,9 @@ defmodule BlockScoutWeb.ViewingAddressesTest do |> AddressPage.visit_page(lincoln) |> AddressPage.click_balance_dropdown_toggle() |> AddressPage.fill_balance_dropdown_search("T2") - |> assert_has(AddressPage.token_balance(count: 1)) - |> assert_has(AddressPage.token_type(count: 1)) + |> assert_has(AddressPage.token_balance(count: 2)) + |> assert_has(AddressPage.token_type(count: 2)) |> assert_has(AddressPage.token_type_count(type: "ERC-20", text: "1")) - |> assert_has(AddressPage.token_balance_counter("1")) end test "reset token balances filter when dropdown closes", %{session: session, lincoln: lincoln} do @@ -509,7 +507,6 @@ defmodule BlockScoutWeb.ViewingAddressesTest do |> AddressPage.visit_page(lincoln) |> AddressPage.click_balance_dropdown_toggle() |> AddressPage.fill_balance_dropdown_search("ato") - |> assert_has(AddressPage.token_balance_counter("1")) |> AddressPage.click_outside_of_the_dropdown() |> assert_has(AddressPage.token_balance_counter("2")) end From 9fe7854dff2b7ce39600ac2069cdb73a1eadfadf Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Mon, 18 Mar 2019 16:37:29 +0300 Subject: [PATCH 13/14] rollback cache --- .circleci/config.yml | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b0485f612e..b7abfd3058 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,30 +31,30 @@ jobs: - restore_cache: keys: - - v8-mix-compile-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.lock" }} - - v8-mix-compile-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.exs" }} - - v8-mix-compile-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }} + - v7-mix-compile-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.lock" }} + - v7-mix-compile-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.exs" }} + - v7-mix-compile-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }} - run: mix deps.get - restore_cache: keys: - - v8-npm-install-{{ .Branch }}-{{ checksum "apps/block_scout_web/assets/package-lock.json" }} - - v8-npm-install-{{ .Branch }} - - v8-npm-install + - v7-npm-install-{{ .Branch }}-{{ checksum "apps/block_scout_web/assets/package-lock.json" }} + - v7-npm-install-{{ .Branch }} + - v7-npm-install - run: command: npm install working_directory: "apps/explorer" - save_cache: - key: v4-npm-install-{{ .Branch }}-{{ checksum "apps/explorer/package-lock.json" }} + key: v3-npm-install-{{ .Branch }}-{{ checksum "apps/explorer/package-lock.json" }} paths: "apps/explorer/node_modules" - save_cache: - key: v4-npm-install-{{ .Branch }} + key: v3-npm-install-{{ .Branch }} paths: "apps/explorer/node_modules" - save_cache: - key: v4-npm-install + key: v3-npm-install paths: "apps/explorer/node_modules" - run: @@ -62,13 +62,13 @@ jobs: working_directory: "apps/block_scout_web/assets" - save_cache: - key: v8-npm-install-{{ .Branch }}-{{ checksum "apps/block_scout_web/assets/package-lock.json" }} + key: v7-npm-install-{{ .Branch }}-{{ checksum "apps/block_scout_web/assets/package-lock.json" }} paths: "apps/block_scout_web/assets/node_modules" - save_cache: - key: v8-npm-install-{{ .Branch }} + key: v7-npm-install-{{ .Branch }} paths: "apps/block_scout_web/assets/node_modules" - save_cache: - key: v8-npm-install + key: v7-npm-install paths: "apps/block_scout_web/assets/node_modules" - run: mix compile @@ -81,17 +81,17 @@ jobs: # `deps` needs to be cached with `_build` because `_build` will symlink into `deps` - save_cache: - key: v8-mix-compile-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.lock" }} + key: v7-mix-compile-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.lock" }} paths: - deps - _build - save_cache: - key: v8-mix-compile-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.exs" }} + key: v7-mix-compile-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.exs" }} paths: - deps - _build - save_cache: - key: v8-mix-compile-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }} + key: v7-mix-compile-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }} paths: - deps - _build @@ -189,9 +189,9 @@ jobs: - restore_cache: keys: - - v8-mix-dailyzer-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.lock" }} - - v8-mix-dialyzer-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.exs" }} - - v8-mix-dialyzer-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }} + - v7-mix-dailyzer-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.lock" }} + - v7-mix-dialyzer-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.exs" }} + - v7-mix-dialyzer-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }} - run: name: Unpack PLT cache @@ -211,15 +211,15 @@ jobs: cp ~/.mix/dialyxir*.plt plts/ - save_cache: - key: v8-mix-dialyzer-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.lock" }} + key: v7-mix-dialyzer-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.lock" }} paths: - plts - save_cache: - key: v8-mix-dialyzer-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.exs" }} + key: v7-mix-dialyzer-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }}-{{ checksum "mix.exs" }} paths: - plts - save_cache: - key: v8-mix-dialyzer-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }} + key: v7-mix-dialyzer-{{ checksum "OTP_VERSION.lock" }}-{{ checksum "ELIXIR_VERSION.lock" }} paths: - plts From 5c2e2f230911849572022b7a2ebb8865156502ed Mon Sep 17 00:00:00 2001 From: saneery Date: Mon, 18 Mar 2019 19:06:31 +0300 Subject: [PATCH 14/14] Added guard for check block number before fetch it --- apps/indexer/lib/indexer/block/realtime/consensus_ensurer.ex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/indexer/lib/indexer/block/realtime/consensus_ensurer.ex b/apps/indexer/lib/indexer/block/realtime/consensus_ensurer.ex index 363f54fbed..816f1d76bf 100644 --- a/apps/indexer/lib/indexer/block/realtime/consensus_ensurer.ex +++ b/apps/indexer/lib/indexer/block/realtime/consensus_ensurer.ex @@ -9,6 +9,8 @@ defmodule Indexer.Block.Realtime.ConsensusEnsurer do alias Explorer.Chain.Hash alias Indexer.Block.Realtime.Fetcher + def perform(_, number, _) when not is_integer(number) or number < 0, do: :ok + def perform(%Hash{byte_count: unquote(Hash.Full.byte_count())} = block_hash, number, block_fetcher) do case Chain.hash_to_block(block_hash) do {:ok, %{consensus: true} = _block} ->