Skip to content
This repository was archived by the owner on Aug 19, 2025. It is now read-only.

Commit c05ac23

Browse files
authored
fix ut and e2e test (#29)
* fix ut * update image * bridgel2 * update doc
1 parent 6991c3b commit c05ac23

81 files changed

Lines changed: 5010 additions & 1403 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test-e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
matrix:
1818
go-version: [ 1.19.x ]
1919
goarch: [ "amd64" ]
20-
e2e-group: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ]
20+
e2e-group: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, dac-1 ]
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: Checkout code

.github/workflows/test-from-prover.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test from zkevm-prover call
1+
name: Test from xgon-prover call
22
on:
33
workflow_call:
44
inputs:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../test/e2e/datacommittee_test.go

ci/e2e-group-dac/datacommittee_test.go

Lines changed: 0 additions & 1 deletion
This file was deleted.

ci/e2e-group10/forced_batches_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323

2424
const (
2525
toAddressHex = "0x4d5Cf5032B2a844602278b01199ED191A86c93ff"
26-
gerFinalityBlocks = uint64(250)
26+
gerFinalityBlocks = uint64(2500)
2727
forkID5 = 5
2828
)
2929

@@ -166,6 +166,8 @@ func sendForcedBatch(t *testing.T, txs []byte, opsman *operations.Manager) (*sta
166166
require.NoError(t, err)
167167

168168
log.Debug("currentBlock.Time(): ", currentBlock.Time())
169+
temp, _, err := st.GetLatestGer(ctx, gerFinalityBlocks)
170+
log.Infof("temp: %v", temp.GlobalExitRoot.String())
169171

170172
// Send forceBatch
171173
tx, err := zkEvm.ForceBatch(auth, txs, tip)
@@ -226,6 +228,7 @@ func sendForcedBatch(t *testing.T, txs []byte, opsman *operations.Manager) (*sta
226228
finalGer, _, err := st.GetLatestGer(ctx, gerFinalityBlocks)
227229
require.NoError(t, err)
228230
if finalGer.GlobalExitRoot != rootInContractHash {
231+
log.Infof("initialGer.GlobalExitRoot: %v, finalGer.GlobalExitRoot: %v, rootInContractHash: %v", initialGer.GlobalExitRoot.String(), finalGer.GlobalExitRoot.String(), rootInContractHash.String())
229232
log.Fatal("global exit root is not updated")
230233
}
231234
}

cmd/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"crypto/ecdsa"
66
"errors"
77
"fmt"
8-
"github.com/ethereum/go-ethereum/common"
98
"net"
109
"net/http"
1110
"net/http/pprof"
@@ -37,6 +36,7 @@ import (
3736
"github.com/0xPolygonHermez/zkevm-node/state"
3837
"github.com/0xPolygonHermez/zkevm-node/state/runtime/executor"
3938
"github.com/0xPolygonHermez/zkevm-node/synchronizer"
39+
"github.com/ethereum/go-ethereum/common"
4040
"github.com/ethereum/go-ethereum/crypto"
4141
"github.com/jackc/pgx/v4/pgxpool"
4242
"github.com/prometheus/client_golang/prometheus/promhttp"

config/config_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ func Test_Defaults(t *testing.T) {
181181
expectedValue: types.NewDuration(5 * time.Second),
182182
},
183183
{
184-
path: "SequenceSender.MaxTxSizeForL1",
185-
expectedValue: uint64(131072),
184+
path: "SequenceSender.MaxBatchesForL1",
185+
expectedValue: uint64(10),
186186
},
187187
{
188188
path: "Etherman.URL",
@@ -242,7 +242,7 @@ func Test_Defaults(t *testing.T) {
242242
},
243243
{
244244
path: "MTClient.URI",
245-
expectedValue: "zkevm-prover:50061",
245+
expectedValue: "xgon-prover:50061",
246246
},
247247
{
248248
path: "StateDB.User",
@@ -258,7 +258,7 @@ func Test_Defaults(t *testing.T) {
258258
},
259259
{
260260
path: "StateDB.Host",
261-
expectedValue: "zkevm-state-db",
261+
expectedValue: "xgon-state-db",
262262
},
263263
{
264264
path: "StateDB.Port",
@@ -319,7 +319,7 @@ func Test_Defaults(t *testing.T) {
319319
},
320320
{
321321
path: "Pool.DB.Host",
322-
expectedValue: "zkevm-pool-db",
322+
expectedValue: "xgon-pool-db",
323323
},
324324
{
325325
path: "Pool.DB.Port",
@@ -375,7 +375,7 @@ func Test_Defaults(t *testing.T) {
375375
},
376376
{
377377
path: "Executor.URI",
378-
expectedValue: "zkevm-prover:50071",
378+
expectedValue: "xgon-prover:50071",
379379
},
380380
{
381381
path: "Executor.MaxResourceExhaustedAttempts",

config/default.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ MaxTxLifetime = "3h"
116116
[SequenceSender]
117117
WaitPeriodSendSequence = "5s"
118118
LastBatchVirtualizationTimeMaxWaitPeriod = "5s"
119-
MaxTxSizeForL1 = 1000
119+
MaxBatchesForL1 = 10
120120
L2Coinbase = "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"
121121
PrivateKey = {Path = "/pk/sequencer.keystore", Password = "testonly"}
122122
UseValidium = true

config/environments/local/local.genesis.config.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"l1Config" : {
33
"chainId": 1337,
4-
"polygonZkEVMAddress": "0x610178dA211FEF7D417bC0e6FeD39F05609AD788",
4+
"polygonZkEVMAddress": "0x0D9088C72Cd4F08e9dDe474D8F5394147f64b22C",
55
"maticTokenAddress": "0x5FbDB2315678afecb367f032d93F642f64180aa3",
6-
"polygonZkEVMGlobalExitRootAddress": "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6"
6+
"polygonZkEVMGlobalExitRootAddress": "0xEd236da21Ff62bC7B62608AdB818da49E8549fa7"
77
},
88
"root": "0xd88680f1b151dd67518f9aca85161424c0cac61df2f5424a3ddc04ea25adecc7",
99
"genesisBlockNumber": 102,
@@ -39,7 +39,7 @@
3939
"contractName": "PolygonZkEVMBridge proxy",
4040
"balance": "200000000000000000000000000",
4141
"nonce": "1",
42-
"address": "0xff0EE8ea08cEf5cb4322777F5CC3E8A584B8A4A0",
42+
"address": "0x10B65c586f795aF3eCCEe594fE4E38E1F059F780",
4343
"bytecode": "0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461088b565b610135565b61006b6100a33660046108a6565b61017f565b3480156100b457600080fd5b506100bd6101f3565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461088b565b610231565b34801561011257600080fd5b506100bd61025e565b6101236102d4565b61013361012e6103ab565b6103b5565b565b61013d6103d9565b73ffffffffffffffffffffffffffffffffffffffff1633036101775761017481604051806020016040528060008152506000610419565b50565b61017461011b565b6101876103d9565b73ffffffffffffffffffffffffffffffffffffffff1633036101eb576101e68383838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525060019250610419915050565b505050565b6101e661011b565b60006101fd6103d9565b73ffffffffffffffffffffffffffffffffffffffff163303610226576102216103ab565b905090565b61022e61011b565b90565b6102396103d9565b73ffffffffffffffffffffffffffffffffffffffff1633036101775761017481610444565b60006102686103d9565b73ffffffffffffffffffffffffffffffffffffffff163303610226576102216103d9565b60606102b183836040518060600160405280602781526020016109bb602791396104a5565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b6102dc6103d9565b73ffffffffffffffffffffffffffffffffffffffff163303610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b600061022161052a565b3660008037600080366000845af43d6000803e8080156103d4573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b61042283610552565b60008251118061042f5750805b156101e65761043e838361028c565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61046d6103d9565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a16101748161059f565b60606000808573ffffffffffffffffffffffffffffffffffffffff16856040516104cf919061094d565b600060405180830381855af49150503d806000811461050a576040519150601f19603f3d011682016040523d82523d6000602084013e61050f565b606091505b5091509150610520868383876106ab565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6103fd565b61055b81610753565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff8116610642576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016103a2565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b6060831561074157825160000361073a5773ffffffffffffffffffffffffffffffffffffffff85163b61073a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103a2565b508161074b565b61074b838361081e565b949350505050565b73ffffffffffffffffffffffffffffffffffffffff81163b6107f7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e74726163740000000000000000000000000000000000000060648201526084016103a2565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610665565b81511561082e5781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103a29190610969565b803573ffffffffffffffffffffffffffffffffffffffff8116811461088657600080fd5b919050565b60006020828403121561089d57600080fd5b6102b182610862565b6000806000604084860312156108bb57600080fd5b6108c484610862565b9250602084013567ffffffffffffffff808211156108e157600080fd5b818601915086601f8301126108f557600080fd5b81358181111561090457600080fd5b87602082850101111561091657600080fd5b6020830194508093505050509250925092565b60005b8381101561094457818101518382015260200161092c565b50506000910152565b6000825161095f818460208701610929565b9190910192915050565b6020815260008251806020840152610988816040850160208701610929565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220a1af0d6cb4f1e31496a4c5c1448913bce4bd6ad3a39e47c6f7190c114d6f9bf464736f6c63430008110033",
4444
"storage": {
4545
"0x0000000000000000000000000000000000000000000000000000000000000000": "0x0000000000000000000000000000000000000000000000000000000000000001",

config/environments/local/local.node.config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ MaxTxLifetime = "3h"
104104
[SequenceSender]
105105
WaitPeriodSendSequence = "5s"
106106
LastBatchVirtualizationTimeMaxWaitPeriod = "5s"
107-
MaxTxSizeForL1 = 131072
107+
MaxBatchesForL1 = 10
108108
L2Coinbase = "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"
109109
PrivateKey = {Path = "/pk/sequencer.keystore", Password = "testonly"}
110110

0 commit comments

Comments
 (0)