Skip to content

Commit

Permalink
move to max request data columns to preset
Browse files Browse the repository at this point in the history
  • Loading branch information
g11tech committed Apr 22, 2024
1 parent 507a2f4 commit f2737cf
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 6 deletions.
1 change: 0 additions & 1 deletion packages/config/src/chainConfig/configs/mainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ export const chainConfig: ChainConfig = {

// Electra
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 32,
MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384,
SAMPLES_PER_SLOT: 8,
CUSTODY_REQUIREMENT: 1,
};
1 change: 0 additions & 1 deletion packages/config/src/chainConfig/configs/minimal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ export const chainConfig: ChainConfig = {

// Electra
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 32,
MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384,
SAMPLES_PER_SLOT: 8,
CUSTODY_REQUIREMENT: 1,
};
2 changes: 0 additions & 2 deletions packages/config/src/chainConfig/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ export type ChainConfig = {
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: number;

DATA_COLUMN_SIDECAR_SUBNET_COUNT: number;
MAX_REQUEST_DATA_COLUMN_SIDECARS: number;
SAMPLES_PER_SLOT: number;
CUSTODY_REQUIREMENT: number;
};
Expand Down Expand Up @@ -141,7 +140,6 @@ export const chainConfigTypes: SpecTypes<ChainConfig> = {
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: "number",

DATA_COLUMN_SIDECAR_SUBNET_COUNT: "number",
MAX_REQUEST_DATA_COLUMN_SIDECARS: "number",
SAMPLES_PER_SLOT: "number",
CUSTODY_REQUIREMENT: "number",
};
Expand Down
1 change: 1 addition & 0 deletions packages/params/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export const {
FIELD_ELEMENTS_PER_CELL,
FIELD_ELEMENTS_PER_EXT_BLOB,
KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH,
MAX_REQUEST_DATA_COLUMN_SIDECARS,
} = activePreset;

////////////
Expand Down
1 change: 1 addition & 0 deletions packages/params/src/presets/mainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,5 @@ export const mainnetPreset: BeaconPreset = {
FIELD_ELEMENTS_PER_CELL: 64,
FIELD_ELEMENTS_PER_EXT_BLOB: 8192,
KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH: 4,
MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384,
};
1 change: 1 addition & 0 deletions packages/params/src/presets/minimal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,5 @@ export const minimalPreset: BeaconPreset = {
FIELD_ELEMENTS_PER_CELL: 64,
FIELD_ELEMENTS_PER_EXT_BLOB: 8192,
KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH: 4,
MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384,
};
2 changes: 2 additions & 0 deletions packages/params/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export type BeaconPreset = {
FIELD_ELEMENTS_PER_CELL: number;
FIELD_ELEMENTS_PER_EXT_BLOB: number;
KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH: number;
MAX_REQUEST_DATA_COLUMN_SIDECARS: number;
};

/**
Expand Down Expand Up @@ -179,6 +180,7 @@ export const beaconPresetTypes: BeaconPresetTypes = {
FIELD_ELEMENTS_PER_CELL: "number",
FIELD_ELEMENTS_PER_EXT_BLOB: "number",
KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH: "number",
MAX_REQUEST_DATA_COLUMN_SIDECARS: "number",
};

type BeaconPresetTypes = {
Expand Down
3 changes: 2 additions & 1 deletion packages/types/src/electra/sszTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ import {
MAX_BLOB_COMMITMENTS_PER_BLOCK,
NUMBER_OF_COLUMNS,
KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH,
MAX_REQUEST_DATA_COLUMN_SIDECARS,
} from "@lodestar/params";

import {ssz as primitiveSsz} from "../primitive/index.js";
import {ssz as phase0Ssz} from "../phase0/index.js";
import {ssz as denebSsz} from "../deneb/index.js";

const {BLSSignature, Root, ColumnIndex, Bytes32} = primitiveSsz;
const {BLSSignature, Root, ColumnIndex, Bytes32, Slot, UintNum64} = primitiveSsz;

export const Cell = new ByteVectorType(BYTES_PER_FIELD_ELEMENT * FIELD_ELEMENTS_PER_CELL);
export const DataColumn = new ListCompositeType(Cell, MAX_BLOB_COMMITMENTS_PER_BLOCK);
Expand Down
2 changes: 1 addition & 1 deletion packages/validator/src/util/params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,10 @@ function getSpecCriticalParams(localConfig: ChainConfig): Record<keyof ConfigWit
FIELD_ELEMENTS_PER_CELL: electraForkRelevant,
FIELD_ELEMENTS_PER_EXT_BLOB: electraForkRelevant,
KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH: electraForkRelevant,
MAX_REQUEST_DATA_COLUMN_SIDECARS: electraForkRelevant,

// Electra
DATA_COLUMN_SIDECAR_SUBNET_COUNT: electraForkRelevant,
MAX_REQUEST_DATA_COLUMN_SIDECARS: electraForkRelevant,
SAMPLES_PER_SLOT: electraForkRelevant,
CUSTODY_REQUIREMENT: electraForkRelevant,
};
Expand Down

0 comments on commit f2737cf

Please sign in to comment.