Clarification around `rowRoots` provided to `Repair`
rootulp opened this issue · comments
Context
rsmt2d/extendeddatacrossword.go
Lines 59 to 74 in e8e042f
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.
On the complete EDS iirc. In the node we pass there roots from DAH
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)
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.