Skip to content

Commit 5d93a62

Browse files
authored
chore: v1.15.0 release (#6347)
2 parents 5ac2fae + 92ed347 commit 5d93a62

File tree

378 files changed

+5059
-6319
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

378 files changed

+5059
-6319
lines changed

.c8rc.json

-21
This file was deleted.

.eslintrc.js

+17-18
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ module.exports = {
44
browser: true,
55
es6: true,
66
node: true,
7+
// Performance tests still use mocha
78
mocha: true,
89
},
910
globals: {
@@ -110,7 +111,11 @@ module.exports = {
110111
"error",
111112
{
112113
groups: ["builtin", "external", "internal", "parent", "sibling", "index"],
113-
pathGroups: [{pattern: "@lodestar/**", group: "internal"}],
114+
pathGroups: [
115+
{pattern: "@lodestar/**", group: "internal"},
116+
// We want mocks to be imported before any internal code
117+
{pattern: "**/mocks/**", group: "internal"},
118+
],
114119
pathGroupsExcludedImportTypes: ["builtin"],
115120
},
116121
],
@@ -201,24 +206,18 @@ module.exports = {
201206
},
202207
{
203208
files: ["**/test/**/*.test.ts"],
204-
plugins: ["mocha", "chai-expect"],
205-
extends: ["plugin:mocha/recommended", "plugin:chai-expect/recommended"],
209+
plugins: ["vitest"],
210+
extends: ["plugin:vitest/recommended"],
206211
rules: {
207-
// We observed that having multiple top level "describe" save valuable indentation
208-
// https://github.com/lo1tuma/eslint-plugin-mocha/blob/master/docs/rules/max-top-level-suites.md
209-
"mocha/max-top-level-suites": "off",
210-
// We need to disable because we disabled "mocha/no-setup-in-describe" rule
211-
// TODO: Move all setup code to before/beforeEach and then disable async describe
212-
// https://github.com/lo1tuma/eslint-plugin-mocha/blob/master/docs/rules/no-async-describe.md
213-
"mocha/no-async-describe": "off",
214-
// Use of arrow functions are very common
215-
"mocha/no-mocha-arrows": "off",
216-
// It's common to call function inside describe block
217-
// https://github.com/lo1tuma/eslint-plugin-mocha/blob/master/docs/rules/no-setup-in-describe.md
218-
"mocha/no-setup-in-describe": "off",
219-
// We use to split before in small isolated tasks
220-
// https://github.com/lo1tuma/eslint-plugin-mocha/blob/master/docs/rules/no-sibling-hooks.md
221-
"mocha/no-sibling-hooks": "off",
212+
"vitest/consistent-test-it": ["error", {fn: "it", withinDescribe: "it"}],
213+
// We use a lot dynamic assertions so tests may not have usage of expect
214+
"vitest/expect-expect": "off",
215+
"vitest/no-disabled-tests": "warn",
216+
"vitest/no-focused-tests": "error",
217+
"vitest/prefer-called-with": "error",
218+
"vitest/prefer-spy-on": "error",
219+
// Our usage contains dynamic test title, this rule enforce static string value
220+
"vitest/valid-title": "off",
222221
},
223222
},
224223
{

.github/workflows/docs-check.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ jobs:
3939
run: scripts/wordlist_sort_check.sh
4040

4141
- name: Build and collect docs
42-
run: yarn build:docs
42+
run: yarn docs:build
4343

4444
# Run prettier check with fix after generating the docs. The CLI reference is formatted with prettier for
4545
# deployed version so this will fail if not "fixable"
4646
- name: Check docs format
47-
run: yarn lint-docs:fix
47+
run: yarn docs:lint:fix
4848

4949
# Run spellcheck AFTER building docs, in case the CLI reference has issues
5050
- name: Spellcheck

.github/workflows/docs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ jobs:
5757
if: steps.cache-deps.outputs.cache-hit == 'true'
5858

5959
- name: Build and collect docs
60-
run: yarn build:docs
60+
run: yarn docs:build
6161

6262
- name: Lint built docs
63-
run: yarn lint-docs:fix
63+
run: yarn docs:lint:fix
6464

6565
- name: Set up Python
6666
uses: actions/setup-python@v1

.github/workflows/test-sim.yml

+7
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ on:
1616
description: Runtime DEBUG value
1717
required: false
1818
default: ""
19+
genesisDelaySlots:
20+
description: 'Number of slots delay before genesis'
21+
required: true
22+
type: number
23+
default: 40
1924

2025
env:
2126
GETH_DOCKER_IMAGE: ethereum/client-go:v1.11.6
@@ -56,6 +61,8 @@ jobs:
5661
- name: Sim tests multifork
5762
run: DEBUG='${{github.event.inputs.debug}}' yarn test:sim:multifork
5863
working-directory: packages/cli
64+
env:
65+
GENESIS_DELAY_SLOTS: ${{github.event.inputs.genesisDelaySlots}}
5966

6067
- name: Sim tests endpoints
6168
run: yarn test:sim:endpoints

.github/workflows/test.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,15 @@ jobs:
321321
# Run them in different steps to quickly identifying which command failed
322322
# Otherwise just doing `yarn test:spec` you can't tell which specific suite failed
323323
# many of the suites have identical names for minimal and mainnet
324-
- name: Spec tests bls-general
325-
run: yarn test:spec-bls-general
324+
- name: Spec tests general
325+
run: yarn test:spec:general
326326
working-directory: packages/beacon-node
327+
- name: Spec tests bls
328+
run: yarn test:spec:bls
329+
working-directory: packages/beacon-node
327330
- name: Spec tests minimal
328-
run: yarn test:spec-minimal
331+
run: yarn test:spec:minimal
329332
working-directory: packages/beacon-node
330333
- name: Spec tests mainnet
331-
run: NODE_OPTIONS='--max-old-space-size=4096' yarn test:spec-mainnet
334+
run: NODE_OPTIONS='--max-old-space-size=4096' yarn test:spec:mainnet
332335
working-directory: packages/beacon-node

.mocharc.yaml

-4
This file was deleted.

.nycrc.json

-17
This file was deleted.

.wordlist.txt

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Chai
1414
ChainSafe
1515
Customizations
1616
DPoS
17+
DVs
1718
Discv
1819
DockerHub
1920
Dockerized
@@ -83,6 +84,7 @@ UPnP
8384
UTF
8485
VM
8586
Vitalik
87+
Vitest
8688
Wagyu
8789
api
8890
async
@@ -122,6 +124,7 @@ envs
122124
ephemery
123125
flamegraph
124126
flamegraphs
127+
getNetworkIdentity
125128
gnosis
126129
goerli
127130
heapdump
@@ -172,6 +175,7 @@ scalability
172175
secp
173176
sepolia
174177
sharding
178+
src
175179
ssz
176180
stakers
177181
subnet
@@ -186,6 +190,7 @@ util
186190
utils
187191
validator
188192
validators
193+
vitest
189194
wip
190195
xcode
191196
yaml

CONTRIBUTING.md

+28-4
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,25 @@ Contributing to tests:
3939
- Do not pull unpinned versions from DockerHub (use deterministic tag) or Github (checkout commit not branch).
4040
- Carefully design tests that depend on timing sensitive events like p2p network e2e tests. Consider that Github runners are significantly less powerful than your development environment.
4141

42+
### Common Issues
43+
44+
**Error: [vitest] Cannot mock "../../src/db/repositories/index.js" because it is already loaded by "src/db/beacon.ts"**
45+
46+
If you observe any error in tests with matching to above error message, that implies you are loading the mocks in the wrong order. The correct order is to import the mocks first and then the actual module. We suggest to import the mocks on very top before any local modules.
47+
48+
**✖ Error: Cannot find package 'async_hooks' imported from**
49+
50+
If you observe following error running any of the test files that means you are running a file which itself or any dependency of that file imports `vitest`, but you are not running that file with `vitest` runner. Try running it with `yarn vitest` command, not with `node` command.
51+
4252
### Debugging Spec Tests
4353

4454
- To fix errors always focus on passing all minimal tests first without running mainnet tests.
45-
- Spec tests often compare full expected vs actual states in JSON format. To better understand the diff it's convenient to use mocha's option `--inline-diffs`.
46-
- A single logical error can cause many spec tests to fail. To focus on a single test at a time you can use mocha's option `--bail` to stop at the first failed test
47-
- To then run only that failed test you can run against a specific file as use mocha's option `--grep` to run only one case
55+
- Spec tests often compare full expected vs actual states in JSON format.
56+
- A single logical error can cause many spec tests to fail. To focus on a single test at a time you can use vitest's option `--bail` to stop at the first failed test
57+
- To then run only that failed test you can run against a specific file as use vitest's filters to run only one case
4858

4959
```sh
50-
LODESTAR_PRESET=minimal ../../node_modules/.bin/mocha --config .mocharc.spec.yml test/spec/phase0/sanity.test.ts --inline-diffs --bail --grep "attestation"
60+
LODESTAR_PRESET=minimal yarn vitest --run --config vitest.config.spec.ts test/spec/phase0/sanity.test.ts
5161
```
5262

5363
## Docker
@@ -229,6 +239,20 @@ Run script to download dashboards to `./dashboards` folder
229239
node scripts/download_dashboards.mjs
230240
```
231241

242+
## Contributing to Documentation
243+
244+
When submitting PRs for documentation updates, build and run the documentation locally to ensure functionality before submission. For first time documentation contributors, install the python dependencies with `yarn docs:install`. Build the documentation locally with `yarn docs:build` and serve with `yarn docs:serve`
245+
246+
Your locally served documentation will then be accessible at http://localhost:8000.
247+
248+
If you run into build issues due to circular dependencies, branch switching or other incompatibilities, try cleaning your modules and rebuild your dependencies with:
249+
250+
```sh
251+
yarn clean && yarn clean:nm && yarn && yarn build
252+
```
253+
254+
We also use a spelling [word list](https://github.com/ChainSafe/lodestar/blob/unstable/.wordlist.txt) as part of our documentation checks. If using unrecognized words or abbreviations, please extend the word list to pass checks. Make sure the list is sorted with `./scripts/wordlist_sort.sh` and checked with `./scripts/wordlist_sort_check.sh` for sorting and duplicates.
255+
232256
## Label Guide
233257

234258
Issues and pull requests are subject to the following labeling guidelines.

Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ FROM node:20-alpine
3939
WORKDIR /usr/app
4040
COPY --from=build_deps /usr/app .
4141

42-
# NodeJS applications have a default memory limit of 2.5GB.
43-
# This limit is bit tight for a Prater node, it is recommended to raise the limit
42+
# NodeJS applications have a default memory limit of 4GB on most machines.
43+
# This limit is bit tight for a Mainnet node, it is recommended to raise the limit
4444
# since memory may spike during certain network conditions.
45-
ENV NODE_OPTIONS=--max-old-space-size=4096
45+
ENV NODE_OPTIONS=--max-old-space-size=8192
4646

4747
ENTRYPOINT ["node", "./packages/cli/bin/lodestar"]

0 commit comments

Comments
 (0)