-
-
Notifications
You must be signed in to change notification settings - Fork 346
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'unstable' into nh/node-22
- Loading branch information
Showing
130 changed files
with
1,263 additions
and
798 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
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
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 |
---|---|---|
|
@@ -8,9 +8,6 @@ on: | |
push: | ||
branches: | ||
- unstable | ||
paths-ignore: | ||
- 'dashboards/**' | ||
- 'docs/**' | ||
|
||
jobs: | ||
npm: | ||
|
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
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
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,3 @@ | ||
Copy `launch.template.json` as `launch.json` and adapt to your needs. | ||
|
||
See [Debugging](../docs/pages/tools/debugging.md) for more details. |
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,79 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"name": "Attach", | ||
"port": 9229, | ||
"request": "attach", | ||
"skipFiles": [ | ||
"<node_internals>/**" | ||
] | ||
}, | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Beacon", | ||
"skipFiles": [ | ||
"<node_internals>/**" | ||
], | ||
"smartStep": true, | ||
"program": "${workspaceFolder}/packages/cli/bin/lodestar.js", | ||
"args": [ | ||
"beacon" | ||
], | ||
"console": "integratedTerminal" | ||
}, | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Dev", | ||
"skipFiles": [ | ||
"<node_internals>/**" | ||
], | ||
"smartStep": true, | ||
"program": "${workspaceFolder}/packages/cli/bin/lodestar.js", | ||
"args": [ | ||
"dev" | ||
], | ||
"console": "integratedTerminal" | ||
}, | ||
{ | ||
"name": "Test Current File", | ||
"type": "node", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/node_modules/.bin/vitest", | ||
"args": [ | ||
"--run", | ||
"${file}", | ||
"-t", | ||
"${input:testName}", | ||
"--pool", | ||
"threads", | ||
"--poolOptions.threads.singleThread" | ||
], | ||
"cwd": "${workspaceFolder}/${input:packageName}", | ||
"console": "integratedTerminal", | ||
"skipFiles": [ | ||
"<node_internals>/**" | ||
] | ||
} | ||
], | ||
"inputs": [ | ||
{ | ||
"id": "packageName", | ||
"type": "command", | ||
"command": "extension.commandvariable.transform", | ||
"args": { | ||
"text": "${relativeFileDirname}", | ||
"find": "^(packages/[^/]+).*", | ||
"replace": "$1" | ||
} | ||
}, | ||
{ | ||
"id": "testName", | ||
"type": "promptString", | ||
"description": "Enter the test name to run, leave empty to run all" | ||
} | ||
] | ||
} |
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
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
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,24 @@ | ||
# Debugging | ||
|
||
This page describes different approaches for debugging Lodestar. | ||
|
||
## VS Code launch config | ||
|
||
The simplest way to debug is to use the provided [launch.template.json](https://github.com/ChainSafe/lodestar/blob/unstable/.vscode/launch.template.json) `configurations`. Copy them as `.vscode/launch.json` and they will be made available in the `Run and Debug` section in VS Code. Adapt as needed, e.g. by adding additional arguments to the beacon [configuration](https://github.com/ChainSafe/lodestar/blob/unstable/.vscode/launch.template.json#L22) to match your needs. | ||
|
||
VS Code supports debugging Workers out of the box when using those configurations. | ||
|
||
## Attach to running process | ||
|
||
Remote `lodestar` processes can also be debugged by leveraging [node:inspector](https://nodejs.org/api/inspector.html). Adding `--inspect` to the node CLI (e.g. `NODE_OPTIONS=--inspect ./lodestar beacon`) allows to debug the main thread. To debug a specific `Worker`, follow those steps: | ||
|
||
- remove `--inspect` from `node` CLI | ||
- add following code to the `worker` | ||
|
||
```js | ||
import inspector from "node:inspector"; | ||
inspector.open(); | ||
inspector.waitForDebugger(); | ||
``` | ||
|
||
Use VS Code or Chrome devtools to debug those processes. |
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
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
Oops, something went wrong.