-
-
Notifications
You must be signed in to change notification settings - Fork 457
feat: validate data column sidecars #7073
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
cc263ee
feat: update c-kzg to final DAS version
matthewkeil 2844eeb
refactor: use trusted-setup from c-kzg package
matthewkeil f239059
feat: implement validateDataColumnsSidecars
matthewkeil 76d8447
feat: check block and column commitments match
matthewkeil 49b13f5
test: add unit test for validateDataColumnsSidecars
matthewkeil 6f1f025
fix: invalid build and update validity condition of validateDataColum…
matthewkeil 38baa72
fix: make error messages better
matthewkeil 4f3de52
Merge branch 'peerDAS' into mkeil/validate-data-column-sidecars
matthewkeil c2a3c0b
fix: electra vs peerdas type conflict
matthewkeil File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import {bellatrix, deneb} from "@lodestar/types"; | ||
| import {BLOB_TX_TYPE, BYTES_PER_FIELD_ELEMENT} from "@lodestar/params"; | ||
| import {kzgCommitmentToVersionedHash} from "../../src/util/blobs.js"; | ||
| import {FIELD_ELEMENTS_PER_BLOB_MAINNET} from "../../src/util/kzg.js"; | ||
|
|
||
| export function transactionForKzgCommitment(kzgCommitment: deneb.KZGCommitment): bellatrix.Transaction { | ||
| // Just use versionedHash as the transaction encoding to mock newPayloadV3 verification | ||
| // prefixed with BLOB_TX_TYPE | ||
| const transaction = new Uint8Array(33); | ||
| const versionedHash = kzgCommitmentToVersionedHash(kzgCommitment); | ||
| transaction[0] = BLOB_TX_TYPE; | ||
| transaction.set(versionedHash, 1); | ||
| return transaction; | ||
| } | ||
|
|
||
| /** | ||
| * Generate random blob of sequential integers such that each element is < BLS_MODULUS | ||
| */ | ||
| export function generateRandomBlob(): deneb.Blob { | ||
| const blob = new Uint8Array(FIELD_ELEMENTS_PER_BLOB_MAINNET * BYTES_PER_FIELD_ELEMENT); | ||
| const dv = new DataView(blob.buffer, blob.byteOffset, blob.byteLength); | ||
| for (let i = 0; i < FIELD_ELEMENTS_PER_BLOB_MAINNET; i++) { | ||
| dv.setUint32(i * BYTES_PER_FIELD_ELEMENT, i); | ||
| } | ||
| return blob; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.