-
-
Notifications
You must be signed in to change notification settings - Fork 434
feat: fulu types #7774
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
feat: fulu types #7774
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
117fdf7
feat: fulu types
wemeetagain 918fd17
chore: apply suggestions from code review
wemeetagain cd424d8
feat: add params and config
wemeetagain aba16e9
chore: add validator params update
wemeetagain c2d6010
chore: remove duplicate types
wemeetagain 40e3958
chore: more duplicate types
wemeetagain 841b391
chore: update packages/params/test/unit/forkName.test.ts
wemeetagain f12f410
chore: fix types
wemeetagain 2895969
chore: standardize added primitives
wemeetagain 4e948f3
chore: apply suggestions from code review
wemeetagain ece7403
chore: remove "forkblobs"
wemeetagain 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
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
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,4 @@ | ||
| export * from "./types.js"; | ||
| import * as ssz from "./sszTypes.js"; | ||
| import * as ts from "./types.js"; | ||
| export {ts, ssz}; |
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,75 @@ | ||
| import {ByteVectorType, ContainerType, ListBasicType, ListCompositeType, VectorCompositeType} from "@chainsafe/ssz"; | ||
| import { | ||
| BYTES_PER_FIELD_ELEMENT, | ||
| FIELD_ELEMENTS_PER_CELL, | ||
| KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH, | ||
| MAX_BLOB_COMMITMENTS_PER_BLOCK, | ||
| MAX_REQUEST_DATA_COLUMN_SIDECARS, | ||
| NUMBER_OF_COLUMNS, | ||
| } from "@lodestar/params"; | ||
|
|
||
| import {ssz as altairSsz} from "../altair/index.js"; | ||
| import {ssz as denebSsz} from "../deneb/index.js"; | ||
| import {ssz as phase0Ssz} from "../phase0/index.js"; | ||
| import {ssz as primitiveSsz} from "../primitive/index.js"; | ||
|
|
||
| const {Root, ColumnIndex, RowIndex, Bytes32, Slot, UintNum64} = primitiveSsz; | ||
|
|
||
| export const Metadata = new ContainerType( | ||
| { | ||
| ...altairSsz.Metadata.fields, | ||
| custodyGroupCount: UintNum64, | ||
| }, | ||
| {typeName: "Metadata", jsonCase: "eth2"} | ||
| ); | ||
|
|
||
| export const Cell = new ByteVectorType(BYTES_PER_FIELD_ELEMENT * FIELD_ELEMENTS_PER_CELL); | ||
| export const DataColumn = new ListCompositeType(Cell, MAX_BLOB_COMMITMENTS_PER_BLOCK); | ||
| export const ExtendedMatrix = new ListCompositeType(Cell, MAX_BLOB_COMMITMENTS_PER_BLOCK * NUMBER_OF_COLUMNS); | ||
| export const KzgCommitmentsInclusionProof = new VectorCompositeType(Bytes32, KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH); | ||
|
|
||
| export const DataColumnSidecar = new ContainerType( | ||
| { | ||
| index: ColumnIndex, | ||
| column: DataColumn, | ||
| kzgCommitments: denebSsz.BlobKzgCommitments, | ||
| kzgProofs: denebSsz.KZGProofs, | ||
| signedBlockHeader: phase0Ssz.SignedBeaconBlockHeader, | ||
| kzgCommitmentsInclusionProof: KzgCommitmentsInclusionProof, | ||
| }, | ||
| {typeName: "DataColumnSidecar", jsonCase: "eth2"} | ||
| ); | ||
|
|
||
| export const DataColumnSidecars = new ListCompositeType(DataColumnSidecar, NUMBER_OF_COLUMNS); | ||
|
|
||
| export const MatrixEntry = new ContainerType( | ||
| { | ||
| cell: Cell, | ||
| kzgProof: denebSsz.KZGProof, | ||
| columnIndex: ColumnIndex, | ||
| rowIndex: RowIndex, | ||
| }, | ||
| {typeName: "MatrixEntry", jsonCase: "eth2"} | ||
| ); | ||
|
|
||
| export const DataColumnIdentifier = new ContainerType( | ||
| { | ||
| blockRoot: Root, | ||
| index: ColumnIndex, | ||
| }, | ||
| {typeName: "DataColumnIdentifier", jsonCase: "eth2"} | ||
| ); | ||
|
|
||
| export const DataColumnSidecarsByRootRequest = new ListCompositeType( | ||
| DataColumnIdentifier, | ||
| MAX_REQUEST_DATA_COLUMN_SIDECARS | ||
| ); | ||
|
|
||
| export const DataColumnSidecarsByRangeRequest = new ContainerType( | ||
| { | ||
| startSlot: Slot, | ||
| count: UintNum64, | ||
| columns: new ListBasicType(ColumnIndex, NUMBER_OF_COLUMNS), | ||
| }, | ||
| {typeName: "DataColumnSidecarsByRangeRequest", jsonCase: "eth2"} | ||
| ); |
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,16 @@ | ||
| import {ValueOf} from "@chainsafe/ssz"; | ||
| import * as ssz from "./sszTypes.js"; | ||
|
|
||
| export type Metadata = ValueOf<typeof ssz.Metadata>; | ||
|
|
||
| export type Cell = ValueOf<typeof ssz.Cell>; | ||
| export type DataColumn = ValueOf<typeof ssz.DataColumn>; | ||
| export type ExtendedMatrix = ValueOf<typeof ssz.ExtendedMatrix>; | ||
| export type KzgCommitmentsInclusionProof = ValueOf<typeof ssz.KzgCommitmentsInclusionProof>; | ||
| export type DataColumnSidecar = ValueOf<typeof ssz.DataColumnSidecar>; | ||
| export type DataColumnSidecars = ValueOf<typeof ssz.DataColumnSidecars>; | ||
| export type MatrixEntry = ValueOf<typeof ssz.MatrixEntry>; | ||
|
|
||
| export type DataColumnIdentifier = ValueOf<typeof ssz.DataColumnIdentifier>; | ||
| export type DataColumnSidecarsByRootRequest = ValueOf<typeof ssz.DataColumnSidecarsByRootRequest>; | ||
| export type DataColumnSidecarsByRangeRequest = ValueOf<typeof ssz.DataColumnSidecarsByRangeRequest>; |
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
Oops, something went wrong.
Oops, something went wrong.
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.