Skip to content

Commit

Permalink
feat: placeholder PR for electra
Browse files Browse the repository at this point in the history
add types stub and epoch config
  • Loading branch information
g11tech committed Jan 24, 2024
1 parent 43994ba commit e481acc
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/config/src/chainConfig/configs/mainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ export const chainConfig: ChainConfig = {
DENEB_FORK_VERSION: b("0x04000000"),
DENEB_FORK_EPOCH: Infinity,

// Electra
ELECTRA_FORK_VERSION: b("0x05000000"),
ELECTRA_FORK_EPOCH: Infinity,

// Time parameters
// ---------------------------------------------------------------
// 12 seconds
Expand Down
4 changes: 4 additions & 0 deletions packages/config/src/chainConfig/configs/minimal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ export const chainConfig: ChainConfig = {
DENEB_FORK_VERSION: b("0x04000001"),
DENEB_FORK_EPOCH: Infinity,

// Electra
ELECTRA_FORK_VERSION: b("0x05000001"),
ELECTRA_FORK_EPOCH: Infinity,

// Time parameters
// ---------------------------------------------------------------
// [customized] Faster for testing purposes
Expand Down
6 changes: 6 additions & 0 deletions packages/config/src/chainConfig/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ export type ChainConfig = {
// DENEB
DENEB_FORK_VERSION: Uint8Array;
DENEB_FORK_EPOCH: number;
// ELECTRA
ELECTRA_FORK_VERSION: Uint8Array;
ELECTRA_FORK_EPOCH: number;

// Time parameters
SECONDS_PER_SLOT: number;
Expand Down Expand Up @@ -96,6 +99,9 @@ export const chainConfigTypes: SpecTypes<ChainConfig> = {
// DENEB
DENEB_FORK_VERSION: "bytes",
DENEB_FORK_EPOCH: "number",
// ELECTRA
ELECTRA_FORK_VERSION: "bytes",
ELECTRA_FORK_EPOCH: "number",

// Time parameters
SECONDS_PER_SLOT: "number",
Expand Down
2 changes: 2 additions & 0 deletions packages/params/src/forkName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export enum ForkName {
bellatrix = "bellatrix",
capella = "capella",
deneb = "deneb",
electra = "electra",
}

/**
Expand All @@ -18,6 +19,7 @@ export enum ForkSeq {
bellatrix = 2,
capella = 3,
deneb = 4,
electra = 5,
}

export type ForkPreLightClient = ForkName.phase0;
Expand Down
3 changes: 3 additions & 0 deletions packages/types/src/electra/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from "./types.js";
export * as ts from "./types.js";
export * as ssz from "./sszTypes.js";
Empty file.
Empty file.
1 change: 1 addition & 0 deletions packages/types/src/sszTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export {ssz as altair} from "./altair/index.js";
export {ssz as bellatrix} from "./bellatrix/index.js";
export {ssz as capella} from "./capella/index.js";
export {ssz as deneb} from "./deneb/index.js";
export {ssz as electra} from "./electra/index.js";

import {ssz as allForksSsz} from "./allForks/index.js";
export const allForks = allForksSsz.allForks;
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export {ts as altair} from "./altair/index.js";
export {ts as bellatrix} from "./bellatrix/index.js";
export {ts as capella} from "./capella/index.js";
export {ts as deneb} from "./deneb/index.js";
export {ts as electra} from "./electra/index.js";

export {ts as allForks} from "./allForks/index.js";

Expand Down

0 comments on commit e481acc

Please sign in to comment.