Skip to content

Commit

Permalink
add some presets
Browse files Browse the repository at this point in the history
  • Loading branch information
g11tech committed Apr 11, 2024
1 parent e0c252c commit fd22c86
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/params/src/presets/mainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,11 @@ export const mainnetPreset: BeaconPreset = {
MAX_BLOB_COMMITMENTS_PER_BLOCK: 4096,
MAX_BLOBS_PER_BLOCK: 6,
KZG_COMMITMENT_INCLUSION_PROOF_DEPTH: 17,

// ELECTRA
///////////
FIELD_ELEMENTS_PER_CELL: 64,
KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH: 4,
NUMBER_OF_COLUMNS: 128,

};
6 changes: 6 additions & 0 deletions packages/params/src/presets/minimal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,10 @@ export const minimalPreset: BeaconPreset = {
MAX_BLOB_COMMITMENTS_PER_BLOCK: 16,
MAX_BLOBS_PER_BLOCK: 6,
KZG_COMMITMENT_INCLUSION_PROOF_DEPTH: 9,

// ELECTRA
///////////
FIELD_ELEMENTS_PER_CELL: 64,
KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH: 4,
NUMBER_OF_COLUMNS: 128,
};
12 changes: 12 additions & 0 deletions packages/params/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ export type BeaconPreset = {
MAX_BLOB_COMMITMENTS_PER_BLOCK: number;
MAX_BLOBS_PER_BLOCK: number;
KZG_COMMITMENT_INCLUSION_PROOF_DEPTH: number;

// ELECTRA
///////////
FIELD_ELEMENTS_PER_CELL: number,
KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH: number,
NUMBER_OF_COLUMNS: number,
};

/**
Expand Down Expand Up @@ -167,6 +173,12 @@ export const beaconPresetTypes: BeaconPresetTypes = {
MAX_BLOB_COMMITMENTS_PER_BLOCK: "number",
MAX_BLOBS_PER_BLOCK: "number",
KZG_COMMITMENT_INCLUSION_PROOF_DEPTH: "number",

// ELECTRA
///////////
FIELD_ELEMENTS_PER_CELL: "number",
KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH: "number",
NUMBER_OF_COLUMNS: "number",
};

type BeaconPresetTypes = {
Expand Down
6 changes: 6 additions & 0 deletions packages/validator/src/util/params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,5 +222,11 @@ function getSpecCriticalParams(localConfig: ChainConfig): Record<keyof ConfigWit
MAX_BLOBS_PER_BLOCK: denebForkRelevant,
MAX_BLOB_COMMITMENTS_PER_BLOCK: denebForkRelevant,
KZG_COMMITMENT_INCLUSION_PROOF_DEPTH: denebForkRelevant,

// # ElectraPreset
/////////////////
FIELD_ELEMENTS_PER_CELL: electraForkRelevant,
KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH: electraForkRelevant,
NUMBER_OF_COLUMNS: electraForkRelevant,
};
}

0 comments on commit fd22c86

Please sign in to comment.