-
-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add: initial ephemery config based on pk910's work in progress * fix: add missing new line * fix: rm unused disable es-lint directive * fix: rename ephemeryBaseChainConfig to baseChainConfig * fix: update comment to reflect 7 day reset period * fix: reset period in MS, latest spec linked (EIP), dev comments updated * fix: config fixes, add ref to config.yaml * add: case ephemery added in packages/prover
- Loading branch information
1 parent
d130ccd
commit cf13ce9
Showing
5 changed files
with
93 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export {ephemeryChainConfig as chainConfig} from "@lodestar/config/networks"; | ||
|
||
export const depositContractDeployBlock = 0; | ||
export const genesisFileUrl = "https://ephemery.dev/latest/genesis.ssz"; | ||
export const bootnodesFileUrl = "https://ephemery.dev/latest/bootstrap_nodes.txt"; | ||
|
||
// Pick from above file | ||
export const bootEnrs = []; |
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,61 @@ | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
import {fromHexString as b} from "@chainsafe/ssz"; | ||
import {ChainConfig} from "../types.js"; | ||
import {chainConfig as mainnet} from "../presets/mainnet.js"; | ||
|
||
// Ephemery dynamic beacon chain config: | ||
// https://github.com/ephemery-testnet/ephemery-genesis/blob/master/cl-config.yaml | ||
|
||
// Ephemery specification: | ||
// https://github.com/taxmeifyoucan/EIPs/blob/d298cdd8eaf47a21e7770e5c6efef870587c924d/EIPS/eip-6916.md | ||
|
||
// iteration 0, "base"-genesis | ||
const baseChainConfig: ChainConfig = { | ||
...mainnet, | ||
|
||
CONFIG_NAME: "ephemery", | ||
|
||
// Genesis | ||
// --------------------------------------------------------------- | ||
MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: 64, | ||
// Thu Dec 02 2021 19:00:00 GMT+0000 | ||
MIN_GENESIS_TIME: 1638471600, | ||
GENESIS_FORK_VERSION: b("0x1000101b"), | ||
GENESIS_DELAY: 300, | ||
|
||
// Forking | ||
// --------------------------------------------------------------- | ||
// Altair | ||
ALTAIR_FORK_VERSION: b("0x2000101b"), | ||
ALTAIR_FORK_EPOCH: 0, | ||
// Merge | ||
BELLATRIX_FORK_VERSION: b("0x3000101b"), | ||
BELLATRIX_FORK_EPOCH: 0, | ||
TERMINAL_TOTAL_DIFFICULTY: BigInt("0"), | ||
// Capella | ||
CAPELLA_FORK_VERSION: b("0x4000101b"), | ||
CAPELLA_FORK_EPOCH: 0, | ||
// Deneb | ||
DENEB_FORK_VERSION: b("0x5000101b"), | ||
|
||
// Deposit contract | ||
// --------------------------------------------------------------- | ||
DEPOSIT_CHAIN_ID: 39438000, | ||
DEPOSIT_NETWORK_ID: 39438000, | ||
DEPOSIT_CONTRACT_ADDRESS: b("0x4242424242424242424242424242424242424242"), | ||
|
||
ETH1_FOLLOW_DISTANCE: 12, | ||
}; | ||
|
||
// Reset interval (7 days) in milliseconds, based on ephemery-genesis values.env: | ||
// https://github.com/ephemery-testnet/ephemery-genesis/blob/9a28fbef950c8547d78785f8a0ea49a95ce19a48/values.env#L5 | ||
const RESET_INTERVAL_MS = 604800000; | ||
const iteration = Math.floor(Date.now() - baseChainConfig.MIN_GENESIS_TIME) / RESET_INTERVAL_MS; | ||
|
||
export const ephemeryChainConfig: ChainConfig = { | ||
...baseChainConfig, | ||
|
||
MIN_GENESIS_TIME: RESET_INTERVAL_MS * iteration + baseChainConfig.MIN_GENESIS_TIME, | ||
DEPOSIT_CHAIN_ID: baseChainConfig.DEPOSIT_CHAIN_ID + iteration, | ||
DEPOSIT_NETWORK_ID: baseChainConfig.DEPOSIT_NETWORK_ID + iteration, | ||
}; |
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