-
Notifications
You must be signed in to change notification settings - Fork 87
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
Partial fanout #1468
Comments
@colll78 is this related to how you aim to do things in Midgard? |
I reached out to Thomas a few weeks ago to discuss the potential of using the BLS accumulator for the Midgard inbox / outbox contracts. To have an optimistic rollup truly inherit L1 security, you need to have a mechanism through which users can transact on the L2 directly via L1 transactions (as opposed to submitting the tx to the L2 validator network). To achieve this, you have an inbox contract that users can send transactions to on the L1, and any state commitments (containing batches of incoming blocks from the L2) must include the transactions in the inbox in their commitment (emptying the inbox in the process). The state commitment is invalidated if it does not contain all the pending transactions from the inbox. Currently, the inbox stores these pending txs in a sparse merkle tree and the process of guaranteeing inclusion involves providing a one-by-one proof of inclusion of each inbox transaction in the incoming state commitment (which updates each inbox entry to prevent re-use of the same membership proof). The BLS accumulator can likely be used here to vastly speed up this process with the batched membership proofs. Current focus is on implementing fraud proof validators so this is on the backburner for now. |
@perturbing created the optimized rust accumulator and already demonstrated using it from haskell here |
A small update, for prover times (on my beefy machine), for sets of the following sizes, proof creation over G2 takes roughly
To run such a test yourself for different sizes, change the PS: there is a known issue in linking the rust -> C -> haskell code on mac (I do not own a mac, so could not reproduce it yet). |
Note: hydra-doom requires around 2-3 ms creation time for snapshots; (below 10 UTxOs); what do the benchmarks looks like in that domain? |
It depends on the machine ofc, but on my beefy laptop
So, that sounds doable, though this an isolated measurment of only the core functionality. |
Why
The current naiive, but correct implementation (see #145) of representing L2 UTxO in the Head validators is limiting the number of UTXOs supported in a Hydra Head (currently about 80 ada-only outputs, see benchmarks)
This is an all-or-nothing approach and the
fanout
can only succeed if all UTxOs are produced in a single transaction. This means, there is no way to finalize a head which exceeds these limits!Within this feature, we want to overcome this limitation by enabling individual (subsets of) outputs to be realized onto the main chain after the contestation deadline passed.
This is similar to #190, but allows for individual UTxOs to be realized and hence can even work around situations where some parts of the state are not compatible with the L1 (e.g. min UTxO value not met)
What
The
hydra-node
when asked toFanout
a head can fanout any size of UTxO set with one or more (partial)fanout
transactionsOut of scope: asking
hydra-node
deliberatly picking a subset of UTxO to fanout.Head protocol
fanout
transactions allow arbitrary subset of closed UTxO to be realized onto the main chain.fanout
transaction.fanout
transactions can be sequenced in the protocol (as long as there are outputs left to fanout).Maintain offchain performance in the same order of magnitude
How
Idea: We update the digest mechanism used in
collect
, (increment
/decrement
) andclose
transactions in such a way to allow for exclusion proofs infanout
transactions.Using BLS accumulators as researched and experimented by @perturbing in https://github.com/perturbing/plutus-accumulator and https://hackmd.io/@CjIlIbTxRqWOCpWzxuWmkQ/BybaUlSN0
Possible tasks:
collect
,abort
andfanout
) #1667ModelSpec
where the test just saysClose
andFanout
TBD: Off-chain performance is still to be benchmarked and might impact snapshot signing performance on the L2
The text was updated successfully, but these errors were encountered: