Skip to content

Commit

Permalink
feat: read max_chunks_per_batch from config.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
yiweichi committed Aug 1, 2024
1 parent 1da6067 commit 2fc37bd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions docker/config-example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ CHAIN_ID_L2 = 222222

MAX_TX_IN_CHUNK = 100
MAX_BLOCK_IN_CHUNK = 100
MAX_CHUNK_IN_BATCH = 15
MAX_L1_MESSAGE_GAS_LIMIT = 10000000

L1_CONTRACT_DEPLOYMENT_BLOCK = 0
Expand Down
4 changes: 2 additions & 2 deletions docker/templates/rollup-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"gas_price_diff": 50000
},
"chain_monitor": {
"enabled": true,
"enabled": false,
"timeout": 3,
"try_times": 5,
"base_url": "http://chain-monitor:8080"
Expand All @@ -72,7 +72,7 @@
"max_uncompressed_batch_bytes_size": 634880
},
"batch_proposer_config": {
"max_chunk_num_per_batch": 15,
"max_chunk_num_per_batch": null,
"max_l1_commit_gas_per_batch": 5000000,
"max_l1_commit_calldata_size_per_batch": 110000,
"batch_timeout_sec": 2700,
Expand Down
2 changes: 2 additions & 0 deletions scripts/deterministic/Configuration.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ abstract contract Configuration is Script {

uint256 internal MAX_TX_IN_CHUNK;
uint256 internal MAX_BLOCK_IN_CHUNK;
uint256 internal MAX_CHUNK_IN_BATCH;
uint256 internal MAX_L1_MESSAGE_GAS_LIMIT;

uint256 internal L1_CONTRACT_DEPLOYMENT_BLOCK;
Expand Down Expand Up @@ -104,6 +105,7 @@ abstract contract Configuration is Script {

MAX_TX_IN_CHUNK = cfg.readUint(".general.MAX_TX_IN_CHUNK");
MAX_BLOCK_IN_CHUNK = cfg.readUint(".general.MAX_BLOCK_IN_CHUNK");
MAX_CHUNK_IN_BATCH = cfg.readUint(".general.MAX_CHUNK_IN_BATCH");
MAX_L1_MESSAGE_GAS_LIMIT = cfg.readUint(".general.MAX_L1_MESSAGE_GAS_LIMIT");

L1_CONTRACT_DEPLOYMENT_BLOCK = cfg.readUint(".general.L1_CONTRACT_DEPLOYMENT_BLOCK");
Expand Down
1 change: 1 addition & 0 deletions scripts/deterministic/GenerateConfigs.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ contract GenerateRollupConfig is DeployScroll {

vm.writeJson(vm.toString(MAX_BLOCK_IN_CHUNK), ROLLUP_CONFIG_PATH, ".l2_config.chunk_proposer_config.max_block_num_per_chunk");
vm.writeJson(vm.toString(MAX_TX_IN_CHUNK), ROLLUP_CONFIG_PATH, ".l2_config.chunk_proposer_config.max_tx_num_per_chunk");
vm.writeJson(vm.toString(MAX_CHUNK_IN_BATCH), ROLLUP_CONFIG_PATH, ".l2_config.batch_proposer_config.max_chunk_num_per_batch");

vm.writeJson(SCROLL_DB_CONNECTION_STRING, ROLLUP_CONFIG_PATH, ".db_config.dsn");
}
Expand Down

0 comments on commit 2fc37bd

Please sign in to comment.