Merge branch 'master' into master

pull/2129/head
maxgrapps 6 years ago committed by GitHub
commit 4450dbb77f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      CHANGELOG.md
  2. 5
      apps/block_scout_web/lib/block_scout_web/controller.ex
  3. 8
      apps/block_scout_web/lib/block_scout_web/controllers/page_not_found_controller.ex
  4. 2
      apps/block_scout_web/lib/block_scout_web/router.ex
  5. 2
      apps/block_scout_web/lib/block_scout_web/templates/address/_tile.html.eex
  6. 4
      apps/block_scout_web/lib/block_scout_web/templates/page_not_found/index.html.eex
  7. 5
      apps/block_scout_web/lib/block_scout_web/views/page_not_found.ex
  8. 2
      apps/indexer/lib/indexer/block/realtime/fetcher.ex
  9. 33
      apps/indexer/lib/indexer/temporary/blocks_transactions_mismatch.ex
  10. 2
      bin/install_chrome_headless.sh

@ -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

@ -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

@ -0,0 +1,8 @@
defmodule BlockScoutWeb.PageNotFoundController do
use BlockScoutWeb, :controller
def index(conn, _params) do
conn
|> render("index.html")
end
end

@ -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

@ -39,7 +39,7 @@
</span>
<!-- percentage of coins from total supply -->
<span class="ml-0 ml-md-2">
<% if @total_supply do %>
<%= if @total_supply do %>
(<%= balance_percentage(@address, @total_supply) %>)
<% end %>
</span>

@ -4,8 +4,8 @@
<img alt="Page Not Found" src="/images/errors-img/poa-page-not-found.png" srcset="/images/errors-img/poa-page-not-found@2x.png 2x">
</div>
<div class="block-not-found-content">
<h1 class="card-title error-title">Lorem Ipsum Dolor</h1>
<p class="error-descr">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</p>
<h1 class="card-title error-title">Page not found</h1>
<p class="error-descr">The requested path was not found on BlockScout.</p>
<a class="error-btn btn-line" href="/">Back Home</a>
</div>
</div>

@ -0,0 +1,5 @@
defmodule BlockScoutWeb.PageNotFoundView do
use BlockScoutWeb, :view
@dialyzer :no_match
end

@ -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

@ -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

@ -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

Loading…
Cancel
Save