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

[Feature Request]: implement stubs for BadEncodingFraudProofs #263

Closed
adlerjohn opened this issue Dec 6, 2021 · 1 comment
Closed

[Feature Request]: implement stubs for BadEncodingFraudProofs #263

adlerjohn opened this issue Dec 6, 2021 · 1 comment
Assignees
Labels
architecture Architecture / design-related issues area:fraud enhancement New feature or request

Comments

@adlerjohn
Copy link
Member

adlerjohn commented Dec 6, 2021

Summary

Tracking issue: #4

Implement stubs to produce and verify BadEncodingFraudProofs.

Impact on users

BadEncodingFraudProofs are necessary to have secure partial nodes.

Cost of not doing

No partial nodes ☹️

Evidence

No response

Implementation ideas

As the first step towards having BadEncodingFraudProofs, add stubs to the node for functions to produce and verify BadEncodingFraudProofs.

Producing BEFPs

Full node starts performing FullAvailability check.

return share.NewFullAvailability(merkledag.NewSession(fxutil.WithLifecycle(ctx, lc), dag))

During FullAvailability, repairing the square is attempted.

// repair the square
tree := wrapper.NewErasuredNamespacedMerkleTree(uint64(edsWidth) / 2)
return rsmt2d.RepairExtendedDataSquare(rowRoots, colRoots, flattened, codec, tree.Constructor)

The error is returned immediately and not processed. RepairExtendedDataSquare needs to be changed to check that the error is not ErrUnrepairableDataSquare (which indicates a need for more samples, orthogonally), and if not, instead create a BEFP using

  1. The returned ErrByzantineRow or ErrByzantineCol, and,
  2. A Merkle proof for shares in the above error that are missing from the error struct.

The second point will require retrieveShare to return a Merkle proof along with the share value.

go sc.retrieveShare(rootCid, true, row, col, dag)

A produced BEFP must then be disseminated across the network with some new p2p message (a separate issue).

Verifying BEFPs

When receiving a BEFP from the network (a separate issue), it is verified.

Urgency

Medium

@renaynay
Copy link
Member

Closing in favour of #528

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture Architecture / design-related issues area:fraud enhancement New feature or request
Projects
No open projects
Archived in project
Development

No branches or pull requests

2 participants