Skip to content

Sync upstream v11.2.7 (merge conflicts) - #195

Open
JOY (JOY) wants to merge 19 commits into
mainfrom
sync-upstream-v11.2.7
Open

Sync upstream v11.2.7 (merge conflicts)#195
JOY (JOY) wants to merge 19 commits into
mainfrom
sync-upstream-v11.2.7

Conversation

@JOY

Copy link
Copy Markdown

Upstream Sync - v11.2.7

Auto-merge with upstream v11.2.7 failed. Version/workflow conflicts were auto-resolved,
but the following files have code conflicts that need manual resolution:

docker-compose/envs/common-blockscout.env
mix.lock

To resolve:

  1. Check out this branch locally
  2. Resolve remaining conflicts
  3. Push and merge this PR
  4. Then create tag v11.2.7 to trigger Docker build

Upstream release notes

dependabot Bot and others added 18 commits August 11, 2026 17:35
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…lockscout#14674)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request upgrades Blockscout to version 11.2.7, introduces a lightweight transaction preview endpoint, optimizes ENS and metadata preloading using concurrent requests, and implements a pooled HTTP client using Finch to reuse connections. It also adds caching for contract methods and fixes state changes for Eden sponsored transactions. The review feedback highlights critical issues, including unresolved merge conflicts in common-blockscout.env and mix.lock, a bug in HttpClient where Finch.Error is not properly rescued, and several potential runtime crashes due to missing safety checks for nil values or unconfigured environment variables.

Comment on lines +166 to +171
<<<<<<< HEAD
CONTRACT_ENABLE_PARTIAL_REVERIFICATION=true
=======
# CONTRACT_ENABLE_PARTIAL_REVERIFICATION=
# CONTRACT_PROXY_EMPTY_IMPLEMENTATION_DATA_CACHE_TTL=1d
>>>>>>> v11.2.7

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

There is an unresolved merge conflict in this environment file. Please resolve it by removing the conflict markers and keeping the desired configuration.

CONTRACT_ENABLE_PARTIAL_REVERIFICATION=true
# CONTRACT_PROXY_EMPTY_IMPLEMENTATION_DATA_CACHE_TTL=1d

Comment thread mix.lock
Comment on lines +130 to +134
<<<<<<< HEAD
"oban": {:hex, :oban, "2.23.0", "1867d0fa4e8c7685217b02cc2632e3ee86c93da770e9029ff71304d9e62e53d7", [:mix], [{:ecto_sql, "~> 3.10", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:ecto_sqlite3, "~> 0.9", [hex: :ecto_sqlite3, repo: "hexpm", optional: true]}, {:igniter, "~> 0.5", [hex: :igniter, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: true]}, {:myxql, "~> 0.7", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.20", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 1.3", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "8e5f0cec5abecce78dd08cb14dc5438db90ec3884987b44773ce76fe60dd3f81"},
=======
"oban": {:hex, :oban, "2.23.1", "0b9495e28a236ca0478c80d666c58a8b2b55182731c3603c6e766e298a08342a", [:mix], [{:ecto_sql, "~> 3.10", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:ecto_sqlite3, "~> 0.9", [hex: :ecto_sqlite3, repo: "hexpm", optional: true]}, {:igniter, "~> 0.5", [hex: :igniter, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: true]}, {:myxql, "~> 0.7", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.20", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 1.3", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "a9855b9f5d87e31de3e2f46731b163f372e329613892a56c5b2aacceb50ed508"},
>>>>>>> v11.2.7

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

There is an unresolved merge conflict in the mix.lock file. Since this is a sync with upstream v11.2.7, please resolve it by keeping the upstream version (2.23.1) of the oban package.

  "oban": {:hex, :oban, "2.23.1", "0b9495e28a236ca0478c80d666c58a8b2b55182731c3603c6e766e298a08342a", [:mix], [{:ecto_sql, "~> 3.10", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:ecto_sqlite3, "~> 0.9", [hex: :ecto_sqlite3, repo: "hexpm", optional: true]}, {:igniter, "~> 0.5", [hex: :igniter, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: true]}, {:myxql, "~> 0.7", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.20", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 1.3", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "a9855b9f5d87e31de3e2f46731b163f372e329613892a56c5b2aacceb50ed508"},

Comment on lines +113 to +118
rescue
# Finch raises when no connection frees up within the pool timeout (and for
# little else). Callers expect the hackney-era contract where a saturated
# pool is an {:error, _} to log and degrade on - a response without ENS
# names or tags - not an exception that kills the API request.
exception in RuntimeError -> {:error, exception}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The rescue block specifies exception in RuntimeError, but Finch raises Finch.Error (which is a custom exception, not a RuntimeError) on pool timeouts and other errors. This means pool timeouts will not be caught and will crash the API request instead of degrading gracefully as intended. You should rescue any exception using exception -> or include Finch.Error in the rescue list.

  rescue
    # Finch raises when no connection frees up within the pool timeout (and for
    # little else). Callers expect the hackney-era contract where a saturated
    # pool is an {:error, _} to log and degrade on - a response without ENS
    # names or tags - not an exception that kills the API request.
    exception -> {:error, exception}

Comment on lines +278 to +279
defp implementation_refetch_necessary?(%__MODULE__{} = proxy_implementations, smart_contract) do
if Enum.empty?(proxy_implementations.address_hashes) && verified_on_this_address?(smart_contract) do

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

proxy_implementations.address_hashes can be nil if the database column is NULL. Calling Enum.empty?/1 on nil will raise a Protocol.UndefinedError and crash the process. It is safer to default it to an empty list before checking.

  defp implementation_refetch_necessary?(%__MODULE__{} = proxy_implementations, smart_contract) do
    address_hashes = proxy_implementations.address_hashes || []

    if Enum.empty?(address_hashes) && verified_on_this_address?(smart_contract) do


defp implementation_refetch_necessary?(%__MODULE__{} = proxy_implementations, smart_contract) do
if Enum.empty?(proxy_implementations.address_hashes) && verified_on_this_address?(smart_contract) do
ttl = Application.get_env(:explorer, :proxy)[:empty_cached_implementation_data_ttl] || get_fresh_time_distance()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Accessing Application.get_env(:explorer, :proxy)[:empty_cached_implementation_data_ttl] directly can crash with a Protocol.UndefinedError if the :proxy configuration is nil or not set. It is safer to use Keyword.get/3 with a default empty list fallback.

      ttl =
        :explorer
        |> Application.get_env(:proxy, [])
        |> Keyword.get(:empty_cached_implementation_data_ttl)
        |> Kernel.||(get_fresh_time_distance())

Comment on lines +73 to +74
total_size = Application.get_env(:explorer, :microservice_http_pool_size)
pool_count = Application.get_env(:explorer, :microservice_http_pool_count)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

If :microservice_http_pool_size or :microservice_http_pool_count are not configured or are nil, Application.get_env/2 will return nil, causing an ArithmeticError in div/2. It is safer to provide default fallbacks directly in Application.get_env/3.

    total_size = Application.get_env(:explorer, :microservice_http_pool_size, 1000)
    pool_count = Application.get_env(:explorer, :microservice_http_pool_count, 20)

@JOY
JOY (JOY) force-pushed the sync-upstream-v11.2.7 branch 10 times, most recently from d3c3751 to 4f8c2b8 Compare August 21, 2026 02:54
@JOY
JOY (JOY) force-pushed the sync-upstream-v11.2.7 branch 3 times, most recently from 3bb780d to 119e5e6 Compare August 21, 2026 20:13
@JOY
JOY (JOY) force-pushed the sync-upstream-v11.2.7 branch from 119e5e6 to 3d005dd Compare August 22, 2026 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants