diff --git a/CHANGELOG.md b/CHANGELOG.md index a847de3b1d..94a259cd55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,11 @@ ## Current ### Features +- [#2109](https://github.com/poanetwork/blockscout/pull/2109) - use bigger updates instead of `Multi` transactions in BlocksTransactionsMismatch - [#2075](https://github.com/poanetwork/blockscout/pull/2075) - add blocks cache ### Fixes +- [#2121](https://github.com/poanetwork/blockscout/pull/2121) - Binding of 404 page - [#2120](https://github.com/poanetwork/blockscout/pull/2120) - footer links and socials focus color issue - [#2113](https://github.com/poanetwork/blockscout/pull/2113) - renewed logos for rsk, dai, blockscout; themes color changes for lukso; error images for lukso - [#2112](https://github.com/poanetwork/blockscout/pull/2112) - themes color improvements, dropdown color issue @@ -12,7 +14,12 @@ - [#2090](https://github.com/poanetwork/blockscout/pull/2090) - updated some ETC theme colors - [#2096](https://github.com/poanetwork/blockscout/pull/2096) - RSK theme fixes - [#2093](https://github.com/poanetwork/blockscout/pull/2093) - detect token transfer type for deprecated erc721 spec -- [#2108](https://github.com/poanetwork/blockscout/pull/2108) - fixe uncle fetching without full transactions +- [#2108](https://github.com/poanetwork/blockscout/pull/2108) - fix uncle fetching without full transactions +- [#2123](https://github.com/poanetwork/blockscout/pull/2123) - fix coins percentage view +- [#2119](https://github.com/poanetwork/blockscout/pull/2119) - fix map logging + +### Chore +- [#2127](https://github.com/poanetwork/blockscout/pull/2127) - use previouse chromedriver version ### Chore diff --git a/apps/block_scout_web/lib/block_scout_web/controller.ex b/apps/block_scout_web/lib/block_scout_web/controller.ex index fe2851c197..cf545f5260 100644 --- a/apps/block_scout_web/lib/block_scout_web/controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controller.ex @@ -12,8 +12,9 @@ defmodule BlockScoutWeb.Controller do def not_found(conn) do conn |> put_status(:not_found) - |> put_view(BlockScoutWeb.ErrorView) - |> render("404.html") + |> put_view(BlockScoutWeb.PageNotFoundView) + |> render(:index) + |> halt() end def unprocessable_entity(conn) do diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/page_not_found_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/page_not_found_controller.ex new file mode 100644 index 0000000000..e453e5463b --- /dev/null +++ b/apps/block_scout_web/lib/block_scout_web/controllers/page_not_found_controller.ex @@ -0,0 +1,8 @@ +defmodule BlockScoutWeb.PageNotFoundController do + use BlockScoutWeb, :controller + + def index(conn, _params) do + conn + |> render("index.html") + end +end diff --git a/apps/block_scout_web/lib/block_scout_web/router.ex b/apps/block_scout_web/lib/block_scout_web/router.ex index aa19725811..48a5c8f8da 100644 --- a/apps/block_scout_web/lib/block_scout_web/router.ex +++ b/apps/block_scout_web/lib/block_scout_web/router.ex @@ -245,5 +245,7 @@ defmodule BlockScoutWeb.Router do get("/chain_blocks", ChainController, :chain_blocks, as: :chain_blocks) get("/api_docs", APIDocsController, :index) + + get("/:page", PageNotFoundController, :index) end end diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address/_tile.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address/_tile.html.eex index 270450c2c0..c2e62e2004 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address/_tile.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address/_tile.html.eex @@ -39,7 +39,7 @@ - <% if @total_supply do %> + <%= if @total_supply do %> (<%= balance_percentage(@address, @total_supply) %>) <% end %> diff --git a/apps/block_scout_web/lib/block_scout_web/templates/page_not_found/index.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/page_not_found/index.html.eex index 6850c2deb2..d91690ea9e 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/page_not_found/index.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/page_not_found/index.html.eex @@ -4,8 +4,8 @@ Page Not Found
-

Lorem Ipsum Dolor

-

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua

+

Page not found

+

The requested path was not found on BlockScout.

Back Home
diff --git a/apps/block_scout_web/lib/block_scout_web/views/page_not_found.ex b/apps/block_scout_web/lib/block_scout_web/views/page_not_found.ex new file mode 100644 index 0000000000..b5a18f0434 --- /dev/null +++ b/apps/block_scout_web/lib/block_scout_web/views/page_not_found.ex @@ -0,0 +1,5 @@ +defmodule BlockScoutWeb.PageNotFoundView do + use BlockScoutWeb, :view + + @dialyzer :no_match +end diff --git a/apps/indexer/lib/indexer/block/realtime/fetcher.ex b/apps/indexer/lib/indexer/block/realtime/fetcher.ex index 8778677f33..28887223b3 100644 --- a/apps/indexer/lib/indexer/block/realtime/fetcher.ex +++ b/apps/indexer/lib/indexer/block/realtime/fetcher.ex @@ -140,7 +140,7 @@ defmodule Indexer.Block.Realtime.Fetcher do %__MODULE__{state | subscription: subscription} {:error, reason} -> - Logger.debug(fn -> ["Could not connect to websocket: ", reason, ". Continuing with polling."] end) + Logger.debug(fn -> ["Could not connect to websocket: #{inspect(reason)}. Continuing with polling."] end) state end end diff --git a/apps/indexer/lib/indexer/temporary/blocks_transactions_mismatch.ex b/apps/indexer/lib/indexer/temporary/blocks_transactions_mismatch.ex index 49b33b7c44..486789f675 100644 --- a/apps/indexer/lib/indexer/temporary/blocks_transactions_mismatch.ex +++ b/apps/indexer/lib/indexer/temporary/blocks_transactions_mismatch.ex @@ -13,7 +13,6 @@ defmodule Indexer.Temporary.BlocksTransactionsMismatch do import Ecto.Query - alias Ecto.Multi alias EthereumJSONRPC.Blocks alias Explorer.Chain.Block alias Explorer.Repo @@ -23,13 +22,14 @@ defmodule Indexer.Temporary.BlocksTransactionsMismatch do @defaults [ flush_interval: :timer.seconds(3), - max_batch_size: 10, + max_batch_size: 50, max_concurrency: 1, task_supervisor: Indexer.Temporary.BlocksTransactionsMismatch.TaskSupervisor, metadata: [fetcher: :blocks_transactions_mismatch] ] @doc false + # credo:disable-for-next-line Credo.Check.Design.DuplicatedCode def child_spec([init_options, gen_server_options]) when is_list(init_options) do {state, mergeable_init_options} = Keyword.pop(init_options, :json_rpc_named_arguments) @@ -99,17 +99,26 @@ defmodule Indexer.Temporary.BlocksTransactionsMismatch do Map.has_key?(found_blocks_map, to_string(block.hash)) end) - {:ok, _} = - found_blocks_data - |> Enum.reduce(Multi.new(), fn {block, trans_num}, multi -> - changes = %{ - refetch_needed: false, - consensus: found_blocks_map[to_string(block.hash)] == trans_num - } - - Multi.update(multi, block.hash, Block.changeset(block, changes)) + {matching_blocks_data, unmatching_blocks_data} = + Enum.split_with(found_blocks_data, fn {block, trans_num} -> + found_blocks_map[to_string(block.hash)] == trans_num end) - |> Repo.transaction() + + unless Enum.empty?(matching_blocks_data) do + hashes = Enum.map(matching_blocks_data, fn {block, _trans_num} -> block.hash end) + + Block + |> where([block], block.hash in ^hashes) + |> Repo.update_all(set: [refetch_needed: false]) + end + + unless Enum.empty?(unmatching_blocks_data) do + hashes = Enum.map(unmatching_blocks_data, fn {block, _trans_num} -> block.hash end) + + Block + |> where([block], block.hash in ^hashes) + |> Repo.update_all(set: [refetch_needed: false, consensus: false]) + end if Enum.empty?(missing_blocks_data) do :ok diff --git a/bin/install_chrome_headless.sh b/bin/install_chrome_headless.sh index 9721e84ea3..d27bb6f9d8 100755 --- a/bin/install_chrome_headless.sh +++ b/bin/install_chrome_headless.sh @@ -1,6 +1,6 @@ export DISPLAY=:99.0 sh -e /etc/init.d/xvfb start -export CHROMEDRIVER_VERSION=`curl -s http://chromedriver.storage.googleapis.com/LATEST_RELEASE` +export CHROMEDRIVER_VERSION=74.0.3729.6 curl -L -O "http://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip" unzip chromedriver_linux64.zip sudo chmod +x chromedriver