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] Chunk builder's block limit #335

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
14 changes: 13 additions & 1 deletion bin/src/chain_prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ impl ChunkBuilder {
let mut chunk = self.traces.clone();
chunk.push(trace.clone());
self.traces.clear();
self.acc_row_usage_normalized = RowUsage::default();
return Some(chunk);
}
}
Expand Down Expand Up @@ -157,7 +158,18 @@ impl ChunkBuilder {
// Construct chunk myself
async fn prove_by_block(l2geth: &l2geth_client::Client, begin_block: i64, end_block: i64) {
let mut chunk_builder = ChunkBuilder::new();
chunk_builder.block_limit = Some(1);
chunk_builder.block_limit = if let Some(v) = env::var("CHUNK_BLOCK_LIMIT")
.ok()
.and_then(|n| n.parse().ok())
{
if v == 0 {
None
} else {
Some(v)
}
} else {
Some(1)
};
let mut batch_builder = BatchBuilder::new();
let (begin_block, end_block) = if begin_block == 0 && end_block == 0 {
// Blocks within last 24 hours
Expand Down
Loading