-
Notifications
You must be signed in to change notification settings - Fork 80
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
Public API extension proposal #60
Comments
@liamsi, don't have enough rights to set labels/project |
ref: #12 |
we should change that. The labels here are not really set up properly yet anyways. Regarding project/priority: I set this to devnet. The rationale is that this is "just" an optimization, although an important one. So we should decide on and implement it rather sooner than later. Or would you asses the priority differently @Wondertan ? |
Rationally agree about the priority, but my gut tells me to start this sooner than later 😄 |
However, I do not entirely understand how to implement this, besides how to use the proposed API. Also, guess that @adlerjohn will do a better job here and maybe he already has some thoughts on how to. |
We could simply export that logic and use it from several places. I think the API you are proposing makes sense but it is "just" an optimization we can think about later. While at it, I'd also like to improve the readability of some methods. e.g. by reducing the number of parameters for methods. For example, minor things like introducing a struct: type Commitments struct {
rowRoots [][]byte
colRoots [][]byte
} that can be used in all these functions. |
Note that to guarantee we can reconstruct the block, ~3/4 of shares of the EDS must be downloaded. Any less and it's possible that the downloaded shares aren't sufficient to reconstruct the block with a adversarial block proposer. |
We discussed this in some other comment I think, but having an exported function that allows recovering a single row like this one: would be useful. |
But it is still possible to recover with fewer shares, right?
Ok, the interface I proposed assumes that. Can you pls confirm the possibility to implement it and in the best case scenario it will require only a quarter of the shares. |
Yes. If there's nothing malicious going on, you can download exactly 1/4 of EDS shares (i.e. the entire ODS) and recover the whole EDS. |
Motivation and Proposal
Currently, our block data retrieving strategy is this:
The main drawback of the flow is that it does not use all the available leaves and instead optimistically relies only on a subjective random set of leaves. Instead, fetching block's data should try to retrieve all the leaves and repair block data on the go. This way, we would still fetch the same quarter, but naturally selected by network conditions and practical leaves availability on known peers/network.
So the flow will change to:
Ideally, we should support custom fetching/repairing strategies similar to those, but for now, we can aim to support the most efficient one. However, to accomplish this we likely need to update the rsmt2d library API.
Implementation
In case we agree that the proposed flow is a go, we can think of ways to implements it. The biggest issue for fetching/retrieving logic implementation is to know "if we have enough leaves". This can be accomplished through:
RepairExtendedDataSquare
after every new leaf retrieval. This is an overhead as it's a quite expensive operation due to sanity checks with lots of allocations in square flattening and etc.New methods/funcs
The text was updated successfully, but these errors were encountered: