Giter Site home page Giter Site logo

b2network / b2-zkevm-node Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 0xpolygonhermez/zkevm-node

6.0 0.0 7.0 11.93 MB

Go implementation of a node that operates the B2 zkEVM Network

License: Other

Shell 0.29% JavaScript 0.87% Go 92.97% Makefile 1.08% Dockerfile 0.02% Solidity 4.77%

b2-zkevm-node's Introduction

zkEVM Node

zkEVM Node is a Go implementation of a node that operates the Polygon zkEVM Network.

About the Polygon zkEVM network

Since this is an implementation of a protocol it's fundamental to understand it, here you can find the specification of the protocol.

Glossary:

  • L1: Base blockchain where the rollup smart contracts are deployed. It's Ethereum or a testnet of Ethereum, but it could be any EVM compatible blockchain.
  • L2: the rollup network aka the Polygon zkEVM network.
  • Batch: a group of transactions that are executed/proved, using the zkEVM prover and sent to / synchronized from L1
  • Sequencer: the actor that is responsible for selecting transactions, putting them in a specific order, and sending them in batches to L1
  • Trusted sequencer: sequencer that has special privileges, there can only be one trusted sequencer. The privileges granted to the trusted sequencer allow it to forecast the batches that will be applied to L1. This way it can commit to a specific sequence before interacting with L1. This is done to achieve fast finality and reduce costs associated with using the network (lower gas fees)
  • Permissionless sequencer: sequencer role that can be performed by anyone. It has competitive disadvantages compared to the trusted sequencer (slow finality, MEV attacks). Its main purpose is to provide censorship resistance and unstoppability features to the network.
  • Sequence: Group of batches and other metadata that the trusted sequencer sends to L1 to update the state
  • Forced batch: batch that is sent by permissionless sequencers to L1 to update the state
  • L2 Block: Same as an L1 block, but for L2. This is mostly used by the JSON RPC interface. Currently, all the L2 Blocks are set to only include one transaction, this is done to achieve instant finality: it's not necessary to close a batch to allow the JSON RPC to expose results of already processed transactions
  • Trusted state: state reached through processing transactions that have been shared by the trusted sequencer. This state is considered trusted as the trusted sequencer could commit to a certain sequence, and then send a different one to L1
  • Virtual state: state reached through processing transactions that have already been submitted to L1. These transactions are sent in batches by either trusted or permissionless sequencers. Those batches are also called virtual batches. Note that this state is trustless as it relies on L1 security assumptions
  • Consolidated state: state that is proven on-chain by submitting a ZKP (Zero Knowledge Proof) that proves the execution of a sequence of the last virtual batch.
  • Invalid transaction: a transaction that can't be processed and doesn't affect the state. Note that such a transaction could be included in a virtual batch. The reason for a transaction to be invalid could be related to the Ethereum protocol (invalid nonce, not enough balance, ...) or due to limitations introduced by the zkEVM (each batch can make use of a limited amount of resources such as the total amount of keccak hashes that can be computed)
  • Reverted transaction: a transaction that is executed, but is reverted (because of smart contract logic). The main difference with invalid transaction is that this transaction modifies the state, at least to increment nonce of the sender.

Architecture

The diagram represents the main components of the software and how they interact between them. Note that this reflects a single entity running a node, in particular a node that acts as the trusted sequencer. But there are many entities running nodes in the network, and each of these entities can perform different roles. More on this later.

  • (JSON) RPC: an HTTP interface that allows users (dApps, metamask, etherscan, ...) to interact with the node. Fully compatible with Ethereum RPC + some extra custom endpoints specifics of the network. It interacts with the state (to get data and process transactions) as well as the pool (to store transactions).
  • L2GasPricer: it fetches the L1 gas price and applies some formula to calculate the gas price that will be suggested for the users to use for paying fees on L2. The suggestions are stored on the pool, and will be consumed by the rpc
  • Pool: DB that stores transactions by the RPC to be selected/discarded by the sequencer later on
  • Sequencer: responsible for building the trusted state. To do so, it gets transactions from the pool and puts them in a specific order. It needs to take care of opening and closing batches while trying to make them as full as possible. To achieve this it needs to use the executor to actually process the transaction not only to execute the state transition (and update the hashDB) but also to check the consumed resources by the transactions and the remaining resources of the batch. After executing a transaction that fits into a batch, it gets stored on the state. Once transactions are added into the state, they are immediately available through the rpc.
  • SequenceSender: gets closed batches from the state, tries to aggregate as many of them as possible, and at some point, decides that it's time to send those batches to L1, turning the state from trusted to virtualized. In order to send the L1 tx, it uses the ethtxmanager
  • EthTxManager: handles requests to send L1 transactions from sequencesender and aggregator. It takes care of dealing with the nonce of the accounts, increasing the gas price, and other actions that may be needed to ensure that L1 transactions get mined
  • Etherman: abstraction that implements the needed methods to interact with the Ethereum network and the relevant smart contracts.
  • Synchronizer: Updates the state (virtual batches, verified batches, forced batches, ...) by fetching data from L1 through the etherman. If the node is not a trusted sequencer it also updates the state with the data fetched from the rpc of the trusted sequencer. It also detects and handles reorgs that can happen if the trusted sequencer sends different data in the rpc vs the sequences sent to L1 (trusted reorg aka L2 reorg). Also handles L1 reorgs (reorgs that happen on the L1 network)
  • State: Responsible for managing the state data (batches, blocks, transactions, ...) that is stored on the state SB. It also handles the integration with the executor and the Merkletree service
  • State DB: persistence layer for the state data (except the Merkletree that is handled by the HashDB service), it stores informationrelated to L1 (blocks, global exit root updates, ...) and L2 (batches, L2 blocks, transactions, ...)
  • Aggregator: consolidates batches by generating ZKPs (Zero Knowledge proofs). To do so it gathers the necessary data that the prover needs as input through the state and sends a request to it. Once the proof is generated it sends a request to send an L1 tx to verify the proof and move the state from virtual to verified to the ethtxmanager. Note that provers connect to the aggregator and not the other way around. The aggregator can handle multiple connected provers at once and make them work concurrently in the generation of different proofs
  • Prover/Executor/hashDB: service that generates ZK proofs. Note that this component is not implemented in this repository, and it's treated as a "black box" from the perspective of the node. The prover/executor has two implementations: JS reference implementation and C production-ready implementation. Although it's the same software/binary, it implements three services:
    • Executor: Provides an EVM implementation that allows processing batches as well as getting metadata (state root, transaction receipts, logs, ...) of all the needed results.
    • Prover: Generates ZKPs for batches, batches aggregation, and final proofs.
    • HashDB: service that stores the Merkletree, containing all the account information (balances, nonces, smart contract code, and smart contract storage)

Roles of the network

The node software is designed to support the execution of multiple roles. Each role requires different services to work. Most of the services can run in different instances, and the JSON RPC can run in many instances (all the other services must have a single instance)

RPC

This role can be performed by anyone.

Required services and components:

  • JSON RPC: can run in a separated instance, and can have multiple instances
  • Synchronizer: single instance that can run on a separate instance
  • Executor & Merkletree: service that can run on a separate instance
  • State DB: Postgres SQL that can be run in a separate instance

There must be only one synchronizer, and it's recommended that it has exclusive access to an executor instance, although it's not necessary. This role can perfectly be run in a single instance, however, the JSON RPC and executor services can benefit from running in multiple instances, if the performance decreases due to the number of requests received

Trusted sequencer

This role can only be performed by a single entity. This is enforced in the smart contract, as the related methods of the trusted sequencer can only be performed by the owner of a particular private key.

Required services and components:

  • JSON RPC: can run in a separated instance, and can have multiple instances
  • Sequencer & Synchronizer: single instance that needs to run together
  • Executor & Merkletree: service that can run on a separate instance
  • Pool DB: Postgres SQL that can be run in a separate instance
  • State DB: Postgres SQL that can be run in a separate instance

Note that the JSON RPC is required to receive transactions. It's recommended that the JSON RPC runs on separated instances, and potentially more than one (depending on the load of the network). It's also recommended that the JSON RPC and the Sequencer don't share the same executor instance, to make sure that the sequencer has exclusive access to an executor

Aggregator

This role can be performed by anyone.

Required services and components:

  • Synchronizer: single instance that can run on a separated instance
  • Executor & Merkletree: service that can run on a separate instance
  • State DB: Postgres SQL that can be run in a separate instance
  • Aggregator: single instance that can run on a separated instance
  • Prover: single instance that can run on a separated instance
  • Executor: single instance that can run on a separated instance

It's recommended that the prover is run on a separate instance, as it has important hardware requirements. On the other hand, all the other components can run on a single instance,

Development

It's recommended to use make for building, and testing the code, ... Run make help to get a list of the available commands.

Running the node

Requirements

  • Go 1.21
  • Docker
  • Docker Compose
  • Make
  • GCC

Contribute

Before opening a pull request, please read this guide.

b2-zkevm-node's People

Contributors

toniramirezm avatar tclemos avatar dependabot[bot] avatar arr552 avatar psykepro avatar fgimenez avatar mikelle avatar agnusmor avatar arnaubennassar avatar joanestebanr avatar konradit avatar cool-develope avatar kind84 avatar dpunish3r avatar github-actions[bot] avatar obrezhniev avatar xavier-romero avatar amonsosanz avatar najeal avatar estensen avatar omahs avatar elias-garcia avatar zkronos73 avatar criadoperez avatar 0xcvh avatar bap2pecs avatar pierce403 avatar adventureseeker987 avatar joethechicken avatar isavov avatar

Stargazers

Dan avatar faskety avatar  avatar andyhu avatar wuquan.yu avatar  avatar

b2-zkevm-node's Issues

fix test-e2e-group-6

System information

  • b2-zkevm-node version(b2-zkevm-node version):
    intel-10400f test git:(fix-test-e2e-group-6) b2-zkevm-node version
    Version:      v0.4.0-RC6-4-gd40bf393
    Git revision: d40bf393
    Git branch:   dev
    Go version:   go1.21.4
    Built:        Mon, 27 Nov 2023 16:24:27 +0800
    OS/Arch:      linux/amd64
  • OS & Version(cat /etc/os-release):
    NAME="Arch Linux"
    PRETTY_NAME="Arch Linux"
    ID=arch
    BUILD_ID=rolling
    ANSI_COLOR="38;2;23;147;209"
    HOME_URL="https://archlinux.org/"
    DOCUMENTATION_URL="https://wiki.archlinux.org/"
    SUPPORT_URL="https://bbs.archlinux.org/"
    BUG_REPORT_URL="https://bugs.archlinux.org/"
    PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
    LOGO=archlinux-logo
  • Network: Mainnet/Testnet: Testnet

Expected behaviour

  1. test passed
  2. require.False(t, isThereL2Reorg)

Actual behaviour

  1. failed

Steps to reproduce the behaviour

Backtrace

  1. test log:
    2023-11-30T16:36:34.576+0800	�[34mINFO�[0m	db/logger.go:18	Dialing PostgreSQL server map[host:localhost]	{"pid": 50051, "version": "v0.1.0"}
    2023-11-30T16:36:34.596+0800	�[34mINFO�[0m	db/logger.go:18	Query map[args:[] pid:136 rowCount:1 sql:SELECT COUNT(*) > 0 FROM state.trusted_reorg; time:673.93µs]	{"pid": 50051, "version": "v0.1.0"}
        permissionlessrpc_test.go:129: 
                Error Trace:	/root/b2network/b2-zkevm-node/ci/e2e-group6/permissionlessrpc_test.go:129
                Error:      	Should be false
                Test:       	TestPermissionlessJRPC
    make[1]: Entering directory '/root/b2network/b2-zkevm-node/test'
    d
    

fix test-e2e-group-9

Steps to reproduce the issue

make test-e2e-group-9

What's the actual result?

  1. TestForcedBatchesVectorFilesGroup1 execution failed due to timeout
  2. log:
    2023-11-28T23:56:00.764+0800	�[34mINFO�[0m	e2e-group9/forced_batches_vector_group1_test.go:67	################################	{"pid": 483830, "version": "v0.1.0"}
    2023-11-28T23:56:00.764+0800	�[34mINFO�[0m	e2e-group9/forced_batches_vector_group1_test.go:68	# Verifying initial state root #	{"pid": 483830, "version": "v0.1.0"}
    2023-11-28T23:56:00.764+0800	�[34mINFO�[0m	e2e-group9/forced_batches_vector_group1_test.go:69	################################	{"pid": 483830, "version": "v0.1.0"}
    2023-11-28T23:56:00.765+0800	�[34mINFO�[0m	e2e-group9/shared.go:150	Using address: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266	{"pid": 483830, "version": "v0.1.0"}
    2023-11-28T23:56:00.766+0800	�[34mINFO�[0m	e2e-group9/shared.go:153	Number of forceBatches in the smc: 0	{"pid": 483830, "version": "v0.1.0"}
    2023-11-28T23:56:01.779+0800	�[35mDEBUG�[0m	operations/wait.go:99	Transaction successfully mined: 0x5bca1d71baeece629745915b66883ba821b08f4c320057f1c1c8e07c3059e5f9	{"pid": 483830, "version": "v0.1.0"}
    2023-11-28T23:56:01.813+0800	�[34mINFO�[0m	e2e-group9/shared.go:172	Forced Batch Submit to L1 TxHash: 0x9b98318cd47ac2c35716516b9c58390da05c8fad5bb6488b8c4b0952a3098603	{"pid": 483830, "version": "v0.1.0"}
    2023-11-28T23:56:03.816+0800	�[35mDEBUG�[0m	operations/wait.go:99	Transaction successfully mined: 0x9b98318cd47ac2c35716516b9c58390da05c8fad5bb6488b8c4b0952a3098603	{"pid": 483830, "version": "v0.1.0"}
    2023-11-28T23:56:03.820+0800	�[35mDEBUG�[0m	e2e-group9/shared.go:180	currentBlock.Time(): 1701186961	{"pid": 483830, "version": "v0.1.0"}
    2023-11-28T23:56:03.826+0800	�[35mDEBUG�[0m	e2e-group9/shared.go:200	log decoded: &{ForceBatchNum:1 LastGlobalExitRoot:[173 50 40 182 118 247 211 205 66 132 165 68 63 23 241 150 43 54 228 145 179 10 64 178 64 88 73 229 151 186 95 181] Sequencer:0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 Transactions:[] Raw:{Address:0x67d269191c92Caf3cD7723F116c85e6E9bf55933 Topics:[0xf94bb37db835f1ab585ee00041849a09b12cd081d77fa15ca070757619cbc931 0x0000000000000000000000000000000000000000000000000000000000000001] Data:[173 50 40 182 118 247 211 205 66 132 165 68 63 23 241 150 43 54 228 145 179 10 64 178 64 88 73 229 151 186 95 181 0 0 0 0 0 0 0 0 0 0 0 0 243 159 214 229 26 173 136 246 244 206 106 184 130 114 121 207 255 185 34 102 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 96 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] BlockNumber:212 TxHash:0x9b98318cd47ac2c35716516b9c58390da05c8fad5bb6488b8c4b0952a3098603 TxIndex:0 BlockHash:0xfd2f489a7f2d0ebcd9ae30b21f0cd22dd5405010f439807f2c5a90e1138b377e Index:1 Removed:false}}	{"pid": 483830, "version": "v0.1.0"}
    2023-11-28T23:56:03.826+0800	�[34mINFO�[0m	e2e-group9/shared.go:202	GlobalExitRoot: [173 50 40 182 118 247 211 205 66 132 165 68 63 23 241 150 43 54 228 145 179 10 64 178 64 88 73 229 151 186 95 181]	{"pid": 483830, "version": "v0.1.0"}
    2023-11-28T23:56:03.826+0800	�[34mINFO�[0m	e2e-group9/shared.go:203	Transactions: 	{"pid": 483830, "version": "v0.1.0"}
    2023-11-28T23:56:03.830+0800	�[34mINFO�[0m	e2e-group9/shared.go:209	MinForcedTimestamp: 1701186961	{"pid": 483830, "version": "v0.1.0"}
    panic: test timed out after 33m20s
    running tests:
        TestForcedBatchesVectorFilesGroup1 (33m20s)
        TestForcedBatchesVectorFilesGroup1/general_1.json (27m4s)
    
    goroutine 61897 [running]:
    testing.(*M).startAlarm.func1()
        /usr/lib/go/src/testing/testing.go:2259 +0x1fc
    created by time.goFunc
        /usr/lib/go/src/time/sleep.go:176 +0x45
    
    goroutine 1 [chan receive, 33 minutes]:
    testing.(*T).Run(0xc000183380, {0x1fb1b64, 0x22}, 0x2157c70)
        /usr/lib/go/src/testing/testing.go:1649 +0x856
    testing.runTests.func1(0x0?)
        /usr/lib/go/src/testing/testing.go:2054 +0x85
    testing.tRunner(0xc000183380, 0xc00041fb08)
        /usr/lib/go/src/testing/testing.go:1595 +0x239
    testing.runTests(0xc0002faa00?, {0x2dee930, 0x1, 0x1}, {0xd0?, 0x1e79620?, 0x2fc6480?})
        /usr/lib/go/src/testing/testing.go:2052 +0x897
    testing.(*M).Run(0xc0002faa00)
        /usr/lib/go/src/testing/testing.go:1925 +0xb58
    main.main()
        _testmain.go:47 +0x2be
    ......
    goroutine 31068 [select, 27 minutes]:
    database/sql.(*DB).connectionOpener(0xc000583110, {0x239f778, 0xc000640fa0})
        /usr/lib/go/src/database/sql/sql.go:1218 +0xed
    created by database/sql.OpenDB in goroutine 30970
        /usr/lib/go/src/database/sql/sql.go:791 +0x2f0
    FAIL	github.com/0xPolygonHermez/zkevm-node/ci/e2e-group9	2000.088s
    FAIL
    

Additional details / screenshot

  1. key tips: fatal error: failed to process forced batch, Executor err: ERROR: insert or update on table "batch" violates foreign key constraint "batch_forced_batch_num_fkey" (SQLSTATE 23503)%!(EXTRA string=
  2. zkevm-sequencer container log
    zkevm-sequencer        | 2023-11-30T09:46:56.101Z       ERROR   sequencer/finalizer.go:453      fatal error: failed to process forced batch, Executor err: ERROR: insert or update on table "batch" violates foreign key constraint "batch_forced_batch_num_fkey" (SQLSTATE 23503)%!(EXTRA string=
    zkevm-sequencer        | /src/log/log.go:142 github.com/0xPolygonHermez/zkevm-node/log.appendStackTraceMaybeArgs()
    zkevm-sequencer        | /src/log/log.go:251 github.com/0xPolygonHermez/zkevm-node/log.Errorf()
    zkevm-sequencer        | /src/sequencer/finalizer.go:453 github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).halt()
    zkevm-sequencer        | /src/sequencer/finalizer.go:1138 github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).processForcedBatch()
    zkevm-sequencer        | /src/sequencer/finalizer.go:1116 github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).processForcedBatches()
    zkevm-sequencer        | /src/sequencer/finalizer.go:560 github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).newWIPBatch()
    zkevm-sequencer        | /src/sequencer/finalizer.go:429 github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).finalizeBatch()
    zkevm-sequencer        | /src/sequencer/finalizer.go:381 github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).finalizeBatches()
    zkevm-sequencer        | /src/sequencer/finalizer.go:194 github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).Start()
    zkevm-sequencer        | )      {"pid": 1, "version": "v0.4.1-6-ge2d706ef"}
    zkevm-sequencer        | github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).halt
    zkevm-sequencer        |        /src/sequencer/finalizer.go:453
    zkevm-sequencer        | github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).processForcedBatch
    zkevm-sequencer        |        /src/sequencer/finalizer.go:1138
    zkevm-sequencer        | github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).processForcedBatches
    zkevm-sequencer        |        /src/sequencer/finalizer.go:1116
    zkevm-sequencer        | github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).newWIPBatch
    zkevm-sequencer        |        /src/sequencer/finalizer.go:560
    zkevm-sequencer        | github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).finalizeBatch
    zkevm-sequencer        |        /src/sequencer/finalizer.go:429
    zkevm-sequencer        | github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).finalizeBatches
    zkevm-sequencer        |        /src/sequencer/finalizer.go:381
    zkevm-sequencer        | github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).Start
    zkevm-sequencer        |        /src/sequencer/finalizer.go:194
    zkevm-sequencer        | 2023-11-30T09:46:56.101Z       ERROR   sequencer/finalizer.go:454      halting the finalizer   {"pid": 1, "version": "v0.4.1-6-ge2d706ef"}
    zkevm-sequencer        | github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).halt
    zkevm-sequencer        |        /src/sequencer/finalizer.go:454
    zkevm-sequencer        | github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).processForcedBatch
    zkevm-sequencer        |        /src/sequencer/finalizer.go:1138
    zkevm-sequencer        | github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).processForcedBatches
    zkevm-sequencer        |        /src/sequencer/finalizer.go:1116
    zkevm-sequencer        | github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).newWIPBatch
    zkevm-sequencer        |        /src/sequencer/finalizer.go:560
    zkevm-sequencer        | github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).finalizeBatch
    zkevm-sequencer        |        /src/sequencer/finalizer.go:429
    zkevm-sequencer        | github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).finalizeBatches
    zkevm-sequencer        |        /src/sequencer/finalizer.go:381
    zkevm-sequencer        | github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).Start
    zkevm-sequencer        |        /src/sequencer/finalizer.go:194
    
    

fatal error: TRUSTED REORG DETECTED

  1. the log when the error first occurred was not saved
    2023-12-20T19:47:37.957+0800    ERROR   synchronizer/synchronizer.go:1820       halting the Synchronizer        {"pid": 1, "version": "v0.4.0-RC6-26-g87902b47"}
    github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).halt
            /src/synchronizer/synchronizer.go:1820
    github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).checkTrustedState
            /src/synchronizer/synchronizer.go:791
    github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).processSequenceBatches
            /src/synchronizer/synchronizer.go:1020
    github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).processBlockRange
            /src/synchronizer/synchronizer.go:583
    github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).syncBlocksSequential
            /src/synchronizer/synchronizer.go:423
    github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).Sync
            /src/synchronizer/synchronizer.go:327
    main.runSynchronizer
            /src/cmd/run.go:325
    2023-12-20T19:47:42.958+0800    ERROR   synchronizer/synchronizer.go:1819       fatal error: TRUSTED REORG DETECTED! Batch: 2%!(EXTRA string=
    /src/log/log.go:142 github.com/0xPolygonHermez/zkevm-node/log.appendStackTraceMaybeArgs()
    /src/log/log.go:251 github.com/0xPolygonHermez/zkevm-node/log.Errorf()
    /src/synchronizer/synchronizer.go:1819 github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).halt()
    /src/synchronizer/synchronizer.go:791 github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).checkTrustedState()
    /src/synchronizer/synchronizer.go:1020 github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).processSequenceBatches()
    /src/synchronizer/synchronizer.go:583 github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).processBlockRange()
    /src/synchronizer/synchronizer.go:423 github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).syncBlocksSequential()
    /src/synchronizer/synchronizer.go:327 github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).Sync()
    /src/cmd/run.go:325 main.runSynchronizer()
    )       {"pid": 1, "version": "v0.4.0-RC6-26-g87902b47"}
    github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).halt
            /src/synchronizer/synchronizer.go:1819
    github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).checkTrustedState
            /src/synchronizer/synchronizer.go:791
    github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).processSequenceBatches
            /src/synchronizer/synchronizer.go:1020
    github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).processBlockRange
            /src/synchronizer/synchronizer.go:583
    github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).syncBlocksSequential
            /src/synchronizer/synchronizer.go:423
    github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).Sync
            /src/synchronizer/synchronizer.go:327
    main.runSynchronizer
            /src/cmd/run.go:325
    2023-12-20T19:47:42.958+0800    ERROR   synchronizer/synchronizer.go:1820       halting the Synchronizer        {"pid": 1, "version": "v0.4.0-RC6-26-g87902b47"}
  2. related issue:
    1. 0xPolygonHermez#2740
    2. 0xPolygonHermez#1676
    3. 0xPolygonHermez#828
    4. 0xPolygonHermez#796
  3. https://docs.polygon.technology/pos/operate-node/validator/kb/known-issues/?h=reorg#error-impossible-reorg-please-file-an-issue
  4. how to reproduce and solve it?

regression testing

basic:

  • tranfer
  • contract call
    ...

workflow status

  1. Test non-e2e
  2. Test e2e

sub task:

  • test-e2e-group-1
  • test-e2e-group-2
  • test-e2e-group-3
  • test-e2e-group-4
  • #10
  • #11
  • test-e2e-group-7
  • #12
  • #13
  • #14
  • #15

tx too large

when I performed a stress test, I encountered the following problem:

2023-12-19T22:44:14.573777668+08:00 stderr F 2023-12-19T22:44:14.573+0800	ERROR	ethtxmanager/ethtxmanager.go:416	failed to send tx 0x494e1c1855625e0f28d6189e9f1fc13b02e6c9b8a1cc3e1561f9595bcfd9af5a to network: : tx too large	{"pid": 1, "version": "v0.4.1-6-ge2d706ef", "owner": "sequencer", "monitoredTxId": "sequence-from-322-to-367", "createdAt": "2023-12-19T16:45:16.369+0800", "from": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", "to": "0x67d269191c92Caf3cD7723F116c85e6E9bf55933"}

Account Abstraction

Goal

Email, BTC, ETH account control one smart contract account

Implementation

Go vulnerability check failed

 git rev-parse --short=7 HEAD
bd1db00
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...
Scanning your code and 804 packages across 141 dependent modules for known vulnerabilities...

Vulnerability #1: GO-2024-2466
    Denial of service in github.com/go-git/go-git/v5 and
    gopkg.in/src-d/go-git.v4
  More info: https://pkg.go.dev/vuln/GO-2024-2466
  Module: github.com/go-git/go-git/v5
    Found in: github.com/go-git/go-git/[email protected]
    Fixed in: github.com/go-git/go-git/[email protected]
    Example traces found:
      #1: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone, which eventually calls config.Branch.Validate
      #2: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone
      #3: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone, which eventually calls config.Config.Validate
      #4: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone, which eventually calls filesystem.ConfigStorage.Config
      #5: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone, which eventually calls filesystem.ConfigStorage.SetConfig
      #6: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone, which eventually calls dotgit.DotGit.Alternates
      #7: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone, which eventually calls filesystem.ModuleStorage.Module
      #8: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone, which eventually calls filesystem.NewStorage
      #9: etherman/etherman.go:1097:83: etherman.Client.GetL1GasPrice calls git.NoMatchingRefSpecError.Error
      #10: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone, which eventually calls filesystem.ObjectStorage.EncodedObject
      #11: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone, which eventually calls config.ReadConfig
      #12: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone, which eventually calls config.RemoteConfig.Validate

Vulnerability #2: GO-2024-2456
    Path traversal and RCE in github.com/go-git/go-git/v5 and
    gopkg.in/src-d/go-git.v4
  More info: https://pkg.go.dev/vuln/GO-2024-2456
  Module: github.com/go-git/go-git/v5
    Found in: github.com/go-git/go-git/[email protected]
    Fixed in: github.com/go-git/go-git/[email protected]
    Example traces found:
      #1: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone, which eventually calls config.Branch.Validate
      #2: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone
      #3: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone, which eventually calls config.Config.Validate
      #4: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone, which eventually calls filesystem.ConfigStorage.Config
      #5: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone, which eventually calls filesystem.ConfigStorage.SetConfig
      #6: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone, which eventually calls dotgit.DotGit.Alternates
      #7: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone, which eventually calls filesystem.ModuleStorage.Module
      #8: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone, which eventually calls filesystem.NewStorage
      #9: etherman/etherman.go:1097:83: etherman.Client.GetL1GasPrice calls git.NoMatchingRefSpecError.Error
      #10: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone, which eventually calls filesystem.ObjectStorage.EncodedObject
      #11: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone, which eventually calls config.ReadConfig
      #12: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone, which eventually calls config.RemoteConfig.Validate

Vulnerability #3: GO-2023-2402
    Man-in-the-middle attacker can compromise integrity of secure channel in
    golang.org/x/crypto
  More info: https://pkg.go.dev/vuln/GO-2023-2402
  Module: golang.org/x/crypto
    Found in: golang.org/x/[email protected]
    Fixed in: golang.org/x/[email protected]
    Example traces found:
      #1: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone, which eventually calls ssh.Client.NewSession
      #2: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone, which eventually calls ssh.NewClient
      #3: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone, which eventually calls ssh.NewClientConn
      #4: test/operations/wait.go:210:25: operations.NodeUpCondition calls io.ReadAll, which eventually calls ssh.Session.Close
      #5: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone, which eventually calls ssh.Session.Start
      #6: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone, which eventually calls ssh.channel.Close
      #7: test/scripts/cmd/compilesc/manager.go:225:14: compilesc.Manager.Abigen calls exec.Cmd.Run, which eventually calls ssh.channel.CloseWrite
      #8: test/operations/wait.go:210:25: operations.NodeUpCondition calls io.ReadAll, which eventually calls ssh.channel.Read
      #9: jsonrpc/client/client.go:103:2: client.JSONRPCBatchCall calls http.body.Close, which eventually calls ssh.channel.Write
      #10: test/operations/wait.go:210:25: operations.NodeUpCondition calls io.ReadAll, which eventually calls ssh.extChannel.Read
      #11: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone, which eventually calls ssh.sessionStdin.Close

Vulnerability #4: GO-2023-2382
    Denial of service via chunk extensions in net/http
  More info: https://pkg.go.dev/vuln/GO-2023-2382
  Standard library
    Found in: net/http/[email protected]
    Fixed in: net/http/[email protected]
    Example traces found:
      #1: test/operations/wait.go:210:25: operations.NodeUpCondition calls io.ReadAll, which eventually calls internal.chunkedReader.Read

Vulnerability #5: GO-2023-2185
    Insecure parsing of Windows paths with a \??\ prefix in path/filepath
  More info: https://pkg.go.dev/vuln/GO-2023-2185
  Standard library
    Found in: path/[email protected]
    Fixed in: path/[email protected]
    Platforms: windows
    Example traces found:
      #1: test/scripts/cmd/compilesc/manager.go:225:14: compilesc.Manager.Abigen calls exec.Cmd.Run, which eventually calls filepath.Abs
      #2: test/scripts/cmd/compilesc/manager.go:225:14: compilesc.Manager.Abigen calls exec.Cmd.Run, which eventually calls filepath.Abs
      #3: test/vectors/statetransition_v2.go:32:55: vectors.LoadStateTransitionTestCaseV2 calls filepath.Base
      #4: test/vectors/statetransition_v2.go:32:55: vectors.LoadStateTransitionTestCaseV2 calls filepath.Base
      #5: test/scripts/cmd/dependencies/github.go:205:39: dependencies.AdapterFs.RemoveAll calls filepath.Clean
      #6: test/scripts/cmd/dependencies/github.go:205:39: dependencies.AdapterFs.RemoveAll calls filepath.Clean
      #7: test/operations/manager.go:546:22: operations.runCmd calls filepath.Dir
      #8: test/operations/manager.go:546:22: operations.runCmd calls filepath.Dir
      #9: state/state.go:45:9: state.NewState calls sync.Once.Do, which eventually calls filepath.EvalSymlinks
      #10: state/state.go:45:9: state.NewState calls sync.Once.Do, which eventually calls filepath.EvalSymlinks
      #11: state/state.go:45:9: state.NewState calls sync.Once.Do, which eventually calls filepath.Glob
      #12: state/state.go:45:9: state.NewState calls sync.Once.Do, which eventually calls filepath.Glob
      #13: test/scripts/cmd/dependencies/github.go:200:22: dependencies.AdapterFs.Join calls filepath.Join
      #14: test/scripts/cmd/dependencies/github.go:200:22: dependencies.AdapterFs.Join calls filepath.Join
      #15: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone, which eventually calls filepath.Rel
      #16: test/scripts/cmd/dependencies/github.go:56:20: dependencies.githubManager.cloneTargetRepo calls git.Clone, which eventually calls filepath.Rel
      #17: config/config.go:146:38: config.Load calls filepath.Split
      #18: config/config.go:146:38: config.Load calls filepath.Split
      #19: test/scripts/cmd/compilesc/manager.go:225:14: compilesc.Manager.Abigen calls exec.Cmd.Run, which eventually calls filepath.VolumeName
      #20: test/scripts/cmd/compilesc/manager.go:225:14: compilesc.Manager.Abigen calls exec.Cmd.Run, which eventually calls filepath.VolumeName
      #21: cmd/jsonschema.go:15:53: cmd.genJSONSchema calls jsonschema.Reflector.AddGoComments, which eventually calls filepath.Walk
      #22: cmd/jsonschema.go:15:53: cmd.genJSONSchema calls jsonschema.Reflector.AddGoComments, which eventually calls filepath.Walk
      #23: test/scripts/cmd/compilesc/manager.go:133:26: compilesc.parallelActions calls filepath.WalkDir
      #24: test/scripts/cmd/compilesc/manager.go:133:26: compilesc.parallelActions calls filepath.WalkDir

=== Informational ===

Found 1 vulnerability in packages that you import, but there are no
call stacks leading to the use of this vulnerability. There are also 2
vulnerabilities in modules that you require that are neither imported
nor called. You may not need to take any action.
See https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck for details.

Vulnerability #1: GO-2024-2453
    Timing side channel in github.com/cloudflare/circl
  More info: https://pkg.go.dev/vuln/GO-2024-2453
  Module: github.com/cloudflare/circl
    Found in: github.com/cloudflare/[email protected]
    Fixed in: github.com/cloudflare/[email protected]

Vulnerability #2: GO-2023-2101
    Incorrect exponentiation results in github.com/consensys/gnark-crypto
  More info: https://pkg.go.dev/vuln/GO-2023-2101
  Module: github.com/consensys/gnark-crypto
    Found in: github.com/consensys/[email protected]
    Fixed in: github.com/consensys/[email protected]

Vulnerability #3: GO-2023-2096
    Signature malleability in github.com/consensys/gnark-crypto
  More info: https://pkg.go.dev/vuln/GO-2023-2096
  Module: github.com/consensys/gnark-crypto
    Found in: github.com/consensys/[email protected]
    Fixed in: github.com/consensys/[email protected]

Your code is affected by 5 vulnerabilities from 2 modules and the Go standard library.

Share feedback at https://go.dev/s/govulncheck-feedback.

fix test-e2e-group-8

  1. question:
        debug_calltracer_test.go:197: 
                Error Trace:	/root/b2network/b2-zkevm-node/ci/e2e-group8/debug_calltracer_test.go:197
                Error:      	Expected nil, but got: &types.ErrorObject{Code:-32602, Message:"invalid argument 1: json: cannot unmarshal object into Go struct field TraceConfig.tracerConfig of type string", Data:(*types.ArgBytes)(nil)}
                Test:       	TestDebugTraceTransactionCallTracer/sc_call_reverted
    === RUN   TestDebugTraceTransactionCallTracer/erc20_transfer_reverted
    
  2. reason: rpc api call param format mismatch

txpool is full

when I performed a stress test use jmeter, I encountered the following problem:

<responseData class="java.lang.String">{&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;id&quot;:1,&quot;error&quot;:{&quot;code&quot;:-32000,&quot;message&quot;:&quot;txpool is full&quot;}}</responseData>

set lower gas

L2GasPricer: it fetches the L1 gas price and applies some formula to calculate the gas price that will be suggested for the users to use for paying fees on L2. The suggestions are stored on the pool, and will be consumed by the rpc

set default gasprice see:

DefaultGasPriceWei = 1000000000

Full prover support

Now mock prover is enabled with docker, full prover neeed at least 96-core, 768G machine to debug.

make stop test-e2e-group-1 failed

  1. make stop test-e2e-group-1, save the log to file test-20231113-162225.log

  2. error or fail:

    + grep -irnE 'error|fail' test-20231113-162225.log
    633:            Error Trace:    /root/b2-zkevm-node/ci/e2e-group1/ethtransfer_test.go:71
    634:            Error:          Received unexpected error:
    829:--- FAIL: TestEthTransfer (285.23s)
    1318:           Error Trace:    /root/b2-zkevm-node/ci/e2e-group1/preEIP155_test.go:60
    1319:           Error:          Received unexpected error:
    1320:                           rpc error: code = Unknown desc = execution reverted
    1514:--- FAIL: TestPreEIP155Tx (26.32s)
    2003:           Error Trace:    /root/b2-zkevm-node/ci/e2e-group1/preEIP155_test.go:154
    2004:           Error:          Not equal: 
    2207:--- FAIL: TestFakeEIP155With_V_As35 (26.30s)
    2208:FAIL
    2209:FAIL       github.com/0xPolygonHermez/zkevm-node/ci/e2e-group1     337.934s
    2210:FAIL

finalizer halted due to error: halting Sequencer because of error reprocessing full batch

  1. first, an error will be reported ResourceExhausted
  2. then it will halt
  3. error thrown location
    res, err := s.executorClient.ProcessBatch(ctx, processBatchRequest)
    if err != nil {
    log.Errorf("Error s.executorClient.ProcessBatch: %v", err)
    log.Errorf("Error s.executorClient.ProcessBatch: %s", err.Error())
    log.Errorf("Error s.executorClient.ProcessBatch response: %v", res)
    } else if res.Error != executor.ExecutorError_EXECUTOR_ERROR_NO_ERROR {
  4. log
    2024-02-02T05:02:04.789471419+08:00 stderr F 2024-02-02T05:02:04.789+0800	DEBUG	state/batch.go:341	processBatch[processBatchRequest.UpdateMerkleTree]: 0	{"pid": 1, "version": ""}
    2024-02-02T05:02:04.789489648+08:00 stderr F 2024-02-02T05:02:04.789+0800	DEBUG	state/batch.go:342	processBatch[processBatchRequest.ChainId]: 1102	{"pid": 1, "version": ""}
    2024-02-02T05:02:04.789492901+08:00 stderr F 2024-02-02T05:02:04.789+0800	DEBUG	state/batch.go:343	processBatch[processBatchRequest.ForkId]: 6	{"pid": 1, "version": ""}
    2024-02-02T05:02:04.789507316+08:00 stderr F 2024-02-02T05:02:04.789+0800	DEBUG	state/batch.go:344	processBatch[processBatchRequest.ContextId]: 9ad86617-3138-40f7-9cee-59c81669c77e	{"pid": 1, "version": ""}
    2024-02-02T05:02:04.789938537+08:00 stderr F 2024-02-02T05:02:04.789+0800	ERROR	state/batch.go:349	Error s.executorClient.ProcessBatch: rpc error: code = ResourceExhausted desc = %!(EXTRA string=
    2024-02-02T05:02:04.789950516+08:00 stderr F /src/log/log.go:142 github.com/0xPolygonHermez/zkevm-node/log.appendStackTraceMaybeArgs()
    2024-02-02T05:02:04.789954175+08:00 stderr F /src/log/log.go:251 github.com/0xPolygonHermez/zkevm-node/log.Errorf()
    2024-02-02T05:02:04.789957163+08:00 stderr F /src/state/batch.go:349 github.com/0xPolygonHermez/zkevm-node/state.(*State).sendBatchRequestToExecutor()
    2024-02-02T05:02:04.789960125+08:00 stderr F /src/state/batch.go:188 github.com/0xPolygonHermez/zkevm-node/state.(*State).ProcessBatch()
    2024-02-02T05:02:04.789963216+08:00 stderr F /src/sequencer/finalizer.go:1307 github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).reprocessFullBatch()
    2024-02-02T05:02:04.78996594+08:00 stderr F /src/sequencer/finalizer.go:509 github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).newWIPBatch()
    2024-02-02T05:02:04.789968792+08:00 stderr F /src/sequencer/finalizer.go:429 github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).finalizeBatch()
    2024-02-02T05:02:04.789971691+08:00 stderr F /src/sequencer/finalizer.go:381 github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).finalizeBatches()
    2024-02-02T05:02:04.789976777+08:00 stderr F /src/sequencer/finalizer.go:194 github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).Start()
    2024-02-02T05:02:04.789980204+08:00 stderr F )	{"pid": 1, "version": ""}
    2024-02-02T05:02:04.789982781+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/state.(*State).sendBatchRequestToExecutor
    2024-02-02T05:02:04.789985626+08:00 stderr F 	/src/state/batch.go:349
    2024-02-02T05:02:04.789988564+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/state.(*State).ProcessBatch
    2024-02-02T05:02:04.789991505+08:00 stderr F 	/src/state/batch.go:188
    2024-02-02T05:02:04.789994431+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).reprocessFullBatch
    2024-02-02T05:02:04.789997557+08:00 stderr F 	/src/sequencer/finalizer.go:1307
    2024-02-02T05:02:04.79000018+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).newWIPBatch
    2024-02-02T05:02:04.790003008+08:00 stderr F 	/src/sequencer/finalizer.go:509
    2024-02-02T05:02:04.790006306+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).finalizeBatch
    2024-02-02T05:02:04.790009233+08:00 stderr F 	/src/sequencer/finalizer.go:429
    2024-02-02T05:02:04.790012305+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).finalizeBatches
    2024-02-02T05:02:04.790014969+08:00 stderr F 	/src/sequencer/finalizer.go:381
    2024-02-02T05:02:04.790017642+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).Start
    2024-02-02T05:02:04.790020513+08:00 stderr F 	/src/sequencer/finalizer.go:194
    2024-02-02T05:02:04.790023594+08:00 stderr F 2024-02-02T05:02:04.789+0800	ERROR	state/batch.go:350	Error s.executorClient.ProcessBatch: rpc error: code = ResourceExhausted desc = 	{"pid": 1, "version": ""}
    2024-02-02T05:02:04.790026645+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/state.(*State).sendBatchRequestToExecutor
    2024-02-02T05:02:04.79002939+08:00 stderr F 	/src/state/batch.go:350
    2024-02-02T05:02:04.790032252+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/state.(*State).ProcessBatch
    2024-02-02T05:02:04.790043219+08:00 stderr F 	/src/state/batch.go:188
    2024-02-02T05:02:04.790045912+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).reprocessFullBatch
    2024-02-02T05:02:04.790048792+08:00 stderr F 	/src/sequencer/finalizer.go:1307
    2024-02-02T05:02:04.790051686+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).newWIPBatch
    2024-02-02T05:02:04.790054652+08:00 stderr F 	/src/sequencer/finalizer.go:509
    2024-02-02T05:02:04.790057531+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).finalizeBatch
    2024-02-02T05:02:04.790059995+08:00 stderr F 	/src/sequencer/finalizer.go:429
    2024-02-02T05:02:04.790063362+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).finalizeBatches
    2024-02-02T05:02:04.790066423+08:00 stderr F 	/src/sequencer/finalizer.go:381
    2024-02-02T05:02:04.790069179+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).Start
    2024-02-02T05:02:04.790071997+08:00 stderr F 	/src/sequencer/finalizer.go:194
    2024-02-02T05:02:04.790094396+08:00 stderr F 2024-02-02T05:02:04.789+0800	ERROR	state/batch.go:351	Error s.executorClient.ProcessBatch response: <nil>	{"pid": 1, "version": ""}
    2024-02-02T05:02:04.790114018+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/state.(*State).sendBatchRequestToExecutor
    2024-02-02T05:02:04.790116925+08:00 stderr F 	/src/state/batch.go:351
    2024-02-02T05:02:04.790119505+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/state.(*State).ProcessBatch
    2024-02-02T05:02:04.790122378+08:00 stderr F 	/src/state/batch.go:188
    2024-02-02T05:02:04.79012516+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).reprocessFullBatch
    2024-02-02T05:02:04.790127819+08:00 stderr F 	/src/sequencer/finalizer.go:1307
    2024-02-02T05:02:04.790130337+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).newWIPBatch
    2024-02-02T05:02:04.790132934+08:00 stderr F 	/src/sequencer/finalizer.go:509
    2024-02-02T05:02:04.790135863+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).finalizeBatch
    2024-02-02T05:02:04.790138604+08:00 stderr F 	/src/sequencer/finalizer.go:429
    2024-02-02T05:02:04.790141517+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).finalizeBatches
    2024-02-02T05:02:04.790144785+08:00 stderr F 	/src/sequencer/finalizer.go:381
    2024-02-02T05:02:04.790147591+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).Start
    2024-02-02T05:02:04.790150575+08:00 stderr F 	/src/sequencer/finalizer.go:194
    2024-02-02T05:02:04.790154118+08:00 stderr F 2024-02-02T05:02:04.789+0800	INFO	state/batch.go:360	Batch: 27496 took 513.895µs to be processed by the executor 	{"pid": 1, "version": ""}
    2024-02-02T05:02:04.790164874+08:00 stderr F 2024-02-02T05:02:04.789+0800	ERROR	sequencer/finalizer.go:1309	reprocessFullBatch: failed to process batch 27496. Error: rpc error: code = ResourceExhausted desc = %!(EXTRA string=
    2024-02-02T05:02:04.790172721+08:00 stderr F /src/log/log.go:142 github.com/0xPolygonHermez/zkevm-node/log.appendStackTraceMaybeArgs()
    2024-02-02T05:02:04.790175392+08:00 stderr F /src/log/log.go:251 github.com/0xPolygonHermez/zkevm-node/log.Errorf()
    2024-02-02T05:02:04.790177917+08:00 stderr F /src/sequencer/finalizer.go:1309 github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).reprocessFullBatch()
    2024-02-02T05:02:04.790180828+08:00 stderr F /src/sequencer/finalizer.go:509 github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).newWIPBatch()
    2024-02-02T05:02:04.790186618+08:00 stderr F /src/sequencer/finalizer.go:429 github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).finalizeBatch()
    2024-02-02T05:02:04.790191599+08:00 stderr F /src/sequencer/finalizer.go:381 github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).finalizeBatches()
    2024-02-02T05:02:04.790194234+08:00 stderr F /src/sequencer/finalizer.go:194 github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).Start()
    2024-02-02T05:02:04.790203078+08:00 stderr F )	{"pid": 1, "version": ""}
    2024-02-02T05:02:04.790205838+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).reprocessFullBatch
    2024-02-02T05:02:04.790208835+08:00 stderr F 	/src/sequencer/finalizer.go:1309
    2024-02-02T05:02:04.79021183+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).newWIPBatch
    2024-02-02T05:02:04.790214802+08:00 stderr F 	/src/sequencer/finalizer.go:509
    2024-02-02T05:02:04.790217442+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).finalizeBatch
    2024-02-02T05:02:04.790221166+08:00 stderr F 	/src/sequencer/finalizer.go:429
    2024-02-02T05:02:04.790224174+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).finalizeBatches
    2024-02-02T05:02:04.790226894+08:00 stderr F 	/src/sequencer/finalizer.go:381
    2024-02-02T05:02:04.790229398+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).Start
    2024-02-02T05:02:04.790232078+08:00 stderr F 	/src/sequencer/finalizer.go:194
    2024-02-02T05:02:04.790235038+08:00 stderr F 2024-02-02T05:02:04.790+0800	ERROR	nileventstorage/nileventstorage.go:30	Event: &{Id:{neg:false abs:[]} ReceivedAt:2024-02-02 05:02:04.790001958 +0800 CST m=+582.609952599 IPAddress: Source:node Component:sequencer Level:crit EventID:FINALIZER HALT Description:finalizer halted due to error: halting Sequencer because of error reprocessing full batch 27496 (sanity check). Error: processing batch error  Data:[] Json:<nil>}	{"pid": 1, "version": ""}
    2024-02-02T05:02:04.790237709+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/event/nileventstorage.LogEvent
    2024-02-02T05:02:04.790240918+08:00 stderr F 	/src/event/nileventstorage/nileventstorage.go:30
    2024-02-02T05:02:04.790243568+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/event/pgeventstorage.(*PostgresEventStorage).LogEvent
    2024-02-02T05:02:04.790246133+08:00 stderr F 	/src/event/pgeventstorage/pgeventstorage.go:45
    2024-02-02T05:02:04.790248711+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/event.(*EventLog).LogEvent
    2024-02-02T05:02:04.790251573+08:00 stderr F 	/src/event/eventlog.go:28
    2024-02-02T05:02:04.790254156+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).halt
    2024-02-02T05:02:04.790256764+08:00 stderr F 	/src/sequencer/finalizer.go:447
    2024-02-02T05:02:04.790259587+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).newWIPBatch
    2024-02-02T05:02:04.790262506+08:00 stderr F 	/src/sequencer/finalizer.go:512
    2024-02-02T05:02:04.790265325+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).finalizeBatch
    2024-02-02T05:02:04.790267831+08:00 stderr F 	/src/sequencer/finalizer.go:429
    2024-02-02T05:02:04.790270275+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).finalizeBatches
    2024-02-02T05:02:04.790272836+08:00 stderr F 	/src/sequencer/finalizer.go:381
    2024-02-02T05:02:04.790275403+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).Start
    2024-02-02T05:02:04.790277963+08:00 stderr F 	/src/sequencer/finalizer.go:194
    2024-02-02T05:02:04.790857566+08:00 stderr F 2024-02-02T05:02:04.790+0800	ERROR	sequencer/finalizer.go:453	fatal error: halting Sequencer because of error reprocessing full batch 27496 (sanity check). Error: processing batch error %!(EXTRA string=
    2024-02-02T05:02:04.790871568+08:00 stderr F /src/log/log.go:142 github.com/0xPolygonHermez/zkevm-node/log.appendStackTraceMaybeArgs()
    2024-02-02T05:02:04.790874914+08:00 stderr F /src/log/log.go:251 github.com/0xPolygonHermez/zkevm-node/log.Errorf()
    2024-02-02T05:02:04.790877885+08:00 stderr F /src/sequencer/finalizer.go:453 github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).halt()
    2024-02-02T05:02:04.790880894+08:00 stderr F /src/sequencer/finalizer.go:512 github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).newWIPBatch()
    2024-02-02T05:02:04.790883826+08:00 stderr F /src/sequencer/finalizer.go:429 github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).finalizeBatch()
    2024-02-02T05:02:04.790893071+08:00 stderr F /src/sequencer/finalizer.go:381 github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).finalizeBatches()
    2024-02-02T05:02:04.790895921+08:00 stderr F /src/sequencer/finalizer.go:194 github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).Start()
    2024-02-02T05:02:04.790899187+08:00 stderr F )	{"pid": 1, "version": ""}
    2024-02-02T05:02:04.790902091+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).halt
    2024-02-02T05:02:04.790904649+08:00 stderr F 	/src/sequencer/finalizer.go:453
    2024-02-02T05:02:04.790907461+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).newWIPBatch
    2024-02-02T05:02:04.790910555+08:00 stderr F 	/src/sequencer/finalizer.go:512
    2024-02-02T05:02:04.790913558+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).finalizeBatch
    2024-02-02T05:02:04.790916331+08:00 stderr F 	/src/sequencer/finalizer.go:429
    2024-02-02T05:02:04.790920908+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).finalizeBatches
    2024-02-02T05:02:04.790924285+08:00 stderr F 	/src/sequencer/finalizer.go:381
    2024-02-02T05:02:04.790927359+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).Start
    2024-02-02T05:02:04.790930111+08:00 stderr F 	/src/sequencer/finalizer.go:194
    2024-02-02T05:02:04.790932998+08:00 stderr F 2024-02-02T05:02:04.790+0800	ERROR	sequencer/finalizer.go:454	halting the finalizer	{"pid": 1, "version": ""}
    2024-02-02T05:02:04.790935987+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).halt
    2024-02-02T05:02:04.790938792+08:00 stderr F 	/src/sequencer/finalizer.go:454
    2024-02-02T05:02:04.790941707+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).newWIPBatch
    2024-02-02T05:02:04.790944528+08:00 stderr F 	/src/sequencer/finalizer.go:512
    2024-02-02T05:02:04.790947739+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).finalizeBatch
    2024-02-02T05:02:04.790951298+08:00 stderr F 	/src/sequencer/finalizer.go:429
    2024-02-02T05:02:04.790954298+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).finalizeBatches
    2024-02-02T05:02:04.790957181+08:00 stderr F 	/src/sequencer/finalizer.go:381
    2024-02-02T05:02:04.79096006+08:00 stderr F github.com/0xPolygonHermez/zkevm-node/sequencer.(*finalizer).Start
    2024-02-02T05:02:04.790963435+08:00 stderr F 	/src/sequencer/finalizer.go:194
    2024-02-02T05:02:04.965183501+08:00 stderr F 2024-02-02T05:02:04.965+0800	INFO	sequencer/worker.go:95	AddTx new tx(0x4af0bb3bf9ca5b1775cf9b3ef0f53cf6619d3eb590548ce07937cbe195fcd8bd) nonce(551171) gasPrice(10000000) to addrQueue(0x35fE57b69964227E67795288746508A7F89b287d) nonce(551171) balance(448713248671840000000)	{"pid": 1, "version": ""}
    2024-02-02T05:02:04.965199751+08:00 stderr F 2024-02-02T05:02:04.965+0800	INFO	sequencer/worker.go:110	AddTx newReadyTx(0x4af0bb3bf9ca5b1775cf9b3ef0f53cf6619d3eb590548ce07937cbe195fcd8bd) nonce(551171) gasPrice(10000000) addr(0x35fE57b69964227E67795288746508A7F89b287d) added to TxSortedList	{"pid": 1, "version": ""}

Missing sequencer URL

The documentation at https://github.com/b2network/b2-zkevm-node/blob/main/docs/production-setup.md#setup recommends downloading artifacts from the 0xPolygonHermez repository. This setup will synchronize the node with Polygon as Polygon is the default sequencer.

However, within the repository at https://github.com/b2network/b2-zkevm-node/blob/main/config/environments/mainnet/node.config.toml, there is no specific sequencer URL for the b2 network.

Could you please direct me to where I can find the sequencer URL needed to sync the node?

Deploy B2network full node found that data is wrong

System information

zkEVM Node version: ghcr.io/b2network/b2-zkevm-node:v0.6.2.1
OS & Version: ubuntu:22.04
Network: b2 Mainnet

I use Docker to deploy b2network full nodes, Reference document address https://github.com/b2network/b2-zkevm-node/blob/main/docs/production-setup.md

docker images:
ghcr.io/b2network/b2-zkevm-node   v0.6.2.1   
hermeznetwork/zkevm-prover        v6.0.0   
postgres                          15       
check block data info:
new l2 block detected: number 2744857, hash 0x4010e3683950ce8f5f9b69ca2f564d8076796ff6fe21fc8106ce74d90ad2befc

####Unable to find information about this block in b2 explorer, but You can query the information of this block in the ZKEVM browser https://zkevm.polygonscan.com/block/2744857

how to fix this issues??

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.