Merge pull request #5082 from blockscout/vb-elixir-1.13.1

Elixir 1.12 -> 1.13
pull/5433/head
Victor Baranov 3 years ago committed by GitHub
commit 0a4a7dba5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .dialyzer-ignore
  2. 4
      .github/workflows/config.yml
  3. 6
      .tool-versions
  4. 1
      CHANGELOG.md
  5. 41
      apps/explorer/lib/explorer/chain.ex
  6. 8
      apps/indexer/lib/indexer/buffered_task.ex
  7. 2
      apps/indexer/lib/indexer/memory/monitor.ex
  8. 2
      docker/Dockerfile
  9. 2
      mix.lock

@ -4,6 +4,7 @@
:0: Unknown type 'Elixir.Hash':t/0 :0: Unknown type 'Elixir.Hash':t/0
:0: Unknown type 'Elixir.Address':t/0 :0: Unknown type 'Elixir.Address':t/0
apps/ethereum_jsonrpc/lib/ethereum_jsonrpc.ex:400: Function timestamp_to_datetime/1 has no local return apps/ethereum_jsonrpc/lib/ethereum_jsonrpc.ex:400: Function timestamp_to_datetime/1 has no local return
lib/ethereum_jsonrpc/rolling_window.ex:173
lib/explorer/repo/prometheus_logger.ex:8 lib/explorer/repo/prometheus_logger.ex:8
lib/explorer/smart_contract/solidity/publisher_worker.ex:1 lib/explorer/smart_contract/solidity/publisher_worker.ex:1
lib/explorer/smart_contract/vyper/publisher_worker.ex:1 lib/explorer/smart_contract/vyper/publisher_worker.ex:1

@ -11,8 +11,8 @@ on:
env: env:
MIX_ENV: test MIX_ENV: test
OTP_VERSION: '24.2.2' OTP_VERSION: '24.3.3'
ELIXIR_VERSION: '1.12.3' ELIXIR_VERSION: '1.13.4'
jobs: jobs:
build-and-cache: build-and-cache:

@ -1,3 +1,3 @@
elixir 1.12.3-otp-24 elixir 1.13.4-otp-24
erlang 24.2 erlang 24.3.3
nodejs 16.13.0 nodejs 16.14.2

@ -47,6 +47,7 @@
- [#5287](https://github.com/blockscout/blockscout/pull/5287) - Docker: modify native token symbol - [#5287](https://github.com/blockscout/blockscout/pull/5287) - Docker: modify native token symbol
- [#5286](https://github.com/blockscout/blockscout/pull/5286) - Change namespace for one of the SmartContractViewTest test - [#5286](https://github.com/blockscout/blockscout/pull/5286) - Change namespace for one of the SmartContractViewTest test
- [#5260](https://github.com/blockscout/blockscout/pull/5260) - Makefile release task to prerelease and release task - [#5260](https://github.com/blockscout/blockscout/pull/5260) - Makefile release task to prerelease and release task
- [#5082](https://github.com/blockscout/blockscout/pull/5082) - Elixir 1.12 -> 1.13
## 4.1.2-beta ## 4.1.2-beta

@ -5166,15 +5166,14 @@ defmodule Explorer.Chain do
{:ok, "0x" <> token1_encoded} <- {:ok, "0x" <> token1_encoded} <-
token1_signature token1_signature
|> Contract.eth_call_request(foreign_token_address_hash, 2, nil, nil) |> Contract.eth_call_request(foreign_token_address_hash, 2, nil, nil)
|> json_rpc(eth_call_foreign_json_rpc_named_arguments) do |> json_rpc(eth_call_foreign_json_rpc_named_arguments),
token0_hash = parse_contract_response(token0_encoded, :address) token0_hash <- parse_contract_response(token0_encoded, :address),
token1_hash = parse_contract_response(token1_encoded, :address) token1_hash <- parse_contract_response(token1_encoded, :address),
false <- is_nil(token0_hash),
if token0_hash && token1_hash do false <- is_nil(token1_hash),
token0_hash_str = "0x" <> Base.encode16(token0_hash, case: :lower) token0_hash_str <- "0x" <> Base.encode16(token0_hash, case: :lower),
token1_hash_str = "0x" <> Base.encode16(token1_hash, case: :lower) token1_hash_str <- "0x" <> Base.encode16(token1_hash, case: :lower),
{:ok, "0x" <> token0_name_encoded} <-
with {:ok, "0x" <> token0_name_encoded} <-
name_signature name_signature
|> Contract.eth_call_request(token0_hash_str, 1, nil, nil) |> Contract.eth_call_request(token0_hash_str, 1, nil, nil)
|> json_rpc(eth_call_foreign_json_rpc_named_arguments), |> json_rpc(eth_call_foreign_json_rpc_named_arguments),
@ -5200,13 +5199,6 @@ defmodule Explorer.Chain do
_ -> _ ->
nil nil
end end
else
nil
end
else
_ ->
nil
end
end end
def calc_lp_tokens_total_liqudity do def calc_lp_tokens_total_liqudity do
@ -5309,16 +5301,14 @@ defmodule Explorer.Chain do
|> parse_contract_response({:uint, 256}) |> parse_contract_response({:uint, 256})
|> Decimal.new() |> Decimal.new()
with {:ok, "0x" <> token_encoded} <- case token_signature
token_signature
|> Contract.eth_call_request(foreign_token_address_hash, 1, nil, nil) |> Contract.eth_call_request(foreign_token_address_hash, 1, nil, nil)
|> json_rpc(eth_call_foreign_json_rpc_named_arguments) do |> json_rpc(eth_call_foreign_json_rpc_named_arguments) do
token_hash = parse_contract_response(token_encoded, :address) {:ok, "0x" <> token_encoded} ->
with token_hash <- parse_contract_response(token_encoded, :address),
if token_hash do false <- is_nil(token_hash),
token_hash_str = "0x" <> Base.encode16(token_hash, case: :lower) token_hash_str <- "0x" <> Base.encode16(token_hash, case: :lower),
{:ok, "0x" <> token_decimals_encoded} <-
with {:ok, "0x" <> token_decimals_encoded} <-
decimals_signature decimals_signature
|> Contract.eth_call_request(token_hash_str, 1, nil, nil) |> Contract.eth_call_request(token_hash_str, 1, nil, nil)
|> json_rpc(eth_call_foreign_json_rpc_named_arguments), |> json_rpc(eth_call_foreign_json_rpc_named_arguments),
@ -5355,7 +5345,8 @@ defmodule Explorer.Chain do
end end
{:ok, token_cap_usd} {:ok, token_cap_usd}
end else
_ -> :error
end end
end end
end end

@ -403,8 +403,8 @@ defmodule Indexer.BufferedTask do
" bound queue is at maximum size (", " bound queue is at maximum size (",
to_string(maximum_size), to_string(maximum_size),
") and ", ") and ",
remaining_entries |> Enum.count() |> to_string() remaining_entries |> Enum.count() |> to_string(),
| " entries could not be added." " entries could not be added."
] ]
end) end)
@ -448,8 +448,8 @@ defmodule Indexer.BufferedTask do
Logger.info(fn -> Logger.info(fn ->
[ [
"BufferedTask ", "BufferedTask ",
process(self()) process(self()),
| " ran out of work, but work queue was shrunk to save memory, so restoring lost work from `c:init/2`." " ran out of work, but work queue was shrunk to save memory, so restoring lost work from `c:init/2`."
] ]
end) end)

@ -157,7 +157,7 @@ defmodule Indexer.Memory.Monitor do
{:error, :minimum_size} -> {:error, :minimum_size} ->
Logger.error(fn -> Logger.error(fn ->
[process(pid) | " is at its minimum size and could not shrink."] [process(pid), " is at its minimum size and could not shrink."]
end) end)
shrink(tail) shrink(tail)

@ -1,4 +1,4 @@
FROM bitwalker/alpine-elixir-phoenix:1.12 FROM bitwalker/alpine-elixir-phoenix:1.13
RUN apk --no-cache --update add alpine-sdk gmp-dev automake libtool inotify-tools autoconf python3 file RUN apk --no-cache --update add alpine-sdk gmp-dev automake libtool inotify-tools autoconf python3 file

@ -32,7 +32,7 @@
"earmark": {:hex, :earmark, "1.3.5", "0db71c8290b5bc81cb0101a2a507a76dca659513984d683119ee722828b424f6", [:mix], [], "hexpm", "762b999fd414fb41e297944228aa1de2cd4a3876a07f968c8b11d1e9a2190d07"}, "earmark": {:hex, :earmark, "1.3.5", "0db71c8290b5bc81cb0101a2a507a76dca659513984d683119ee722828b424f6", [:mix], [], "hexpm", "762b999fd414fb41e297944228aa1de2cd4a3876a07f968c8b11d1e9a2190d07"},
"earmark_parser": {:hex, :earmark_parser, "1.4.20", "89970db71b11b6b89759ce16807e857df154f8df3e807b2920a8c39834a9e5cf", [:mix], [], "hexpm", "1eb0d2dabeeeff200e0d17dc3048a6045aab271f73ebb82e416464832eb57bdd"}, "earmark_parser": {:hex, :earmark_parser, "1.4.20", "89970db71b11b6b89759ce16807e857df154f8df3e807b2920a8c39834a9e5cf", [:mix], [], "hexpm", "1eb0d2dabeeeff200e0d17dc3048a6045aab271f73ebb82e416464832eb57bdd"},
"ecto": {:hex, :ecto, "3.7.1", "a20598862351b29f80f285b21ec5297da1181c0442687f9b8329f0445d228892", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "d36e5b39fc479e654cffd4dbe1865d9716e4a9b6311faff799b6f90ab81b8638"}, "ecto": {:hex, :ecto, "3.7.1", "a20598862351b29f80f285b21ec5297da1181c0442687f9b8329f0445d228892", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "d36e5b39fc479e654cffd4dbe1865d9716e4a9b6311faff799b6f90ab81b8638"},
"ecto_sql": {:hex, :ecto_sql, "3.7.0", "2fcaad4ab0c8d76a5afbef078162806adbe709c04160aca58400d5cbbe8eeac6", [:mix], [{:db_connection, "~> 2.2", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.7.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.4.0 or ~> 0.5.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.15.0 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "a26135dfa1d99bf87a928c464cfa25bba6535a4fe761eefa56077a4febc60f70"}, "ecto_sql": {:hex, :ecto_sql, "3.7.1", "8de624ef50b2a8540252d8c60506379fbbc2707be1606853df371cf53df5d053", [:mix], [{:db_connection, "~> 2.2", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.7.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.4.0 or ~> 0.5.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.15.0 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "2b42a32e2ce92f64aba5c88617891ab3b0ba34f3f3a503fa20009eae1a401c81"},
"elixir_make": {:hex, :elixir_make, "0.6.2", "7dffacd77dec4c37b39af867cedaabb0b59f6a871f89722c25b28fcd4bd70530", [:mix], [], "hexpm", "03e49eadda22526a7e5279d53321d1cced6552f344ba4e03e619063de75348d9"}, "elixir_make": {:hex, :elixir_make, "0.6.2", "7dffacd77dec4c37b39af867cedaabb0b59f6a871f89722c25b28fcd4bd70530", [:mix], [], "hexpm", "03e49eadda22526a7e5279d53321d1cced6552f344ba4e03e619063de75348d9"},
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"}, "erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
"ex_abi": {:hex, :ex_abi, "0.5.11", "a53307cf796231bf068a9941d57fbcb8654e72042c2a113a49f08dfb248875fb", [:mix], [{:ex_keccak, "~> 0.4.0", [hex: :ex_keccak, repo: "hexpm", optional: false]}, {:jason, "~> 1.3", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "e128577740bdc0f05ed6841cbb1c88bb80377613970ed870fa052b780870655a"}, "ex_abi": {:hex, :ex_abi, "0.5.11", "a53307cf796231bf068a9941d57fbcb8654e72042c2a113a49f08dfb248875fb", [:mix], [{:ex_keccak, "~> 0.4.0", [hex: :ex_keccak, repo: "hexpm", optional: false]}, {:jason, "~> 1.3", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "e128577740bdc0f05ed6841cbb1c88bb80377613970ed870fa052b780870655a"},

Loading…
Cancel
Save