Skip to content
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

Clarification around rowRoots provided to Repair #220

Closed
rootulp opened this issue Jul 5, 2023 · 3 comments · Fixed by #240
Closed

Clarification around rowRoots provided to Repair #220

rootulp opened this issue Jul 5, 2023 · 3 comments · Fixed by #240
Assignees
Labels
question Further information is requested

Comments

@rootulp
Copy link
Collaborator

rootulp commented Jul 5, 2023

Context

// Repair attempts to repair an incomplete extended data
// square (EDS), comparing repaired rows and columns against expected Merkle
// roots.
//
// # Input
//
// Missing shares must be nil.
//
// # Output
//
// The EDS is modified in-place. If repairing is successful, the EDS will be
// complete. If repairing is unsuccessful, the EDS will be the most-repaired
// prior to the Byzantine row or column being repaired, and the Byzantine row
// or column prior to repair is returned in the error with missing shares as
// nil.
func (eds *ExtendedDataSquare) Repair(

Question

Should the rowRoots and columnRoots that are provided to Repair be the row roots that are computed on the complete EDS or the incomplete EDS? I assume the complete EDS because computing row roots for an incomplete EDS is undefined behavior (see #122).

However, if the row roots are indeed the ones computed on the complete EDS prior to shares being removed, I don't understand why this test exists. I would expect every test case in that test to fail because Repair is being called with bad roots. The only reason test cases in that test pass is because row roots are being computed after shares are removed from the data square which is undefined behavior.

@Wondertan
Copy link
Member

On the complete EDS iirc. In the node we pass there roots from DAH

@staheri14
Copy link
Contributor

staheri14 commented Jul 5, 2023

However, if the row roots are indeed the ones computed on the complete EDS prior to shares being removed, I don't understand why this test exists. I would expect every test case in that test to fail because Repair is being called with bad roots. The only reason test cases in that test pass is because row roots are being computed after shares are removed from the data square which is undefined behavior.

Interestingly, I also contemplated the same issue yesterday regarding why roots are computed from the corrupted EDS. As mentioned by @Wondertan, the roots should be derived from the DA header, which, in the tests, represents the roots of the sample EDS before it got corrupted.

Regarding the specific test, my understanding is that it seems to aim at examining whether a full node can identify faulty erasure coding, even when the roots of the DA header are corrupted, meaning they were computed from a corrupted EDS.
However, even if this is the scenario, I am still unsure why one can even compute a row root while some shares are nil as also mentioned in this issue #214 (in this test, some shares in the EDS are set to nil, and then the roots are computed from the altered EDS)

@rootulp
Copy link
Collaborator Author

rootulp commented Jul 5, 2023

I am still unsure why one can even compute a row root while some shares are nil

+1. If an EDS contains nil shares, I think RowRoots should return an error.

@rootulp rootulp self-assigned this Jul 7, 2023
rootulp added a commit that referenced this issue Jul 10, 2023
0xchainlover pushed a commit to celestia-org/rsmt2d that referenced this issue Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants