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

Add Polygon zkEVM batches fetcher #7584

Merged
merged 52 commits into from Oct 25, 2023
Merged

Add Polygon zkEVM batches fetcher #7584

merged 52 commits into from Oct 25, 2023

Conversation

varasev
Copy link
Contributor

@varasev varasev commented May 30, 2023

Motivation

This PR adds an indexer (fetcher) for Polygon zkEVM (Hermez) transaction batches and the corresponding pages and fields to API v2.

These changes are inspired by https://zkevm.polygonscan.com/ functionality in part of displaying transaction batches.

Note that it doesn't include the corresponding changes for old UI.

The fetcher uses zkevm_batchNumber, zkevm_virtualBatchNumber, zkevm_verifiedBatchNumber, and zkevm_getBatchByNumber RPC requests (documented here).

For API v2 there are following changes:

To enable/disable the fetcher, one need to use INDEXER_ZKEVM_BATCHES_ENABLED=true env variable. To test the fetcher, the public RPC https://zkevm-rpc.com can be used.

The new UI will need to have the following new pages and items (see the examples above):

Checklist for your Pull Request (PR)

CHANGELOG.md Outdated Show resolved Hide resolved
config/runtime.exs Outdated Show resolved Hide resolved
apps/explorer/lib/explorer/chain/zkevm_batch_txn.ex Outdated Show resolved Hide resolved
apps/indexer/lib/indexer/fetcher/zkevm_txn_batch.ex Outdated Show resolved Hide resolved
apps/explorer/lib/explorer/chain/transaction.ex Outdated Show resolved Hide resolved
apps/explorer/lib/explorer/chain/transaction.ex Outdated Show resolved Hide resolved
apps/block_scout_web/lib/block_scout_web/api_router.ex Outdated Show resolved Hide resolved
apps/block_scout_web/lib/block_scout_web/api_router.ex Outdated Show resolved Hide resolved
apps/block_scout_web/lib/block_scout_web/api_router.ex Outdated Show resolved Hide resolved
Copy link
Member

@vbaranov vbaranov left a comment

Choose a reason for hiding this comment

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

@varasev please rebase the current branch to the master branch.

@varasev
Copy link
Contributor Author

varasev commented Sep 27, 2023

@vbaranov Done

@varasev varasev force-pushed the va-zkevm branch 2 times, most recently from 260c674 to 2376332 Compare October 9, 2023 04:41
@vbaranov vbaranov self-requested a review October 20, 2023 15:01
Copy link
Member

@vbaranov vbaranov left a comment

Choose a reason for hiding this comment

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

@varasev please rebase onto master branch

@varasev
Copy link
Contributor Author

varasev commented Oct 23, 2023

@varasev please rebase onto master branch

Done

@vbaranov vbaranov self-requested a review October 23, 2023 14:59
Copy link
Member

@vbaranov vbaranov left a comment

Choose a reason for hiding this comment

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

@varasev web tests are failing https://github.com/blockscout/blockscout/actions/runs/6614170606/job/17966222220?pr=7584

Invalid call found at 2 locations:
  lib/block_scout_web/controllers/api/v2/zkevm_controller.ex:66: BlockScoutWeb.API.V2.ZkevmController.batches/2
  lib/block_scout_web/controllers/api/v2/zkevm_controller.ex:99: BlockScoutWeb.API.V2.ZkevmController.batches_confirmed/2

@vbaranov
Copy link
Member

@varasev and please move Changelog entry to the current chapter.

@varasev
Copy link
Contributor Author

varasev commented Oct 24, 2023

@vbaranov all fixed

@vbaranov vbaranov self-requested a review October 25, 2023 07:44
apps/explorer/config/test.exs Outdated Show resolved Hide resolved
apps/explorer/lib/explorer/chain/transaction.ex Outdated Show resolved Hide resolved
@vbaranov vbaranov self-requested a review October 25, 2023 09:45
@vbaranov vbaranov merged commit 2dba270 into master Oct 25, 2023
15 checks passed
@vbaranov vbaranov deleted the va-zkevm branch October 25, 2023 09:46
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.

None yet

3 participants