Sha256 circom component does not parallelize at the time to compute the witness. The other rollup-main components (DecodeTx, RollupTx & FeeTx) are already parallelized, being the Sha256 component the one which takes mucht ime to be calculated.
There are two approaches that could be followed when trying to paralleize Sha256:
1 - External intermediary signals
This approach pretends to calculate Sha256 internal blocks outside of the circuit. Therefore, intermediary signals should be added to the rollup-main circuit. Besides, circomlib Sha256 should be adapted to accept those intermediary signalsa nd check them properly.
Following this approach:
small changes on circomlib Sha256
small changes on rollup-main circuit
Javascript and Go implementation to get Sha256 intermediary signals
it will reduce witness time computation
2 - Internal intermediary signals
This approach computes Sha256 internal blocks directly on the circom Sha256 circomlib circuit. No additional signals should be added to the rollup-main circuit but a new Sha256Parallel should be build on circomlib.
Following this approach:
new circomlib Sha256Parallel circuit implementing block computation with no comnstraints
no changes on rollup-main circuit (just changing the template name)
general circomlib implementation to be used for anyone an not for an specific circuit
should be benchmarrking if this approach really redice the witness computation
Overview
Sha256
circom component does not parallelize at the time to compute the witness. The otherrollup-main
components (DecodeTx
,RollupTx
&FeeTx
) are already parallelized, being theSha256
component the one which takes mucht ime to be calculated. There are two approaches that could be followed when trying to paralleizeSha256
:1 - External intermediary signals
This approach pretends to calculate Sha256 internal blocks outside of the circuit. Therefore, intermediary signals should be added to the
rollup-main
circuit. Besides, circomlibSha256
should be adapted to accept those intermediary signalsa nd check them properly.Sha256
rollup-main
circuit2 - Internal intermediary signals
This approach computes Sha256 internal blocks directly on the circom
Sha256
circomlib circuit. No additional signals should be added to therollup-main
circuit but a newSha256Parallel
should be build oncircomlib
.Sha256Parallel
circuit implementing block computation with no comnstraintsrollup-main
circuit (just changing the template name)