Skip to content

Commit

Permalink
Merge pull request #37 from aurora-is-near/sync-25-10
Browse files Browse the repository at this point in the history
Sync with origin
  • Loading branch information
spilin authored Oct 25, 2023
2 parents 8036683 + 2086a39 commit 07917d5
Show file tree
Hide file tree
Showing 70 changed files with 3,089 additions and 277 deletions.
6 changes: 6 additions & 0 deletions .dialyzer-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ lib/indexer/fetcher/polygon_edge/deposit_execute.ex:140
lib/indexer/fetcher/polygon_edge/deposit_execute.ex:184
lib/indexer/fetcher/polygon_edge/withdrawal.ex:160
lib/indexer/fetcher/polygon_edge/withdrawal.ex:204
lib/indexer/fetcher/zkevm/transaction_batch.ex:116
lib/indexer/fetcher/zkevm/transaction_batch.ex:156
lib/indexer/fetcher/zkevm/transaction_batch.ex:252
lib/block_scout_web/views/api/v2/transaction_view.ex:431
lib/block_scout_web/views/api/v2/transaction_view.ex:472
lib/explorer/chain/transaction.ex:165
3 changes: 3 additions & 0 deletions .github/workflows/publish-docker-image-for-immutable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ jobs:
file: ./docker/Dockerfile
push: true
tags: blockscout/blockscout-${{ env.DOCKER_CHAIN_NAME }}:latest, blockscout/blockscout-${{ env.DOCKER_CHAIN_NAME }}:${{ env.RELEASE_VERSION }}-postrelease-${{ env.SHORT_SHA }}
platforms: |
linux/amd64
linux/arm64/v8
build-args: |
CACHE_EXCHANGE_RATES_PERIOD=
API_V1_READ_METHODS_DISABLED=false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-docker-image-for-rsk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
uses: docker/build-push-action@5
with:
context: .
file: ./docker/Dockerfile
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/publish-docker-image-for-suave.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Publish Docker image for specific chain branches

on:
push:
branches:
- production-suave-stg
env:
OTP_VERSION: '25.2.1'
ELIXIR_VERSION: '1.14.5'
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: 5.3.0
DOCKER_CHAIN_NAME: suave
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: blockscout/blockscout

- name: Add SHORT_SHA env property with commit short sha
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
push: true
tags: blockscout/blockscout-${{ env.DOCKER_CHAIN_NAME }}:latest, blockscout/blockscout-${{ env.DOCKER_CHAIN_NAME }}:${{ env.RELEASE_VERSION }}-postrelease-${{ env.SHORT_SHA }}
platforms: |
linux/amd64
linux/arm64/v8
build-args: |
CACHE_EXCHANGE_RATES_PERIOD=
API_V1_READ_METHODS_DISABLED=false
DISABLE_WEBAPP=false
API_V1_WRITE_METHODS_DISABLED=false
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=suave
2 changes: 1 addition & 1 deletion .github/workflows/publish-docker-image-for-zkevm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV

- name: Build and push Docker image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
Expand Down
88 changes: 88 additions & 0 deletions .github/workflows/publish-docker-image-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,94 @@ jobs:
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-beta
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
- name: Build and push Docker image for zkEVM
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
push: true
tags: blockscout/blockscout-zkevm:latest, blockscout/blockscout-zkevm:${{ env.RELEASE_VERSION }}
platforms: |
linux/amd64
linux/arm64/v8
build-args: |
CACHE_EXCHANGE_RATES_PERIOD=
API_V1_READ_METHODS_DISABLED=false
DISABLE_WEBAPP=false
API_V1_WRITE_METHODS_DISABLED=false
CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED=
ADMIN_PANEL_ENABLED=false
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-beta
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=polygon_zkevm
- name: Build and push Docker image for SUAVE
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
push: true
tags: blockscout/blockscout-suave:latest, blockscout/blockscout-suave:${{ env.RELEASE_VERSION }}
platforms: |
linux/amd64
linux/arm64/v8
build-args: |
CACHE_EXCHANGE_RATES_PERIOD=
API_V1_READ_METHODS_DISABLED=false
DISABLE_WEBAPP=false
API_V1_WRITE_METHODS_DISABLED=false
CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED=
ADMIN_PANEL_ENABLED=false
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-beta
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=suave
- name: Build and push Docker image for Rootstock
uses: docker/build-push-action@5
with:
context: .
file: ./docker/Dockerfile
push: true
tags: blockscout/blockscout-rsk:latest, blockscout/blockscout-rsk:${{ env.RELEASE_VERSION }}
platforms: |
linux/amd64
linux/arm64/v8
build-args: |
CACHE_EXCHANGE_RATES_PERIOD=
API_V1_READ_METHODS_DISABLED=false
DISABLE_WEBAPP=false
API_V1_WRITE_METHODS_DISABLED=false
CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED=
ADMIN_PANEL_ENABLED=false
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-beta
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=rsk
- name: Build and push Docker image for Polygon Edge
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
push: true
tags: blockscout/blockscout-polygon-edge:latest, blockscout/blockscout-polygon-edge:${{ env.RELEASE_VERSION }}
platforms: |
linux/amd64
linux/arm64/v8
build-args: |
CACHE_EXCHANGE_RATES_PERIOD=
API_V1_READ_METHODS_DISABLED=false
DISABLE_WEBAPP=false
API_V1_WRITE_METHODS_DISABLED=false
CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED=
ADMIN_PANEL_ENABLED=false
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-beta
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
CHAIN_TYPE=polygon_edge
- name: Send release announcement to Slack workflow
id: slack
uses: slackapi/[email protected]
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,19 @@

### Features

- [#8696](https://github.com/blockscout/blockscout/pull/8696) - Support tokenSymbol and tokenName in `/api/v2/import/token-info`
- [#8673](https://github.com/blockscout/blockscout/pull/8673) - Add a window for balances fetching from non-archive node
- [#8556](https://github.com/blockscout/blockscout/pull/8556) - Suave functional
- [#8528](https://github.com/blockscout/blockscout/pull/8528) - Account: add pagination + envs for limits
- [#7584](https://github.com/blockscout/blockscout/pull/7584) - Add Polygon zkEVM batches fetcher

### Fixes

- [#8705](https://github.com/blockscout/blockscout/pull/8705) - Fix sourcify enabled flag
- [#8695](https://github.com/blockscout/blockscout/pull/8695) - Don't override internal transaction error if it's present already
- [#8685](https://github.com/blockscout/blockscout/pull/8685) - Fix db pool size exceeds Postgres max connections
- [#8678](https://github.com/blockscout/blockscout/pull/8678) - Fix `is_verified` for `/addresses` and `/smart-contracts`

### Chore

<details>
Expand Down
89 changes: 88 additions & 1 deletion apps/block_scout_web/lib/block_scout_web/api_router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ defmodule BlockScoutWeb.ApiRouter do
alias BlockScoutWeb.Account.Api.V1.{AuthenticateController, EmailController, TagsController, UserController}
alias BlockScoutWeb.API.V2

# TODO: Remove /account/v1 paths
scope "/account/v1", as: :account_v1 do
pipe_through(:api)
pipe_through(:account_api)
Expand All @@ -62,6 +63,70 @@ defmodule BlockScoutWeb.ApiRouter do
get("/resend", EmailController, :resend_email)
end

scope "/user" do
get("/info", UserController, :info)

get("/watchlist", UserController, :watchlist_old)
delete("/watchlist/:id", UserController, :delete_watchlist)
post("/watchlist", UserController, :create_watchlist)
put("/watchlist/:id", UserController, :update_watchlist)

get("/api_keys", UserController, :api_keys)
delete("/api_keys/:api_key", UserController, :delete_api_key)
post("/api_keys", UserController, :create_api_key)
put("/api_keys/:api_key", UserController, :update_api_key)

get("/custom_abis", UserController, :custom_abis)
delete("/custom_abis/:id", UserController, :delete_custom_abi)
post("/custom_abis", UserController, :create_custom_abi)
put("/custom_abis/:id", UserController, :update_custom_abi)

get("/public_tags", UserController, :public_tags_requests)
delete("/public_tags/:id", UserController, :delete_public_tags_request)
post("/public_tags", UserController, :create_public_tags_request)
put("/public_tags/:id", UserController, :update_public_tags_request)

scope "/tags" do
get("/address/", UserController, :tags_address_old)
get("/address/:id", UserController, :tags_address)
delete("/address/:id", UserController, :delete_tag_address)
post("/address/", UserController, :create_tag_address)
put("/address/:id", UserController, :update_tag_address)

get("/transaction/", UserController, :tags_transaction_old)
get("/transaction/:id", UserController, :tags_transaction)
delete("/transaction/:id", UserController, :delete_tag_transaction)
post("/transaction/", UserController, :create_tag_transaction)
put("/transaction/:id", UserController, :update_tag_transaction)
end
end
end

# TODO: Remove /account/v1 paths
scope "/account/v1" do
pipe_through(:api)
pipe_through(:account_api)

scope "/tags" do
get("/address/:address_hash", TagsController, :tags_address)

get("/transaction/:transaction_hash", TagsController, :tags_transaction)
end
end

scope "/account/v2", as: :account_v2 do
pipe_through(:api)
pipe_through(:account_api)

get("/authenticate", AuthenticateController, :authenticate_get)
post("/authenticate", AuthenticateController, :authenticate_post)

get("/get_csrf", UserController, :get_csrf)

scope "/email" do
get("/resend", EmailController, :resend_email)
end

scope "/user" do
get("/info", UserController, :info)

Expand Down Expand Up @@ -101,7 +166,7 @@ defmodule BlockScoutWeb.ApiRouter do
end
end

scope "/account/v1" do
scope "/account/v2" do
pipe_through(:api)
pipe_through(:account_api)

Expand Down Expand Up @@ -135,6 +200,15 @@ defmodule BlockScoutWeb.ApiRouter do
scope "/transactions" do
get("/", V2.TransactionController, :transactions)
get("/watchlist", V2.TransactionController, :watchlist_transactions)

if System.get_env("CHAIN_TYPE") == "polygon_zkevm" do
get("/zkevm-batch/:batch_number", V2.TransactionController, :zkevm_batch)
end

if System.get_env("CHAIN_TYPE") == "suave" do
get("/execution-node/:execution_node_hash_param", V2.TransactionController, :execution_node)
end

get("/:transaction_hash_param", V2.TransactionController, :transaction)
get("/:transaction_hash_param/token-transfers", V2.TransactionController, :token_transfers)
get("/:transaction_hash_param/internal-transactions", V2.TransactionController, :internal_transactions)
Expand Down Expand Up @@ -185,6 +259,11 @@ defmodule BlockScoutWeb.ApiRouter do
get("/transactions", V2.MainPageController, :transactions)
get("/transactions/watchlist", V2.MainPageController, :watchlist_transactions)
get("/indexing-status", V2.MainPageController, :indexing_status)

if System.get_env("CHAIN_TYPE") == "polygon_zkevm" do
get("/zkevm/batches/confirmed", V2.ZkevmController, :batches_confirmed)
get("/zkevm/batches/latest-number", V2.ZkevmController, :batch_latest_number)
end
end

scope "/stats" do
Expand All @@ -209,6 +288,14 @@ defmodule BlockScoutWeb.ApiRouter do
get("/", V2.WithdrawalController, :withdrawals_list)
get("/counters", V2.WithdrawalController, :withdrawals_counters)
end

scope "/zkevm" do
if System.get_env("CHAIN_TYPE") == "polygon_zkevm" do
get("/batches", V2.ZkevmController, :batches)
get("/batches/count", V2.ZkevmController, :batches_count)
get("/batches/:batch_number", V2.ZkevmController, :batch)
end
end
end

scope "/v1", as: :api_v1 do
Expand Down
Loading

0 comments on commit 07917d5

Please sign in to comment.