Skip to content

Commit

Permalink
add cardona testnet (#2909)
Browse files Browse the repository at this point in the history
  • Loading branch information
tclemos authored Dec 14, 2023
1 parent 5b01e7c commit acb2cdc
Show file tree
Hide file tree
Showing 13 changed files with 1,167 additions and 11 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,18 @@ jobs:
uses: olegtarasov/get-tag@v2.1.2
id: tagName

- name: Put testnet and mainnet artifacts into a single zip
- name: Put cardona, testnet and mainnet artifacts into a single zip
run: |
# CARDONA
mkdir -p cardona/config/environments/cardona
mkdir -p cardona/db/scripts
cp config/environments/cardona/* cardona/config/environments/cardona
cp docker-compose.yml cardona
sed -i 's/\/config\/environments\/${ZKEVM_NETWORK}/\/config\/environments\/cardona/g' cardona/docker-compose.yml
cp db/scripts/init_prover_db.sql cardona/db/scripts
mv cardona/config/environments/cardona/example.env cardona
sed -i -e "s/image: zkevm-node/image: hermeznetwork\/zkevm-node:$GIT_TAG_NAME/g" cardona/docker-compose.yml
zip -r cardona.zip cardona
# TESTNET
mkdir -p testnet/config/environments/testnet
mkdir -p testnet/db/scripts
Expand All @@ -56,10 +66,10 @@ jobs:
sed -i -e "s/image: zkevm-node/image: hermeznetwork\/zkevm-node:$GIT_TAG_NAME/g" mainnet/docker-compose.yml
zip -r mainnet.zip mainnet
- name: Publish testnet and mainnet zip into release
- name: Publish cardona, testnet and mainnet zip into release
uses: AButler/upload-release-assets@v2.0
with:
files: 'testnet.zip;mainnet.zip'
files: 'cardona.zip;testnet.zip;mainnet.zip'
repo-token: ${{ secrets.TOKEN_RELEASE }}
release-tag: ${{ steps.tagName.outputs.tag }}

2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var (
networkFlag = cli.StringFlag{
Name: config.FlagNetwork,
Aliases: []string{"net"},
Usage: "Load default network configuration. Supported values: [`mainnet`, `testnet`, `custom`]",
Usage: "Load default network configuration. Supported values: [`mainnet`, `testnet`, `cardona`, `custom`]",
Required: true,
}
customNetworkFlag = cli.StringFlag{
Expand Down
107 changes: 107 additions & 0 deletions config/cardonagenesis.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const (
FlagYes = "yes"
// FlagCfg is the flag for cfg.
FlagCfg = "cfg"
// FlagNetwork is the flag for the network name. Valid values: ["testnet", "mainnet", "custom"].
// FlagNetwork is the flag for the network name. Valid values: ["testnet", "mainnet", "cardona", "custom"].
FlagNetwork = "network"
// FlagCustomNetwork is the flag for the custom network file. This is required if --network=custom
FlagCustomNetwork = "custom-network-file"
Expand Down
9 changes: 9 additions & 0 deletions config/environments/cardona/example.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ZKEVM_NETWORK = "cardona"
# URL of a JSON RPC for Goerli
ZKEVM_NODE_ETHERMAN_URL = "http://your.L1node.url"
# PATH WHERE THE STATEDB POSTGRES CONTAINER WILL STORE PERSISTENT DATA
ZKEVM_NODE_STATEDB_DATA_DIR = "/path/to/persistent/data/statedb"
# PATH WHERE THE POOLDB POSTGRES CONTAINER WILL STORE PERSISTENT DATA
ZKEVM_NODE_POOLDB_DATA_DIR = "/path/to/persistent/data/pooldb"
# OPTIONAL, UNCOMENT IF YOU WANT TO DO ADVANCED CONFIG
# ZKEVM_ADVANCED_CONFIG_DIR = "/should/be/same/path/as/ZKEVM_CONFIG_DIR"
93 changes: 93 additions & 0 deletions config/environments/cardona/node.config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
[Log]
Environment = "development" # "production" or "development"
Level = "info"
Outputs = ["stderr"]

[State]
[State.DB]
User = "state_user"
Password = "state_password"
Name = "state_db"
Host = "zkevm-state-db"
Port = "5432"
EnableLog = false
MaxConns = 200
[State.Batch]
[State.Batch.Constraints]
MaxTxsPerBatch = 300
MaxBatchBytesSize = 120000
MaxCumulativeGasUsed = 30000000
MaxKeccakHashes = 2145
MaxPoseidonHashes = 252357
MaxPoseidonPaddings = 135191
MaxMemAligns = 236585
MaxArithmetics = 236585
MaxBinaries = 473170
MaxSteps = 7570538

[Pool]
IntervalToRefreshBlockedAddresses = "5m"
IntervalToRefreshGasPrices = "5s"
MaxTxBytesSize=100132
MaxTxDataBytesSize=100000
DefaultMinGasPriceAllowed = 1000000000
MinAllowedGasPriceInterval = "5m"
PollMinAllowedGasPriceInterval = "15s"
AccountQueue = 64
GlobalQueue = 1024
[Pool.DB]
User = "pool_user"
Password = "pool_password"
Name = "pool_db"
Host = "zkevm-pool-db"
Port = "5432"
EnableLog = false
MaxConns = 200

[Etherman]
URL = "http://your.L1node.url"
ForkIDChunkSize = 20000
MultiGasProvider = false
[Etherman.Etherscan]
ApiKey = ""

[RPC]
Host = "0.0.0.0"
Port = 8545
ReadTimeout = "60s"
WriteTimeout = "60s"
MaxRequestsPerIPAndSecond = 5000
EnableL2SuggestedGasPricePolling = false
[RPC.WebSockets]
Enabled = true
Port = 8546

[Synchronizer]
SyncInterval = "2s"
SyncChunkSize = 100

[MTClient]
URI = "zkevm-prover:50061"

[Executor]
URI = "zkevm-prover:50071"
MaxResourceExhaustedAttempts = 3
WaitOnResourceExhaustion = "1s"
MaxGRPCMessageSize = 100000000

[Metrics]
Host = "0.0.0.0"
Port = 9091
Enabled = false
ProfilingHost = "0.0.0.0"
ProfilingPort = 6060
ProfilingEnabled = false

[HashDB]
User = "prover_user"
Password = "prover_pass"
Name = "prover_db"
Host = "zkevm-state-db"
Port = "5432"
EnableLog = false
MaxConns = 200
Loading

0 comments on commit acb2cdc

Please sign in to comment.