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 new cdk for seq sender and agg #249

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
/test/datastreamer/*.db/*
/test/*.bin
/test/*.db/*
/test/data

**/.DS_Store
.vscode
Expand Down
13 changes: 10 additions & 3 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ STOPV1TOV2APPROVE := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSENODEAPPROVEV1TOV2) &&

STOPMETRICS := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEMETRICS) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEMETRICS)

STOPDSDATA := rm -rf datastream.bin && rm -rf datastream.db
STOPDSDATA := rm -rf datastream.bin && rm -rf datastream.db && rm -rf data;

STOP := $(DOCKERCOMPOSE) down --remove-orphans

Expand Down Expand Up @@ -706,11 +706,18 @@ run: ## Runs a full node
$(RUNETHTXMANAGER)
$(RUNSEQUENCER)
#$(RUNSIGNER)
$(RUNSEQUENCESENDER)
$(RUNL2GASPRICER)
$(RUNAGGREGATOR)
$(RUNJSONRPC)

docker-compose up -d xlayer-ds
sleep 3
docker-compose up -d xlayer-rpc
docker-compose up -d xlayer-agg-db
sleep 3

docker-compose up -d xlayer-seqs
docker-compose up -d xlayer-agg

.PHONY: run-v1tov2
run-v1tov2: ## Runs a full node using v1tov2 network
$(RUNSTATEDB)
Expand Down
172 changes: 172 additions & 0 deletions test/config/cdk.config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
ForkUpgradeBatchNumber = 0
ForkUpgradeNewForkId = 0

[Log]
Environment = "development" # "production" or "development"
Level = "info"
Outputs = ["stderr"]

[NetworkConfig.L1]
L1ChainID = 1337
PolAddr = "0x5FbDB2315678afecb367f032d93F642f64180aa3"
ZkEVMAddr = "0xeb173087729c88a47568AF87b17C653039377BA6"
RollupManagerAddr = "0x2d42E2899662EFf08b13eeb65b154b904C7a1c8a"
GlobalExitRootManagerAddr = "0xB8cedD4B9eF683f0887C44a6E4312dC7A6e2fcdB"

[Etherman]
URL="http://xlayer-mock-l1-network:8545"
ForkIDChunkSize=100
[Etherman.EthermanConfig]
URL="http://xlayer-mock-l1-network:8545"
MultiGasProvider=false
L1ChainID=1337
HTTPHeaders=[]
[Etherman.EthermanConfig.Etherscan]
ApiKey=""
Url="https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey="

[Common]
NetworkID = 1
IsValidiumMode = true
ContractVersions = "elderberry"

[SequenceSender]
WaitPeriodSendSequence = "15s"
LastBatchVirtualizationTimeMaxWaitPeriod = "10s"
L1BlockTimestampMargin = "30s"
MaxTxSizeForL1 = 131072
L2Coinbase = "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"
PrivateKey = {Path = "/pk/sequencer.keystore", Password = "testonly"}
SequencesTxFileName = "sequencesender.json"
GasOffset = 80000
WaitPeriodPurgeTxFile = "60m"
MaxPendingTx = 1
MaxBatchesForL1 = 300
BlockFinality = "FinalizedBlock"
RPCURL = "http://xlayer-json-rpc:8123"
GetBatchWaitInterval = "10s"
[SequenceSender.EthTxManager]
FrequencyToMonitorTxs = "1s"
WaitTxToBeMined = "2m"
GetReceiptMaxTime = "250ms"
GetReceiptWaitInterval = "1s"
PrivateKeys = [
{Path = "/pk/sequencer.keystore", Password = "testonly"},
]
ForcedGas = 0
GasPriceMarginFactor = 1
MaxGasPriceLimit = 0
StoragePath = "/tmp/cdk/ethtxmanager.sqlite"
ReadPendingL1Txs = false
SafeStatusL1NumberOfBlocks = 0
FinalizedStatusL1NumberOfBlocks = 0
[SequenceSender.EthTxManager.Etherman]
URL = "http://xlayer-mock-l1-network:8545"
MultiGasProvider = false
L1ChainID = 1337
[Aggregator]
# GRPC server host
Host = "0.0.0.0"
# GRPC server port
Port = 50081
RetryTime = "5s"
VerifyProofInterval = "10s"
ProofStatePollingInterval = "5s"
TxProfitabilityCheckerType = "acceptall"
TxProfitabilityMinReward = "1.1"
IntervalAfterWhichBatchConsolidateAnyway="0s"
BatchProofSanityCheckEnabled = true
# ChainID is L2ChainID. Is populated on runtimme
ChainID = 0
ForkId = 9
SenderAddress = "0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
CleanupLockedProofsInterval = "2m"
GeneratingProofCleanupThreshold = "10m"
GasOffset = 0
RPCURL = "http://xlayer-rpc:8545"
WitnessURL = "http://xlayer-rpc:8545"
UseFullWitness = false
SettlementBackend = "l1"
AggLayerTxTimeout = "5m"
AggLayerURL = ""
SyncModeOnlyEnabled = false
[Aggregator.SequencerPrivateKey]
Path = "/pk/sequencer.keystore"
Password = "testonly"
[Aggregator.DB]
Name = "aggregator_db"
User = "aggregator_user"
Password = "aggregator_password"
Host = "xlayer-agg-db"
Port = "5432"
EnableLog = false
MaxConns = 200
[Aggregator.Log]
Environment = "development" # "production" or "development"
Level = "info"
Outputs = ["stderr"]
[Aggregator.EthTxManager]
FrequencyToMonitorTxs = "1s"
WaitTxToBeMined = "2m"
GetReceiptMaxTime = "250ms"
GetReceiptWaitInterval = "1s"
PrivateKeys = [
{Path = "/pk/aggregator.keystore", Password = "testonly"},
]
ForcedGas = 0
GasPriceMarginFactor = 1
MaxGasPriceLimit = 0
StoragePath = "/tmp/cdk/ethtxmanager.sqlite"
ReadPendingL1Txs = false
SafeStatusL1NumberOfBlocks = 0
FinalizedStatusL1NumberOfBlocks = 0
[Aggregator.EthTxManager.Etherman]
URL = "http://xlayer-mock-l1-network:8545"
L1ChainID = 1337
HTTPHeaders = []
[Aggregator.Synchronizer]
[Aggregator.Synchronizer.Log]
Environment = "development" # "production" or "development"
Level = "info"
Outputs = ["stderr"]
[Aggregator.Synchronizer.SQLDB]
DriverName = "sqlite3"
DataSource = "/tmp/cdk/aggregator_sync_db.sqlite"
[Aggregator.Synchronizer.Synchronizer]
SyncInterval = "10s"
SyncChunkSize = 1000
GenesisBlockNumber = 368
SyncUpToBlock = "finalized"
BlockFinality = "finalized"
OverrideStorageCheck = false
[Aggregator.Synchronizer.Etherman]
L1URL = "http://xlayer-mock-l1-network:8545"
ForkIDChunkSize = 100
L1ChainID = 1337
PararellBlockRequest = false
[Aggregator.Synchronizer.Etherman.Contracts]
GlobalExitRootManagerAddr = "0xB8cedD4B9eF683f0887C44a6E4312dC7A6e2fcdB"
RollupManagerAddr = "0x2d42E2899662EFf08b13eeb65b154b904C7a1c8a"
ZkEVMAddr = "0xeb173087729c88a47568AF87b17C653039377BA6"
[Aggregator.Synchronizer.Etherman.Validium]
Enabled = true
# L2URL, empty ask to contract
TrustedSequencerURL = ""
RetryOnDACErrorInterval = "1m"
DataSourcePriority = ["trusted", "external"]
[Aggregator.Synchronizer.Etherman.Validium.Translator]
FullMatchRules = []
[Aggregator.Synchronizer.Etherman.Validium.RateLimit]
NumRequests = 1000
Interval = "1s"
[ReorgDetectorL1]
DBPath = "/tmp/cdk/reorg_detector_l1.sqlite"

[L1InfoTreeSync]
DBPath = "/tmp/cdk/l1_info_tree_sync.sqlite"
GlobalExitRootAddr="0xB8cedD4B9eF683f0887C44a6E4312dC7A6e2fcdB"
RollupManagerAddr = "0x2d42E2899662EFf08b13eeb65b154b904C7a1c8a"
SyncBlockChunkSize=10
BlockFinality="LatestBlock"
WaitForNewBlocksPeriod="100ms"
InitialBlock= 368
4 changes: 4 additions & 0 deletions test/config/ds-config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Server = "xlayer-sequencer:6900"
Port = 7900
File = "/home/dsrelay/datarelay.bin"
Log = "info"
86 changes: 86 additions & 0 deletions test/config/dynamic-mynetwork-allocs.json

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions test/config/dynamic-mynetwork-chainspec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"ChainName": "dynamic-mynetwork",
"chainId": 195,
"consensus": "ethash",
"homesteadBlock": 0,
"daoForkBlock": 0,
"eip150Block": 0,
"eip155Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0,
"muirGlacierBlock": 0,
"berlinBlock": 0,
"londonBlock": 9999999999999999999999999999999999999999999999999,
"arrowGlacierBlock": 9999999999999999999999999999999999999999999999999,
"grayGlacierBlock": 9999999999999999999999999999999999999999999999999,
"terminalTotalDifficulty": 58750000000000000000000,
"terminalTotalDifficultyPassed": false,
"shanghaiTime": 9999999999999999999999999999999999999999999999999,
"cancunTime": 9999999999999999999999999999999999999999999999999,
"pragueTime": 9999999999999999999999999999999999999999999999999,
"ethash": {}
}

6 changes: 6 additions & 0 deletions test/config/dynamic-mynetwork-conf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"root": "0xc48ca035cf2fe444dbedf708ec5ee7e7d1f1fffaccaac6a206f1e14fb488e7c0",
"timestamp": 1715268529,
"gasLimit": 0,
"difficulty": 0
}
87 changes: 87 additions & 0 deletions test/config/test.erigon.rpc.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
datadir: /home/erigon/data/
chain: dynamic-mynetwork
http: true
private.api.addr: localhost:19091
zkevm.l2-chain-id: 195
zkevm.l2-sequencer-rpc-url: http://xlayer-json-rpc:8123
zkevm.l2-datastreamer-url: xlayer-ds:7900
zkevm.l1-chain-id: 1337
zkevm.l1-rpc-url: http://xlayer-mock-l1-network:8545

zkevm.address-sequencer: "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"
zkevm.address-zkevm: "0xeb173087729c88a47568AF87b17C653039377BA6"
zkevm.address-admin: "0x8f8E2d6cF621f30e9a11309D6A56A876281Fd534"
zkevm.address-rollup: "0x2d42E2899662EFf08b13eeb65b154b904C7a1c8a"
zkevm.address-ger-manager: "0xB8cedD4B9eF683f0887C44a6E4312dC7A6e2fcdB"

zkevm.l1-rollup-id: 1
zkevm.l1-first-block: 368
zkevm.l1-block-range: 10
zkevm.l1-query-delay: 6000
zkevm.l1-highest-block-type: latest
zkevm.rpc-ratelimit: 300
zkevm.datastream-version: 2

log.console.verbosity: info

#zkevm.executor-urls: xlayer-executor:50071
zkevm.executor-urls: ""
zkevm.executor-strict: false
zkevm.witness-full: false

zkevm.sequencer-block-seal-time: "6s"
zkevm.sequencer-batch-seal-time: "12s"
zkevm.sequencer-batch-sleep-duration: "0s"

zkevm.data-stream-host: "localhost"
zkevm.data-stream-port: 6900
zkevm.default-gas-price: 1000000000
zkevm.max-gas-price: 0
zkevm.gas-price-factor: 0.000001
zkevm.allow-free-transactions: true
zkevm.allow-internal-transactions: true
externalcl: true
http.api: [eth, debug, net, trace, web3, erigon, txpool, zkevm]
http.addr: 0.0.0.0
http.port: 8545
http.vhosts: any
http.corsdomain: any
http.timeouts.read: "10s"
http.timeouts.write: "10s"
http.timeouts.idle: "10s"
http.methodratelimit: "{\"methods\":[\"eth_syncing\"],\"count\":10,\"bucket\":1}"
# http.apikeys: |
# {"project":"Biconomy","key":"45543e0adc5dd3e316044909d32501a5","timeout":"2030-12-31","methods":["eth_syncing"],"count":10000,"bucket":1}

ws: true

zkevm.apollo-enabled: false
zkevm.apollo-ip-addr: ""
zkevm.apollo-app-id: ""
zkevm.apollo-namespace-name: ""

zkevm.nacos-urls: ""
zkevm.nacos-namespace-id: ""
zkevm.nacos-application-name: ""
zkevm.nacos-external-listen-addr: ""

metrics: true
metrics.addr: "0.0.0.0"
metrics.port: 9095

txpool.globalslots: 100000
networkid: 195

zkevm.pool-manager-url: http://xlayer-pool-manager:8545

http.methodratelimit: "{\"methods\":[\"eth_syncing\"],\"count\":10,\"bucket\":1}"
#http.apikeys: |
# {"project":"project1","key":"944cd2a6939eb23053289d9b91d6c498","timeout":"2033-12-12","methods":["eth_syncing"],"count":5,"bucket":1}

pprof: true
pprof.port: 6060
pprof.addr: 0.0.0.0

db.pagesize: 8KB
db.size.limit: 500MB
db.read.concurrency: 10000
2 changes: 1 addition & 1 deletion test/config/test.executor.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

"aggregatorServerPort": 50081,
"aggregatorClientPort": 50081,
"aggregatorClientHost": "xlayer-aggregator",
"aggregatorClientHost": "xlayer-agg",
"aggregatorClientMockTimeout": 10000000,
"aggregatorClientWatchdogTimeout": 60000000,

Expand Down
2 changes: 1 addition & 1 deletion test/config/test.mock.prover.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

"aggregatorServerPort": 50081,
"aggregatorClientPort": 50081,
"aggregatorClientHost": "xlayer-aggregator",
"aggregatorClientHost": "xlayer-agg",

"mapConstPolsFile": false,
"mapConstantsTreeFile": false,
Expand Down
2 changes: 1 addition & 1 deletion test/config/test.permissionless.prover.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

"aggregatorServerPort": 50081,
"aggregatorClientPort": 50081,
"aggregatorClientHost": "xlayer-aggregator",
"aggregatorClientHost": "xlayer-agg",

"mapConstPolsFile": false,
"mapConstantsTreeFile": false,
Expand Down
2 changes: 1 addition & 1 deletion test/config/test.prover.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

"aggregatorServerPort": 50081,
"aggregatorClientPort": 50081,
"aggregatorClientHost": "xlayer-aggregator",
"aggregatorClientHost": "xlayer-agg",

"mapConstPolsFile": false,
"mapConstantsTreeFile": false,
Expand Down
Loading
Loading