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

fix ut and e2e test #29

Merged
merged 4 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 1 addition & 1 deletion .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
matrix:
go-version: [ 1.19.x ]
goarch: [ "amd64" ]
e2e-group: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ]
e2e-group: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, dac-1 ]
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-from-prover.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test from zkevm-prover call
name: Test from xgon-prover call
on:
workflow_call:
inputs:
Expand Down
1 change: 1 addition & 0 deletions ci/e2e-group-dac-1/datacommittee_test.go
1 change: 0 additions & 1 deletion ci/e2e-group-dac/datacommittee_test.go

This file was deleted.

5 changes: 4 additions & 1 deletion ci/e2e-group10/forced_batches_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

const (
toAddressHex = "0x4d5Cf5032B2a844602278b01199ED191A86c93ff"
gerFinalityBlocks = uint64(250)
gerFinalityBlocks = uint64(2500)
forkID5 = 5
)

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

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

// Send forceBatch
tx, err := zkEvm.ForceBatch(auth, txs, tip)
Expand Down Expand Up @@ -226,6 +228,7 @@ func sendForcedBatch(t *testing.T, txs []byte, opsman *operations.Manager) (*sta
finalGer, _, err := st.GetLatestGer(ctx, gerFinalityBlocks)
require.NoError(t, err)
if finalGer.GlobalExitRoot != rootInContractHash {
log.Infof("initialGer.GlobalExitRoot: %v, finalGer.GlobalExitRoot: %v, rootInContractHash: %v", initialGer.GlobalExitRoot.String(), finalGer.GlobalExitRoot.String(), rootInContractHash.String())
log.Fatal("global exit root is not updated")
}
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"crypto/ecdsa"
"errors"
"fmt"
"github.com/ethereum/go-ethereum/common"
"net"
"net/http"
"net/http/pprof"
Expand Down Expand Up @@ -37,6 +36,7 @@ import (
"github.com/0xPolygonHermez/zkevm-node/state"
"github.com/0xPolygonHermez/zkevm-node/state/runtime/executor"
"github.com/0xPolygonHermez/zkevm-node/synchronizer"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/jackc/pgx/v4/pgxpool"
"github.com/prometheus/client_golang/prometheus/promhttp"
Expand Down
12 changes: 6 additions & 6 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ func Test_Defaults(t *testing.T) {
expectedValue: types.NewDuration(5 * time.Second),
},
{
path: "SequenceSender.MaxTxSizeForL1",
expectedValue: uint64(131072),
path: "SequenceSender.MaxBatchesForL1",
expectedValue: uint64(10),
},
{
path: "Etherman.URL",
Expand Down Expand Up @@ -242,7 +242,7 @@ func Test_Defaults(t *testing.T) {
},
{
path: "MTClient.URI",
expectedValue: "zkevm-prover:50061",
expectedValue: "xgon-prover:50061",
},
{
path: "StateDB.User",
Expand All @@ -258,7 +258,7 @@ func Test_Defaults(t *testing.T) {
},
{
path: "StateDB.Host",
expectedValue: "zkevm-state-db",
expectedValue: "xgon-state-db",
},
{
path: "StateDB.Port",
Expand Down Expand Up @@ -319,7 +319,7 @@ func Test_Defaults(t *testing.T) {
},
{
path: "Pool.DB.Host",
expectedValue: "zkevm-pool-db",
expectedValue: "xgon-pool-db",
},
{
path: "Pool.DB.Port",
Expand Down Expand Up @@ -375,7 +375,7 @@ func Test_Defaults(t *testing.T) {
},
{
path: "Executor.URI",
expectedValue: "zkevm-prover:50071",
expectedValue: "xgon-prover:50071",
},
{
path: "Executor.MaxResourceExhaustedAttempts",
Expand Down
2 changes: 1 addition & 1 deletion config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ MaxTxLifetime = "3h"
[SequenceSender]
WaitPeriodSendSequence = "5s"
LastBatchVirtualizationTimeMaxWaitPeriod = "5s"
MaxTxSizeForL1 = 1000
MaxBatchesForL1 = 10
L2Coinbase = "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"
PrivateKey = {Path = "/pk/sequencer.keystore", Password = "testonly"}
UseValidium = true
Expand Down
2 changes: 1 addition & 1 deletion config/environments/local/local.node.config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ MaxTxLifetime = "3h"
[SequenceSender]
WaitPeriodSendSequence = "5s"
LastBatchVirtualizationTimeMaxWaitPeriod = "5s"
MaxTxSizeForL1 = 131072
MaxBatchesForL1 = 10
L2Coinbase = "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"
PrivateKey = {Path = "/pk/sequencer.keystore", Password = "testonly"}

Expand Down
2 changes: 1 addition & 1 deletion config/environments/mainnet/prover.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"starkInfoFile": "zkevm.starkinfo.json",
"starkInfoC12aFile": "zkevm.c12a.starkinfo.json",
"starkInfoRecursive1File": "zkevm.recursive1.starkinfo.json",
"databaseURL": "postgresql://prover_user:prover_pass@zkevm-state-db:5432/prover_db",
"databaseURL": "postgresql://prover_user:prover_pass@xgon-state-db:5432/prover_db",
"dbNodesTableName": "state.nodes",
"dbProgramTableName": "state.program",
"dbAsyncWrite": false,
Expand Down
2 changes: 1 addition & 1 deletion config/environments/testnet/prover.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"starkInfoFile": "zkevm.starkinfo.json",
"starkInfoC12aFile": "zkevm.c12a.starkinfo.json",
"starkInfoRecursive1File": "zkevm.recursive1.starkinfo.json",
"databaseURL": "postgresql://prover_user:prover_pass@zkevm-state-db:5432/prover_db",
"databaseURL": "postgresql://prover_user:prover_pass@xgon-state-db:5432/prover_db",
"dbNodesTableName": "state.nodes",
"dbProgramTableName": "state.program",
"dbAsyncWrite": false,
Expand Down
4 changes: 2 additions & 2 deletions config/metrics/prometheus/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ scrape_configs:
metrics_path: /metrics
static_configs:
- targets:
- zkevm-json-rpc:9091 #inside port of the zkevm-json-rpc
- zkevm-sequencer:9091 #inside port of the zkevm-sequencer
- xgon-json-rpc:9091 #inside port of the xgon-json-rpc
- xgon-sequencer:9091 #inside port of the xgon-sequencer
4 changes: 2 additions & 2 deletions db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (

const (
// StateMigrationName is the name of the migration used by packr to pack the migration file
StateMigrationName = "zkevm-state-db"
StateMigrationName = "xgon-state-db"
// PoolMigrationName is the name of the migration used by packr to pack the migration file
PoolMigrationName = "zkevm-pool-db"
PoolMigrationName = "xgon-pool-db"
)

var packrMigrations = map[string]*packr.Box{
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3.5"
networks:
default:
name: Xgon
name: xgon
services:
xgon-rpc:
container_name: xgon-rpc
Expand Down Expand Up @@ -107,7 +107,7 @@ services:
xgon-prover:
container_name: xgon-prover
restart: unless-stopped
image: hermeznetwork/xgon-prover:v2.2.0
image: hermeznetwork/zkevm-prover:v2.2.0
depends_on:
xgon-state-db:
condition: service_healthy
Expand Down
2 changes: 1 addition & 1 deletion docs/config-file/custom_network-config-doc.html

Large diffs are not rendered by default.

18 changes: 12 additions & 6 deletions docs/config-file/custom_network-config-doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,13 @@ must respect the following conditions
**Type:** : `object`
**Description:** L1: configuration of the network

| Property | Pattern | Type | Deprecated | Definition | Title/Description |
| ----------------------------------------------------------------------------------- | ------- | ---------------- | ---------- | ---------- | ------------------------------------------------ |
| - [chainId](#L1Config_chainId ) | No | integer | No | - | Chain ID of the L1 network |
| - [polygonZkEVMAddress](#L1Config_polygonZkEVMAddress ) | No | array of integer | No | - | Address of the L1 contract |
| - [maticTokenAddress](#L1Config_maticTokenAddress ) | No | array of integer | No | - | Address of the L1 Matic token Contract |
| - [polygonZkEVMGlobalExitRootAddress](#L1Config_polygonZkEVMGlobalExitRootAddress ) | No | array of integer | No | - | Address of the L1 GlobalExitRootManager contract |
| Property | Pattern | Type | Deprecated | Definition | Title/Description |
| ----------------------------------------------------------------------------------- | ------- | ---------------- | ---------- | ---------- | --------------------------------------------------- |
| - [chainId](#L1Config_chainId ) | No | integer | No | - | Chain ID of the L1 network |
| - [polygonZkEVMAddress](#L1Config_polygonZkEVMAddress ) | No | array of integer | No | - | Address of the L1 contract |
| - [maticTokenAddress](#L1Config_maticTokenAddress ) | No | array of integer | No | - | Address of the L1 Matic token Contract |
| - [polygonZkEVMGlobalExitRootAddress](#L1Config_polygonZkEVMGlobalExitRootAddress ) | No | array of integer | No | - | Address of the L1 GlobalExitRootManager contract |
| - [dataCommitteeContract](#L1Config_dataCommitteeContract ) | No | array of integer | No | - | Address of the data availability committee contract |

### <a name="L1Config_chainId"></a>4.1. `L1Config.chainId`

Expand All @@ -117,5 +118,10 @@ must respect the following conditions
**Type:** : `array of integer`
**Description:** Address of the L1 GlobalExitRootManager contract

### <a name="L1Config_dataCommitteeContract"></a>4.5. `L1Config.dataCommitteeContract`

**Type:** : `array of integer`
**Description:** Address of the data availability committee contract

----------------------------------------------------------------------------------------------------------------------------
Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans)
9 changes: 9 additions & 0 deletions docs/config-file/custom_network-config-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@
"maxItems": 20,
"minItems": 20,
"description": "Address of the L1 GlobalExitRootManager contract"
},
"dataCommitteeContract": {
"items": {
"type": "integer"
},
"type": "array",
"maxItems": 20,
"minItems": 20,
"description": "Address of the data availability committee contract"
}
},
"additionalProperties": false,
Expand Down
Loading
Loading