celestiaorg / celestia-node

Celestia Data Availability Nodes
Apache License 2.0
926 stars 924 forks source link

eds/byzantine: Bad encoding fraud proofs need more unit testing #1086

Open musalbas opened 2 years ago

musalbas commented 2 years ago

The current tests for bad encoding fraud proofs are rather sparse.

I believe due to ErrByzantineData returning shares that are bad, as well as good, it shouldn't be possible to generate a bad encoding fraud proof in some cases because it's not possible to get a Merkle proof for the bad reconstructed shares which don't match the Merkle root.

Related: https://github.com/celestiaorg/rsmt2d/issues/112

liamsi commented 2 years ago

Current tests: https://github.com/celestiaorg/celestia-node/blob/00d80c423b2bfacec22a253ce6af3a534a1be3a7/fraud/bad_encoding_test.go#L15

And using a "mock service": https://github.com/celestiaorg/celestia-node/blob/00d80c423b2bfacec22a253ce6af3a534a1be3a7/das/daser_test.go#L257