-
Notifications
You must be signed in to change notification settings - Fork 169
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
Reduce congestion via Aggregating ProveCommits via Inner Product Pairing #50
Comments
Note that this should be done in conjunction with #25 |
Update:
|
Update:
Reach out if you are interested in helping! |
Update:
Questions to answer:
|
For the aggregation versioning question I am currently convinced that the correct thing to do is the solution described in the second paragraph: introduce an independent |
We've used the specs-actors prototype in 1381 to compare gas usage between the current prove commit entrypoint and the proposed aggregate entrypoint. Reposting this summary from slack: PR 1381 contains two tests which measure the gas cost of prove committing x sectors using the current strategy (x invocations of ProveCommit) and the new prototype ProveCommitAggregate. The highlights from the results:
Biggest risks:
Biggest opportunities:
|
I have changed the benchmark so it repeats a few times the operations to smoothen out the results. Here is the resulting CSV file.
|
Updated the benchmark notebook: https://observablehq.com/@protocol/provecommitaggregate-notebook, hopefully this should give much better results! |
Hi , I have met the panic problem about commit aggregate failed, who can help me to solve it? Thanks. {“level”:“warn”,“ts”:“2021-07-02T12:08:48.101+0800",“logger”:“sectors”,“caller”:“storage-sealing/fsm.go:627",“msg”:“sector 2393 got error event sealing.SectorCommitFailed: aggregate error: aggregating proofs: Rust panic: Once instance has previously been poisoned”} {"level":"warn","ts":"2021-07-02T12:04:52.703+0800","logger":"sectors","caller":"storage-sealing/fsm.go:627","msg":"sector 2396 got error event sealing.SectorCommitFailed: aggregate error: aggregating proofs: Rust panic: no unwind information"} |
Marking as inactive due to the passage of FIP-0013 |
Problem
(same as #49 )
(however, differently from #49)
ProveCommits messages and gas used scale linearly with network growth.
Proposed solution
(similar to #49)
Processing multiple ProveCommits at the same time can drastically reduce the gas used per sector, leading to a much lower gas usage from ProveCommits. We propose to add a new method: "ProveCommitAggregated".
(differently from #49)
The ProveCommitAggregated method allows for gas used in the network to scale sub-linearly with the growth of the network. A miner can submit a single short proof for many ProveCommits and the gas used for verification is sublinear in the ProveCommits aggregated. In other words, miners could be making a single ProveCommitAggregated transaction per day, instead of one per sector or one per batch of sectors.
There are ~6M individual SNARK are published on chain per day, largest miner publishes ~600k of them. With this solution - at least in theory - we would need a single SNARK per miner ~700. If we assume that miners only batch every 1,000 proofs on average, the SNARKs published per day would be ~6,000.
There are two parts that can be amortized:
Context on Groth16 aggregation
The Protocol Labs team in collaboration with external researchers and engineers has improved the performances of the rust implementation of the IPP protocol (see ripp). The inner product pairing protocol for aggregating groth16 proofs has been described in this paper.
In high level, the idea is the following: given X Groth16 proofs, we can generate a single proof that these were correctly aggregated in a single proof.
Our preliminary result show that a prover can aggregate up to ~65,000 SNARKs (6,500 ProveCommits) in a size of ~78kB and with verification time of ~150ms.
Note the this type of aggregation sits on top of the existing SNARKs that we do. In other words, there is no need for a new trusted setup.
Comparison with #49 (Batching ProveCommits)
The size of an aggregated proof grows logarithmically in the numbers of proofs to aggregate, differently with batching, where the proof size scales linearly.
In other words, proposal #49 ProveCommitBatched has a limitation in the numbers of proofs to be aggregated, while ProveCommitAggregatedIPP does not. This opens up the possibility for miners to submit a daily single proof of new storage being added.
Outline
With this mechanism, miners should always prefer to aggregate multiple proofs together since they would be substantially reduce their costs.
Discussion
This issue is intended for discussion. There are a number of details to work out before drafting a FIP.
Aggregation parameters
This is a test that aggregates 65536 SNARKs (~6,500 poreps) with a proof size of 78kB and verification time of 197ms
Open questions:
Note there is a separate line of investigation to propose ProveCommitAggregated with Halo instead of IPP, however it seems that IPP would be ready to be used faster than Halo.
The text was updated successfully, but these errors were encountered: