Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: draft genesis script #2

Draft
wants to merge 34 commits into
base: unstable
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
03a6d00
v1.11.2
nflaig Sep 25, 2023
2a9a17d
fix: update holesky config for new genesis (#5971)
nflaig Sep 20, 2023
90475d4
fix: update holesky genesis time (#5972)
nflaig Sep 20, 2023
429516e
chore: update holesky bootnode ENRs (#5982)
nflaig Sep 22, 2023
5a86160
chore: release v1.11.2 (#5994)
nflaig Sep 25, 2023
96654ba
v1.11.3
nflaig Sep 25, 2023
9ade975
chore: release v1.11.3 (#5998)
nflaig Sep 25, 2023
1397834
feat: add max activation churn limit and other deneb devnet-9 spec up…
dapplion Sep 28, 2023
4288f8c
fix: only check doppelganger liveness for relevant epochs (#5991)
nflaig Sep 29, 2023
070c121
fix: skip validator monitoring pre-genesis (#6001)
nflaig Sep 29, 2023
ce54e32
fix: run sync notifier once every slot pre-genesis (#6002)
nflaig Sep 29, 2023
9cd65cc
feat: add option to log validator monitor events as info (#6009)
nflaig Sep 29, 2023
3cfa9cd
fix: improve jsonRPC error UX for eth1 + execution (#5949)
nazarhussain Sep 29, 2023
fbedeca
add: draft genesis script
atkinsonholly Sep 29, 2023
c3f5823
fix: more clearly separate log and error message (#5992)
nflaig Sep 30, 2023
b46dfcb
refactor: compute validator monitor log level only once (#6010)
nflaig Sep 30, 2023
1d14dc1
feat(logger): remove unused trace log level (#5861)
matthewkeil Oct 2, 2023
6629242
chore: merge stable to unstable (#5996)
wemeetagain Oct 2, 2023
d9e6f1a
feat: support qvalue weighting in Accept headers (#6014)
jshufro Oct 3, 2023
1d301bb
ci: set job status of e2e tests to passed after 15m timeout (#6017)
nflaig Oct 3, 2023
2493672
fix: update cache with newly discovered attester duties (#6013)
nflaig Oct 3, 2023
43c86ac
update: generate config updated for eth2-testnet-genesis WIP
atkinsonholly Oct 3, 2023
a1b8378
fix: TODOs and remove unused variable
atkinsonholly Oct 3, 2023
38d6a5d
update: eth2-testnet-genesis params
atkinsonholly Oct 3, 2023
d25d57e
chore(deps-dev): bump electron from 26.2.2 to 26.2.4 (#6023)
dependabot[bot] Oct 6, 2023
514c2c1
fix: new line in validator inputs and generate ssz file
atkinsonholly Oct 6, 2023
b306b4e
add: TODO for generate file
atkinsonholly Oct 6, 2023
7f6089a
rm: serialize notes
atkinsonholly Oct 6, 2023
361dc84
rm: empty reset dir
atkinsonholly Oct 6, 2023
ef911ec
fix: tidy ephemery exports
atkinsonholly Oct 6, 2023
8778bea
add: WIP ephemery genesisFileUrl using ephemery export
atkinsonholly Oct 6, 2023
038a3e3
Merge branch 'unstable' of https://github.com/ChainSafe/lodestar into…
atkinsonholly Oct 6, 2023
3fae613
add: add ephemery dependency to cli package
atkinsonholly Oct 6, 2023
8713378
add: WIP ephemery cli option, generateGenesis
atkinsonholly Oct 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 32 additions & 28 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ on:
branches: [unstable, stable]
pull_request:
workflow_dispatch:

env:
GETH_DOCKER_IMAGE: ethereum/client-go:v1.11.6
NETHERMIND_DOCKER_IMAGE: nethermind/nethermind:1.18.0

jobs:
build:
name: Build
Expand Down Expand Up @@ -53,9 +53,9 @@ jobs:
if: steps.cache-build-restore.outputs.cache-hit == 'true'
run: yarn build
- name: Check Build
run: yarn check-build
run: yarn check-build
- name: Test root binary exists
run: ./lodestar --version
run: ./lodestar --version
- name: Reject yarn.lock changes
run: .github/workflows/scripts/reject_yarn_lock_changes.sh
# Run only on forks
Expand All @@ -69,17 +69,17 @@ jobs:
packages/*/node_modules
lib/
packages/*/lib
packages/*/.git-data.json
packages/*/.git-data.json
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ github.sha }}

lint:
name: Lint
needs: build
runs-on: 'ubuntu-latest'
runs-on: "ubuntu-latest"
strategy:
fail-fast: false
matrix:
node: [20]
node: [20]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand All @@ -96,28 +96,28 @@ jobs:
packages/*/node_modules
lib/
packages/*/lib
packages/*/.git-data.json
packages/*/.git-data.json
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ github.sha }}
fail-on-cache-miss: true
- name: Assert yarn prints no warnings
run: scripts/assert_no_yarn_warnings.sh
run: scripts/assert_no_yarn_warnings.sh
- name: Lint Code
run: yarn lint
run: yarn lint
- name: Lint Grafana dashboards
run: scripts/validate-grafana-dashboards.sh
run: scripts/validate-grafana-dashboards.sh
- name: Assert ESM module exports
run: node scripts/assert_exports.mjs
- name: Assert eslintrc rules sorted
run: scripts/assert_eslintrc_sorted.mjs

type-checks:
type-checks:
name: Type Checks
needs: build
runs-on: 'ubuntu-latest'
runs-on: "ubuntu-latest"
strategy:
fail-fast: false
matrix:
node: [20]
node: [20]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand All @@ -134,16 +134,16 @@ jobs:
packages/*/node_modules
lib/
packages/*/lib
packages/*/.git-data.json
packages/*/.git-data.json
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ github.sha }}
fail-on-cache-miss: true

- name: Check Types
run: yarn check-types

- name: README check
run: yarn check-readme

unit-tests:
name: Unit Tests
needs: type-checks
Expand All @@ -168,7 +168,7 @@ jobs:
packages/*/node_modules
lib/
packages/*/lib
packages/*/.git-data.json
packages/*/.git-data.json
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ github.sha }}
fail-on-cache-miss: true

Expand Down Expand Up @@ -199,7 +199,7 @@ jobs:
with:
node-version: ${{matrix.node}}
check-latest: true
cache: yarn
cache: yarn
- name: Restore build cache
id: cache-primes-restore
uses: actions/cache/restore@v3
Expand All @@ -209,15 +209,19 @@ jobs:
packages/*/node_modules
lib/
packages/*/lib
packages/*/.git-data.json
packages/*/.git-data.json
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ github.sha }}
fail-on-cache-miss: true

- name: Run the e2e test environment
run: scripts/run_e2e_env.sh start

- name: E2E tests
run: yarn test:e2e
# E2E tests are sometimes stalling until timeout is reached but we know that
# after 15 minutes those should have passed already if there are no failed test cases.
# In this case, just set the job status to passed as there was likely no actual issue.
# See https://github.com/ChainSafe/lodestar/issues/5913
run: timeout 15m yarn test:e2e || { test $? -eq 124 || exit 1; }
env:
GOERLI_RPC_URL: ${{ secrets.GOERLI_RPC_URL!=0 && secrets.GOERLI_RPC_URL || env.GOERLI_RPC_DEFAULT_URL }}

Expand All @@ -230,7 +234,7 @@ jobs:
with:
name: debug-e2e-test-logs-node-${{matrix.node}}
path: test-logs/e2e-test-env

browser-tests:
name: Browser Tests
runs-on: buildjet-4vcpu-ubuntu-2204
Expand All @@ -246,7 +250,7 @@ jobs:
with:
node-version: ${{matrix.node}}
check-latest: true
cache: yarn
cache: yarn
- name: Restore build cache
id: cache-primes-restore
uses: actions/cache/restore@v3
Expand All @@ -256,7 +260,7 @@ jobs:
packages/*/node_modules
lib/
packages/*/lib
packages/*/.git-data.json
packages/*/.git-data.json
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ github.sha }}
fail-on-cache-miss: true

Expand Down Expand Up @@ -290,18 +294,18 @@ jobs:
packages/*/node_modules
lib/
packages/*/lib
packages/*/.git-data.json
packages/*/.git-data.json
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ github.sha }}
fail-on-cache-miss: true

# Download spec tests with cache
- name: Restore spec tests cache
uses: actions/cache@master
with:
path: packages/beacon-node/spec-tests
key: spec-test-data-${{ hashFiles('packages/beacon-node/test/spec/specTestVersioning.ts') }}
- name: Download spec tests
run: yarn download-spec-tests
- name: Download spec tests
run: yarn download-spec-tests
working-directory: packages/beacon-node
# Run them in different steps to quickly identifying which command failed
# Otherwise just doing `yarn test:spec` you can't tell which specific suite failed
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ docker/grafana_dev/dashboards
# EIP-4844 (only commit .ssz file)
packages/beacon-node/trusted_setup.json
packages/beacon-node/trusted_setup.txt
# Ephemery testnet out dir
packages/ephemery/out

# Wallet CLI artifacts
.pass
Expand Down
3 changes: 2 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"packages": ["packages/*"],
"npmClient": "yarn",
"version": "1.11.1",
"useNx": true,
"version": "1.11.3",
"stream": true,
"command": {
"version": {
Expand Down
10 changes: 5 additions & 5 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"bugs": {
"url": "https://github.com/ChainSafe/lodestar/issues"
},
"version": "1.11.1",
"version": "1.11.3",
"type": "module",
"exports": {
".": {
Expand Down Expand Up @@ -71,10 +71,10 @@
"dependencies": {
"@chainsafe/persistent-merkle-tree": "^0.5.0",
"@chainsafe/ssz": "^0.13.0",
"@lodestar/config": "^1.11.1",
"@lodestar/params": "^1.11.1",
"@lodestar/types": "^1.11.1",
"@lodestar/utils": "^1.11.1",
"@lodestar/config": "^1.11.3",
"@lodestar/params": "^1.11.3",
"@lodestar/types": "^1.11.3",
"@lodestar/utils": "^1.11.3",
"eventsource": "^2.0.2",
"qs": "^6.11.1"
},
Expand Down
8 changes: 4 additions & 4 deletions packages/api/src/beacon/client/debug.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {ChainForkConfig} from "@lodestar/config";
import {ApiClientResponse} from "../../interfaces.js";
import {ApiClientResponse, ResponseFormat} from "../../interfaces.js";
import {HttpStatusCode} from "../../utils/client/httpStatusCode.js";
import {generateGenericJsonClient, getFetchOptsSerializers, IHttpClient} from "../../utils/client/index.js";
import {StateId} from "../routes/beacon/state.js";
import {Api, getReqSerializers, getReturnTypes, ReqTypes, routesData, StateFormat} from "../routes/debug.js";
import {Api, getReqSerializers, getReturnTypes, ReqTypes, routesData} from "../routes/debug.js";

// As Jul 2022, it takes up to 3 mins to download states so make this 5 mins for reservation
const GET_STATE_TIMEOUT_MS = 5 * 60 * 1000;
Expand All @@ -25,7 +25,7 @@ export function getClient(_config: ChainForkConfig, httpClient: IHttpClient): Ap
// TODO: Debug the type issue
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
async getState(stateId: string, format?: StateFormat) {
async getState(stateId: string, format?: ResponseFormat) {
if (format === "ssz") {
const res = await httpClient.arrayBuffer({
...fetchOptsSerializers.getState(stateId, format),
Expand All @@ -43,7 +43,7 @@ export function getClient(_config: ChainForkConfig, httpClient: IHttpClient): Ap
// TODO: Debug the type issue
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
async getStateV2(stateId: StateId, format?: StateFormat) {
async getStateV2(stateId: StateId, format?: ResponseFormat) {
if (format === "ssz") {
const res = await httpClient.arrayBuffer({
...fetchOptsSerializers.getStateV2(stateId, format),
Expand Down
6 changes: 3 additions & 3 deletions packages/api/src/beacon/routes/beacon/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
ContainerData,
} from "../../../utils/index.js";
import {HttpStatusCode} from "../../../utils/client/httpStatusCode.js";
import {parseAcceptHeader, writeAcceptHeader} from "../../../utils/acceptHeader.js";
import {ApiClientResponse, ResponseFormat} from "../../../interfaces.js";
import {
SignedBlockContents,
Expand All @@ -31,7 +32,6 @@ import {
// See /packages/api/src/routes/index.ts for reasoning and instructions to add new routes

export type BlockId = RootHex | Slot | "head" | "genesis" | "finalized";
export const mimeTypeSSZ = "application/octet-stream";

/**
* True if the response references an unverified execution payload. Optimistic information may be invalidated at
Expand Down Expand Up @@ -283,9 +283,9 @@ export function getReqSerializers(config: ChainForkConfig): ReqSerializers<Api,
const getBlockReq: ReqSerializer<Api["getBlock"], GetBlockReq> = {
writeReq: (block_id, format) => ({
params: {block_id: String(block_id)},
headers: {accept: format === "ssz" ? mimeTypeSSZ : "application/json"},
headers: {accept: writeAcceptHeader(format)},
}),
parseReq: ({params, headers}) => [params.block_id, headers.accept === mimeTypeSSZ ? "ssz" : "json"],
parseReq: ({params, headers}) => [params.block_id, parseAcceptHeader(headers.accept)],
schema: {params: {block_id: Schema.StringRequired}},
};

Expand Down
14 changes: 6 additions & 8 deletions packages/api/src/beacon/routes/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@ import {
ContainerData,
} from "../../utils/index.js";
import {HttpStatusCode} from "../../utils/client/httpStatusCode.js";
import {ApiClientResponse} from "../../interfaces.js";
import {parseAcceptHeader, writeAcceptHeader} from "../../utils/acceptHeader.js";
import {ApiClientResponse, ResponseFormat} from "../../interfaces.js";
import {ExecutionOptimistic, StateId} from "./beacon/state.js";

// See /packages/api/src/routes/index.ts for reasoning and instructions to add new routes

export type StateFormat = "json" | "ssz";
export const mimeTypeSSZ = "application/octet-stream";

const stringType = new StringType();
const protoNodeSszType = new ContainerType(
{
Expand Down Expand Up @@ -91,7 +89,7 @@ export type Api = {
getState(stateId: StateId, format: "ssz"): Promise<ApiClientResponse<{[HttpStatusCode.OK]: Uint8Array}>>;
getState(
stateId: StateId,
format?: StateFormat
format?: ResponseFormat
): Promise<
ApiClientResponse<{
[HttpStatusCode.OK]: Uint8Array | {data: allForks.BeaconState; executionOptimistic: ExecutionOptimistic};
Expand All @@ -117,7 +115,7 @@ export type Api = {
getStateV2(stateId: StateId, format: "ssz"): Promise<ApiClientResponse<{[HttpStatusCode.OK]: Uint8Array}>>;
getStateV2(
stateId: StateId,
format?: StateFormat
format?: ResponseFormat
): Promise<
ApiClientResponse<{
[HttpStatusCode.OK]:
Expand Down Expand Up @@ -149,9 +147,9 @@ export function getReqSerializers(): ReqSerializers<Api, ReqTypes> {
const getState: ReqSerializer<Api["getState"], ReqTypes["getState"]> = {
writeReq: (state_id, format) => ({
params: {state_id: String(state_id)},
headers: {accept: format === "ssz" ? mimeTypeSSZ : "application/json"},
headers: {accept: writeAcceptHeader(format)},
}),
parseReq: ({params, headers}) => [params.state_id, headers.accept === mimeTypeSSZ ? "ssz" : "json"],
parseReq: ({params, headers}) => [params.state_id, parseAcceptHeader(headers.accept)],
schema: {params: {state_id: Schema.StringRequired}},
};

Expand Down
Loading