Skip to content

Commit 4e429d4

Browse files
committed
Update batch configuration and environment variables for data availability worker
1 parent 57ddc24 commit 4e429d4

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

README.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,6 @@ proxy-relay:
291291
- LEGACY_BRIDGE_TESTING=1
292292
# - IPFS_API_URL=http://ipfs:5001
293293
- ML_RPC_URL=http://host.docker.internal:13034 # change to mainnet if needed
294-
- ML_BATCH_SIZE=10 # change if necessary
295294
- 4EVERLAND_API_KEY= XXXXX
296295
- 4EVERLAND_SECRET_KEY= XXXX
297296
- 4EVERLAND_BUCKET_NAME=zkthunder # only for test
@@ -317,8 +316,6 @@ In zkthunder’s environment settings:
317316
318317
- **ML_RPC_URL** stands for the RPC wallet port of Mintlayer.
319318
320-
- **ML_BATCH_SIZE** controls the frequency of sending data to Mintlayer.
321-
322319
- **4EVERLAND_API_KEY, 4EVERLAND_SECRET_KEY, 4EVERLAND_BUCKET_NAME** these three variables stand for a specific bucket
323320
on 4everland, we upload the block information to it.
324321
@@ -344,14 +341,14 @@ tracing::info!( "put {} to ipfs and get response code: {:?}",
344341
345342
Note that three batches is related to one block. And every time we add a batch’s data to the 4everland bucket, the
346343
storage network will respond with an ipfs hash value. We collect such value until the number of responses reach the
347-
threshold of **BATCH_SIZE\*3**.
344+
threshold of **BATCH_SIZE**.
348345
349346
Then, we upload these all hash values as a file to 4everland storage:
350347
351348
```rust
352349
353350
// if block_number reaches the BATCH_SIZE, report the hashes to ipfs and then mintlayer
354-
let batch_size: usize = env::var("ML_BATCH_SIZE")
351+
let batch_size: usize = env::var("BATCH_SIZE")
355352
.ok()
356353
.and_then(|v| v.parse().ok())
357354
.unwrap_or(10 as usize);

local-setup/.env.example

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ CF_ZONE_API_TOKEN=your-zone-api-token
3737
4EVERLAND_API_KEY=your-4everland-api-key
3838
4EVERLAND_SECRET_KEY=your-4everland-secret-key
3939
4EVERLAND_BUCKET_NAME=zkthunder-2
40+
BATCH_SIZE=30
4041

4142
#######################
4243
# MintLayer Configuration
@@ -46,7 +47,6 @@ ML_RPC_URL=http://wallet-rpc-daemon:13034
4647
ML_RPC_USERNAME=wallet_rpc_user
4748
ML_RPC_PASSWORD=your-secure-password
4849
ML_MNEMONIC=your-wallet-mnemonic
49-
ML_BATCH_SIZE=10
5050

5151
# Node Configuration
5252
ML_TESTNET_NODE_RPC_BIND_ADDRESS=0.0.0.0:13030
@@ -79,6 +79,7 @@ CHAIN_ETH_ZKSYNC_NETWORK=zkthunder
7979
CHAIN_ETH_ZKSYNC_NETWORK_ID=4237
8080
CONTRACTS_ERA_CHAIN_ID=4237
8181
LEGACY_BRIDGE_TESTING=1
82+
CHAIN_STATE_KEEPER_BLOCK_COMMIT_DEADLINE_MS=30000
8283

8384
#######################
8485
# Accounts Configuration

local-setup/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ Default metrics collected from:
9898
- `4EVERLAND_API_KEY`: API key from 4EVERLAND
9999
- `4EVERLAND_SECRET_KEY`: Secret key from 4EVERLAND
100100
- `4EVERLAND_BUCKET_NAME`: Your bucket name in 4EVERLAND
101+
- `BATCH_SIZE`: The number of IPFS CIDs to consolidate into a single IPFS CID batch, should be a multiple of 3
101102

102103
#### MintLayer Configuration
103104

@@ -403,6 +404,10 @@ All services will be accessible as subdomains of this domain.
403404
- `ML_TESTNET_NODE_RPC_PASSWORD`
404405
- `ML_TESTNET_WALLET_RPC_DAEMON_RPC_PASSWORD`
405406

407+
408+
#### Chain State Keeper Configuration
409+
- `CHAIN_STATE_KEEPER_BLOCK_COMMIT_DEADLINE_MS`: This variable defines the maximum time limit, in milliseconds, for the batch commit process to Layer 1
410+
406411
### Deploying L2 Faucet
407412

408413
You can deploy a faucet contract on the L2 network to allow users to request test ETH. Here's how to set it up:

local-setup/docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ services:
143143
--http.corsdomain "*"
144144
--http.addr 0.0.0.0
145145
--http.port 8545
146-
--dev.block-time 2000ms
146+
--dev.block-time 6000ms
147147
--chain /chaindata/reth_config
148148
environment:
149149
RUST_LOG: ${RUST_LOG:-info}

0 commit comments

Comments
 (0)