Skip to content

Commit

Permalink
Merged in unstable and resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
dadepo committed May 27, 2022
2 parents ee95f1d + c1ed45d commit 2252766
Show file tree
Hide file tree
Showing 1,106 changed files with 12,529 additions and 8,943 deletions.
6 changes: 3 additions & 3 deletions .benchrc.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Mocha opts
extension: ["ts"]
colors: true
require:
- ts-node/register
- packages/lodestar/test/setupBLS.ts
node-option:
- "loader=ts-node/register"

# benchmark opts
threshold: 3
Expand Down
33 changes: 30 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ module.exports = {
parserOptions: {
ecmaVersion: 10,
project: "./tsconfig.json",
sourceType: "module",
},
plugins: ["@typescript-eslint", "eslint-plugin-import", "eslint-plugin-node", "no-only-tests", "prettier"],
plugins: ["@typescript-eslint", "eslint-plugin-import", "@chainsafe/eslint-plugin-node", "no-only-tests", "prettier"],
extends: [
"eslint:recommended",
"plugin:import/errors",
Expand All @@ -26,6 +27,19 @@ module.exports = {
"prettier/prettier": "error",
//doesnt work, it reports false errors
"constructor-super": "off",
"import/order" : [
"error",
{ "groups":
[
"builtin",
"external",
"internal",
"parent",
"sibling",
"index",
],
}
],
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/naming-convention": [
"error",
Expand Down Expand Up @@ -69,7 +83,8 @@ module.exports = {
},
],
"@typescript-eslint/func-call-spacing": "error",
"@typescript-eslint/member-ordering": "error",
// TODO after upgrading es-lint, member-ordering is now leading to lint errors. Set to warning now and fix in another PR
"@typescript-eslint/member-ordering": "warn",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/no-unused-vars": [
Expand Down Expand Up @@ -110,7 +125,7 @@ module.exports = {
//if --fix is run it messes imports like /lib/presets/minimal & /lib/presets/mainnet
"import/no-duplicates": "off",
"import/no-relative-packages": "error",
"node/no-deprecated-api": "error",
"@chainsafe/node/no-deprecated-api": "error",
"new-parens": "error",
"no-caller": "error",
"no-bitwise": "off",
Expand Down Expand Up @@ -147,8 +162,20 @@ module.exports = {

// Prevents accidentally pushing a commit with .only in Mocha tests
"no-only-tests/no-only-tests": "error",

// TEMP Disabled while eslint-plugin-import support ESM (Typescript does support it) https://github.com/import-js/eslint-plugin-import/issues/2170
"import/no-unresolved": "off",

"@chainsafe/node/file-extension-in-import": [
"error",
"always",
{
"esm": true
}
],
},
settings: {
"import/internal-regex": "^@chainsafe/",
"import/core-modules": [
"node:child_process",
"node:crypto",
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ jobs:
- name: Run benchmarks
run: yarn benchmark
env:
# To download content for tests
INFURA_ETH2_CREDENTIALS: ${{ secrets.INFURA_ETH2_CREDENTIALS }}
# To write to PRs and commits
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# benchmark options
BENCHMARK_S3: true
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '19 21 * * 3'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
52 changes: 34 additions & 18 deletions .github/workflows/release-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,39 @@ jobs:
run: yarn build
if: steps.cache-deps.outputs.cache-hit == 'true'
# </common-build>
- name: Get version
id: version
run: |
PACKAGE_VERSION=$(node -p "require('./packages/lodestar/package.json').version")
export VERSION=${PACKAGE_VERSION}-dev.${GITHUB_SHA:0:10}
echo "::set-output name=version::$VERSION"
echo PACKAGE_VERSION $PACKAGE_VERSION GITHUB_SHA $GITHUB_SHA VERSION $VERSION
- name: Change and commit version
# Write version before publishing so it's picked up by `lerna publish from-package`.
# It must also be committed to ensure a clean git tree, otherwise `lerna publish` errors.
# This "temp" commit doesn't change the actually release commit which is captured above.
# git-data is also correct, since it's generated at build time, before `lerna version` run.
run: |
node_modules/.bin/lerna version ${{ steps.version.outputs.version }} \
--force-publish \
--exact \
--yes \
--no-git-tag-version
git config user.name 'temp'
git config user.email '[email protected]'
git commit -am "${{ steps.version.outputs.version }}"
- name: Publish to npm registry
# Just use lerna publish with --canary option. Using 'from-package' ignore other options
# and only compares against the verison in package.json, and skips release if already
# published.
# Note: before https://github.com/ChainSafe/lodestar/commit/28e2c74cf0f1bede8b09c8c9fec26f54b367e3fd
# We used `lerna publish --canary` option. However, since we now publish must version on branches,
# i.e. v0.35.x branch, lerna fails to detect the latest version and publishes canary versions as
# `0.34.0-dev.173+28e2c74cf0` instead of `0.36.0-dev.4+28e2c74cf0`, which creates confusion.
#
# --no-git-reset:
# Do not delete code version artifacts so the next step can pick the version
#
# --canary:
# Format version with commit (1.1.0-alpha.0+81e3b443). Make sure the previous
# released tags are not lightweight("commit" type), but proper annotated ("tag" type)
# Otherwise the version canary will generate will be from last annotated tag type
# Best way to create such a tag is by using 'git tag -a' or using lerna publish!
#
# --dist-tag next:
# Make this nightly version installable with `@next`
#
Expand All @@ -71,17 +89,15 @@ jobs:
#
# NOTE: Using --preid dev.$(git rev-parse --short=7 HEAD) results in `0.24.3-dev.3ddb91d.0+3ddb91d`
run: |
node_modules/.bin/lerna publish --yes --no-verify-access \
--canary --dist-tag next --no-git-reset --force-publish \
--preid dev --exact
node_modules/.bin/lerna publish from-package \
--yes \
--no-verify-access \
--dist-tag next \
--no-git-reset \
--force-publish \
--exact
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Get version
id: version
run: |
VERSION=$(node -p "require('./packages/lodestar/package.json').version")
echo VERSION $VERSION
echo "::set-output name=version::$VERSION"
outputs:
version: ${{ steps.version.outputs.version }}

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test-sim-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: Sim merge tests
on: [pull_request, push]

env:
GETH_COMMIT: e0e8bf31c5d44f7de33ce774b221debf2c42256c
NETHERMIND_COMMIT: 29ffe2630afb69120004ff79bde70d37a3b80b7b
GETH_COMMIT: bb5633c5ee3975ce016636066ec790054ec469e4
NETHERMIND_COMMIT: 00b50532543824dbac65e8b7ab09484e44992c27

jobs:
sim-merge-tests:
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
EL_BINARY_DIR: ../../go-ethereum/build/bin
EL_SCRIPT_DIR: kiln/geth
ENGINE_PORT: 8551
EL_PORT: 8545
ETH_PORT: 8545
TX_SCENARIOS: simple

# Install Nethermind merge interop
Expand All @@ -69,8 +69,8 @@ jobs:
env:
EL_BINARY_DIR: ../../nethermind/src/Nethermind/Nethermind.Runner
EL_SCRIPT_DIR: kiln/nethermind
EL_PORT: 8550
ENGINE_PORT: 8551
ETH_PORT: 8545

- name: Upload debug log test files
if: ${{ always() }}
Expand Down
23 changes: 4 additions & 19 deletions .github/workflows/test-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,31 +43,16 @@ jobs:
- name: Download spec tests
run: yarn download-spec-tests
working-directory: packages/lodestar
- name: Check spec tests
run: yarn check-spec-tests
working-directory: packages/lodestar

# 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
# many of the suites have identical names for minimal and mainnet
- name: Spec tests general
run: yarn test:spec-general
working-directory: packages/lodestar
- name: Spec tests phase0-minimal
run: yarn test:spec-phase0-minimal
working-directory: packages/lodestar
- name: Spec tests phase0-mainnet
run: yarn test:spec-phase0-mainnet
working-directory: packages/lodestar
- name: Spec tests altair-minimal
run: yarn test:spec-altair-minimal
working-directory: packages/lodestar
- name: Spec tests altair-mainnet
run: yarn test:spec-altair-mainnet
working-directory: packages/lodestar
- name: Spec tests bellatrix-minimal
run: yarn test:spec-bellatrix-minimal
- name: Spec tests minimal
run: yarn test:spec-minimal
working-directory: packages/lodestar
- name: Spec tests bellatrix-mainnet
run: yarn test:spec-bellatrix-mainnet
- name: Spec tests mainnet
run: yarn test:spec-mainnet
working-directory: packages/lodestar
7 changes: 5 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,13 @@ jobs:

- name: Check Types
run: yarn run check-types
- name: README check
run: yarn run check-readme
# TODO: uncomment after https://github.com/bbc/typescript-docs-verifier/issues/17 is resolved
# - name: README check
# run: yarn run check-readme
- name: Lint
run: yarn lint
- name: Check Build
run: yarn check-build
- name: Unit tests
run: yarn test:unit
- name: Upload coverage data
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ docs/reference/cli.md
.lodestar
*.ssz
.pyrmont
packages/lodestar/.tmpdb/
.tmpdb

# Wallet CLI artifacts
.pass
Expand Down
5 changes: 3 additions & 2 deletions .mocharc.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
extension: ["ts"]
colors: true
require:
- ts-node/register
node-option:
- "loader=ts-node/esm"
6 changes: 3 additions & 3 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ In the same day:
3. The selected commit is tagged as `v0.34.0-beta.0`, released, and published for testing as a Pre-Release

```
export TAG=v0.34.0-beta.0 && git tag -a $TAG 9fceb02 -m "$TAG" && git push origin $TAG
yarn release -t v0.34.0-beta.0
```

4. The team creates a PR to bump `master` to the next version (in the example: `v0.35.0`) and continues releasing nightly builds.

```
lerna version minor --no-git-tag-version --force-publish
lerna version minor --no-git-tag-version --force-publish --yes
```

After 3-5 days of testing:

5. Tag final stable commit as `v0.34.0`, release and publish the stable release. This commit will be in `v0.34.x` branch and may note be on `master` if beta candidate required bug fixes.

```
export TAG=v0.34.0 && git tag -a $TAG 9fceb02 -m "$TAG" && git push origin $TAG
yarn release -t v0.34.0
```

## Pre-Releases
Expand Down
12 changes: 12 additions & 0 deletions dashboards/lodestar_general.json
Original file line number Diff line number Diff line change
Expand Up @@ -8632,6 +8632,18 @@
"interval": "",
"legendFormat": "till processed",
"refId": "B"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "delta(lodestar_gossip_block_elapsed_time_till_become_head_sum[$__rate_interval])\n/\ndelta(lodestar_gossip_block_elapsed_time_till_become_head_count[$__rate_interval])",
"hide": false,
"interval": "",
"legendFormat": "till become head",
"refId": "C"
}
],
"title": "Gossip Block Received Delay",
Expand Down
6 changes: 6 additions & 0 deletions docker/from_source.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ RUN yarn install --non-interactive --frozen-lockfile --ignore-scripts
COPY . .
RUN yarn install --non-interactive --frozen-lockfile && yarn build

# To have access to the specific branch and commit used to build this source,
# a git-data.json file is created by persisting git data at build time. Then,
# a version string like `v0.35.0-beta.0/HEAD/82219149 (git)` can be shown in
# the terminal and in the logs; which is very useful to track tests better.
RUN cd packages/cli && yarn write-git-data

# Copy built src + node_modules to a new layer to prune unnecessary fs
# Previous layer weights 7.25GB, while this final 488MB (as of Oct 2020)
FROM node:16-alpine
Expand Down
Loading

0 comments on commit 2252766

Please sign in to comment.