Skip to content

Sync upstream v12.0.3 (merge conflicts) - #270

Open
JOY (JOY) wants to merge 129 commits into
mainfrom
sync-upstream-v12.0.3
Open

JOY (JOY) wants to merge 129 commits into
mainfrom
sync-upstream-v12.0.3

Conversation

@JOY

Copy link
Copy Markdown

Upstream Sync - v12.0.3

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

apps/explorer/lib/explorer/migrator/delete_zero_value_internal_transactions.ex
docker-compose/envs/common-blockscout.env
docker/Dockerfile
mix.lock
types-package/package-lock.json

To resolve:

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

Upstream release notes

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…cout#14654)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…4761)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…#14764)

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>
Co-authored-by: Victor Baranov <baranov.viktor.27@gmail.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>
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>

@claude claude 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 skipped — your organization has no extra usage available to pay for this review.

If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.

Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-21T08:04:46.385066Z
We couldn’t complete this review. Comment @codex review to try again.
0e96eec PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown

Walkthrough

Warning

Review details and warnings were omitted to fit the comment limit.

@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 the codebase to Elixir 1.20.4 and Erlang OTP 28, migrates JSON handling to the built-in JSON library, and introduces support for the ERC-8056 token standard. It also unifies pagination across API v2 endpoints, optimizes participant preloads, and adds new Etherscan-compatible token endpoints. The review feedback highlights several critical robustness improvements, such as adding a default fallback for the rate-limit multiplier to prevent arithmetic crashes, avoiding strict pattern matching on optional query parameters in CSV exports, implementing early-return optimizations for empty lists, enforcing batch size limits at the application layer, and guarding against nil-pointer crashes when scaling token total supply.

Comment on lines +459 to +461
defp recaptcha_disabled_limit_multiplier do
Application.get_env(:block_scout_web, :api_rate_limit)[:recaptcha_disabled_limit_multiplier]
end

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

If :recaptcha_disabled_limit_multiplier is not configured in the :api_rate_limit environment (e.g., in test environments or fallback setups), recaptcha_disabled_limit_multiplier/0 will return nil. This will cause an ArithmeticError when multiplying the limit in rate_limit_by_ip/5 and other rate-limiting functions. Adding a default fallback value (such as 2) prevents potential runtime crashes.

  defp recaptcha_disabled_limit_multiplier do
    Application.get_env(:block_scout_web, :api_rate_limit)[:recaptcha_disabled_limit_multiplier] || 2
  end

Comment on lines +101 to +102
@spec export_token_transfers(Conn.t(), map()) :: Conn.t()
def export_token_transfers(conn, %{address_hash_param: address_hash_string, from_period: _, to_period: _} = params) 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.

high

Pattern matching on from_period and to_period in the function head will cause a FunctionClauseError (resulting in a 500 Internal Server Error) if these optional parameters are omitted by the client. It is safer to pattern match only on the required address_hash_param and retrieve the optional parameters using Map.get/2 or map access.

  @spec export_token_transfers(Conn.t(), map()) :: Conn.t()
  def export_token_transfers(conn, %{address_hash_param: address_hash_string} = params) do

Comment on lines +20 to +21
@spec internal_transactions_pending?(list(), any() | nil) :: boolean()
def internal_transactions_pending?(internal_transactions, transaction_hash \\ nil) 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

If internal_transactions is empty and transaction_hash is nil, we can return false immediately. This avoids executing unnecessary queries or potentially passing nil values to PendingOperationsHelper which could cause database errors or crashes.

  @spec internal_transactions_pending?(list(), any() | nil) :: boolean()
  def internal_transactions_pending?(internal_transactions, transaction_hash \\ nil)
  def internal_transactions_pending?([], nil), do: false
  def internal_transactions_pending?(internal_transactions, transaction_hash) do

Comment on lines +47 to +48
@spec address_internal_transactions_pending?(list()) :: boolean()
def address_internal_transactions_pending?(internal_transactions) 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

If internal_transactions is empty, we can return false immediately to avoid executing unnecessary queries in PendingOperationsHelper.

  @spec address_internal_transactions_pending?(list()) :: boolean()
  def address_internal_transactions_pending?([]), do: false
  def address_internal_transactions_pending?(internal_transactions) do

Comment on lines +955 to +958
defp do_tokens_batch(conn, params, address_hashes) do
valid_hashes =
address_hashes
|> Enum.flat_map(fn hash_string ->

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

Although the OpenAPI spec defines maxItems: 50 for address_hashes, it is a security and performance best practice to enforce this limit at the application layer as well. This prevents potential Denial of Service (DoS) or database performance issues if the validation layer is bypassed or misconfigured.

  defp do_tokens_batch(conn, params, address_hashes) do
    valid_hashes =
      address_hashes
      |> Stream.take(@max_batch_size)
      |> Enum.flat_map(fn hash_string ->

Comment on lines +88 to +91
tokens =
token.total_supply
|> ScaledUIAmount.scale(Token.effective_ui_multiplier(token))
|> CurrencyHelper.divide_decimals(token.decimals)

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 token.total_supply is nil (which is possible for some tokens if the supply hasn't been fetched or failed to fetch), calling ScaledUIAmount.scale/2 will crash. Wrapping this in a nil check ensures robustness.

      tokens =
        if token.total_supply do
          token.total_supply
          |> ScaledUIAmount.scale(Token.effective_ui_multiplier(token))
          |> CurrencyHelper.divide_decimals(token.decimals)
        else
          Decimal.new(0)
        end

@JOY
JOY (JOY) force-pushed the sync-upstream-v12.0.3 branch 4 times, most recently from f5ea95f to 55f46cd Compare October 22, 2026 08:04

@claude claude 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 skipped — your organization has no extra usage available to pay for this review.

If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.

Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.

@JOY
JOY (JOY) force-pushed the sync-upstream-v12.0.3 branch 5 times, most recently from 8c0fb5d to bd8d442 Compare October 23, 2026 14:03

@claude claude 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 skipped — your organization has no extra usage available to pay for this review.

If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.

Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.

@JOY
JOY (JOY) force-pushed the sync-upstream-v12.0.3 branch 5 times, most recently from eae42a3 to d665241 Compare October 24, 2026 20:03

@claude claude 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 skipped — your organization has no extra usage available to pay for this review.

If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.

Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.

@JOY
JOY (JOY) force-pushed the sync-upstream-v12.0.3 branch 4 times, most recently from fdb127d to b41690b Compare October 25, 2026 20:03

@claude claude 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 skipped — your organization has no extra usage available to pay for this review.

If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.

Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.

@JOY
JOY (JOY) force-pushed the sync-upstream-v12.0.3 branch from b41690b to 35053db Compare October 26, 2026 02:10
@JOY
JOY (JOY) force-pushed the sync-upstream-v12.0.3 branch from 35053db to 605a4c9 Compare October 26, 2026 08:10

This branch has not been deployed

No deployments
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.

6 participants