-
-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
further handle datacolumns sync by range by root and forkaware data h…
…andling
- Loading branch information
Showing
11 changed files
with
168 additions
and
30 deletions.
There are no files selected for viewing
This file contains 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
10 changes: 6 additions & 4 deletions
10
packages/beacon-node/src/chain/errors/dataColumnSidecarError.ts
This file contains 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 |
---|---|---|
@@ -1,15 +1,17 @@ | ||
import {Slot} from "@lodestar/types"; | ||
import {Slot, RootHex} from "@lodestar/types"; | ||
import {GossipActionError} from "./gossipValidation.js"; | ||
|
||
export enum DataColumnSidecarErrorCode { | ||
INVALID_INDEX = "BLOB_SIDECAR_ERROR_INVALID_INDEX", | ||
INVALID_INDEX = "DATA_COLUMN_SIDECAR_ERROR_INVALID_INDEX", | ||
|
||
// following errors are adapted from the block errors | ||
FUTURE_SLOT = "BLOB_SIDECAR_ERROR_FUTURE_SLOT", | ||
FUTURE_SLOT = "DATA_COLUMN_SIDECAR_ERROR_FUTURE_SLOT", | ||
PARENT_UNKNOWN = "DATA_COLUMN_SIDECAR_ERROR_PARENT_UNKNOWN", | ||
} | ||
|
||
export type DataColumnSidecarErrorType = | ||
| {code: DataColumnSidecarErrorCode.INVALID_INDEX; columnIndex: number; gossipIndex: number} | ||
| {code: DataColumnSidecarErrorCode.FUTURE_SLOT; blockSlot: Slot; currentSlot: Slot}; | ||
| {code: DataColumnSidecarErrorCode.FUTURE_SLOT; blockSlot: Slot; currentSlot: Slot} | ||
| {code: DataColumnSidecarErrorCode.PARENT_UNKNOWN; parentRoot: RootHex}; | ||
|
||
export class DataColumnSidecarGossipError extends GossipActionError<DataColumnSidecarErrorType> {} |
This file contains 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 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 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 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 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 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 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 {NUMBER_OF_COLUMNS} from "@lodestar/params"; | ||
import {ColumnIndex} from "@lodestar/types"; | ||
import {ChainForkConfig} from "@lodestar/config"; | ||
|
||
export function getCustodyColumns(config: ChainForkConfig, _nodeId: number | string): Uint8Array { | ||
const custodyColumnIndexes = getCustodyColumnIndexes(config); | ||
const custodyColumns = new Uint8Array(NUMBER_OF_COLUMNS); | ||
for (const columnIndex of custodyColumnIndexes) { | ||
custodyColumns[columnIndex] = 1; | ||
} | ||
return custodyColumns; | ||
} | ||
|
||
export function getCustodyColumnIndexes(config: ChainForkConfig): ColumnIndex[] { | ||
return Array.from({length: config.CUSTODY_REQUIREMENT}, (_val, i) => i); | ||
} |
This file contains 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 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