Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/blockscout/blockscout int…
Browse files Browse the repository at this point in the history
…o sync-02-07
  • Loading branch information
pustovalov committed Jul 4, 2024
2 parents 944f91d + ea9f6e5 commit e5f7271
Show file tree
Hide file tree
Showing 13 changed files with 77 additions and 41 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 6.7.2

### 🐛 Bug Fixes

- Apply Ecto set explicit ssl_opts: [verify: :verify_none] to all prod repos ([#10369](https://github.com/blockscout/blockscout/issues/10369))
- Fix slow internal transactions query ([#10346](https://github.com/blockscout/blockscout/issues/10346))
- Don't execute update query for empty list ([#10344](https://github.com/blockscout/blockscout/issues/10344))
- Add rescue on tx revert reason fetching ([#10366](https://github.com/blockscout/blockscout/issues/10366))
- Reth compatibility ([#10335](https://github.com/blockscout/blockscout/issues/10335))
- Public metrics enabling ([#10365](https://github.com/blockscout/blockscout/issues/10365))
- Flaky market test ([#10262](https://github.com/blockscout/blockscout/issues/10262))

### ⚙️ Miscellaneous Tasks

- Bump elixir to 1.16.3 and Erlang OTP to 26.2.5.1 ([#9256](https://github.com/blockscout/blockscout/issues/9256))

## 6.7.1

### 🐛 Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion apps/block_scout_web/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ defmodule BlockScoutWeb.Mixfile do
dialyzer: :test
],
start_permanent: Mix.env() == :prod,
version: "6.7.1",
version: "6.7.2",
xref: [
exclude: [
Explorer.Chain.PolygonZkevm.Reader,
Expand Down
2 changes: 1 addition & 1 deletion apps/ethereum_jsonrpc/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ defmodule EthereumJsonrpc.MixProject do
dialyzer: :test
],
start_permanent: Mix.env() == :prod,
version: "6.7.1"
version: "6.7.2"
]
end

Expand Down
48 changes: 32 additions & 16 deletions apps/explorer/config/prod.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,69 +4,85 @@ import Config
config :explorer, Explorer.Repo,
prepare: :unnamed,
timeout: :timer.seconds(60),
migration_lock: nil
migration_lock: nil,
ssl_opts: [verify: :verify_none]

# Configures API the database
config :explorer, Explorer.Repo.Replica1,
prepare: :unnamed,
timeout: :timer.seconds(60)
timeout: :timer.seconds(60),
ssl_opts: [verify: :verify_none]

# Configures Account database
config :explorer, Explorer.Repo.Account,
prepare: :unnamed,
timeout: :timer.seconds(60)
timeout: :timer.seconds(60),
ssl_opts: [verify: :verify_none]

config :explorer, Explorer.Repo.Optimism,
prepare: :unnamed,
timeout: :timer.seconds(60)
timeout: :timer.seconds(60),
ssl_opts: [verify: :verify_none]

config :explorer, Explorer.Repo.PolygonEdge,
prepare: :unnamed,
timeout: :timer.seconds(60)
timeout: :timer.seconds(60),
ssl_opts: [verify: :verify_none]

config :explorer, Explorer.Repo.PolygonZkevm,
prepare: :unnamed,
timeout: :timer.seconds(60)
timeout: :timer.seconds(60),
ssl_opts: [verify: :verify_none]

config :explorer, Explorer.Repo.ZkSync,
prepare: :unnamed,
timeout: :timer.seconds(60)
timeout: :timer.seconds(60),
ssl_opts: [verify: :verify_none]

config :explorer, Explorer.Repo.RSK,
prepare: :unnamed,
timeout: :timer.seconds(60)
timeout: :timer.seconds(60),
ssl_opts: [verify: :verify_none]

config :explorer, Explorer.Repo.Shibarium,
prepare: :unnamed,
timeout: :timer.seconds(60)
timeout: :timer.seconds(60),
ssl_opts: [verify: :verify_none]

config :explorer, Explorer.Repo.Suave,
prepare: :unnamed,
timeout: :timer.seconds(60)
timeout: :timer.seconds(60),
ssl_opts: [verify: :verify_none]

config :explorer, Explorer.Repo.Beacon,
prepare: :unnamed,
timeout: :timer.seconds(60)
timeout: :timer.seconds(60),
ssl_opts: [verify: :verify_none]

config :explorer, Explorer.Repo.Arbitrum,
prepare: :unnamed,
timeout: :timer.seconds(60)
timeout: :timer.seconds(60),
ssl_opts: [verify: :verify_none]

config :explorer, Explorer.Repo.BridgedTokens,
prepare: :unnamed,
timeout: :timer.seconds(60)
timeout: :timer.seconds(60),
ssl_opts: [verify: :verify_none]

config :explorer, Explorer.Repo.Filecoin,
prepare: :unnamed,
timeout: :timer.seconds(60)
timeout: :timer.seconds(60),
ssl_opts: [verify: :verify_none]

config :explorer, Explorer.Repo.Stability,
prepare: :unnamed,
timeout: :timer.seconds(60)
timeout: :timer.seconds(60),
ssl_opts: [verify: :verify_none]

config :explorer, Explorer.Repo.Mud,
prepare: :unnamed,
timeout: :timer.seconds(60)
timeout: :timer.seconds(60),
ssl_opts: [verify: :verify_none]

config :explorer, Explorer.Tracer, env: "production", disabled?: true

Expand Down
6 changes: 4 additions & 2 deletions apps/explorer/lib/explorer/chain/internal_transaction.ex
Original file line number Diff line number Diff line change
Expand Up @@ -576,8 +576,10 @@ defmodule Explorer.Chain.InternalTransaction do
"""
def where_nonpending_block(query \\ nil) do
(query || __MODULE__)
|> join(:left, [it], pending in assoc(it, :pending_block), as: :pending)
|> where([it, pending: pending], is_nil(pending.block_hash))
|> where(
[it],
fragment("(SELECT block_hash FROM pending_block_operations WHERE block_hash = ? LIMIT 1) IS NULL", it.block_hash)
)
end

def internal_transactions_to_raw(internal_transactions) when is_list(internal_transactions) do
Expand Down
29 changes: 15 additions & 14 deletions apps/explorer/lib/explorer/chain/metrics/queries.ex
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,24 @@ defmodule Explorer.Chain.Metrics.Queries do
|> select([tx, block], tx.created_contract_address_hash)
end

internal_transactions_query =
InternalTransaction
|> join(:inner, [it], transaction in assoc(it, :transaction))
|> where([it, tx], not is_nil(it.created_contract_address_hash))
|> where([it, tx], tx.block_timestamp >= ago(7, "day"))
|> where([it, tx], tx.block_consensus == true)
|> where([it, tx], tx.status == ^1)
|> select([it, tx], it.created_contract_address_hash)
|> wrapped_union_subquery()
# todo: this part is too slow, need to optimize
# internal_transactions_query =
# InternalTransaction
# |> join(:inner, [it], transaction in assoc(it, :transaction))
# |> where([it, tx], not is_nil(it.created_contract_address_hash))
# |> where([it, tx], tx.block_timestamp >= ago(7, "day"))
# |> where([it, tx], tx.block_consensus == true)
# |> where([it, tx], tx.status == ^1)
# |> select([it, tx], it.created_contract_address_hash)
# |> wrapped_union_subquery()

query =
transactions_query
|> wrapped_union_subquery()
|> union(^internal_transactions_query)
# query =
# transactions_query
# |> wrapped_union_subquery()
# |> union(^internal_transactions_query)

from(
q in subquery(query),
q in subquery(transactions_query),
select: fragment("COUNT(DISTINCT(?))", q.created_contract_address_hash)
)
end
Expand Down
3 changes: 2 additions & 1 deletion apps/explorer/lib/explorer/prometheus/instrumenter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ defmodule Explorer.Prometheus.Instrumenter do

@gauge [
name: :weekly_deployed_smart_contracts_number,
help: "Number of deployed smart-contracts in the last 7 days",
help:
"Number of deployed smart-contracts (smart-contracts from internal transactions are not accounted) in the last 7 days",
registry: :public
]

Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ defmodule Explorer.Mixfile do
dialyzer: :test
],
start_permanent: Mix.env() == :prod,
version: "6.7.1",
version: "6.7.2",
xref: [exclude: [BlockScoutWeb.Routers.WebRouter.Helpers, Indexer.Helper]]
]
end
Expand Down
2 changes: 1 addition & 1 deletion apps/indexer/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ defmodule Indexer.MixProject do
elixirc_paths: elixirc_paths(Mix.env()),
lockfile: "../../mix.lock",
start_permanent: Mix.env() == :prod,
version: "6.7.1",
version: "6.7.2",
xref: [
exclude: [
Explorer.Chain.Optimism.Deposit,
Expand Down
2 changes: 1 addition & 1 deletion docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ services:
CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED: ""
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL: ""
ADMIN_PANEL_ENABLED: ""
RELEASE_VERSION: 6.7.1
RELEASE_VERSION: 6.7.2
links:
- db:database
environment:
Expand Down
2 changes: 1 addition & 1 deletion docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ STATS_CONTAINER_NAME := stats
STATS_DB_CONTAINER_NAME := stats-db
PROXY_CONTAINER_NAME := proxy
PG_CONTAINER_NAME := postgres
RELEASE_VERSION ?= '6.7.1'
RELEASE_VERSION ?= '6.7.2'
TAG := $(RELEASE_VERSION)-commit-$(shell git log -1 --pretty=format:"%h")
STABLE_TAG := $(RELEASE_VERSION)

Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defmodule BlockScout.Mixfile do
[
# app: :block_scout,
# aliases: aliases(config_env()),
version: "6.7.1",
version: "6.7.2",
apps_path: "apps",
deps: deps(),
dialyzer: dialyzer(),
Expand Down
2 changes: 1 addition & 1 deletion rel/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ end
# will be used by default

release :blockscout do
set version: "6.7.1-beta"
set version: "6.7.2-beta"
set applications: [
:runtime_tools,
block_scout_web: :permanent,
Expand Down

0 comments on commit e5f7271

Please sign in to comment.