-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Update ckzg4844 to latest version of das branch #14223
Conversation
beacon-chain/blockchain/kzg/kzg.go
Outdated
@@ -2,14 +2,24 @@ package kzg | |||
|
|||
import ( | |||
"errors" | |||
fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" |
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.
This shim file was intentionally made to not rely on other parts of the code -- Can you define NumOfColumns in this file as an alias for CellsPerExtBlob?
The idea is that this file and code by itself can be tested and checked to be correct in isolation to the rest of the code
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.
If the length only exists in that package, I don't think it makes sense to have it at all. I've pushed a commit which changes CellsAndProofs
to use slices instead of arrays. Open to changing it though.
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 think it ideally gets checked by the caller who knows fieldparams.NumOfColumns
-- There should probably be a check/test that breaks if ckzg.CellsPerExtBlob != fieldparams.NumOfColumns
, since these values come from two different sources but should be the same.
If c-kzg for example, were to return less cells than the client code is expecting due to the params, then this would be caught by that test.
RE changing to slice, imo ideally this PR just updates the dependency and other changes which are not necessary are done in a separate PR.
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 don't like making this change in this PR either. But it was using a constant which no longer exists. ckzg.CellsPerExtBlob
isn't available anymore, it's been made private.
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.
Oh I didn't realise that CellsPerExtBlob was now private from ckzg -- whether that should be private is out of scope of this PR, so this change makes sense in that context.
This test fails.
|
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.
Crypto(kzg.go) changes look good to me (Can't explicitly approve)
All green, thanks a lot! |
* Update ckzg4844 to latest version * Run go mod tidy * Remove unnecessary tests & run goimports * Remove fieldparams from blockchain/kzg * Add back blank line * Avoid large copies * Run gazelle * Use trusted setup from the specs & fix issue with struct * Run goimports * Fix mistake in makeCellsAndProofs --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update ckzg4844 to latest version * Run go mod tidy * Remove unnecessary tests & run goimports * Remove fieldparams from blockchain/kzg * Add back blank line * Avoid large copies * Run gazelle * Use trusted setup from the specs & fix issue with struct * Run goimports * Fix mistake in makeCellsAndProofs --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update ckzg4844 to latest version * Run go mod tidy * Remove unnecessary tests & run goimports * Remove fieldparams from blockchain/kzg * Add back blank line * Avoid large copies * Run gazelle * Use trusted setup from the specs & fix issue with struct * Run goimports * Fix mistake in makeCellsAndProofs --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update ckzg4844 to latest version * Run go mod tidy * Remove unnecessary tests & run goimports * Remove fieldparams from blockchain/kzg * Add back blank line * Avoid large copies * Run gazelle * Use trusted setup from the specs & fix issue with struct * Run goimports * Fix mistake in makeCellsAndProofs --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update ckzg4844 to latest version * Run go mod tidy * Remove unnecessary tests & run goimports * Remove fieldparams from blockchain/kzg * Add back blank line * Avoid large copies * Run gazelle * Use trusted setup from the specs & fix issue with struct * Run goimports * Fix mistake in makeCellsAndProofs --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update ckzg4844 to latest version * Run go mod tidy * Remove unnecessary tests & run goimports * Remove fieldparams from blockchain/kzg * Add back blank line * Avoid large copies * Run gazelle * Use trusted setup from the specs & fix issue with struct * Run goimports * Fix mistake in makeCellsAndProofs --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update ckzg4844 to latest version * Run go mod tidy * Remove unnecessary tests & run goimports * Remove fieldparams from blockchain/kzg * Add back blank line * Avoid large copies * Run gazelle * Use trusted setup from the specs & fix issue with struct * Run goimports * Fix mistake in makeCellsAndProofs --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update ckzg4844 to latest version * Run go mod tidy * Remove unnecessary tests & run goimports * Remove fieldparams from blockchain/kzg * Add back blank line * Avoid large copies * Run gazelle * Use trusted setup from the specs & fix issue with struct * Run goimports * Fix mistake in makeCellsAndProofs --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update ckzg4844 to latest version * Run go mod tidy * Remove unnecessary tests & run goimports * Remove fieldparams from blockchain/kzg * Add back blank line * Avoid large copies * Run gazelle * Use trusted setup from the specs & fix issue with struct * Run goimports * Fix mistake in makeCellsAndProofs --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update ckzg4844 to latest version * Run go mod tidy * Remove unnecessary tests & run goimports * Remove fieldparams from blockchain/kzg * Add back blank line * Avoid large copies * Run gazelle * Use trusted setup from the specs & fix issue with struct * Run goimports * Fix mistake in makeCellsAndProofs --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update ckzg4844 to latest version * Run go mod tidy * Remove unnecessary tests & run goimports * Remove fieldparams from blockchain/kzg * Add back blank line * Avoid large copies * Run gazelle * Use trusted setup from the specs & fix issue with struct * Run goimports * Fix mistake in makeCellsAndProofs --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update ckzg4844 to latest version * Run go mod tidy * Remove unnecessary tests & run goimports * Remove fieldparams from blockchain/kzg * Add back blank line * Avoid large copies * Run gazelle * Use trusted setup from the specs & fix issue with struct * Run goimports * Fix mistake in makeCellsAndProofs --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update ckzg4844 to latest version * Run go mod tidy * Remove unnecessary tests & run goimports * Remove fieldparams from blockchain/kzg * Add back blank line * Avoid large copies * Run gazelle * Use trusted setup from the specs & fix issue with struct * Run goimports * Fix mistake in makeCellsAndProofs --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update ckzg4844 to latest version * Run go mod tidy * Remove unnecessary tests & run goimports * Remove fieldparams from blockchain/kzg * Add back blank line * Avoid large copies * Run gazelle * Use trusted setup from the specs & fix issue with struct * Run goimports * Fix mistake in makeCellsAndProofs --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update ckzg4844 to latest version * Run go mod tidy * Remove unnecessary tests & run goimports * Remove fieldparams from blockchain/kzg * Add back blank line * Avoid large copies * Run gazelle * Use trusted setup from the specs & fix issue with struct * Run goimports * Fix mistake in makeCellsAndProofs --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update ckzg4844 to latest version * Run go mod tidy * Remove unnecessary tests & run goimports * Remove fieldparams from blockchain/kzg * Add back blank line * Avoid large copies * Run gazelle * Use trusted setup from the specs & fix issue with struct * Run goimports * Fix mistake in makeCellsAndProofs --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update ckzg4844 to latest version * Run go mod tidy * Remove unnecessary tests & run goimports * Remove fieldparams from blockchain/kzg * Add back blank line * Avoid large copies * Run gazelle * Use trusted setup from the specs & fix issue with struct * Run goimports * Fix mistake in makeCellsAndProofs --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update ckzg4844 to latest version * Run go mod tidy * Remove unnecessary tests & run goimports * Remove fieldparams from blockchain/kzg * Add back blank line * Avoid large copies * Run gazelle * Use trusted setup from the specs & fix issue with struct * Run goimports * Fix mistake in makeCellsAndProofs --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update ckzg4844 to latest version * Run go mod tidy * Remove unnecessary tests & run goimports * Remove fieldparams from blockchain/kzg * Add back blank line * Avoid large copies * Run gazelle * Use trusted setup from the specs & fix issue with struct * Run goimports * Fix mistake in makeCellsAndProofs --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update ckzg4844 to latest version * Run go mod tidy * Remove unnecessary tests & run goimports * Remove fieldparams from blockchain/kzg * Add back blank line * Avoid large copies * Run gazelle * Use trusted setup from the specs & fix issue with struct * Run goimports * Fix mistake in makeCellsAndProofs --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update ckzg4844 to latest version * Run go mod tidy * Remove unnecessary tests & run goimports * Remove fieldparams from blockchain/kzg * Add back blank line * Avoid large copies * Run gazelle * Use trusted setup from the specs & fix issue with struct * Run goimports * Fix mistake in makeCellsAndProofs --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update ckzg4844 to latest version * Run go mod tidy * Remove unnecessary tests & run goimports * Remove fieldparams from blockchain/kzg * Add back blank line * Avoid large copies * Run gazelle * Use trusted setup from the specs & fix issue with struct * Run goimports * Fix mistake in makeCellsAndProofs --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update ckzg4844 to latest version * Run go mod tidy * Remove unnecessary tests & run goimports * Remove fieldparams from blockchain/kzg * Add back blank line * Avoid large copies * Run gazelle * Use trusted setup from the specs & fix issue with struct * Run goimports * Fix mistake in makeCellsAndProofs --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Update ckzg4844 to latest version * Run go mod tidy * Remove unnecessary tests & run goimports * Remove fieldparams from blockchain/kzg * Add back blank line * Avoid large copies * Run gazelle * Use trusted setup from the specs & fix issue with struct * Run goimports * Fix mistake in makeCellsAndProofs --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
What type of PR is this?
Other
What does this PR do? Why is it needed?
ckzg4844.Cell
is now an array of bytes, so the conversion is simpler.Usefieldparams.NumberOfColumns
instead ofckzg4844.CellsPerExtBlob
.ckzg4844.CellsPerExtBlob
since it's no longer a public constant.rowIndices
params & pass a commitment for each cell.Other notes for review
I think it's best to review this split-view. The diff looks pretty ugly.