diff --git a/CHANGELOG.md b/CHANGELOG.md index 289f674be3..3d4e6f755f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ ## Current + +### Features + +- [#2294](https://github.com/poanetwork/blockscout/pull/2294) - add healthy block period checking endpoint + +### Fixes +- [#2299](https://github.com/poanetwork/blockscout/pull/2299) - fix interpolation in error message +- [#2303](https://github.com/poanetwork/blockscout/pull/2303) - fix transaction csv download link +- [#2304](https://github.com/poanetwork/blockscout/pull/2304) - footer grid fix for md resolution +- [#2291](https://github.com/poanetwork/blockscout/pull/2291) - dashboard fix for md resolution, transactions load fix, block info row fix, addresses page issue, check mark issue + +### Chore +- [#2302](https://github.com/poanetwork/blockscout/pull/2302) - fix names for xDai source +- [#2289](https://github.com/poanetwork/blockscout/pull/2289) - Optional websockets for dev environment + + +## 2.0.1-beta + ### Features +- [#2283](https://github.com/poanetwork/blockscout/pull/2283) - Add transactions cache - [#2182](https://github.com/poanetwork/blockscout/pull/2182) - add market history cache - [#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 @@ -13,6 +32,8 @@ - [#2266](https://github.com/poanetwork/blockscout/pull/2266) - allow excluding uncles from average block time calculation ### Fixes +- [#2290](https://github.com/poanetwork/blockscout/pull/2290) - Add eth_get_balance.json to AddressView's render +- [#2286](https://github.com/poanetwork/blockscout/pull/2286) - banner stats issues on sm resolutions, transactions title issue - [#2284](https://github.com/poanetwork/blockscout/pull/2284) - add 404 status for not existing pages - [#2244](https://github.com/poanetwork/blockscout/pull/2244) - fix internal transactions failing to be indexed because of constraint - [#2281](https://github.com/poanetwork/blockscout/pull/2281) - typo issues, dropdown issues @@ -60,6 +81,8 @@ - [#2173](https://github.com/poanetwork/blockscout/pull/2173) - handle correctly empty transactions - [#2174](https://github.com/poanetwork/blockscout/pull/2174) - fix reward channel joining - [#2186](https://github.com/poanetwork/blockscout/pull/2186) - fix net version test +- [#2196](https://github.com/poanetwork/blockscout/pull/2196) - Nethermind client fixes +- [#2237](https://github.com/poanetwork/blockscout/pull/2237) - fix rsk total_supply - [#2198](https://github.com/poanetwork/blockscout/pull/2198) - reduce transaction status and error constraint - [#2167](https://github.com/poanetwork/blockscout/pull/2167) - feat: document eth rpc api mimicking endpoints - [#2225](https://github.com/poanetwork/blockscout/pull/2225) - fix metadata decoding in Solidity 0.5.9 smart contract verification @@ -78,8 +101,6 @@ - [#2118](https://github.com/poanetwork/blockscout/pull/2118) - show only the last decompiled contract - [#2256](https://github.com/poanetwork/blockscout/pull/2256) - use the latest version of chromedriver -### Chore - ## 2.0.0-beta ### Features diff --git a/apps/block_scout_web/assets/css/components/_card.scss b/apps/block_scout_web/assets/css/components/_card.scss index 6e50100f0d..0737e1b355 100644 --- a/apps/block_scout_web/assets/css/components/_card.scss +++ b/apps/block_scout_web/assets/css/components/_card.scss @@ -6,7 +6,7 @@ $card-vertical-padding: 30px; $card-background-1: $primary !default; $card-background-1-text-color: #fff !default; $card-tab-icon-color: #20b760 !default; -$card-tab-icon-color-active: #20b760 !default; +$card-tab-icon-color-active: #fff !default; .card { background-color: $card-background-color; @@ -14,6 +14,21 @@ $card-tab-icon-color-active: #20b760 !default; border: none; box-shadow: 0 0 30px 0 rgba(202, 199, 226, 0.5); margin-bottom: $common-container-margin; + + .block-details-row { + flex-direction: row; + @include media-breakpoint-down(sm) { + flex-direction: column; + } + + .block-detail-el { + & + .block-detail-el { + @include media-breakpoint-down(sm) { + margin-top: 6px; + } + } + } + } } .card-background-1 { @@ -42,6 +57,12 @@ $card-tab-icon-color-active: #20b760 !default; line-height: 1.2rem; margin-bottom: 2rem; + &.lg-card-title { + @media (max-width: 374px) { + font-size: 13px; + } + } + &.margin-bottom-md { margin-bottom: 25px; } diff --git a/apps/block_scout_web/assets/css/components/_dashboard-banner.scss b/apps/block_scout_web/assets/css/components/_dashboard-banner.scss index ade21afea5..33d104a9fd 100644 --- a/apps/block_scout_web/assets/css/components/_dashboard-banner.scss +++ b/apps/block_scout_web/assets/css/components/_dashboard-banner.scss @@ -80,6 +80,12 @@ $dashboard-banner-chart-axis-font-color: $dashboard-stats-item-value-color !defa flex-direction: row; } + @media (max-width: 599px) { + padding-top: 0; + padding-bottom: 0; + flex-direction: column; + } + &::before { border-radius: 2px; content: ""; @@ -107,6 +113,11 @@ $dashboard-banner-chart-axis-font-color: $dashboard-stats-item-value-color !defa line-height: 1.2; margin: 0 0 5px; + @media (max-width: 374px) { + position: relative; + top: -2px; + } + @include media-breakpoint-down(md) { margin: 0 5px 0 0; } @@ -135,12 +146,16 @@ $dashboard-banner-chart-axis-font-color: $dashboard-stats-item-value-color !defa width: 750px; position: relative; + @include media-breakpoint-down(lg) { + margin-top: 15px; + width: 550px; + } + @include media-breakpoint-down(md) { border-top-right-radius: 10px; height: auto; justify-content: flex-start; margin-left: 0; - margin-top: 15px; max-width: 100%; padding: 20px 0 20px 20px; width: 250px; @@ -175,6 +190,11 @@ $dashboard-banner-chart-axis-font-color: $dashboard-stats-item-value-color !defa display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; + @include media-breakpoint-down(lg) { + grid-template-columns: 1fr 1fr; + row-gap: 20px; + } + @include media-breakpoint-down(md) { grid-template-columns: 1fr; row-gap: 20px; @@ -186,4 +206,17 @@ $dashboard-banner-chart-axis-font-color: $dashboard-stats-item-value-color !defa } @include stats-item($dashboard-stats-item-border-color, $dashboard-stats-item-label-color, $dashboard-stats-item-value-color); + + .dashboard-banner-network-stats-item { + @media (max-width: 374px) { + padding-left: calc(0.6rem + 4px); + padding-right: 0.5rem; + } + } + + .dashboard-banner-network-stats-value { + @media (max-width: 374px) { + font-size: 0.9rem; + } + } } \ No newline at end of file diff --git a/apps/block_scout_web/assets/css/components/_stakes_table.scss b/apps/block_scout_web/assets/css/components/_stakes_table.scss index 0bbf59e69c..79cdc20b38 100644 --- a/apps/block_scout_web/assets/css/components/_stakes_table.scss +++ b/apps/block_scout_web/assets/css/components/_stakes_table.scss @@ -7,6 +7,25 @@ $stakes-table-cell-separation: 25px !default; width: 100%; } +.addresses-table-container { + margin-left: -30px; + margin-right: -30px; + .stakes-table-container { + table { + width: 100%; + th:first-child { + padding-left: 25px; + } + td:first-child { + padding-left: 25px; + } + } + } + .color-lighten { + color: #828ba0; + } +} + .stakes-table { min-width: fit-content; width: 100%; diff --git a/apps/block_scout_web/assets/css/components/_tile.scss b/apps/block_scout_web/assets/css/components/_tile.scss index 68b873334c..8965715727 100644 --- a/apps/block_scout_web/assets/css/components/_tile.scss +++ b/apps/block_scout_web/assets/css/components/_tile.scss @@ -272,6 +272,7 @@ $tile-body-a-color: #5959d8 !default; } &.tile-type-block { + max-width: 100%; .tile-title { font-weight: 700; line-height: 1.2; @@ -330,3 +331,23 @@ $tile-body-a-color: #5959d8 !default; } } } + +.card-chain-blocks { + .card-body { + .col-lg-3 { + @include media-breakpoint-down(lg) { + padding-left: 6px; + padding-right: 6px; + } + .tile-type-block { + overflow: hidden; + } + } + .row { + @include media-breakpoint-down(lg) { + margin-left: -6px; + margin-right: -6px; + } + } + } +} diff --git a/apps/block_scout_web/assets/js/pages/chain.js b/apps/block_scout_web/assets/js/pages/chain.js index 00f92523ec..f4cd0e6628 100644 --- a/apps/block_scout_web/assets/js/pages/chain.js +++ b/apps/block_scout_web/assets/js/pages/chain.js @@ -142,7 +142,7 @@ const elements = { chart = createMarketHistoryChart($el[0]) }, render ($el, state, oldState) { - if (!chart || (oldState.availableSupply === state.availableSupply && oldState.marketHistoryData === state.marketHistoryData)) return + if (!chart || (oldState.availableSupply === state.availableSupply && oldState.marketHistoryData === state.marketHistoryData) || !state.availableSupply) return chart.update(state.availableSupply, state.marketHistoryData) } }, diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/api/v1/health_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/api/v1/health_controller.ex new file mode 100644 index 0000000000..957dc797be --- /dev/null +++ b/apps/block_scout_web/lib/block_scout_web/controllers/api/v1/health_controller.ex @@ -0,0 +1,49 @@ +defmodule BlockScoutWeb.API.V1.HealthController do + use BlockScoutWeb, :controller + + alias Explorer.Chain + + def health(conn, _) do + with {:ok, number, timestamp} <- Chain.last_block_status() do + send_resp(conn, :ok, result(number, timestamp)) + else + status -> send_resp(conn, :internal_server_error, error(status)) + end + end + + def result(number, timestamp) do + %{ + "healthy" => true, + "data" => %{ + "latest_block_number" => to_string(number), + "latest_block_inserted_at" => to_string(timestamp) + } + } + |> Jason.encode!() + end + + def error({:error, :no_blocks}) do + %{ + "healthy" => false, + "error_code" => 5002, + "error_title" => "no blocks in db", + "error_description" => "There are no blocks in the DB" + } + |> Jason.encode!() + end + + def error({:error, number, timestamp}) do + %{ + "healthy" => false, + "error_code" => 5001, + "error_title" => "blocks fetching is stuck", + "error_description" => + "There are no new blocks in the DB for the last 5 mins. Check the healthiness of Ethereum archive node or the Blockscout DB instance", + "data" => %{ + "latest_block_number" => to_string(number), + "latest_block_inserted_at" => to_string(timestamp) + } + } + |> Jason.encode!() + end +end diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/recent_transactions_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/recent_transactions_controller.ex index 4f66597bcb..b001093c6e 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/recent_transactions_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/recent_transactions_controller.ex @@ -12,7 +12,7 @@ defmodule BlockScoutWeb.RecentTransactionsController do necessity_by_association: %{ :block => :required, [created_contract_address: :names] => :optional, - [from_address: :names] => :required, + [from_address: :names] => :optional, [to_address: :names] => :optional }, paging_options: %PagingOptions{page_size: 5} 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 2b577722be..e01d121eb8 100644 --- a/apps/block_scout_web/lib/block_scout_web/router.ex +++ b/apps/block_scout_web/lib/block_scout_web/router.ex @@ -23,6 +23,8 @@ defmodule BlockScoutWeb.Router do get("/supply", SupplyController, :supply) + get("/health", HealthController, :health) + resources("/decompiled_smart_contract", DecompiledSmartContractController, only: [:create]) resources("/verified_smart_contracts", VerifiedSmartContractController, only: [:create]) 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 c2e62e2004..9680faa2a8 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 @@ -1,51 +1,39 @@ -
-
- -
+ + - + <%= @index %> -
- -
-
-
- <%= @address |> BlockScoutWeb.AddressView.address_partial_selector(nil, nil) |> BlockScoutWeb.RenderHelpers.render_partial() %> - - - - <%= @tx_count %> - <%= gettext "Transactions sent" %> - <% if validator?(@address) do %> - - <%= @validation_count %> - <%= gettext "Validations" %> - <% end %> - -
- - -
- - <%= balance(@address) %> -
- - - data-usd-exchange-rate="<%= @exchange_rate.usd_value %>"> - <% end %> - - - - <%= if @total_supply do %> - (<%= balance_percentage(@address, @total_supply) %>) - <% end %> - -
-
-
-
-
-
+ + + <%= @address |> BlockScoutWeb.AddressView.address_partial_selector(nil, nil) |> BlockScoutWeb.RenderHelpers.render_partial() %> + + + <%= balance(@address) %> + + + data-usd-exchange-rate="<%= @exchange_rate.usd_value %>"> + <% end %> + + + + + <%= if @total_supply do %> + (<%= balance_percentage(@address, @total_supply) %>) + <% end %> + + + + + <%= @tx_count %> + <%= gettext "Transactions sent" %> + <% if validator?(@address) do %> + + <%= @validation_count %> + <%= gettext "Validations" %> + <% end %> + + + diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address/index.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address/index.html.eex index 47d7f2457b..3aaab46ad5 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address/index.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address/index.html.eex @@ -3,11 +3,48 @@

<%= gettext "Addresses" %>

- <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "top", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %> - -
- - <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "bottom", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %> + <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "top", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %> + +
+
+ + + + + + + + + + + + + +
+
+   +
+
+
+ Address +
+
+
+ Balance +
+
+
+ Percentage +
+
+
+ Txn Count +
+
+
+
+ + <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "bottom", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %>
diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address/overview.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address/overview.html.eex index 76387a9662..e6178a4e72 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address/overview.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address/overview.html.eex @@ -4,7 +4,7 @@
-

+

<%= address_title(@address) %> <%= gettext "Details" %> diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address_transaction/index.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address_transaction/index.html.eex index 5abd8285c6..c3a4c94129 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address_transaction/index.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address_transaction/index.html.eex @@ -66,10 +66,10 @@

- +
- Download to_string(@address.hash)}) %>><%= gettext("CSV") %> + Download to_string(@address.hash)}) %>><%= gettext("CSV") %> diff --git a/apps/block_scout_web/lib/block_scout_web/templates/block/overview.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/block/overview.html.eex index 23985be4f6..24b2d9e61a 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/block/overview.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/block/overview.html.eex @@ -16,17 +16,17 @@ <%= link(@block, to: block_path(BlockScoutWeb.Endpoint, :show, @block.number)) %> <% end %> -
+
- <%= gettext "%{count} Transactions", count: @block_transaction_count %> + <%= gettext "%{count} Transactions", count: @block_transaction_count %> <%= if @block.size do %> - <%= Cldr.Unit.new(:byte, @block.size) |> cldr_unit_to_string!() %> + <%= Cldr.Unit.new(:byte, @block.size) |> cldr_unit_to_string!() %> <% end %> - +

diff --git a/apps/block_scout_web/lib/block_scout_web/templates/chain/show.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/chain/show.html.eex index 17bd9c4afe..0c29001697 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/chain/show.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/chain/show.html.eex @@ -105,7 +105,7 @@
<%= link(gettext("View All Transactions"), to: transaction_path(BlockScoutWeb.Endpoint, :index), class: "btn-line float-right") %> -

<%= gettext "Transactions" %>

+

<%= gettext "Transactions" %>

<%= gettext "More transactions have come in" %> diff --git a/apps/block_scout_web/lib/block_scout_web/templates/layout/_footer.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/layout/_footer.html.eex index 7188f283a1..9d84836a5a 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/layout/_footer.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/layout/_footer.html.eex @@ -13,7 +13,7 @@ <% col_size = if Enum.empty?(other_explorers), do: 3, else: 2 %>
-
+
-