0xPolygonZero / zk_evm

Apache License 2.0
80 stars 35 forks source link

Make block pool size customizable #626

Closed Nashtare closed 1 week ago

Nashtare commented 2 weeks ago

The code snippet below:

// All proving tasks are executed concurrently, which can cause issues for large
// block intervals, where distant future blocks may be proven first.
//
// We then create a pool to limit the number of parallel proving block
// tasks, retrieving new blocks in increasing order when some block proofs are
// complete.
//
// While proving a block interval, we will output proofs corresponding to block
// batches as soon as they are generated.
const PARALLEL_BLOCK_PROVING_PERMIT_POOL_SIZE: usize = 16;
static PARALLEL_BLOCK_PROVING_PERMIT_POOL: Semaphore =
    Semaphore::const_new(PARALLEL_BLOCK_PROVING_PERMIT_POOL_SIZE);

is kind of limiting. I have to manually tweak it when testing every time, and will be heavily impacted by the activity of the targeted network, so it would be preferable to have it as configurable.