Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync with origin #49

Merged
merged 34 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e7fa979
fix: indexer first block usage to halt Arbitrum missed messages disco…
akolotov Jul 4, 2024
bd09249
fix: proper lookup of confirmed Arbitrum cross-chain messages (#10322)
akolotov Jul 4, 2024
98c5668
chore: Update buildkit builders (#10377)
alik-agaev Jul 5, 2024
d6080e0
fix: proper handling for re-discovered Arbitrum batches (#10326)
akolotov Jul 5, 2024
b2345b1
feat: broadcast updates about new Arbitrum batches and L1-L2 messages…
akolotov Jul 5, 2024
c89696b
fix: empty revert reasons in geth variant (#10243)
k1rill-fedoseev Jul 5, 2024
2a00b0c
chore: Refactor init functions to use continue if needed (#10300)
Qwerty5Uiop Jul 5, 2024
28a7d59
fix: Fix address controller flickering test (#10382)
vbaranov Jul 8, 2024
b5cd862
Fix gas price oracle flickering test (#10381)
vbaranov Jul 8, 2024
a5a7ebb
fix exchange rate flickering test (#10383)
vbaranov Jul 8, 2024
3c268d2
feat: AnyTrust and Celestia support as DA for Arbitrum batches (#10144)
akolotov Jul 8, 2024
fd22965
chore: remove single implementation name, address from API v2 respons…
vbaranov Jul 8, 2024
e40f8be
chore(deps-dev): bump ex_doc from 0.34.1 to 0.34.2 (#10394)
dependabot[bot] Jul 8, 2024
a8e4830
fix: alternative way to detect blocks range for ArbitrumOne batches (…
akolotov Jul 8, 2024
9a98839
Fix /stats/charts/market test (#10392)
vbaranov Jul 8, 2024
a1817f4
Fix missing expectation in mock_beacon_storage_pointer_request (#10399)
vbaranov Jul 9, 2024
82f053e
fix: /addresses empty list flickering test fix (#10400)
vbaranov Jul 9, 2024
772fae1
Fix flickering "updates cache if initial value is zero" tests (#10402)
vbaranov Jul 9, 2024
6488951
Fix flickering transaction_estimated_count/1 test (#10403)
vbaranov Jul 9, 2024
a22ee8b
fix: Fix logs sorting in API v1 (#10405)
nikitosing Jul 10, 2024
afa053a
chore(deps): bump mime from 2.0.5 to 2.0.6 (#10395)
dependabot[bot] Jul 11, 2024
73ac626
chore(deps): bump phoenix_ecto from 4.6.1 to 4.6.2 (#10396)
dependabot[bot] Jul 11, 2024
c6ee471
feat: Add Celestia blobs support to Optimism batches fetcher (#10199)
varasev Jul 11, 2024
ad78a4d
Add Brotli decompression to Indexer.Fetcher.Optimism.TxnBatch (#10410)
varasev Jul 15, 2024
bc7f6a7
Indexer/API docker images from production-optimism branch
vbaranov Jul 15, 2024
314d2e7
chore: Remove catchup sequence logic (#10415)
Qwerty5Uiop Jul 15, 2024
a860835
Merge branch 'master' of https://github.com/blockscout/blockscout int…
pustovalov Jul 15, 2024
07d3c0c
chore(deps): bump cldr_utils from 2.27.0 to 2.28.0 (#10421)
dependabot[bot] Jul 16, 2024
6223cef
chore(deps): bump tesla from 1.11.1 to 1.11.2 (#10419)
dependabot[bot] Jul 16, 2024
277f493
fix: Filter out internal transactions belonging to reorg (#10330)
Qwerty5Uiop Jul 16, 2024
b8d77f8
fix: allow fetching image from properties -> image prop in token inst…
vbaranov Jul 16, 2024
86b10d9
fix: Transactions and token transfers block_consensus (#10285)
Qwerty5Uiop Jul 16, 2024
81256f3
chore(deps): bump absinthe from 1.7.6 to 1.7.7 (#10420)
dependabot[bot] Jul 16, 2024
bf3a9a7
Merge branch 'master' of https://github.com/blockscout/blockscout int…
pustovalov Jul 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/actions/setup-repo/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ runs:
- name: Find builder
if: ${{ inputs.docker-remote-multi-platform }}
shell: bash
run: echo "BUILDER_IP=$(./.github/scripts/select-builder.sh ${{ inputs.docker-arm-host }} ubuntu ~/.ssh/id_rsa)" >> $GITHUB_ENV
run: echo "BUILDER_IP=$(./.github/scripts/select-builder.sh ${{ inputs.docker-arm-host }} root ~/.ssh/id_rsa)" >> $GITHUB_ENV
- name: Set up SSH
if: ${{ inputs.docker-remote-multi-platform }}
uses: MrSquaare/ssh-setup-action@523473d91581ccbf89565e12b40faba93f2708bd # v1.1.0
Expand All @@ -68,7 +68,7 @@ runs:
with:
platforms: linux/amd64
append: |
- endpoint: ssh://ubuntu@${{ env.BUILDER_IP }}
- endpoint: ssh://root@${{ env.BUILDER_IP }}
platforms: linux/arm64/v8

- name: Log in to Docker Hub
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-docker-image-for-eth-sepolia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ jobs:
linux/amd64
linux/arm64/v8
build-args: |
CHAIN_TYPE=ethereum
CACHE_EXCHANGE_RATES_PERIOD=
API_V1_READ_METHODS_DISABLED=false
DISABLE_WEBAPP=false
Expand All @@ -46,6 +45,7 @@ jobs:
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-beta.+commit.${{ env.SHORT_SHA }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=ethereum

- name: Build and push Docker image (indexer)
uses: docker/build-push-action@v5
Expand All @@ -59,7 +59,6 @@ jobs:
linux/amd64
linux/arm64/v8
build-args: |
CHAIN_TYPE=ethereum
CACHE_EXCHANGE_RATES_PERIOD=
DISABLE_WEBAPP=true
DISABLE_API=true
Expand All @@ -68,6 +67,7 @@ jobs:
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-beta.+commit.${{ env.SHORT_SHA }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=ethereum

- name: Build and push Docker image (API)
uses: docker/build-push-action@v5
Expand All @@ -81,12 +81,12 @@ jobs:
linux/amd64
linux/arm64/v8
build-args: |
CHAIN_TYPE=ethereum
CACHE_EXCHANGE_RATES_PERIOD=
DISABLE_WEBAPP=true
DISABLE_INDEXER=true
CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED=
ADMIN_PANEL_ENABLED=false
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-beta.+commit.${{ env.SHORT_SHA }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=ethereum
4 changes: 2 additions & 2 deletions .github/workflows/publish-docker-image-for-eth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ jobs:
linux/amd64
linux/arm64/v8
build-args: |
CHAIN_TYPE=ethereum
CACHE_EXCHANGE_RATES_PERIOD=
API_V1_READ_METHODS_DISABLED=false
DISABLE_WEBAPP=false
Expand All @@ -45,4 +44,5 @@ jobs:
ADMIN_PANEL_ENABLED=false
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-beta.+commit.${{ env.SHORT_SHA }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=ethereum
46 changes: 45 additions & 1 deletion .github/workflows/publish-docker-image-for-optimism.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
docker-arm-host: ${{ secrets.ARM_RUNNER_HOSTNAME }}
docker-arm-host-key: ${{ secrets.ARM_RUNNER_KEY }}

- name: Build and push Docker image
- name: Build and push Docker image (indexer + API)
uses: docker/build-push-action@v5
with:
context: .
Expand All @@ -45,4 +45,48 @@ jobs:
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-beta.+commit.${{ env.SHORT_SHA }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=optimism

- name: Build and push Docker image (indexer)
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
push: true
tags: blockscout/blockscout-${{ env.DOCKER_CHAIN_NAME }}:${{ env.RELEASE_VERSION }}-postrelease-${{ env.SHORT_SHA }}-indexer
labels: ${{ steps.setup.outputs.docker-labels }}
platforms: |
linux/amd64
linux/arm64/v8
build-args: |
CACHE_EXCHANGE_RATES_PERIOD=
DISABLE_WEBAPP=true
DISABLE_API=true
CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED=
ADMIN_PANEL_ENABLED=false
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-beta.+commit.${{ env.SHORT_SHA }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=optimism

- name: Build and push Docker image (API)
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
push: true
tags: blockscout/blockscout-${{ env.DOCKER_CHAIN_NAME }}:${{ env.RELEASE_VERSION }}-postrelease-${{ env.SHORT_SHA }}-api
labels: ${{ steps.setup.outputs.docker-labels }}
platforms: |
linux/amd64
linux/arm64/v8
build-args: |
CACHE_EXCHANGE_RATES_PERIOD=
DISABLE_WEBAPP=true
DISABLE_INDEXER=true
CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED=
ADMIN_PANEL_ENABLED=false
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-beta.+commit.${{ env.SHORT_SHA }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=optimism
1 change: 1 addition & 0 deletions apps/block_scout_web/config/runtime/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Config

alias EthereumJSONRPC.Variant

config :ethereum_jsonrpc, EthereumJSONRPC.Utility.EndpointAvailabilityChecker, enabled: false
config :explorer, Explorer.ExchangeRates, enabled: false, store: :none

config :ueberauth, Ueberauth.Strategy.Auth0.OAuth,
Expand Down
7 changes: 7 additions & 0 deletions apps/block_scout_web/lib/block_scout_web/chain.ex
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ defmodule BlockScoutWeb.Chain do
}

alias Explorer.Chain.Optimism.Deposit, as: OptimismDeposit
alias Explorer.Chain.Optimism.FrameSequence, as: OptimismFrameSequence
alias Explorer.Chain.Optimism.OutputRoot, as: OptimismOutputRoot

alias Explorer.Chain.PolygonZkevm.TransactionBatch
Expand Down Expand Up @@ -435,6 +436,7 @@ defmodule BlockScoutWeb.Chain do

# clause for pagination of entities:
# - Account's entities
# - Optimism frame sequences
# - Polygon Edge Deposits
# - Polygon Edge Withdrawals
# - Arbitrum cross chain messages
Expand All @@ -450,6 +452,7 @@ defmodule BlockScoutWeb.Chain do

# clause for pagination of entities:
# - Account's entities
# - Optimism frame sequences
# - Polygon Edge Deposits
# - Polygon Edge Withdrawals
# - Arbitrum cross chain messages
Expand Down Expand Up @@ -621,6 +624,10 @@ defmodule BlockScoutWeb.Chain do
paging_params(token)
end

defp paging_params(%OptimismFrameSequence{id: id}) do
%{"id" => id}
end

defp paging_params(%TagAddress{id: id}) do
%{"id" => id}
end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
defmodule BlockScoutWeb.ArbitrumChannel do
@moduledoc """
Establishes pub/sub channel for live updates of Arbitrum related events.
"""
use BlockScoutWeb, :channel

def join("arbitrum:new_batch", _params, socket) do
{:ok, %{}, socket}
end

def join("arbitrum:new_messages_to_rollup_amount", _params, socket) do
{:ok, %{}, socket}
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ defmodule BlockScoutWeb.UserSocketV2 do
channel("token_instances:*", BlockScoutWeb.TokenInstanceChannel)
channel("zkevm_batches:*", BlockScoutWeb.PolygonZkevmConfirmedBatchChannel)

case Application.compile_env(:explorer, :chain_type) do
:arbitrum -> channel("arbitrum:*", BlockScoutWeb.ArbitrumChannel)
_ -> nil
end

def connect(_params, socket) do
{:ok, socket}
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@ defmodule BlockScoutWeb.API.V2.ArbitrumController do
only: [
next_page_params: 4,
paging_options: 1,
split_list_by_page: 1
split_list_by_page: 1,
parse_block_hash_or_number_param: 1
]

import Explorer.Chain.Arbitrum.DaMultiPurposeRecord.Helper, only: [calculate_celestia_data_key: 2]

alias Explorer.PagingOptions
alias Explorer.Chain.Arbitrum.{L1Batch, Message, Reader}

action_fallback(BlockScoutWeb.API.V2.FallbackController)

@batch_necessity_by_association %{:commitment_transaction => :optional}
@batch_necessity_by_association %{:commitment_transaction => :required}

@doc """
Function to handle GET requests to `/api/v2/arbitrum/messages/:direction` endpoint.
Expand Down Expand Up @@ -76,6 +79,39 @@ defmodule BlockScoutWeb.API.V2.ArbitrumController do
end
end

@doc """
Function to handle GET requests to `/api/v2/arbitrum/batches/da/:data_hash` or
`/api/v2/arbitrum/batches/da/:tx_commitment/:height` endpoints.
"""
@spec batch_by_data_availability_info(Plug.Conn.t(), map()) :: Plug.Conn.t()
def batch_by_data_availability_info(conn, %{"data_hash" => data_hash} = _params) do
# In case of AnyTrust, `data_key` is the hash of the data itself
case Reader.get_da_record_by_data_key(data_hash, api?: true) do
{:ok, {batch_number, _}} ->
batch(conn, %{"batch_number" => batch_number})

{:error, :not_found} = res ->
res
end
end

def batch_by_data_availability_info(conn, %{"tx_commitment" => tx_commitment, "height" => height} = _params) do
# In case of Celestia, `data_key` is the hash of the height and the commitment hash
with {:ok, :hash, tx_commitment_hash} <- parse_block_hash_or_number_param(tx_commitment),
key <- calculate_celestia_data_key(height, tx_commitment_hash) do
case Reader.get_da_record_by_data_key(key, api?: true) do
{:ok, {batch_number, _}} ->
batch(conn, %{"batch_number" => batch_number})

{:error, :not_found} = res ->
res
end
else
res ->
res
end
end

@doc """
Function to handle GET requests to `/api/v2/arbitrum/batches/count` endpoint.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ defmodule BlockScoutWeb.API.V2.BlockController do
[transactions: :beacon_blob_transaction] => :optional
}

:optimism ->
@chain_type_transaction_necessity_by_association %{}
@chain_type_block_necessity_by_association %{
:op_frame_sequence => :optional
}

:zksync ->
@chain_type_transaction_necessity_by_association %{}
@chain_type_block_necessity_by_association %{
Expand Down
Loading
Loading