Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:
- production-sokol
- production-suave
- production-xdai
- production-via
- production-zkevm
- production-zksync
- staging-l2
Expand Down Expand Up @@ -65,6 +66,7 @@ jobs:
"stability",
"zetachain",
"zilliqa",
"via",
"zksync",
"neon"
];
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/pre-release-via.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Pre-release for Via

on:
workflow_dispatch:
inputs:
number:
type: number
required: true

env:
OTP_VERSION: ${{ vars.OTP_VERSION }}
ELIXIR_VERSION: ${{ vars.ELIXIR_VERSION }}

jobs:
push_to_registry:
name: Push Docker image to GitHub Container Registry
runs-on: ubuntu-latest
env:
RELEASE_VERSION: 8.0.2
steps:
- uses: actions/checkout@v4
- name: Setup repo
uses: ./.github/actions/setup-repo
id: setup
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
docker-remote-multi-platform: true
docker-arm-host: ${{ secrets.ARM_RUNNER_HOSTNAME }}
docker-arm-host-key: ${{ secrets.ARM_RUNNER_KEY }}

- name: Build and push Docker image for Via (indexer + API)
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/Dockerfile
push: true
tags: ghcr.io/blockscout/blockscout-via:${{ env.RELEASE_VERSION }}-alpha.${{ inputs.number }}
labels: ${{ steps.setup.outputs.docker-labels }}
platforms: |
linux/amd64
linux/arm64/v8
build-args: |
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-alpha.${{ inputs.number }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=via

- name: Build and push Docker image for Via (indexer)
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/Dockerfile
push: true
tags: ghcr.io/blockscout/blockscout-via:${{ env.RELEASE_VERSION }}-alpha.${{ inputs.number }}-indexer
labels: ${{ steps.setup.outputs.docker-labels }}
platforms: |
linux/amd64
linux/arm64/v8
build-args: |
DISABLE_API=true
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-alpha.${{ inputs.number }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=via
57 changes: 57 additions & 0 deletions .github/workflows/publish-docker-image-for-via.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Via publish Docker image

on:
push:
branches:
- production-via
jobs:
push_to_registry:
name: Push Docker image to GitHub Container Registry
runs-on: ubuntu-latest
env:
RELEASE_VERSION: 8.0.2
DOCKER_CHAIN_NAME: via
steps:
- uses: actions/checkout@v4
- name: Setup repo
uses: ./.github/actions/setup-repo
id: setup
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
docker-remote-multi-platform: true
docker-arm-host: ${{ secrets.ARM_RUNNER_HOSTNAME }}
docker-arm-host-key: ${{ secrets.ARM_RUNNER_KEY }}

- name: Build and push Docker image (indexer + API)
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/Dockerfile
push: true
tags: ghcr.io/blockscout/blockscout-${{ env.DOCKER_CHAIN_NAME }}:${{ env.RELEASE_VERSION }}-postrelease-${{ env.SHORT_SHA }}
labels: ${{ steps.setup.outputs.docker-labels }}
platforms: |
linux/amd64
linux/arm64/v8
build-args: |
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}.+commit.${{ env.SHORT_SHA }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=via

- name: Build and push Docker image (indexer)
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/Dockerfile
push: true
tags: ghcr.io/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: |
DISABLE_API=true
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}.+commit.${{ env.SHORT_SHA }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=via

60 changes: 60 additions & 0 deletions .github/workflows/release-via.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Release for Via

on:
workflow_dispatch:
release:
types: [published]

env:
OTP_VERSION: ${{ vars.OTP_VERSION }}
ELIXIR_VERSION: ${{ vars.ELIXIR_VERSION }}

jobs:
push_to_registry:
name: Push Docker image to GitHub Container Registry
runs-on: ubuntu-latest
env:
RELEASE_VERSION: 8.0.2
steps:
- uses: actions/checkout@v4
- name: Setup repo
uses: ./.github/actions/setup-repo
id: setup
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
docker-remote-multi-platform: true
docker-arm-host: ${{ secrets.ARM_RUNNER_HOSTNAME }}
docker-arm-host-key: ${{ secrets.ARM_RUNNER_KEY }}

- name: Build and push Docker image for Via (indexer + API)
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/Dockerfile
push: true
tags: ghcr.io/blockscout/blockscout-via:latest, ghcr.io/blockscout/blockscout-via:${{ env.RELEASE_VERSION }}
labels: ${{ steps.setup.outputs.docker-labels }}
platforms: |
linux/amd64
linux/arm64/v8
build-args: |
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=via

- name: Build and push Docker image for Via (indexer)
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/Dockerfile
push: true
tags: ghcr.io/blockscout/blockscout-via:${{ env.RELEASE_VERSION }}-indexer
labels: ${{ steps.setup.outputs.docker-labels }}
platforms: |
linux/amd64
linux/arm64/v8
build-args: |
DISABLE_API=true
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=via
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defmodule BlockScoutWeb.API.HealthController do

@ok_message "OK"
@backfill_multichain_search_db_migration_name "backfill_multichain_search_db"
@rollups [:arbitrum, :zksync, :optimism, :polygon_zkevm, :scroll]
@rollups [:arbitrum, :zksync, :via, :optimism, :polygon_zkevm, :scroll]

@doc """
Handles health checks for the application.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ defmodule BlockScoutWeb.API.RPC.ContractController do
alias Explorer.SmartContract.Vyper.Publisher, as: VyperPublisher
alias Explorer.ThirdPartyIntegrations.Sourcify

if @chain_type == :zksync do
if @chain_type == :zksync || @chain_type == :via do
@optimization_runs "0"
else
@optimization_runs 200
Expand Down Expand Up @@ -634,6 +634,10 @@ defmodule BlockScoutWeb.API.RPC.ContractController do
do: optional_param(&1, params, "zksolcVersion", "zk_compiler_version"),
else: &1
)).()
|> (&if(Application.get_env(:explorer, :chain_type) == :via,
do: optional_param(&1, params, "zksolcVersion", "zk_compiler_version"),
else: &1
)).()
end

defp fetch_verifysourcecode_solidity_single_file_params(params) do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ defmodule BlockScoutWeb.API.V2.BlockController do
:op_frame_sequence => :optional
}

:via ->
@chain_type_transaction_necessity_by_association %{}
@chain_type_block_necessity_by_association %{
:via_batch => :optional,
:via_commit_transaction => :optional,
:via_prove_transaction => :optional,
:via_execute_transaction => :optional
}

:zksync ->
@chain_type_transaction_necessity_by_association %{}
@chain_type_block_necessity_by_association %{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ defmodule BlockScoutWeb.API.V2.TransactionController do
alias Explorer.Chain.Scroll.Reader, as: ScrollReader
alias Explorer.Chain.Token.Instance
alias Explorer.Chain.ZkSync.Reader, as: ZkSyncReader
alias Explorer.Chain.Via.Reader, as: ViaReader
alias Indexer.Fetcher.OnDemand.FirstTrace, as: FirstTraceOnDemand
alias Indexer.Fetcher.OnDemand.NeonSolanaTransactions, as: NeonSolanaTransactions

Expand Down Expand Up @@ -148,6 +149,13 @@ defmodule BlockScoutWeb.API.V2.TransactionController do
|> Map.put(:zksync_prove_transaction, :optional)
|> Map.put(:zksync_execute_transaction, :optional)

:via ->
necessity_by_association_with_actions
|> Map.put(:via_batch, :optional)
|> Map.put(:via_commit_transaction, :optional)
|> Map.put(:via_prove_transaction, :optional)
|> Map.put(:via_execute_transaction, :optional)

:arbitrum ->
necessity_by_association_with_actions
|> Map.put(:arbitrum_batch, :optional)
Expand Down Expand Up @@ -252,6 +260,15 @@ defmodule BlockScoutWeb.API.V2.TransactionController do
handle_batch_transactions(conn, params, &ZkSyncReader.batch_transactions/2)
end

@doc """
Function to handle GET requests to `/api/v2/transactions/via-batch/:batch_number` endpoint.
It renders the list of L2 transactions bound to the specified batch.
"""
@spec via_batch(Plug.Conn.t(), map()) :: Plug.Conn.t()
def via_batch(conn, params) do
handle_batch_transactions(conn, params, &ViaReader.batch_transactions/2)
end

@doc """
Function to handle GET requests to `/api/v2/transactions/arbitrum-batch/:batch_number` endpoint.
It renders the list of L2 transactions bound to the specified batch.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ defmodule BlockScoutWeb.API.V2.VerificationController do
@sc_verification_started "Smart-contract verification started"
@zk_optimization_modes ["0", "1", "2", "3", "s", "z"]

if @chain_type == :zksync do
if @chain_type == :zksync || @chain_type == :via do
@optimization_runs "0"
else
@optimization_runs 200
Expand Down Expand Up @@ -55,7 +55,7 @@ defmodule BlockScoutWeb.API.V2.VerificationController do
end

defp get_verification_options do
if Application.get_env(:explorer, :chain_type) == :zksync do
if Application.get_env(:explorer, :chain_type) == :zksync || Application.get_env(:explorer, :chain_type) == :via do
["standard-input"]
else
["flattened-code", "standard-input", "vyper-code"]
Expand All @@ -75,7 +75,7 @@ defmodule BlockScoutWeb.API.V2.VerificationController do
end

defp maybe_add_zk_options(config) do
if Application.get_env(:explorer, :chain_type) == :zksync do
if Application.get_env(:explorer, :chain_type) == :zksync || Application.get_env(:explorer, :chain_type) == :via do
zk_compiler_versions = CompilerVersion.fetch_version_list(:zk)

config
Expand Down Expand Up @@ -148,7 +148,9 @@ defmodule BlockScoutWeb.API.V2.VerificationController do
|> Map.put("constructor_arguments", Map.get(params, "constructor_args", ""))
|> Map.put("name", Map.get(params, "contract_name", ""))
|> Map.put("license_type", Map.get(params, "license_type"))
|> (&if(Application.get_env(:explorer, :chain_type) == :zksync,
|> (&if(
Application.get_env(:explorer, :chain_type) == :zksync ||
Application.get_env(:explorer, :chain_type) == :via,
do: Map.put(&1, "zk_compiler_version", Map.get(params, "zk_compiler_version")),
else: &1
)).()
Expand Down
Loading
Loading