Description
Collecting tasks from #1372:
- currently in Phase 2 in
Initialize
method we first obtaincoeffTau1
,coeffTau2
,coeffAlphaTau1
andcoeffBetaTau1
and then compute the updated Phase2 key from the circuit description (the big loop which iterates over constraints). This means that we first need to allocate possibly very big slices and then perform computations on the slice elements. Maybe (needs to be benchmarked) it is fine if we only allocate every slice individually and then iterate for every slice the constraints separately. For large circuits this could potentially save tens of GBs of memory we need to allocate. - for the serialization we could additionally implement
io.UnsafeReaderFrom
andio.BinaryDumper
interfaces. The idea is that when the sequencer stores the contributions, then it doesn't have to do expensive checks when restoring state from storage.- However, when we implement
io.UnsafeReaderFrom
then we need to consider that theVerify
methods ofPhase1
andPhase2
do not explicitly do subgroup checks and depend that the subgroups checks are done at deserialization. So keep in mind when implementing
- However, when we implement
- allow providing randomness source directly to the contribution. We currently by default use
rand.Reader
which is secure, but in some cases would wan't to use something else (for example for some ceremonial contributions ). - in
srsCommons.update
method we currently don't parallelize the computations. We could do it quite nicely as every loop depends directly ontau
, so it should be sufficient if we only compute the starting pointstau
,tau^k
,tau^2k
etc. - we should be able to provide the hash function as a parameter when computing challenge. It would allow to do cool things like SNARK proofs of ceremony contribution correctness