diff --git a/CHANGELOG.md b/CHANGELOG.md index c54fac4b28..66676df93b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ - [#1830](https://github.com/poanetwork/blockscout/pull/1830) - Make block size field nullable - [#1840](https://github.com/poanetwork/blockscout/pull/1840) - Handle case when total supply is nil - [#1838](https://github.com/poanetwork/blockscout/pull/1838) - Block counter calculates only consensus blocks +- [#1849](https://github.com/poanetwork/blockscout/pull/1849) - Improve chains menu +- [#1868](https://github.com/poanetwork/blockscout/pull/1868) - fix: logs list endpoint performance ### Chore diff --git a/apps/block_scout_web/assets/css/components/_dropdown.scss b/apps/block_scout_web/assets/css/components/_dropdown.scss index aa16e5b300..b603d53fea 100644 --- a/apps/block_scout_web/assets/css/components/_dropdown.scss +++ b/apps/block_scout_web/assets/css/components/_dropdown.scss @@ -45,6 +45,7 @@ &, &:hover, &:active { + padding-left: 10px; background-color: transparent; cursor: default; color: #333; @@ -53,7 +54,7 @@ } &.division { - border-color: $base-border-color; + border-top: 1px solid $base-border-color; } } diff --git a/apps/block_scout_web/assets/css/components/_navbar.scss b/apps/block_scout_web/assets/css/components/_navbar.scss index 564a8c97f9..0999ef327c 100644 --- a/apps/block_scout_web/assets/css/components/_navbar.scss +++ b/apps/block_scout_web/assets/css/components/_navbar.scss @@ -217,14 +217,6 @@ $navbar-logo-width: auto !default; padding-left: $header-link-horizontal-padding; padding-right: $header-link-horizontal-padding; } - - &.header { - font-weight: bold; - - &.division { - border-top: 1px solid rgb(183, 185, 184); - } - } } .add-border { diff --git a/apps/block_scout_web/config/config.exs b/apps/block_scout_web/config/config.exs index df6c74ee34..78b887b122 100644 --- a/apps/block_scout_web/config/config.exs +++ b/apps/block_scout_web/config/config.exs @@ -68,19 +68,23 @@ config :block_scout_web, }, %{ title: "Ethereum Classic", - url: "https://blockscout.com/etc/mainnet" + url: "https://blockscout.com/etc/mainnet", + other?: true }, %{ title: "Aerum Mainnet", - url: "https://blockscout.com/aerum/mainnet" + url: "https://blockscout.com/aerum/mainnet", + other?: true }, %{ title: "Callisto Mainnet", - url: "https://blockscout.com/callisto/mainnet" + url: "https://blockscout.com/callisto/mainnet", + other?: true }, %{ title: "RSK Mainnet", - url: "https://blockscout.com/rsk/mainnet" + url: "https://blockscout.com/rsk/mainnet", + other?: true } ] diff --git a/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex index c322b1d35e..032ab22930 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex @@ -84,13 +84,17 @@ <%= subnetwork_title() %> diff --git a/apps/block_scout_web/lib/block_scout_web/views/layout_view.ex b/apps/block_scout_web/lib/block_scout_web/views/layout_view.ex index fac3e83c09..c4e17bc2f1 100644 --- a/apps/block_scout_web/lib/block_scout_web/views/layout_view.ex +++ b/apps/block_scout_web/lib/block_scout_web/views/layout_view.ex @@ -107,10 +107,19 @@ defmodule BlockScoutWeb.LayoutView do Enum.reject(other_networks(), &Map.get(&1, :test_net?)) end + def head_main_nets do + main_nets() + |> Enum.reject(&Map.get(&1, :other?)) + end + def test_nets do Enum.filter(other_networks(), &Map.get(&1, :test_net?)) end + def other_nets do + Enum.filter(other_networks(), &Map.get(&1, :other?)) + end + def other_explorers do if Application.get_env(:block_scout_web, :link_to_other_explorers) do Application.get_env(:block_scout_web, :other_explorers, []) diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index 78cf645a8b..eb4adbee6d 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -711,8 +711,8 @@ msgid "Responses" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:107 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:125 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:111 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:129 msgid "Search" msgstr "" @@ -1653,8 +1653,8 @@ msgid "Error: Could not determine contract creator." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:101 #: lib/block_scout_web/templates/layout/_topnav.html.eex:105 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:109 msgid "Search by address, token symbol name, transaction hash, or block number" 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 be597cb38e..9d15643bdc 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 @@ -711,8 +711,8 @@ msgid "Responses" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:107 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:125 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:111 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:129 msgid "Search" msgstr "" @@ -1653,8 +1653,8 @@ msgid "Error: Could not determine contract creator." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:101 #: lib/block_scout_web/templates/layout/_topnav.html.eex:105 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:109 msgid "Search by address, token symbol name, transaction hash, or block number" msgstr "" diff --git a/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/encoder.ex b/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/encoder.ex index 1331c8f21a..c43737cfdb 100644 --- a/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/encoder.ex +++ b/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/encoder.ex @@ -41,16 +41,6 @@ defmodule EthereumJSONRPC.Encoder do {id, {:error, "(#{code}) #{message}"}} end - def decode_result(result, %{returns: r} = fs) when r in [:string, [:string]] do - case decode_result(result, %{fs | returns: {:tuple, [:string]}}) do - {id, {:ok, [{string}]}} -> - {id, {:ok, [string]}} - - error -> - error - end - end - def decode_result(%{id: id, result: result}, function_selector) do types_list = List.wrap(function_selector.returns) diff --git a/apps/ethereum_jsonrpc/mix.exs b/apps/ethereum_jsonrpc/mix.exs index e72b607dad..a805dbd649 100644 --- a/apps/ethereum_jsonrpc/mix.exs +++ b/apps/ethereum_jsonrpc/mix.exs @@ -84,7 +84,7 @@ defmodule EthereumJsonrpc.MixProject do # Convert unix timestamps in JSONRPC to DateTimes {:timex, "~> 3.4"}, # Encode/decode function names and arguments - {:ex_abi, "~> 0.2.0"}, + {:ex_abi, "~> 0.1.18"}, # `:verify_fun` for `Socket.Web.connect` {:ssl_verify_fun, "~> 1.1"}, # `EthereumJSONRPC.WebSocket` diff --git a/apps/explorer/lib/explorer/etherscan/logs.ex b/apps/explorer/lib/explorer/etherscan/logs.ex index a6811e4a97..e8cfb7404c 100644 --- a/apps/explorer/lib/explorer/etherscan/logs.ex +++ b/apps/explorer/lib/explorer/etherscan/logs.ex @@ -5,7 +5,7 @@ defmodule Explorer.Etherscan.Logs do """ - import Ecto.Query, only: [from: 2, where: 3] + import Ecto.Query, only: [from: 2, where: 3, subquery: 1, order_by: 3, limit: 2] alias Explorer.Chain.Log alias Explorer.Repo @@ -77,8 +77,6 @@ defmodule Explorer.Etherscan.Logs do inner_join: b in assoc(t, :block), where: b.number >= ^prepared_filter.from_block, where: b.number <= ^prepared_filter.to_block, - order_by: b.number, - limit: 1_000, select: merge(map(l, ^@log_fields), %{ gas_price: t.gas_price, @@ -90,8 +88,11 @@ defmodule Explorer.Etherscan.Logs do ) query + |> subquery() |> where_address_match(prepared_filter) |> where_topic_match(prepared_filter) + |> order_by([l], l.block_number) + |> limit(1_000) |> Repo.all() end diff --git a/apps/explorer/priv/compile_solc.js b/apps/explorer/priv/compile_solc.js index 6e9489d433..7179ebda56 100755 --- a/apps/explorer/priv/compile_solc.js +++ b/apps/explorer/priv/compile_solc.js @@ -12,7 +12,7 @@ var evmVersion = process.argv[8]; var compiled_code = solc.loadRemoteVersion(version, function (err, solcSnapshot) { if (err) { - console.log(JSON.stringify(err)); + console.log(JSON.stringify(err.message)); } else { const input = { language: 'Solidity', diff --git a/apps/explorer/test/explorer/validator/metadata_retriever_test.exs b/apps/explorer/test/explorer/validator/metadata_retriever_test.exs index 15a1581d47..228331df94 100644 --- a/apps/explorer/test/explorer/validator/metadata_retriever_test.exs +++ b/apps/explorer/test/explorer/validator/metadata_retriever_test.exs @@ -72,7 +72,7 @@ defmodule Explorer.Validator.MetadataRetrieverTest do id: id, jsonrpc: "2.0", result: - "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001" + "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001" } ]} end @@ -91,7 +91,7 @@ defmodule Explorer.Validator.MetadataRetrieverTest do id: id, jsonrpc: "2.0", result: - "0x546573746e616d65000000000000000000000000000000000000000000000000556e69746172696f6e000000000000000000000000000000000000000000000030303030303030300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000585800000000000000000000000000000000000000000000000000000000000030303030300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003afe130e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000058585858585858207374726565742058585858585800000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + "0x546573746e616d65000000000000000000000000000000000000000000000000556e69746172696f6e000000000000000000000000000000000000000000000030303030303030300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140585800000000000000000000000000000000000000000000000000000000000030303030300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003afe130e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000058585858585858207374726565742058585858585800000000000000000000000000000000000000000000000000000000000000000000000000000000000000" } ]} end