-
Notifications
You must be signed in to change notification settings - Fork 386
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
feat(ProcessProposal)!: Check for message inclusion using subtree roots #747
Conversation
still have to rebase to fix the git history, so leaving as a draft |
… used to. The current way causes bugs as its not doing what we thought it was.
This reverts commit 9e01bd3.
b127e43
to
555c436
Compare
Codecov Report
@@ Coverage Diff @@
## main #747 +/- ##
==========================================
- Coverage 42.16% 42.07% -0.10%
==========================================
Files 42 42
Lines 4383 4383
==========================================
- Hits 1848 1844 -4
- Misses 2387 2390 +3
- Partials 148 149 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
tree := wrapper.NewErasuredNamespacedMerkleTree(appconsts.MaxSquareSize) | ||
// create the nmt todo(evan) use nmt wrapper | ||
tree := nmt.New(sha256.New()) | ||
for _, leaf := range set { | ||
nsLeaf := append(make([]byte, 0), append(namespace, leaf...)...) | ||
// here we hardcode pushing as axis 0 cell 0 because we never want | ||
// to add the parity namespace to our shares when we create roots. | ||
tree.Push(nsLeaf, rsmt2d.SquareIndex{Axis: 0, Cell: 0}) | ||
err := tree.Push(nsLeaf) | ||
if err != nil { | ||
return nil, err | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
had to revert this change from #618 to get the commitments to match, which was really weird. I'm still unsure why this is and requires further debugging. We are using the nmt wrapper to create row and col roots, so it only makes sense to use them when we create commitment so that they match.
func DelimLen(size uint64) int { | ||
lenBuf := make([]byte, binary.MaxVarintLen64) | ||
return binary.PutUvarint(lenBuf, size) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverted this change to calculate the delim len how we used to, as the new way wasn't doing what we thought. We still need to add a unit test to make sure we don't make the same mistake again. This is implicitly tested in the new fuzzer added in this PR, and message inclusion checks.
Co-authored-by: Rootul P <[email protected]>
as noticed in #804 (comment), I forgot to delete the old `DelimLen` function after fixing a bug in #747.
…ts (celestiaorg#747) Co-authored-by: Rootul P <[email protected]>
as noticed in celestiaorg#804 (comment), I forgot to delete the old `DelimLen` function after fixing a bug in celestiaorg#747.
This PR updates
ProcessProposal
to use subtree roots to check for message inclusion, instead of only relying on comparing the commitments.This is last non-interactive defaults PR 🎉
closes #383