-
Notifications
You must be signed in to change notification settings - Fork 298
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
Decouple PartSetHeader from BlockID #441
Decouple PartSetHeader from BlockID #441
Conversation
6c2ba43
to
d3c1e7d
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Besides the hardcoded tests, only the e2e test is failing. The logs show that all the nodes are working fine except edit: resolved 4f064db I just missed passing the partsetheader there was all |
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.
I tried to be careful to not actually change any functionality, and strictly decouple partsetheader from the blockID.
The main breaking change is that the Key
method for BlockID
no longer returns a string that includes the PartSetHeader
's hash and total.
https://github.com/celestiaorg/lazyledger-core/blob/f639bee4e2219ad11ee3f7efc15d77325cbb71a8/types/block.go#L1616-L1619
Ideally, most of the additions of the PartSetHeader
introduced in this PR will be undone. I think this is a great starting point to begin removing the PartSetHeader
, as we can now test smaller removals individually. We could also get rid of the BlockID struct, and just use []byte
or tmbytes.HexBytes
, but I felt like there were enough changes in this PR as is.
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.
Left some nits and refs to todos not be missed. Mostly, I have nothing valuable to add as the change is fairly simple, even though it affects the entire codebase. Another step further, thanks @evan-forbes!
Co-authored-by: Hlib Kanunnikov <hlibwondertan@gmail.com>
BlockID: types.BlockID{Hash: hash}, | ||
PartSetHeader: header, | ||
} | ||
v := vote.ToProto() | ||
err = vs.PrivValidator.SignVote(config.ChainID(), v) |
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.
Question: Wasn't the conclusion that at the voting stage we don't need to sign over the PartsSetHeader anymore? It's probably a good idea to leave it as is in this PR and focus on the decoupling but it seems important to notice as we at least want the commits not be over the PartSetHeader (otherwise verifying a commit sign still means verifying two commitments to the data). We should track this in an issue too.
cc @adlerjohn
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.
Right, you don't want any signatures that end up in the Commit to be over the PartSetHeader (or its hash), otherwise you'll have this dangling hash that can't be validated. There's an open issue for specifying what's in the commit signatures: celestiaorg/celestia-specs#92, which is now relevant.
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.
definitely, I can open an issue for it. Due to the large number of changes necessary to decouple the PSH from the BlockID, I purposefully left this in. The idea being that we can make important changes in a more targeted PRs.
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.
ref #456
Codecov Report
@@ Coverage Diff @@
## master #441 +/- ##
==========================================
- Coverage 61.76% 61.65% -0.12%
==========================================
Files 263 263
Lines 23003 23119 +116
==========================================
+ Hits 14207 14253 +46
- Misses 7292 7343 +51
- Partials 1504 1523 +19
|
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.
Dope! Would you be up to summarize the rationale behind this (just really briefly) in an ADR? I'm also wondering if we should try to upstream this to tendermint (in combination with some modified version of #457 without the DAHeader).
cc @marbar3778
DAHeader *DataAvailabilityHeader `json:"da_header"` | ||
PartSetHeader PartSetHeader `json:"part_set_header"` |
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.
Can we add a comment ontop of both fields why both are needed here (at this stage)?
This reverts commit 9d4265d.
* Revert "Remove the PartSetHeader from VoteSetMaj23, VoteSetBits, and state.State (#479)" This reverts commit 3ba47c2. * Revert "Stop Signing over the `PartSetHeader` for Votes and remove it from the `Header` (#457)" This reverts commit 818be04. * Revert "Decouple PartSetHeader from BlockID (#441)" This reverts commit 9d4265d.
* Revert "Remove the PartSetHeader from VoteSetMaj23, VoteSetBits, and state.State (#479)" This reverts commit 3ba47c2. * Revert "Stop Signing over the `PartSetHeader` for Votes and remove it from the `Header` (#457)" This reverts commit 818be04. * Revert "Decouple PartSetHeader from BlockID (#441)" This reverts commit 9d4265d. * Revert "Save and load block data using IPFS (#374)" This reverts commit 8da1644. * fix merge error * Revert "Add the ipfs dag api object in Blockstore (#356)" and get rid of embedded ipfs objects This reverts commit 40acb17. * remove ipfs node provider from new node * stop init ipfs repos * remove IPFS node config * clean up remaining ipfs stuff
* Update go-built-in.md (#438) (cherry picked from commit 06eeaaa) # Conflicts: # docs/tutorials/go-built-in.md * Revert "Update go-built-in.md (#438)" This reverts commit b197c0883dad94b03d80aba709798e6a80ba103f. * Update go-built-in.md (#438) --------- Co-authored-by: Aliasgar Merchant <44069404+alijnmerchant21@users.noreply.github.com> Co-authored-by: Sergio Mena <sergio@informal.systems> Co-authored-by: Adi Seredinschi <adizere@gmail.com> Co-authored-by: lasarojc <lasaro@informal.systems>
Description
This PR is strictly moving the
PartSetHeader
outside of theBlockID
. Afterwords, it should be easier to decide exactly what to do with thePartSetHeader
in each scenario.PartSetHeader
to structs that have theBlockID
PartSetHeader
fromBlockID
PartSetHeader
Part 1/? to help remove the
PartSetHeader
#418Closes: #XXX