diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 671434fe19ad..e515bef7f92a 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -33,7 +33,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 22.4 + node-version: 22 check-latest: true cache: yarn - name: Node.js version diff --git a/.github/workflows/binaries.yml b/.github/workflows/binaries.yml index 722894424b91..469b0803c378 100644 --- a/.github/workflows/binaries.yml +++ b/.github/workflows/binaries.yml @@ -42,7 +42,7 @@ jobs: sudo apt-get install -y build-essential python3 - uses: "./.github/actions/setup-and-build" with: - node: 22.4 + node: 22 - run: | mkdir -p dist yarn global add caxa@3.0.1 diff --git a/.github/workflows/docs-check.yml b/.github/workflows/docs-check.yml index bd7310995d62..180f1c16fdaa 100644 --- a/.github/workflows/docs-check.yml +++ b/.github/workflows/docs-check.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 22.4 + node-version: 22 cache: yarn - name: Node.js version id: node diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a4c0f18cdbe3..cec2bca86b4b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -31,7 +31,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: 22.4 + node-version: 22 check-latest: true cache: yarn diff --git a/.github/workflows/publish-dev.yml b/.github/workflows/publish-dev.yml index 4e8c76e0dfdd..cb08c5c8fae0 100644 --- a/.github/workflows/publish-dev.yml +++ b/.github/workflows/publish-dev.yml @@ -20,7 +20,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-node@v4 with: - node-version: 22.4 + node-version: 22 registry-url: "https://registry.npmjs.org" check-latest: true cache: yarn diff --git a/.github/workflows/publish-rc.yml b/.github/workflows/publish-rc.yml index 936072de42c9..e16cbce814dc 100644 --- a/.github/workflows/publish-rc.yml +++ b/.github/workflows/publish-rc.yml @@ -61,7 +61,7 @@ jobs: - uses: "./.github/actions/setup-and-build" with: - node: 22.4 + node: 22 - name: Generate changelog run: node scripts/generate_changelog.mjs ${{ needs.tag.outputs.prev_tag }} ${{ needs.tag.outputs.tag }} CHANGELOG.md diff --git a/.github/workflows/publish-stable.yml b/.github/workflows/publish-stable.yml index c2909a7e4e24..26fee0ba6052 100644 --- a/.github/workflows/publish-stable.yml +++ b/.github/workflows/publish-stable.yml @@ -67,7 +67,7 @@ jobs: - uses: "./.github/actions/setup-and-build" with: - node: 22.4 + node: 22 - name: Generate changelog run: node scripts/generate_changelog.mjs ${{ needs.tag.outputs.prev_tag }} ${{ needs.tag.outputs.tag }} CHANGELOG.md diff --git a/.github/workflows/test-sim-merge.yml b/.github/workflows/test-sim-merge.yml index 0042a9337bc3..ad79bc2c0035 100644 --- a/.github/workflows/test-sim-merge.yml +++ b/.github/workflows/test-sim-merge.yml @@ -30,7 +30,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 22.4 + node-version: 22 check-latest: true cache: yarn - name: Node.js version diff --git a/.github/workflows/test-sim.yml b/.github/workflows/test-sim.yml index fbe2691da637..ff28149537d3 100644 --- a/.github/workflows/test-sim.yml +++ b/.github/workflows/test-sim.yml @@ -31,7 +31,7 @@ jobs: - uses: actions/checkout@v4 - uses: "./.github/actions/setup-and-build" with: - node: 22.4 + node: 22 sim-test-multifork: name: Multifork sim test @@ -42,7 +42,7 @@ jobs: - uses: actions/checkout@v4 - uses: "./.github/actions/setup-and-build" with: - node: 22.4 + node: 22 - name: Load env variables uses: ./.github/actions/dotenv - name: Download required docker images before running tests @@ -71,7 +71,7 @@ jobs: - uses: actions/checkout@v4 - uses: "./.github/actions/setup-and-build" with: - node: 22.4 + node: 22 - name: Load env variables uses: ./.github/actions/dotenv - name: Download required docker images before running tests @@ -100,7 +100,7 @@ jobs: - uses: actions/checkout@v4 - uses: "./.github/actions/setup-and-build" with: - node: 22.4 + node: 22 - name: Load env variables uses: ./.github/actions/dotenv - name: Download required docker images before running tests @@ -129,7 +129,7 @@ jobs: - uses: actions/checkout@v4 - uses: "./.github/actions/setup-and-build" with: - node: 22.4 + node: 22 - name: Load env variables uses: ./.github/actions/dotenv - name: Download required docker images before running tests @@ -158,7 +158,7 @@ jobs: - uses: actions/checkout@v4 - uses: "./.github/actions/setup-and-build" with: - node: 22.4 + node: 22 - name: Load env variables uses: ./.github/actions/dotenv - name: Download required docker images before running tests diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5514f6e896b7..4e4aa33a4d43 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - node: [22.4] + node: [22] steps: # - Uses YAML anchors in the future - uses: actions/checkout@v4 @@ -42,7 +42,7 @@ jobs: strategy: fail-fast: false matrix: - node: [22.4] + node: [22] steps: - uses: actions/checkout@v4 - uses: "./.github/actions/setup-and-build" @@ -71,7 +71,7 @@ jobs: strategy: fail-fast: false matrix: - node: [22.4] + node: [22] steps: - uses: actions/checkout@v4 @@ -92,7 +92,7 @@ jobs: strategy: fail-fast: false matrix: - node: [22.4] + node: [22] steps: - uses: actions/checkout@v4 - uses: "./.github/actions/setup-and-build" @@ -131,7 +131,7 @@ jobs: strategy: fail-fast: false matrix: - node: [22.4] + node: [22] steps: # - Uses YAML anchors in the future - uses: actions/checkout@v4 @@ -168,7 +168,7 @@ jobs: strategy: fail-fast: false matrix: - node: [22.4] + node: [22] steps: # - Uses YAML anchors in the future - uses: actions/checkout@v4 @@ -176,9 +176,9 @@ jobs: with: node: ${{ matrix.node }} - name: Install Chrome browser - run: npx @puppeteer/browsers install chromedriver@latest --path /tmp + run: npx @puppeteer/browsers install chromedriver@stable --path /tmp - name: Install Firefox browser - run: npx @puppeteer/browsers install firefox@latest --path /tmp + run: npx @puppeteer/browsers install firefox@stable --path /tmp - name: Browser tests run: | export DISPLAY=':99.0' @@ -192,7 +192,7 @@ jobs: strategy: fail-fast: false matrix: - node: [22.4] + node: [22] steps: - uses: actions/checkout@v4 - uses: "./.github/actions/setup-and-build" diff --git a/.wordlist.txt b/.wordlist.txt index 5070aafcf9a5..d74291a2fb0c 100644 --- a/.wordlist.txt +++ b/.wordlist.txt @@ -198,7 +198,6 @@ namespaces nodemodule orchestrator osx -overriden params performant pid diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 24d087810980..ca5a28442fd8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -126,6 +126,8 @@ Unsure where to begin contributing to Lodestar? Here are some ideas! 5. Make an open pull request when you're ready for it to be reviewed. We review PRs on a regular basis. See Pull request etiquette for more information. 6. You may be asked to sign a Contributor License Agreement (CLA). We make it relatively painless with CLA-bot. +Please note that trivial, non-code contributions such as spelling, grammar, typos, corrections, comments and link fixes are not acceptable pull requests. Although we appreciate the effort to fix these valid concerns, it is not practical for us to run our CI systems to accommodate minor external contributions which generate minimal value for the purpose of contribution/airdrop farming. It would be appreciated for you to open up an issue instead for our team to aggregate these types of contributions into a batch commit. + ## Github Style Guide **Branch Naming** diff --git a/Dockerfile b/Dockerfile index 0ee8083c85e2..5a1f51bfcee6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # --platform=$BUILDPLATFORM is used build javascript source with host arch # Otherwise TS builds on emulated archs and can be extremely slow (+1h) -FROM --platform=${BUILDPLATFORM:-amd64} node:22.4-slim AS build_src +FROM --platform=${BUILDPLATFORM:-amd64} node:22-slim AS build_src ARG COMMIT WORKDIR /usr/app RUN apt-get update && apt-get install -y g++ make python3 python3-setuptools && apt-get clean && rm -rf /var/lib/apt/lists/* @@ -21,7 +21,7 @@ RUN cd packages/cli && GIT_COMMIT=${COMMIT} yarn write-git-data # Copy built src + node_modules to build native packages for archs different than host. # Note: This step is redundant for the host arch -FROM node:22.4-slim AS build_deps +FROM node:22-slim AS build_deps WORKDIR /usr/app RUN apt-get update && apt-get install -y g++ make python3 python3-setuptools && apt-get clean && rm -rf /var/lib/apt/lists/* @@ -35,7 +35,7 @@ RUN cd node_modules/classic-level && yarn rebuild # 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:22.4-slim +FROM node:22-slim WORKDIR /usr/app COPY --from=build_deps /usr/app . diff --git a/README.md b/README.md index e03de683a9de..53c53cee8621 100644 --- a/README.md +++ b/README.md @@ -70,9 +70,9 @@ Read our [contributors document](/CONTRIBUTING.md), [submit an issue](https://gi ## Meetings -Weekly contributor meetings are public and announced on Discord. Feel free to check out our meeting notes and documents on [HackMD](https://hackmd.io/@wemeetagain/rJTEOdqPS/%2FXBzvaQgMTyyMJuToWAEDjw). Post-September 2021, meeting notes can be found on the [Lodestar Wiki Page](https://github.com/ChainSafe/lodestar/wiki). +Weekly contributor meetings are posted under [Discussions](https://github.com/ChainSafe/lodestar/discussions) and topics are welcomed by any participant in the relevant meeting thread. Feel free to check out our meeting notes and documents on [HackMD](https://hackmd.io/@wemeetagain/rJTEOdqPS/%2FXBzvaQgMTyyMJuToWAEDjw). Post-September 2021, meeting notes can be found on the [Lodestar Wiki Page](https://github.com/ChainSafe/lodestar/wiki). ## Donations We are a local group of Toronto open-source developers. As such, all of our open-source work is funded by grants. We all take the time out of our hectic lives to contribute to the Ethereum ecosystem. -If you want to donate, you can send us ETH at the following address: `lodestar.chainsafe.eth` +If you want to donate, you can find the ETH address under "Sponsor this project" on this repository. diff --git a/RELEASE.md b/RELEASE.md index bb40b611ebe5..6d831ddb3bd4 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -69,7 +69,7 @@ Tagging a release candidate will trigger CI to publish to NPM, dockerhub, and Gi Once a release candidate is created, the Lodestar team begins a testing period. -If there is a bug discovered during the testing period which significantly impacts performance, security, or stability, and it is determined that it is no longer prudent to promote the `rc.x` candidate to `stable`, then it will await a bug fix by the team. The fix will be committed to `unstable` first, then cherrypicked into the `rc/v1.1.0` branch. Then we publish and promote the new commit to `rc.x+1`. The 3 day testing period will reset. +If there is a bug discovered during the testing period which significantly impacts performance, security, or stability, and it is determined that it is no longer prudent to promote the `rc.x` candidate to `stable`, then it will await a bug fix by the team. The fix will be committed to `unstable` first, then cherrypicked into the `rc/v1.1.0` branch. Then we publish and promote the new commit to `rc.x+1`. The 3-day testing period will reset. For example: After 3-5 days of testing, is performance equal to or better than latest stable? diff --git a/dashboards/lodestar_summary.json b/dashboards/lodestar_summary.json index 87eaed30bd3e..a3bfbd61f38a 100644 --- a/dashboards/lodestar_summary.json +++ b/dashboards/lodestar_summary.json @@ -104,6 +104,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -351,10 +352,12 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "auto" + "textMode": "auto", + "wideLayout": true }, - "pluginVersion": "10.1.1", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { @@ -368,7 +371,6 @@ } ], "title": "Peer Count", - "transformations": [], "type": "stat" }, { @@ -401,10 +403,12 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "auto" + "textMode": "auto", + "wideLayout": true }, - "pluginVersion": "10.1.1", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { @@ -450,10 +454,12 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "auto" + "textMode": "auto", + "wideLayout": true }, - "pluginVersion": "10.1.1", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { @@ -499,10 +505,12 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "auto" + "textMode": "auto", + "wideLayout": true }, - "pluginVersion": "10.1.1", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { @@ -552,10 +560,12 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "value" + "textMode": "value", + "wideLayout": true }, - "pluginVersion": "10.1.1", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { @@ -603,10 +613,12 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "value" + "textMode": "value", + "wideLayout": true }, - "pluginVersion": "10.1.1", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { @@ -654,10 +666,12 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "auto" + "textMode": "auto", + "wideLayout": true }, - "pluginVersion": "10.1.1", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { @@ -724,10 +738,12 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "value" + "textMode": "value", + "wideLayout": true }, - "pluginVersion": "10.1.1", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { @@ -776,10 +792,12 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "name" + "textMode": "name", + "wideLayout": true }, - "pluginVersion": "10.1.1", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { @@ -832,10 +850,12 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "name" + "textMode": "name", + "wideLayout": true }, - "pluginVersion": "10.1.1", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { @@ -852,7 +872,6 @@ } ], "title": "Lodestar version", - "transformations": [], "type": "stat" }, { @@ -888,10 +907,12 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "name" + "textMode": "name", + "wideLayout": true }, - "pluginVersion": "10.1.1", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { @@ -920,6 +941,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -1014,6 +1036,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -1057,7 +1080,6 @@ "y": 9 }, "id": 196, - "links": [], "options": { "graph": {}, "legend": { @@ -1123,6 +1145,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -1218,6 +1241,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "GWei", @@ -1324,9 +1348,11 @@ "fields": "", "values": false }, - "textMode": "value_and_name" + "showPercentChange": false, + "textMode": "value_and_name", + "wideLayout": true }, - "pluginVersion": "10.1.1", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { @@ -1355,6 +1381,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -1509,6 +1536,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -1570,7 +1598,7 @@ "uid": "${DS_PROMETHEUS}" }, "editorMode": "code", - "expr": "rate(lodestar_gossip_block_elapsed_time_till_processed_count[$rate_interval])\n- on(instance)\nrate(lodestar_gossip_block_elapsed_time_till_processed_bucket{le=\"4\"}[$rate_interval])", + "expr": "rate(lodestar_gossip_block_elapsed_time_till_processed_count[$rate_interval])\n- on(instance)\nrate(lodestar_gossip_block_elapsed_time_till_processed_bucket{le=\"4.0\"}[$rate_interval])", "legendFormat": "__auto", "range": true, "refId": "A" @@ -1590,6 +1618,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -1670,6 +1699,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -2818,8 +2848,7 @@ ], "refresh": "10s", "revision": 1, - "schemaVersion": 38, - "style": "dark", + "schemaVersion": 39, "tags": [ "lodestar" ], diff --git a/docs/pages/contribution/testing/index.md b/docs/pages/contribution/testing/index.md index ecef1ef22c56..a9795670fa82 100644 --- a/docs/pages/contribution/testing/index.md +++ b/docs/pages/contribution/testing/index.md @@ -2,7 +2,7 @@ Testing is critical to the Lodestar project and there are many types of tests that are run to build a product that is both effective AND efficient. This page will help to break down the different types of tests you will find in the Lodestar repo. -There are few flags you can set through env variables to override behavior of testing and it's output. +There are a few flags you can set through env variables to override behavior of testing and its output. | ENV variable | Effect | Impact | | ------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------- | @@ -24,7 +24,7 @@ Node.js is an unforgiving virtual machine when it comes to high performance, mul ### End-To-End Tests -E2E test are where Lodestar is run in its full form, often from the CLI as a user would to check that the system as a whole works as expected. These tests are meant to exercise the entire system in isolation and there is no network interaction, nor interaction with any other code outside of Lodestar. See the [End-To-End Testing](./end-to-end-tests.md) page for more information. +E2E tests are where Lodestar is run in its full form, often from the CLI as a user would to check that the system as a whole works as expected. These tests are meant to exercise the entire system in isolation and there is no network interaction, nor interaction with any other code outside of Lodestar. See the [End-To-End Testing](./end-to-end-tests.md) page for more information. ### Integration Tests diff --git a/docs/pages/contribution/tools/heap-dumps.md b/docs/pages/contribution/tools/heap-dumps.md index 97f2be51dfac..612dfebc3f83 100644 --- a/docs/pages/contribution/tools/heap-dumps.md +++ b/docs/pages/contribution/tools/heap-dumps.md @@ -40,7 +40,7 @@ Click on the `Open dedicated DevTools for Node` link to open the node specific w ![Memory Tab](/images/heap-dumps/memory-tab.png) -Load the profile by either right clicking on the left pane or by clicking the `Load` button at the bottom. +Load the profile by either right-clicking on the left pane or by clicking the `Load` button at the bottom. ![Load Profile](/images/heap-dumps/load-profile.png) @@ -70,7 +70,7 @@ Having a good understanding of the codebase will help to narrow down where to lo _**note: collecting a native heap dump is only supported on linux, analysis can be done from linux or Mac**_ -There are several tools that can be used to do native heap dump analysis. The most common are [`massif`](https://valgrind.org/docs/manual/ms-manual.html) from the [`Valgrind`](https://valgrind.org/) suite, google's [`gperftools`](https://github.com/gperftools/gperftools) and `heaptrack` from [KDE](https://community.kde.org/Main_Page). Of the three, `heaptrack` is the most user friendly tool, and it is specifically designed for the task. It is much faster than `Valgrind`, easier to integrate than `gperftools` and also includes a gui for result analysis. Often times there are also memory allocations that are not related to memory leaks, and tools like `Valgrind` and `gperftools` become less useful. This is why `heaptrack` is the recommended tool for heap dump analysis on Lodestar. +There are several tools that can be used to do native heap dump analysis. The most common are [`massif`](https://valgrind.org/docs/manual/ms-manual.html) from the [`Valgrind`](https://valgrind.org/) suite, google's [`gperftools`](https://github.com/gperftools/gperftools) and `heaptrack` from [KDE](https://community.kde.org/Main_Page). Of the three, `heaptrack` is the most user-friendly tool, and it is specifically designed for the task. It is much faster than `Valgrind`, easier to integrate than `gperftools` and also includes a gui for result analysis. Often times there are also memory allocations that are not related to memory leaks, and tools like `Valgrind` and `gperftools` become less useful. This is why `heaptrack` is the recommended tool for heap dump analysis on Lodestar. There are a few things that will make the results with `heaptrack` far better. The most important is using debug builds of all libraries included in a binary, including the application itself. This will make the results usable. Not to say that they will be useless without debug symbols but it will be kinda tough to optimize functions without knowing the function names nor the file and line numbers. diff --git a/docs/pages/faqs.md b/docs/pages/faqs.md index e7ac490bf9b9..ebe2a2158a2d 100644 --- a/docs/pages/faqs.md +++ b/docs/pages/faqs.md @@ -1,6 +1,6 @@ # Frequently Asked Questions -This section of the documentation will cover common questions and encounters often asked by users and developers. +This section of the documentation will cover common questions and common encounters by users and developers. ## Tooling diff --git a/docs/pages/introduction.md b/docs/pages/introduction.md index f74d0b70768d..5633131dd600 100644 --- a/docs/pages/introduction.md +++ b/docs/pages/introduction.md @@ -1,6 +1,6 @@ # Introduction -Ethereum is one of the most profoundly important inventions in recent history. It is a decentralized, open-source blockchain featuring smart contract functionality. It is the second-largest cryptocurrency by market capitalization, after Bitcoin, and is the second largest blockchain by market capitalization. Ethereum was proposed in 2013 by programmer Vitalik Buterin. Development was crowdfunded in 2014, and the network went live on 30 July 2015, with 72 million coins premined. ChainSafe was founded not too long afterwards in 2017 and has been actively working in the Ethereum ecosystem ever since. We are proud to develop Lodestar, the only TypeScript based consensus client, and to present this documentation as a resource for the Ethereum community. +Ethereum is one of the most profoundly important inventions in recent history. It is a decentralized, open-source blockchain featuring smart contract functionality. It is the second-largest cryptocurrency by market capitalization, after Bitcoin, and is the second-largest blockchain by market capitalization. Ethereum was proposed in 2013 by programmer Vitalik Buterin. Development was crowdfunded in 2014, and the network went live on 30 July 2015, with 72 million coins premined. ChainSafe was founded not too long afterwards in 2017 and has been actively working in the Ethereum ecosystem ever since. We are proud to develop Lodestar, the only TypeScript based consensus client, and to present this documentation as a resource for the Ethereum community. ## Proof of Stake diff --git a/docs/pages/run/logging-and-metrics/client-monitoring.md b/docs/pages/run/logging-and-metrics/client-monitoring.md index 3d9ede1d8464..31a20600ecf3 100644 --- a/docs/pages/run/logging-and-metrics/client-monitoring.md +++ b/docs/pages/run/logging-and-metrics/client-monitoring.md @@ -27,7 +27,7 @@ When sending data to a remote service you should be conscious about security: - Only use a service that you trust as this will send information which may identify you and associate your validators, IP address and other personal information. -- Always use a HTTPS connection (i.e. a URL starting with `https://`) to prevent the traffic +- Always use an HTTPS connection (i.e. a URL starting with `https://`) to prevent the traffic from being intercepted in transit and leaking information. ::: diff --git a/docs/pages/run/validator-management/proposer-config.md b/docs/pages/run/validator-management/proposer-config.md index 444789a9f8b0..38769ebc1878 100644 --- a/docs/pages/run/validator-management/proposer-config.md +++ b/docs/pages/run/validator-management/proposer-config.md @@ -15,7 +15,7 @@ proposer_config: strict_fee_recipient_check: false fee_recipient: "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" builder: - gas_limit: "30000000" + gas_limit: "36000000" selection: "executionalways" boost_factor: "0" "0xa4855c83d868f772a579133d9f23818008417b743e8447e235d8eb78b1d8f8a9f63f98c551beb7de254400f89592314d": @@ -29,7 +29,7 @@ default_config: strict_fee_recipient_check: true fee_recipient: "0xcccccccccccccccccccccccccccccccccccccccc" builder: - gas_limit: "30000000" + gas_limit: "36000000" selection: "default" boost_factor: "90" ``` diff --git a/docs/yarn.lock b/docs/yarn.lock index 80cd3a321a5a..894df90208f9 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -5407,9 +5407,9 @@ http-parser-js@>=0.5.1: integrity sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q== http-proxy-middleware@^2.0.3: - version "2.0.6" - resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz#e1a4dd6979572c7ab5a4e4b55095d1f32a74963f" - integrity sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw== + version "2.0.7" + resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz#915f236d92ae98ef48278a95dedf17e991936ec6" + integrity sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA== dependencies: "@types/http-proxy" "^1.17.8" http-proxy "^1.18.1" @@ -7089,9 +7089,9 @@ multicast-dns@^7.2.5: thunky "^1.0.2" nanoid@^3.3.7: - version "3.3.7" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8" - integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g== + version "3.3.8" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.8.tgz#b1be3030bee36aaff18bacb375e5cce521684baf" + integrity sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w== negotiator@0.6.3: version "0.6.3" diff --git a/lerna.json b/lerna.json index cdd74f75b2cf..99654f9e81de 100644 --- a/lerna.json +++ b/lerna.json @@ -4,7 +4,7 @@ ], "npmClient": "yarn", "useNx": true, - "version": "1.23.1", + "version": "1.24.0", "stream": true, "command": { "version": { diff --git a/packages/api/package.json b/packages/api/package.json index 1f4f3e7c3fdf..f650a377f6a5 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -11,7 +11,7 @@ "bugs": { "url": "https://github.com/ChainSafe/lodestar/issues" }, - "version": "1.23.1", + "version": "1.24.0", "type": "module", "exports": { ".": { @@ -72,10 +72,10 @@ "dependencies": { "@chainsafe/persistent-merkle-tree": "^0.8.0", "@chainsafe/ssz": "^0.18.0", - "@lodestar/config": "^1.23.1", - "@lodestar/params": "^1.23.1", - "@lodestar/types": "^1.23.1", - "@lodestar/utils": "^1.23.1", + "@lodestar/config": "^1.24.0", + "@lodestar/params": "^1.24.0", + "@lodestar/types": "^1.24.0", + "@lodestar/utils": "^1.24.0", "eventsource": "^2.0.2", "qs": "^6.11.1" }, diff --git a/packages/api/test/unit/keymanager/testData.ts b/packages/api/test/unit/keymanager/testData.ts index 6b17611d1e0b..f954eea7aae1 100644 --- a/packages/api/test/unit/keymanager/testData.ts +++ b/packages/api/test/unit/keymanager/testData.ts @@ -12,7 +12,7 @@ import {GenericServerTestCases} from "../../utils/genericServerTest.js"; const pubkeyRand = "0x84105a985058fc8740a48bf1ede9d223ef09e8c6b1735ba0a55cf4a9ff2ff92376b778798365e488dab07a652eb04576"; const ethaddressRand = "0xabcf8e0d4e9587369b2301d0790347320302cc09"; const graffitiRandUtf8 = "636861696e736166652f6c6f64657374"; -const gasLimitRand = 30_000_000; +const gasLimitRand = 36_000_000; const builderBoostFactorRand = BigInt(100); export const testData: GenericServerTestCases = { diff --git a/packages/beacon-node/package.json b/packages/beacon-node/package.json index ffce2f3eacfe..f80dc93b1314 100644 --- a/packages/beacon-node/package.json +++ b/packages/beacon-node/package.json @@ -11,7 +11,7 @@ "bugs": { "url": "https://github.com/ChainSafe/lodestar/issues" }, - "version": "1.23.1", + "version": "1.24.0", "type": "module", "exports": { ".": { @@ -120,18 +120,18 @@ "@libp2p/peer-id-factory": "^4.1.0", "@libp2p/prometheus-metrics": "^3.0.21", "@libp2p/tcp": "9.0.23", - "@lodestar/api": "^1.23.1", - "@lodestar/config": "^1.23.1", - "@lodestar/db": "^1.23.1", - "@lodestar/fork-choice": "^1.23.1", - "@lodestar/light-client": "^1.23.1", - "@lodestar/logger": "^1.23.1", - "@lodestar/params": "^1.23.1", - "@lodestar/reqresp": "^1.23.1", - "@lodestar/state-transition": "^1.23.1", - "@lodestar/types": "^1.23.1", - "@lodestar/utils": "^1.23.1", - "@lodestar/validator": "^1.23.1", + "@lodestar/api": "^1.24.0", + "@lodestar/config": "^1.24.0", + "@lodestar/db": "^1.24.0", + "@lodestar/fork-choice": "^1.24.0", + "@lodestar/light-client": "^1.24.0", + "@lodestar/logger": "^1.24.0", + "@lodestar/params": "^1.24.0", + "@lodestar/reqresp": "^1.24.0", + "@lodestar/state-transition": "^1.24.0", + "@lodestar/types": "^1.24.0", + "@lodestar/utils": "^1.24.0", + "@lodestar/validator": "^1.24.0", "@multiformats/multiaddr": "^12.1.3", "c-kzg": "^2.1.2", "datastore-core": "^9.1.1", diff --git a/packages/beacon-node/src/api/impl/validator/utils.ts b/packages/beacon-node/src/api/impl/validator/utils.ts index b8e5aa525f25..f7d69ec97847 100644 --- a/packages/beacon-node/src/api/impl/validator/utils.ts +++ b/packages/beacon-node/src/api/impl/validator/utils.ts @@ -1,7 +1,7 @@ import {routes} from "@lodestar/api"; import {ATTESTATION_SUBNET_COUNT} from "@lodestar/params"; import {BeaconStateAllForks, computeSlotsSinceEpochStart} from "@lodestar/state-transition"; -import {BLSPubkey, CommitteeIndex, ProducedBlockSource, Slot, ValidatorIndex} from "@lodestar/types"; +import {BLSPubkey, CommitteeIndex, ProducedBlockSource, Slot, SubnetID, ValidatorIndex} from "@lodestar/types"; import {MAX_BUILDER_BOOST_FACTOR} from "@lodestar/validator"; import {BlockSelectionResult, BuilderBlockSelectionReason, EngineBlockSelectionReason} from "./index.js"; @@ -9,7 +9,7 @@ export function computeSubnetForCommitteesAtSlot( slot: Slot, committeesAtSlot: number, committeeIndex: CommitteeIndex -): number { +): SubnetID { const slotsSinceEpochStart = computeSlotsSinceEpochStart(slot); const committeesSinceEpochStart = committeesAtSlot * slotsSinceEpochStart; return (committeesSinceEpochStart + committeeIndex) % ATTESTATION_SUBNET_COUNT; diff --git a/packages/beacon-node/src/chain/blocks/utils/giraffeBanner.ts b/packages/beacon-node/src/chain/blocks/utils/giraffeBanner.ts index d3987831a064..857e07438dac 100644 --- a/packages/beacon-node/src/chain/blocks/utils/giraffeBanner.ts +++ b/packages/beacon-node/src/chain/blocks/utils/giraffeBanner.ts @@ -1,4 +1,5 @@ export const ELECTRA_GIRAFFE_BANNER = String.raw` + 2048 :--: :-@==+-: @@ -24,4 +25,5 @@ export const ELECTRA_GIRAFFE_BANNER = String.raw` *: :- =- :- --: =: ::*-: :::: :-: + `; diff --git a/packages/beacon-node/src/chain/errors/blobSidecarError.ts b/packages/beacon-node/src/chain/errors/blobSidecarError.ts index 216ad9206db4..bf7628b27881 100644 --- a/packages/beacon-node/src/chain/errors/blobSidecarError.ts +++ b/packages/beacon-node/src/chain/errors/blobSidecarError.ts @@ -1,4 +1,4 @@ -import {RootHex, Slot, ValidatorIndex} from "@lodestar/types"; +import {RootHex, Slot, SubnetID, ValidatorIndex} from "@lodestar/types"; import {GossipActionError} from "./gossipValidation.js"; export enum BlobSidecarErrorCode { @@ -28,7 +28,7 @@ export enum BlobSidecarErrorCode { export type BlobSidecarErrorType = | {code: BlobSidecarErrorCode.INDEX_TOO_LARGE; blobIdx: number; maxBlobsPerBlock: number} - | {code: BlobSidecarErrorCode.INVALID_INDEX; blobIdx: number; subnet: number} + | {code: BlobSidecarErrorCode.INVALID_INDEX; blobIdx: number; subnet: SubnetID} | {code: BlobSidecarErrorCode.INVALID_KZG; blobIdx: number} | {code: BlobSidecarErrorCode.INVALID_KZG_TXS} | {code: BlobSidecarErrorCode.INCORRECT_SLOT; blockSlot: Slot; blobSlot: Slot; blobIdx: number} diff --git a/packages/beacon-node/src/chain/opPools/syncCommitteeMessagePool.ts b/packages/beacon-node/src/chain/opPools/syncCommitteeMessagePool.ts index 6551ee625491..cd56b309c2f0 100644 --- a/packages/beacon-node/src/chain/opPools/syncCommitteeMessagePool.ts +++ b/packages/beacon-node/src/chain/opPools/syncCommitteeMessagePool.ts @@ -1,7 +1,7 @@ import {Signature, aggregateSignatures} from "@chainsafe/blst"; import {BitArray} from "@chainsafe/ssz"; import {SYNC_COMMITTEE_SIZE, SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params"; -import {Root, Slot, SubcommitteeIndex, altair} from "@lodestar/types"; +import {Root, Slot, SubcommitteeIndex, SubnetID, altair} from "@lodestar/types"; import {MapDef, toRootHex} from "@lodestar/utils"; import {IClock} from "../../util/clock.js"; import {InsertOutcome, OpPoolError, OpPoolErrorCode} from "./types.js"; @@ -26,7 +26,6 @@ type ContributionFast = Omit> - >(() => new MapDef>(() => new Map())); + MapDef> + >(() => new MapDef>(() => new Map())); private lowestPermissibleSlot = 0; constructor( @@ -62,7 +61,7 @@ export class SyncCommitteeMessagePool { } // TODO: indexInSubcommittee: number should be indicesInSyncCommittee - add(subnet: Subnet, signature: altair.SyncCommitteeMessage, indexInSubcommittee: number): InsertOutcome { + add(subnet: SubnetID, signature: altair.SyncCommitteeMessage, indexInSubcommittee: number): InsertOutcome { const {slot, beaconBlockRoot} = signature; const rootHex = toRootHex(beaconBlockRoot); const lowestPermissibleSlot = this.lowestPermissibleSlot; @@ -146,7 +145,7 @@ function aggregateSignatureInto( * Format `signature` into an efficient `contribution` to add more signatures in with aggregateSignatureInto() */ function signatureToAggregate( - subnet: number, + subnet: SubnetID, signature: altair.SyncCommitteeMessage, indexInSubcommittee: number ): ContributionFast { diff --git a/packages/beacon-node/src/chain/opPools/syncContributionAndProofPool.ts b/packages/beacon-node/src/chain/opPools/syncContributionAndProofPool.ts index 0f25032e1d7e..b38b6c1d117a 100644 --- a/packages/beacon-node/src/chain/opPools/syncContributionAndProofPool.ts +++ b/packages/beacon-node/src/chain/opPools/syncContributionAndProofPool.ts @@ -2,7 +2,7 @@ import {Signature, aggregateSignatures} from "@chainsafe/blst"; import {BitArray} from "@chainsafe/ssz"; import {SYNC_COMMITTEE_SIZE, SYNC_COMMITTEE_SUBNET_SIZE} from "@lodestar/params"; import {G2_POINT_AT_INFINITY} from "@lodestar/state-transition"; -import {Root, Slot, altair, ssz} from "@lodestar/types"; +import {Root, Slot, SubnetID, altair, ssz} from "@lodestar/types"; import {MapDef, toRootHex} from "@lodestar/utils"; import {InsertOutcome, OpPoolError, OpPoolErrorCode} from "./types.js"; import {pruneBySlot, signatureFromBytesNoCheck} from "./utils.js"; @@ -33,7 +33,6 @@ export type SyncContributionFast = { /** Hex string of `contribution.beaconBlockRoot` */ type BlockRootHex = string; -type Subnet = number; /** * Cache SyncCommitteeContribution and seen ContributionAndProof. @@ -43,8 +42,8 @@ type Subnet = number; export class SyncContributionAndProofPool { private readonly bestContributionBySubnetRootBySlot = new MapDef< Slot, - MapDef> - >(() => new MapDef>(() => new Map())); + MapDef> + >(() => new MapDef>(() => new Map())); private lowestPermissibleSlot = 0; diff --git a/packages/beacon-node/src/chain/seenCache/seenAttestationData.ts b/packages/beacon-node/src/chain/seenCache/seenAttestationData.ts index 667b4aa98e9c..d0f615b2bc26 100644 --- a/packages/beacon-node/src/chain/seenCache/seenAttestationData.ts +++ b/packages/beacon-node/src/chain/seenCache/seenAttestationData.ts @@ -1,5 +1,5 @@ import {BitArray} from "@chainsafe/ssz"; -import {CommitteeIndex, RootHex, Slot, phase0} from "@lodestar/types"; +import {CommitteeIndex, RootHex, Slot, SubnetID, phase0} from "@lodestar/types"; import {MapDef} from "@lodestar/utils"; import {Metrics} from "../../metrics/metrics.js"; import {InsertOutcome} from "../opPools/types.js"; @@ -19,7 +19,7 @@ export type AttestationDataCacheEntry = { // caching this for 3 slots take 600 instances max, this is nothing compared to attestations processed per slot // for example in a mainnet node subscribing to all subnets, attestations are processed up to 20k per slot attestationData: phase0.AttestationData; - subnet: number; + subnet: SubnetID; }; export enum RejectReason { diff --git a/packages/beacon-node/src/chain/seenCache/seenCommittee.ts b/packages/beacon-node/src/chain/seenCache/seenCommittee.ts index 9d7e930c94d7..44411eaf2115 100644 --- a/packages/beacon-node/src/chain/seenCache/seenCommittee.ts +++ b/packages/beacon-node/src/chain/seenCache/seenCommittee.ts @@ -38,6 +38,6 @@ export class SeenSyncCommitteeMessages { } } -function seenCacheKey(subnet: number, validatorIndex: ValidatorIndex): ValidatorSubnetKey { +function seenCacheKey(subnet: SubcommitteeIndex, validatorIndex: ValidatorIndex): ValidatorSubnetKey { return `${subnet}-${validatorIndex}`; } diff --git a/packages/beacon-node/src/chain/validation/attestation.ts b/packages/beacon-node/src/chain/validation/attestation.ts index df57a6855019..95471534ef53 100644 --- a/packages/beacon-node/src/chain/validation/attestation.ts +++ b/packages/beacon-node/src/chain/validation/attestation.ts @@ -29,6 +29,7 @@ import { RootHex, SingleAttestation, Slot, + SubnetID, ValidatorIndex, isElectraSingleAttestation, phase0, @@ -65,7 +66,7 @@ export type BatchResult = { export type AttestationValidationResult = { attestation: SingleAttestation; indexedAttestation: IndexedAttestation; - subnet: number; + subnet: SubnetID; attDataRootHex: RootHex; committeeIndex: CommitteeIndex; committeeValidatorIndex: number; @@ -102,7 +103,7 @@ export async function validateGossipAttestationsSameAttData( fork: ForkName, chain: IBeaconChain, attestationOrBytesArr: GossipAttestation[], - subnet: number, + subnet: SubnetID, // for unit test, consumers do not need to pass this step0ValidationFn = validateAttestationNoSignatureCheck ): Promise { @@ -241,7 +242,7 @@ async function validateAttestationNoSignatureCheck( chain: IBeaconChain, attestationOrBytes: AttestationOrBytes, /** Optional, to allow verifying attestations through API with unknown subnet */ - subnet: number | null + subnet: SubnetID | null ): Promise { // Do checks in this order: // - do early checks (w/o indexed attestation) @@ -350,7 +351,7 @@ async function validateAttestationNoSignatureCheck( let committeeValidatorIndices: Uint32Array; let getSigningRoot: () => Uint8Array; - let expectedSubnet: number; + let expectedSubnet: SubnetID; if (attestationOrCache.cache) { committeeValidatorIndices = attestationOrCache.cache.committeeValidatorIndices; const signingRoot = attestationOrCache.cache.signingRoot; @@ -802,7 +803,7 @@ export function getCommitteeIndices( /** * Compute the correct subnet for a slot/committee index */ -export function computeSubnetForSlot(shuffling: EpochShuffling, slot: number, committeeIndex: number): number { +export function computeSubnetForSlot(shuffling: EpochShuffling, slot: number, committeeIndex: number): SubnetID { const slotsSinceEpochStart = slot % SLOTS_PER_EPOCH; const committeesSinceEpochStart = shuffling.committeesPerSlot * slotsSinceEpochStart; return (committeesSinceEpochStart + committeeIndex) % ATTESTATION_SUBNET_COUNT; diff --git a/packages/beacon-node/src/chain/validation/blobSidecar.ts b/packages/beacon-node/src/chain/validation/blobSidecar.ts index 78f40e407925..37fa3067b80b 100644 --- a/packages/beacon-node/src/chain/validation/blobSidecar.ts +++ b/packages/beacon-node/src/chain/validation/blobSidecar.ts @@ -6,7 +6,7 @@ import { isForkPostElectra, } from "@lodestar/params"; import {computeStartSlotAtEpoch, getBlockHeaderProposerSignatureSet} from "@lodestar/state-transition"; -import {BlobIndex, Root, Slot, deneb, ssz} from "@lodestar/types"; +import {BlobIndex, Root, Slot, SubnetID, deneb, ssz} from "@lodestar/types"; import {toRootHex, verifyMerkleBranch} from "@lodestar/utils"; import {byteArrayEquals} from "../../util/bytes.js"; @@ -20,7 +20,7 @@ export async function validateGossipBlobSidecar( fork: ForkName, chain: IBeaconChain, blobSidecar: deneb.BlobSidecar, - subnet: number + subnet: SubnetID ): Promise { const blobSlot = blobSidecar.signedBlockHeader.message.slot; @@ -243,7 +243,7 @@ function validateInclusionProof(blobSidecar: deneb.BlobSidecar): boolean { ); } -function computeSubnetForBlobSidecar(fork: ForkName, config: ChainConfig, blobIndex: BlobIndex): number { +function computeSubnetForBlobSidecar(fork: ForkName, config: ChainConfig, blobIndex: BlobIndex): SubnetID { return ( blobIndex % (isForkPostElectra(fork) ? config.BLOB_SIDECAR_SUBNET_COUNT_ELECTRA : config.BLOB_SIDECAR_SUBNET_COUNT) ); diff --git a/packages/beacon-node/src/chain/validation/syncCommittee.ts b/packages/beacon-node/src/chain/validation/syncCommittee.ts index c563bf7cf6be..fb4b7741b4fd 100644 --- a/packages/beacon-node/src/chain/validation/syncCommittee.ts +++ b/packages/beacon-node/src/chain/validation/syncCommittee.ts @@ -1,6 +1,6 @@ import {SYNC_COMMITTEE_SUBNET_COUNT, SYNC_COMMITTEE_SUBNET_SIZE} from "@lodestar/params"; import {CachedBeaconStateAllForks} from "@lodestar/state-transition"; -import {altair} from "@lodestar/types"; +import {SubnetID, altair} from "@lodestar/types"; import {toRootHex} from "@lodestar/utils"; import {GossipAction, SyncCommitteeError, SyncCommitteeErrorCode} from "../errors/index.js"; import {IBeaconChain} from "../interface.js"; @@ -14,7 +14,7 @@ type IndexInSubcommittee = number; export async function validateGossipSyncCommittee( chain: IBeaconChain, syncCommittee: altair.SyncCommitteeMessage, - subnet: number + subnet: SubnetID ): Promise<{indexInSubcommittee: IndexInSubcommittee}> { const {slot, validatorIndex, beaconBlockRoot} = syncCommittee; const messageRoot = toRootHex(beaconBlockRoot); @@ -103,7 +103,7 @@ async function validateSyncCommitteeSigOnly( export function validateGossipSyncCommitteeExceptSig( chain: IBeaconChain, headState: CachedBeaconStateAllForks, - subnet: number, + subnet: SubnetID, data: Pick ): IndexInSubcommittee { const {slot, validatorIndex} = data; @@ -144,7 +144,7 @@ export function validateGossipSyncCommitteeExceptSig( */ function getIndexInSubcommittee( headState: CachedBeaconStateAllForks, - subnet: number, + subnet: SubnetID, data: Pick ): IndexInSubcommittee | null { const syncCommittee = headState.epochCtx.getIndexedSyncCommittee(data.slot); diff --git a/packages/beacon-node/src/metrics/validatorMonitor.ts b/packages/beacon-node/src/metrics/validatorMonitor.ts index 401d58af57ff..1c9a093656ce 100644 --- a/packages/beacon-node/src/metrics/validatorMonitor.ts +++ b/packages/beacon-node/src/metrics/validatorMonitor.ts @@ -10,7 +10,7 @@ import { parseAttesterFlags, parseParticipationFlags, } from "@lodestar/state-transition"; -import {BeaconBlock, RootHex, altair, deneb} from "@lodestar/types"; +import {BeaconBlock, RootHex, SubnetID, altair, deneb} from "@lodestar/types"; import {Epoch, Slot, ValidatorIndex} from "@lodestar/types"; import {IndexedAttestation, SignedAggregateAndProof} from "@lodestar/types"; import {LogData, LogHandler, LogLevel, Logger, MapDef, MapDefMax, toRootHex} from "@lodestar/utils"; @@ -52,7 +52,7 @@ export type ValidatorMonitor = { onPoolSubmitUnaggregatedAttestation( seenTimestampSec: number, indexedAttestation: IndexedAttestation, - subnet: number, + subnet: SubnetID, sentPeers: number ): void; onPoolSubmitAggregatedAttestation( diff --git a/packages/beacon-node/src/network/core/metrics.ts b/packages/beacon-node/src/network/core/metrics.ts index 7d0ef47d84af..0c9155893ced 100644 --- a/packages/beacon-node/src/network/core/metrics.ts +++ b/packages/beacon-node/src/network/core/metrics.ts @@ -1,3 +1,4 @@ +import {SubnetID} from "@lodestar/types"; import {RegistryMetricCreator} from "../../metrics/utils/registryMetricCreator.js"; import {SubnetType} from "../metadata.js"; import {DiscoveredPeerStatus} from "../peers/discover.js"; @@ -194,14 +195,14 @@ export function createNetworkCoreMetrics(register: RegistryMetricCreator) { name: "lodestar_attnets_service_committee_subscriptions_total", help: "Count of committee subscriptions", }), - subscriptionsCommitteeMeshPeers: register.histogram<{subnet: number}>({ + subscriptionsCommitteeMeshPeers: register.histogram<{subnet: SubnetID}>({ name: "lodestar_attnets_service_committee_subscriptions_mesh_peers", help: "Histogram of mesh peers per committee subscription", labelNames: ["subnet"], // Dlow = 6, D = 8, DHi = 12 plus 2 more buckets buckets: [0, 4, 6, 8, 12], }), - subscriptionsCommitteeTimeToStableMesh: register.histogram<{subnet: number}>({ + subscriptionsCommitteeTimeToStableMesh: register.histogram<{subnet: SubnetID}>({ name: "lodestar_attnets_service_committee_subscriptions_time_to_stable_mesh_seconds", help: "Histogram of time until committee subscription is considered healthy (>= 6 mesh peers)", labelNames: ["subnet"], @@ -216,12 +217,12 @@ export function createNetworkCoreMetrics(register: RegistryMetricCreator) { name: "lodestar_attnets_service_long_lived_subscriptions_total", help: "Count of long lived subscriptions", }), - subscribeSubnets: register.gauge<{subnet: number; src: SubnetSource}>({ + subscribeSubnets: register.gauge<{subnet: SubnetID; src: SubnetSource}>({ name: "lodestar_attnets_service_subscribe_subnets_total", help: "Count of subscribe_subnets calls", labelNames: ["subnet", "src"], }), - unsubscribeSubnets: register.gauge<{subnet: number; src: SubnetSource}>({ + unsubscribeSubnets: register.gauge<{subnet: SubnetID; src: SubnetSource}>({ name: "lodestar_attnets_service_unsubscribe_subnets_total", help: "Count of unsubscribe_subnets calls", labelNames: ["subnet", "src"], @@ -237,12 +238,12 @@ export function createNetworkCoreMetrics(register: RegistryMetricCreator) { name: "lodestar_syncnets_service_committee_subscriptions_total", help: "Count of syncnet committee subscriptions", }), - subscribeSubnets: register.gauge<{subnet: number}>({ + subscribeSubnets: register.gauge<{subnet: SubnetID}>({ name: "lodestar_syncnets_service_subscribe_subnets_total", help: "Count of syncnet subscribe_subnets calls", labelNames: ["subnet"], }), - unsubscribeSubnets: register.gauge<{subnet: number}>({ + unsubscribeSubnets: register.gauge<{subnet: SubnetID}>({ name: "lodestar_syncnets_service_unsubscribe_subnets_total", help: "Count of syncnet unsubscribe_subnets calls", labelNames: ["subnet"], diff --git a/packages/beacon-node/src/network/gossip/gossipsub.ts b/packages/beacon-node/src/network/gossip/gossipsub.ts index 9f2b47e21c6f..236cc40a8d05 100644 --- a/packages/beacon-node/src/network/gossip/gossipsub.ts +++ b/packages/beacon-node/src/network/gossip/gossipsub.ts @@ -4,6 +4,7 @@ import {PeerScoreParams} from "@chainsafe/libp2p-gossipsub/score"; import {SignaturePolicy, TopicStr} from "@chainsafe/libp2p-gossipsub/types"; import {BeaconConfig} from "@lodestar/config"; import {ATTESTATION_SUBNET_COUNT, ForkName, SLOTS_PER_EPOCH, SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params"; +import {SubnetID} from "@lodestar/types"; import {Logger, Map2d, Map2dArr} from "@lodestar/utils"; import {GOSSIP_MAX_SIZE, GOSSIP_MAX_SIZE_BELLATRIX} from "../../constants/network.js"; @@ -319,7 +320,7 @@ export class Eth2Gossipsub extends GossipSub { * Left pad subnets to two characters. Assumes ATTESTATION_SUBNET_COUNT < 99 * Otherwise grafana sorts the mesh peers chart as: [1,11,12,13,...] */ -function attSubnetLabel(subnet: number): string { +function attSubnetLabel(subnet: SubnetID): string { if (subnet > 9) return String(subnet); return `0${subnet}`; diff --git a/packages/beacon-node/src/network/gossip/interface.ts b/packages/beacon-node/src/network/gossip/interface.ts index a5a0aea21a67..93e9e3983d38 100644 --- a/packages/beacon-node/src/network/gossip/interface.ts +++ b/packages/beacon-node/src/network/gossip/interface.ts @@ -9,6 +9,7 @@ import { SignedBeaconBlock, SingleAttestation, Slot, + SubnetID, altair, capella, deneb, @@ -54,16 +55,16 @@ export interface IGossipTopic { export type GossipTopicTypeMap = { [GossipType.beacon_block]: {type: GossipType.beacon_block}; - [GossipType.blob_sidecar]: {type: GossipType.blob_sidecar; subnet: number}; + [GossipType.blob_sidecar]: {type: GossipType.blob_sidecar; subnet: SubnetID}; [GossipType.beacon_aggregate_and_proof]: {type: GossipType.beacon_aggregate_and_proof}; - [GossipType.beacon_attestation]: {type: GossipType.beacon_attestation; subnet: number}; + [GossipType.beacon_attestation]: {type: GossipType.beacon_attestation; subnet: SubnetID}; [GossipType.voluntary_exit]: {type: GossipType.voluntary_exit}; [GossipType.proposer_slashing]: {type: GossipType.proposer_slashing}; [GossipType.attester_slashing]: {type: GossipType.attester_slashing}; [GossipType.sync_committee_contribution_and_proof]: { type: GossipType.sync_committee_contribution_and_proof; }; - [GossipType.sync_committee]: {type: GossipType.sync_committee; subnet: number}; + [GossipType.sync_committee]: {type: GossipType.sync_committee; subnet: SubnetID}; [GossipType.light_client_finality_update]: {type: GossipType.light_client_finality_update}; [GossipType.light_client_optimistic_update]: {type: GossipType.light_client_optimistic_update}; [GossipType.bls_to_execution_change]: {type: GossipType.bls_to_execution_change}; diff --git a/packages/beacon-node/src/network/gossip/metrics.ts b/packages/beacon-node/src/network/gossip/metrics.ts index 5ca5d22154c2..3e11615b44b5 100644 --- a/packages/beacon-node/src/network/gossip/metrics.ts +++ b/packages/beacon-node/src/network/gossip/metrics.ts @@ -1,4 +1,5 @@ import {ForkName} from "@lodestar/params"; +import {SubnetID} from "@lodestar/types"; import {RegistryMetricCreator} from "../../metrics/index.js"; import {GossipType} from "./interface.js"; @@ -33,7 +34,7 @@ export function createEth2GossipsubMetrics(register: RegistryMetricCreator) { help: "Number of connected mesh peers per beacon attestation subnet", labelNames: ["subnet", "fork"], }), - peersBySyncCommitteeSubnet: register.gauge<{subnet: number; fork: ForkName}>({ + peersBySyncCommitteeSubnet: register.gauge<{subnet: SubnetID; fork: ForkName}>({ name: "lodestar_gossip_mesh_peers_by_sync_committee_subnet_count", help: "Number of connected mesh peers per sync committee subnet", labelNames: ["subnet", "fork"], @@ -50,7 +51,7 @@ export function createEth2GossipsubMetrics(register: RegistryMetricCreator) { help: "Number of connected topic peers per beacon attestation subnet", labelNames: ["subnet", "fork"], }), - peersBySyncCommitteeSubnet: register.gauge<{subnet: number; fork: ForkName}>({ + peersBySyncCommitteeSubnet: register.gauge<{subnet: SubnetID; fork: ForkName}>({ name: "lodestar_gossip_topic_peers_by_sync_committee_subnet_count", help: "Number of connected topic peers per sync committee subnet", labelNames: ["subnet", "fork"], diff --git a/packages/beacon-node/src/network/interface.ts b/packages/beacon-node/src/network/interface.ts index c105c0b80f7a..aab3c06991d3 100644 --- a/packages/beacon-node/src/network/interface.ts +++ b/packages/beacon-node/src/network/interface.ts @@ -22,6 +22,7 @@ import { SingleAttestation, Slot, SlotRootHex, + SubnetID, WithBytes, altair, capella, @@ -55,7 +56,7 @@ export interface INetwork extends INetworkCorePublic { getConnectedPeerCount(): number; isSubscribedToGossipCoreTopics(): boolean; reportPeer(peer: PeerIdStr, action: PeerAction, actionName: string): void; - shouldAggregate(subnet: number, slot: Slot): boolean; + shouldAggregate(subnet: SubnetID, slot: Slot): boolean; reStatusPeers(peers: PeerIdStr[]): Promise; searchUnknownSlotRoot(slotRoot: SlotRootHex, peer?: PeerIdStr): void; // ReqResp @@ -74,12 +75,12 @@ export interface INetwork extends INetworkCorePublic { publishBeaconBlock(signedBlock: SignedBeaconBlock): Promise; publishBlobSidecar(blobSidecar: deneb.BlobSidecar): Promise; publishBeaconAggregateAndProof(aggregateAndProof: SignedAggregateAndProof): Promise; - publishBeaconAttestation(attestation: SingleAttestation, subnet: number): Promise; + publishBeaconAttestation(attestation: SingleAttestation, subnet: SubnetID): Promise; publishVoluntaryExit(voluntaryExit: phase0.SignedVoluntaryExit): Promise; publishBlsToExecutionChange(blsToExecutionChange: capella.SignedBLSToExecutionChange): Promise; publishProposerSlashing(proposerSlashing: phase0.ProposerSlashing): Promise; publishAttesterSlashing(attesterSlashing: phase0.AttesterSlashing): Promise; - publishSyncCommitteeSignature(signature: altair.SyncCommitteeMessage, subnet: number): Promise; + publishSyncCommitteeSignature(signature: altair.SyncCommitteeMessage, subnet: SubnetID): Promise; publishContributionAndProof(contributionAndProof: altair.SignedContributionAndProof): Promise; publishLightClientFinalityUpdate(update: LightClientFinalityUpdate): Promise; publishLightClientOptimisticUpdate(update: LightClientOptimisticUpdate): Promise; diff --git a/packages/beacon-node/src/network/network.ts b/packages/beacon-node/src/network/network.ts index ae06cbab715f..6e37f64f2edc 100644 --- a/packages/beacon-node/src/network/network.ts +++ b/packages/beacon-node/src/network/network.ts @@ -17,6 +17,7 @@ import { SignedBeaconBlock, SingleAttestation, SlotRootHex, + SubnetID, WithBytes, altair, capella, @@ -297,7 +298,7 @@ export class Network implements INetwork { return this.subscribedToCoreTopics; } - shouldAggregate(subnet: number, slot: number): boolean { + shouldAggregate(subnet: SubnetID, slot: number): boolean { return this.aggregatorTracker.shouldAggregate(subnet, slot); } @@ -329,7 +330,7 @@ export class Network implements INetwork { ); } - async publishBeaconAttestation(attestation: SingleAttestation, subnet: number): Promise { + async publishBeaconAttestation(attestation: SingleAttestation, subnet: SubnetID): Promise { const fork = this.config.getForkName(attestation.data.slot); return this.publishGossip( {type: GossipType.beacon_attestation, fork, subnet}, @@ -380,7 +381,7 @@ export class Network implements INetwork { ); } - async publishSyncCommitteeSignature(signature: altair.SyncCommitteeMessage, subnet: number): Promise { + async publishSyncCommitteeSignature(signature: altair.SyncCommitteeMessage, subnet: SubnetID): Promise { const fork = this.config.getForkName(signature.slot); return this.publishGossip({type: GossipType.sync_committee, fork, subnet}, signature, { ignoreDuplicatePublishError: true, diff --git a/packages/beacon-node/src/network/peers/discover.ts b/packages/beacon-node/src/network/peers/discover.ts index e658fd6378bf..55fef17bbb21 100644 --- a/packages/beacon-node/src/network/peers/discover.ts +++ b/packages/beacon-node/src/network/peers/discover.ts @@ -3,6 +3,7 @@ import type {PeerId, PeerInfo} from "@libp2p/interface"; import {BeaconConfig} from "@lodestar/config"; import {LoggerNode} from "@lodestar/logger/node"; import {ATTESTATION_SUBNET_COUNT, SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params"; +import {SubnetID} from "@lodestar/types"; import {pruneSetToMax, sleep} from "@lodestar/utils"; import {Multiaddr} from "@multiformats/multiaddr"; import {NetworkCoreMetrics} from "../core/metrics.js"; @@ -65,7 +66,7 @@ type SubnetRequestInfo = { }; export type SubnetDiscvQueryMs = { - subnet: number; + subnet: SubnetID; type: SubnetType; toUnixMs: UnixMs; maxPeersToDiscover: number; diff --git a/packages/beacon-node/src/network/peers/utils/prioritizePeers.ts b/packages/beacon-node/src/network/peers/utils/prioritizePeers.ts index 545d8a6ca8b0..9aa95e8af645 100644 --- a/packages/beacon-node/src/network/peers/utils/prioritizePeers.ts +++ b/packages/beacon-node/src/network/peers/utils/prioritizePeers.ts @@ -1,7 +1,7 @@ import {BitArray} from "@chainsafe/ssz"; import {Direction, PeerId} from "@libp2p/interface"; import {ATTESTATION_SUBNET_COUNT, SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params"; -import {altair, phase0} from "@lodestar/types"; +import {SubnetID, altair, phase0} from "@lodestar/types"; import {MapDef} from "@lodestar/utils"; import {shuffle} from "../../../util/shuffle.js"; import {sortBy} from "../../../util/sortBy.js"; @@ -38,7 +38,7 @@ const OUTBOUND_PEERS_RATIO = 0.1; const attnetsZero = BitArray.fromBitLen(ATTESTATION_SUBNET_COUNT); const syncnetsZero = BitArray.fromBitLen(SYNC_COMMITTEE_SUBNET_COUNT); -type SubnetDiscvQuery = {subnet: number; toSlot: number; maxPeersToDiscover: number}; +type SubnetDiscvQuery = {subnet: SubnetID; toSlot: number; maxPeersToDiscover: number}; type PeerInfo = { id: PeerId; @@ -412,8 +412,8 @@ export function sortPeersToPrune(connectedPeers: PeerInfo[], dutiesByPeer: Map

TARGET_SUBNET_PEERS, return null if peers are not grouped * to any subnets. */ -function findMaxPeersSubnet(subnetToPeers: Map, targetSubnetPeers: number): number | null { - let maxPeersSubnet: number | null = null; +function findMaxPeersSubnet(subnetToPeers: Map, targetSubnetPeers: number): SubnetID | null { + let maxPeersSubnet: SubnetID | null = null; let maxPeerCountPerSubnet = -1; for (const [subnet, peers] of subnetToPeers) { diff --git a/packages/beacon-node/src/network/peers/utils/subnetMap.ts b/packages/beacon-node/src/network/peers/utils/subnetMap.ts index 97985b3d8da0..a815bafc4cbf 100644 --- a/packages/beacon-node/src/network/peers/utils/subnetMap.ts +++ b/packages/beacon-node/src/network/peers/utils/subnetMap.ts @@ -1,7 +1,7 @@ -import {Slot} from "@lodestar/types"; +import {Slot, SubnetID} from "@lodestar/types"; export type RequestedSubnet = { - subnet: number; + subnet: SubnetID; /** * Slot after which the network will stop maintaining a min number of peers * connected to `subnetId`RequestedSubnet @@ -14,13 +14,13 @@ export type RequestedSubnet = { */ export class SubnetMap { /** Map of subnets and the slot until they are needed */ - private subnets = new Map(); + private subnets = new Map(); get size(): number { return this.subnets.size; } - has(subnet: number): boolean { + has(subnet: SubnetID): boolean { return this.subnets.has(subnet); } @@ -35,18 +35,18 @@ export class SubnetMap { /** * Get last active slot of a subnet. */ - getToSlot(subnet: number): number | undefined { + getToSlot(subnet: SubnetID): Slot | undefined { return this.subnets.get(subnet); } - isActiveAtSlot(subnet: number, slot: Slot): boolean { + isActiveAtSlot(subnet: SubnetID, slot: Slot): boolean { const toSlot = this.subnets.get(subnet); return toSlot !== undefined && toSlot >= slot; // ACTIVE: >= } /** Return subnetIds with a `toSlot` equal greater than `currentSlot` */ - getActive(currentSlot: Slot): number[] { - const subnetIds: number[] = []; + getActive(currentSlot: Slot): SubnetID[] { + const subnetIds: SubnetID[] = []; for (const [subnet, toSlot] of this.subnets.entries()) { if (toSlot >= currentSlot) { subnetIds.push(subnet); @@ -67,8 +67,8 @@ export class SubnetMap { } /** Return subnetIds with a `toSlot` less than `currentSlot`. Also deletes expired entries */ - getExpired(currentSlot: Slot): number[] { - const subnetIds: number[] = []; + getExpired(currentSlot: Slot): SubnetID[] { + const subnetIds: SubnetID[] = []; for (const [subnet, toSlot] of this.subnets.entries()) { if (toSlot < currentSlot) { subnetIds.push(subnet); @@ -78,11 +78,11 @@ export class SubnetMap { return subnetIds; } - getAll(): number[] { + getAll(): SubnetID[] { return Array.from(this.subnets.keys()); } - delete(subnet: number): void { + delete(subnet: SubnetID): void { this.subnets.delete(subnet); } } diff --git a/packages/beacon-node/src/network/processor/aggregatorTracker.ts b/packages/beacon-node/src/network/processor/aggregatorTracker.ts index 634e809ae61f..0cd9d3e843b8 100644 --- a/packages/beacon-node/src/network/processor/aggregatorTracker.ts +++ b/packages/beacon-node/src/network/processor/aggregatorTracker.ts @@ -1,9 +1,7 @@ import {SLOTS_PER_EPOCH} from "@lodestar/params"; -import {Slot} from "@lodestar/types"; +import {Slot, SubnetID} from "@lodestar/types"; import {MapDef, pruneSetToMax} from "@lodestar/utils"; -type SubnetId = number; - // Subscriptions are submitted max two epochs in advance const MAX_SLOTS_CACHED = SLOTS_PER_EPOCH * 2; @@ -12,17 +10,17 @@ const MAX_SLOTS_CACHED = SLOTS_PER_EPOCH * 2; * to only then insert attestations into the op pool */ export class AggregatorTracker { - private subnetAggregatorsBySlot = new MapDef>(() => new Set()); + private subnetAggregatorsBySlot = new MapDef>(() => new Set()); get maxSlotsCached(): number { return MAX_SLOTS_CACHED; } - addAggregator(subnet: SubnetId, slot: Slot): void { + addAggregator(subnet: SubnetID, slot: Slot): void { this.subnetAggregatorsBySlot.getOrDefault(slot).add(subnet); } - shouldAggregate(subnet: SubnetId, slot: Slot): boolean { + shouldAggregate(subnet: SubnetID, slot: Slot): boolean { return this.subnetAggregatorsBySlot.get(slot)?.has(subnet) === true; } diff --git a/packages/beacon-node/src/network/processor/gossipHandlers.ts b/packages/beacon-node/src/network/processor/gossipHandlers.ts index 4646797c2425..2a9a9129a983 100644 --- a/packages/beacon-node/src/network/processor/gossipHandlers.ts +++ b/packages/beacon-node/src/network/processor/gossipHandlers.ts @@ -2,7 +2,17 @@ import {routes} from "@lodestar/api"; import {BeaconConfig, ChainForkConfig} from "@lodestar/config"; import {ForkName, ForkPostElectra, ForkPreElectra, ForkSeq, isForkPostElectra} from "@lodestar/params"; import {computeTimeAtSlot} from "@lodestar/state-transition"; -import {Root, SignedBeaconBlock, SingleAttestation, Slot, UintNum64, deneb, ssz, sszTypesFor} from "@lodestar/types"; +import { + Root, + SignedBeaconBlock, + SingleAttestation, + Slot, + SubnetID, + UintNum64, + deneb, + ssz, + sszTypesFor, +} from "@lodestar/types"; import {LogLevel, Logger, prettyBytes, toRootHex} from "@lodestar/utils"; import { BlobSidecarValidation, @@ -180,7 +190,7 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand async function validateBeaconBlob( blobSidecar: deneb.BlobSidecar, blobBytes: Uint8Array, - subnet: number, + subnet: SubnetID, peerIdStr: string, seenTimestampSec: number ): Promise { diff --git a/packages/beacon-node/src/network/subnets/attnetsService.ts b/packages/beacon-node/src/network/subnets/attnetsService.ts index ed2f94bd56d8..5652460b5abb 100644 --- a/packages/beacon-node/src/network/subnets/attnetsService.ts +++ b/packages/beacon-node/src/network/subnets/attnetsService.ts @@ -5,7 +5,7 @@ import { ForkName, SLOTS_PER_EPOCH, } from "@lodestar/params"; -import {Epoch, Slot, ssz} from "@lodestar/types"; +import {Epoch, Slot, SubnetID, ssz} from "@lodestar/types"; import {Logger, MapDef} from "@lodestar/utils"; import {ClockEvent, IClock} from "../../util/clock.js"; import {NetworkCoreMetrics} from "../core/metrics.js"; @@ -25,9 +25,8 @@ export enum SubnetSource { longLived = "long_lived", } -type Subnet = number; // map of subnet to time to form stable mesh as seconds, null if not yet formed -type AggregatorDutyInfo = Map; +type AggregatorDutyInfo = Map; /** * This value means node is not able to form stable mesh. @@ -126,7 +125,7 @@ export class AttnetsService implements IAttnetsService { /** * Check if a subscription is still active before handling a gossip object */ - shouldProcess(subnet: number, slot: Slot): boolean { + shouldProcess(subnet: SubnetID, slot: Slot): boolean { if (!this.aggregatorSlotSubnet.has(slot)) { return false; } diff --git a/packages/beacon-node/src/network/subnets/interface.ts b/packages/beacon-node/src/network/subnets/interface.ts index e3b1e2513818..fe9f1e6172cf 100644 --- a/packages/beacon-node/src/network/subnets/interface.ts +++ b/packages/beacon-node/src/network/subnets/interface.ts @@ -1,12 +1,12 @@ import {ForkName} from "@lodestar/params"; -import {Bytes32, Slot, ValidatorIndex} from "@lodestar/types"; +import {Bytes32, Slot, SubnetID, ValidatorIndex} from "@lodestar/types"; import {GossipTopic} from "../gossip/interface.js"; import {RequestedSubnet} from "../peers/utils/index.js"; /** Generic CommitteeSubscription for both beacon attnets subs and syncnets subs */ export type CommitteeSubscription = { validatorIndex: ValidatorIndex; - subnet: number; + subnet: SubnetID; slot: Slot; isAggregator: boolean; }; @@ -20,7 +20,7 @@ export type SubnetsService = { }; export interface IAttnetsService extends SubnetsService { - shouldProcess(subnet: number, slot: Slot): boolean; + shouldProcess(subnet: SubnetID, slot: Slot): boolean; } export type RandBetweenFn = (min: number, max: number) => number; diff --git a/packages/beacon-node/src/util/graffiti.ts b/packages/beacon-node/src/util/graffiti.ts index fb5c30aca3d3..ff23145d7295 100644 --- a/packages/beacon-node/src/util/graffiti.ts +++ b/packages/beacon-node/src/util/graffiti.ts @@ -12,7 +12,9 @@ export function toGraffitiBuffer(graffiti: string): Buffer { * Converts a graffiti from 32 bytes buffer back to a UTF-8 string */ export function fromGraffitiBuffer(graffiti: Uint8Array): string { - return Buffer.from(graffiti.buffer, graffiti.byteOffset, graffiti.byteLength).toString("utf8"); + return Buffer.from(graffiti.buffer, graffiti.byteOffset, graffiti.byteLength) + .toString("utf8") + .replaceAll("\u0000", ""); } export function getDefaultGraffiti( diff --git a/packages/beacon-node/test/sim/electra-interop.test.ts b/packages/beacon-node/test/sim/electra-interop.test.ts index 148f210f7f65..c46f5179e079 100644 --- a/packages/beacon-node/test/sim/electra-interop.test.ts +++ b/packages/beacon-node/test/sim/electra-interop.test.ts @@ -158,7 +158,7 @@ describe("executionEngine / ExecutionEngineHttp", () => { 256 ), prevRandao: dataToBytes("0x0000000000000000000000000000000000000000000000000000000000000000", 32), - gasLimit: 30000000, + gasLimit: 36000000, gasUsed: 84714, timestamp: 16, extraData: dataToBytes("0x", 0), diff --git a/packages/beacon-node/test/unit/chain/beaconProposerCache.test.ts b/packages/beacon-node/test/unit/chain/beaconProposerCache.test.ts new file mode 100644 index 000000000000..e8f0e410c3f3 --- /dev/null +++ b/packages/beacon-node/test/unit/chain/beaconProposerCache.test.ts @@ -0,0 +1,45 @@ +import {beforeEach, describe, expect, it} from "vitest"; +import {BeaconProposerCache} from "../../../src/chain/beaconProposerCache.js"; + +describe("BeaconProposerCache", () => { + const suggestedFeeRecipient = "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const feeRecipient1 = "0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"; + const feeRecipient2 = "0xcccccccccccccccccccccccccccccccccccccccc"; + + const validatorIndex1 = 23; + const validatorIndex2 = 43; + const unknownValidatorIndex = 32; + + let cache: BeaconProposerCache; + + beforeEach(() => { + // max 2 items + cache = new BeaconProposerCache({suggestedFeeRecipient}); + cache.add(1, {validatorIndex: validatorIndex1, feeRecipient: feeRecipient1}); + cache.add(3, {validatorIndex: validatorIndex2, feeRecipient: feeRecipient2}); + }); + + it("get default", () => { + expect(cache.getOrDefault(unknownValidatorIndex)).toBe(suggestedFeeRecipient); + }); + + it("get what has been set", () => { + expect(cache.get(validatorIndex1)).toBe(feeRecipient1); + }); + + it("override and get latest", () => { + const newFeeRecipient = "0xdddddddddddddddddddddddddddddddddddddddd"; + cache.add(5, {validatorIndex: validatorIndex1, feeRecipient: newFeeRecipient}); + expect(cache.get(validatorIndex1)).toBe(newFeeRecipient); + }); + + it("prune", () => { + cache.prune(4); + + // Default for what has been pruned + expect(cache.getOrDefault(validatorIndex1)).toBe(suggestedFeeRecipient); + + // Original for what hasn't been pruned + expect(cache.get(validatorIndex2)).toBe(feeRecipient2); + }); +}); diff --git a/packages/beacon-node/test/unit/chain/beaconProposerCache.ts b/packages/beacon-node/test/unit/chain/beaconProposerCache.ts deleted file mode 100644 index 96178d508732..000000000000 --- a/packages/beacon-node/test/unit/chain/beaconProposerCache.ts +++ /dev/null @@ -1,37 +0,0 @@ -import {beforeEach, describe, expect, it} from "vitest"; -import {BeaconProposerCache} from "../../../src/chain/beaconProposerCache.js"; - -const suggestedFeeRecipient = "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; -describe("BeaconProposerCache", () => { - let cache: BeaconProposerCache; - - beforeEach(() => { - // max 2 items - cache = new BeaconProposerCache({suggestedFeeRecipient}); - cache.add(1, {validatorIndex: 23, feeRecipient: "0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"}); - cache.add(3, {validatorIndex: 43, feeRecipient: "0xcccccccccccccccccccccccccccccccccccccccc"}); - }); - - it("get default", () => { - expect(cache.get(32)).toBe("0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); - }); - - it("get what has been set", () => { - expect(cache.get(23)).toBe("0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); - }); - - it("override and get latest", () => { - cache.add(5, {validatorIndex: 23, feeRecipient: "0xdddddddddddddddddddddddddddddddddddddddd"}); - expect(cache.get(23)).toBe("0xdddddddddddddddddddddddddddddddddddddddd"); - }); - - it("prune", () => { - cache.prune(4); - - // Default for what has been pruned - expect(cache.get(23)).toBe("0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); - - // Original for what hasn't been pruned - expect(cache.get(43)).toBe("0xcccccccccccccccccccccccccccccccccccccccc"); - }); -}); diff --git a/packages/beacon-node/test/unit/chain/validation/attestation/validateAttestation.test.ts b/packages/beacon-node/test/unit/chain/validation/attestation/validateAttestation.test.ts index 8c6f789e581e..5aecb5f7ccf1 100644 --- a/packages/beacon-node/test/unit/chain/validation/attestation/validateAttestation.test.ts +++ b/packages/beacon-node/test/unit/chain/validation/attestation/validateAttestation.test.ts @@ -1,6 +1,6 @@ import {BitArray} from "@chainsafe/ssz"; import {ForkName, SLOTS_PER_EPOCH} from "@lodestar/params"; -import {ssz} from "@lodestar/types"; +import {SubnetID, ssz} from "@lodestar/types"; import {LodestarError} from "@lodestar/utils"; import {describe, expect, it} from "vitest"; import {generateTestCachedBeaconStateOnlyValidators} from "../../../../../../state-transition/test/perf/util.js"; @@ -309,7 +309,7 @@ describe("validateAttestation", () => { async function expectGossipError( chain: IBeaconChain, attestationOrBytes: GossipAttestation, - subnet: number, + subnet: SubnetID, errorCode: string ): Promise { const fork = chain.config.getForkName(stateSlot); diff --git a/packages/beacon-node/test/unit/network/subnets/attnetsService.test.ts b/packages/beacon-node/test/unit/network/subnets/attnetsService.test.ts index 5e7149f4d7f8..f679532bb09a 100644 --- a/packages/beacon-node/test/unit/network/subnets/attnetsService.test.ts +++ b/packages/beacon-node/test/unit/network/subnets/attnetsService.test.ts @@ -8,6 +8,7 @@ import { } from "@lodestar/params"; import {ZERO_HASH} from "@lodestar/state-transition"; import {getCurrentSlot} from "@lodestar/state-transition"; +import {SubnetID} from "@lodestar/types"; import {bigIntToBytes} from "@lodestar/utils"; import {MockedObject, afterEach, beforeEach, describe, expect, it, vi} from "vitest"; import {Eth2Gossipsub} from "../../../../src/network/gossip/gossipsub.js"; @@ -77,8 +78,8 @@ describe("AttnetsService", () => { expect(gossipStub.subscribeTopic).toBeCalledWith(expect.objectContaining({fork: ForkName.phase0})); expect(gossipStub.subscribeTopic).not.toBeCalledWith({fork: ForkName.altair}); expect(gossipStub.subscribeTopic).toBeCalledTimes(2); - const firstSubnet = (gossipStub.subscribeTopic.mock.calls[0][0] as unknown as {subnet: number}).subnet; - const secondSubnet = (gossipStub.subscribeTopic.mock.calls[1][0] as unknown as {subnet: number}).subnet; + const firstSubnet = (gossipStub.subscribeTopic.mock.calls[0][0] as unknown as {subnet: SubnetID}).subnet; + const secondSubnet = (gossipStub.subscribeTopic.mock.calls[1][0] as unknown as {subnet: SubnetID}).subnet; expect(gossipStub.subscribeTopic).toBeCalledTimes(SUBNETS_PER_NODE); vi.advanceTimersByTime(config.SECONDS_PER_SLOT * SLOTS_PER_EPOCH * (ALTAIR_FORK_EPOCH - 2) * 1000); service.subscribeSubnetsToNextFork(ForkName.altair); @@ -105,8 +106,8 @@ describe("AttnetsService", () => { it("should not subscribe to new short lived subnet if not aggregator", () => { expect(gossipStub.subscribeTopic).toBeCalledTimes(SUBNETS_PER_NODE); - const firstSubnet = (gossipStub.subscribeTopic.mock.calls[0][0] as unknown as {subnet: number}).subnet; - const secondSubnet = (gossipStub.subscribeTopic.mock.calls[1][0] as unknown as {subnet: number}).subnet; + const firstSubnet = (gossipStub.subscribeTopic.mock.calls[0][0] as unknown as {subnet: SubnetID}).subnet; + const secondSubnet = (gossipStub.subscribeTopic.mock.calls[1][0] as unknown as {subnet: SubnetID}).subnet; // should subscribe to new short lived subnet const newSubnet = 63; expect(newSubnet).not.toBe(firstSubnet); @@ -124,8 +125,8 @@ describe("AttnetsService", () => { it("should subscribe to new short lived subnet if aggregator", () => { expect(gossipStub.subscribeTopic).toBeCalledTimes(SUBNETS_PER_NODE); - const firstSubnet = (gossipStub.subscribeTopic.mock.calls[0][0] as unknown as {subnet: number}).subnet; - const secondSubnet = (gossipStub.subscribeTopic.mock.calls[1][0] as unknown as {subnet: number}).subnet; + const firstSubnet = (gossipStub.subscribeTopic.mock.calls[0][0] as unknown as {subnet: SubnetID}).subnet; + const secondSubnet = (gossipStub.subscribeTopic.mock.calls[1][0] as unknown as {subnet: SubnetID}).subnet; // should subscribe to new short lived subnet const newSubnet = 63; expect(newSubnet).not.toBe(firstSubnet); @@ -149,7 +150,7 @@ describe("AttnetsService", () => { it("should not subscribe to existing short lived subnet if aggregator", () => { expect(gossipStub.subscribeTopic).toBeCalledTimes(SUBNETS_PER_NODE); - const firstSubnet = (gossipStub.subscribeTopic.mock.calls[0][0] as unknown as {subnet: number}).subnet; + const firstSubnet = (gossipStub.subscribeTopic.mock.calls[0][0] as unknown as {subnet: SubnetID}).subnet; // should not subscribe to existing short lived subnet const subscription: CommitteeSubscription = { validatorIndex: 2023, diff --git a/packages/beacon-node/test/utils/network.ts b/packages/beacon-node/test/utils/network.ts index 56c831b269f5..d64249d3a130 100644 --- a/packages/beacon-node/test/utils/network.ts +++ b/packages/beacon-node/test/utils/network.ts @@ -2,6 +2,7 @@ import {BitArray} from "@chainsafe/ssz"; import {PeerId} from "@libp2p/interface"; import {createSecp256k1PeerId} from "@libp2p/peer-id-factory"; import {ATTESTATION_SUBNET_COUNT, SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params"; +import {SubnetID} from "@lodestar/types"; import {INetwork, Network, NetworkEvent} from "../../src/network/index.js"; import {Libp2p} from "../../src/network/interface.js"; import {createNodeJsLibp2p} from "../../src/network/libp2p/index.js"; @@ -55,7 +56,7 @@ export function onPeerDisconnect(network: Network): Promise { /** * Generate valid filled attnets BitVector */ -export function getAttnets(subnetIds: number[] = []): BitArray { +export function getAttnets(subnetIds: SubnetID[] = []): BitArray { const attnets = BitArray.fromBitLen(ATTESTATION_SUBNET_COUNT); for (const subnetId of subnetIds) { attnets.set(subnetId, true); @@ -66,7 +67,7 @@ export function getAttnets(subnetIds: number[] = []): BitArray { /** * Generate valid filled syncnets BitVector */ -export function getSyncnets(subnetIds: number[] = []): BitArray { +export function getSyncnets(subnetIds: SubnetID[] = []): BitArray { const syncnets = BitArray.fromBitLen(SYNC_COMMITTEE_SUBNET_COUNT); for (const subnetId of subnetIds) { syncnets.set(subnetId, true); diff --git a/packages/beacon-node/test/utils/validationData/attestation.ts b/packages/beacon-node/test/utils/validationData/attestation.ts index 40dccbd77f18..e8f0fca632eb 100644 --- a/packages/beacon-node/test/utils/validationData/attestation.ts +++ b/packages/beacon-node/test/utils/validationData/attestation.ts @@ -2,7 +2,7 @@ import {BitArray, toHexString} from "@chainsafe/ssz"; import {DataAvailabilityStatus, ExecutionStatus, IForkChoice, ProtoBlock} from "@lodestar/fork-choice"; import {DOMAIN_BEACON_ATTESTER} from "@lodestar/params"; import {computeEpochAtSlot, computeSigningRoot, computeStartSlotAtEpoch} from "@lodestar/state-transition"; -import {Slot, phase0, ssz} from "@lodestar/types"; +import {Slot, SubnetID, phase0, ssz} from "@lodestar/types"; import { generateTestCachedBeaconStateOnlyValidators, getSecretKeyFromIndexCached, @@ -37,7 +37,7 @@ export type AttestationValidDataOpts = { export function getAttestationValidData(opts: AttestationValidDataOpts): { chain: IBeaconChain; attestation: phase0.Attestation; - subnet: number; + subnet: SubnetID; validatorIndex: number; } { const currentSlot = opts.currentSlot ?? 100; diff --git a/packages/cli/package.json b/packages/cli/package.json index e1b2134f5f82..8f3cc163cc57 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@chainsafe/lodestar", - "version": "1.23.1", + "version": "1.24.0", "description": "Command line interface for lodestar", "author": "ChainSafe Systems", "license": "LGPL-3.0", @@ -62,17 +62,17 @@ "@libp2p/crypto": "^4.1.0", "@libp2p/peer-id": "^4.1.0", "@libp2p/peer-id-factory": "^4.1.0", - "@lodestar/api": "^1.23.1", - "@lodestar/beacon-node": "^1.23.1", - "@lodestar/config": "^1.23.1", - "@lodestar/db": "^1.23.1", - "@lodestar/light-client": "^1.23.1", - "@lodestar/logger": "^1.23.1", - "@lodestar/params": "^1.23.1", - "@lodestar/state-transition": "^1.23.1", - "@lodestar/types": "^1.23.1", - "@lodestar/utils": "^1.23.1", - "@lodestar/validator": "^1.23.1", + "@lodestar/api": "^1.24.0", + "@lodestar/beacon-node": "^1.24.0", + "@lodestar/config": "^1.24.0", + "@lodestar/db": "^1.24.0", + "@lodestar/light-client": "^1.24.0", + "@lodestar/logger": "^1.24.0", + "@lodestar/params": "^1.24.0", + "@lodestar/state-transition": "^1.24.0", + "@lodestar/types": "^1.24.0", + "@lodestar/utils": "^1.24.0", + "@lodestar/validator": "^1.24.0", "@multiformats/multiaddr": "^12.1.3", "deepmerge": "^4.3.1", "ethers": "^6.7.0", @@ -88,7 +88,7 @@ "yargs": "^17.7.1" }, "devDependencies": { - "@lodestar/test-utils": "^1.23.1", + "@lodestar/test-utils": "^1.24.0", "@types/debug": "^4.1.7", "@types/got": "^9.6.12", "@types/inquirer": "^9.0.3", diff --git a/packages/cli/test/e2e/propserConfigfromKeymanager.test.ts b/packages/cli/test/e2e/propserConfigfromKeymanager.test.ts index 26bf3e618c2b..e30d65178c7a 100644 --- a/packages/cli/test/e2e/propserConfigfromKeymanager.test.ts +++ b/packages/cli/test/e2e/propserConfigfromKeymanager.test.ts @@ -16,13 +16,13 @@ describe("import keystores from api, test DefaultProposerConfig", () => { const defaultOptions = { suggestedFeeRecipient: "0x0000000000000000000000000000000000000000", - gasLimit: 30_000_000, + gasLimit: 36_000_000, graffiti: "aaaa", }; const updatedOptions = { suggestedFeeRecipient: "0xcccccccccccccccccccccccccccccccccccccccc", - gasLimit: 35_000_000, + gasLimit: 40_000_000, graffiti: "bbbb", }; diff --git a/packages/cli/test/unit/validator/parseProposerConfig.test.ts b/packages/cli/test/unit/validator/parseProposerConfig.test.ts index f10d5d7cc080..42138dbe7d28 100644 --- a/packages/cli/test/unit/validator/parseProposerConfig.test.ts +++ b/packages/cli/test/unit/validator/parseProposerConfig.test.ts @@ -14,7 +14,7 @@ const testValue = { strictFeeRecipientCheck: true, feeRecipient: "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", builder: { - gasLimit: 30000000, + gasLimit: 36000000, selection: undefined, boostFactor: undefined, }, @@ -35,7 +35,7 @@ const testValue = { strictFeeRecipientCheck: true, feeRecipient: "0xcccccccccccccccccccccccccccccccccccccccc", builder: { - gasLimit: 30000000, + gasLimit: 36000000, selection: routes.validator.BuilderSelection.MaxProfit, boostFactor: BigInt(50), }, diff --git a/packages/cli/test/unit/validator/proposerConfigs/invalidData.yaml b/packages/cli/test/unit/validator/proposerConfigs/invalidData.yaml index 361a8aee0a68..63dca6d46eae 100644 --- a/packages/cli/test/unit/validator/proposerConfigs/invalidData.yaml +++ b/packages/cli/test/unit/validator/proposerConfigs/invalidData.yaml @@ -1,20 +1,20 @@ proposer_config: - '0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c': + "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c": graffiti: 123 strict_fee_recipient_check: "true" - fee_recipient: '0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + fee_recipient: "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" builder: enabled: true - gas_limit: "30000000" - '0xa4855c83d868f772a579133d9f23818008417b743e8447e235d8eb78b1d8f8a9f63f98c551beb7de254400f89592314d': - fee_recipient: '0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' + gas_limit: "36000000" + "0xa4855c83d868f772a579133d9f23818008417b743e8447e235d8eb78b1d8f8a9f63f98c551beb7de254400f89592314d": + fee_recipient: "0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" builder: enabled: "true" gas_limit: "35000000" default_config: - graffiti: 'default graffiti' + graffiti: "default graffiti" strict_fee_recipient_check: true - fee_recipient: '0xcccccccccccccccccccccccccccccccccccccccc' + fee_recipient: "0xcccccccccccccccccccccccccccccccccccccccc" builder: enabled: true - gas_limit: "30000000" + gas_limit: "36000000" diff --git a/packages/cli/test/unit/validator/proposerConfigs/validData.yaml b/packages/cli/test/unit/validator/proposerConfigs/validData.yaml index 71dabb9d900d..9532ed4ce008 100644 --- a/packages/cli/test/unit/validator/proposerConfigs/validData.yaml +++ b/packages/cli/test/unit/validator/proposerConfigs/validData.yaml @@ -1,21 +1,21 @@ proposer_config: - '0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c': - graffiti: 'graffiti' + "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c": + graffiti: "graffiti" strict_fee_recipient_check: true - fee_recipient: '0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + fee_recipient: "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" builder: - gas_limit: "30000000" - '0xa4855c83d868f772a579133d9f23818008417b743e8447e235d8eb78b1d8f8a9f63f98c551beb7de254400f89592314d': - fee_recipient: '0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' + gas_limit: "36000000" + "0xa4855c83d868f772a579133d9f23818008417b743e8447e235d8eb78b1d8f8a9f63f98c551beb7de254400f89592314d": + fee_recipient: "0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" builder: gas_limit: "35000000" selection: "builderalways" boost_factor: "18446744073709551616" default_config: - graffiti: 'default graffiti' + graffiti: "default graffiti" strict_fee_recipient_check: "true" - fee_recipient: '0xcccccccccccccccccccccccccccccccccccccccc' + fee_recipient: "0xcccccccccccccccccccccccccccccccccccccccc" builder: - gas_limit: "30000000" + gas_limit: "36000000" selection: "maxprofit" boost_factor: "50" diff --git a/packages/config/package.json b/packages/config/package.json index 5a4edcf7879c..c421d8802f08 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,6 +1,6 @@ { "name": "@lodestar/config", - "version": "1.23.1", + "version": "1.24.0", "description": "Chain configuration required for lodestar", "author": "ChainSafe Systems", "license": "Apache-2.0", @@ -65,8 +65,8 @@ ], "dependencies": { "@chainsafe/ssz": "^0.18.0", - "@lodestar/params": "^1.23.1", - "@lodestar/types": "^1.23.1", - "@lodestar/utils": "^1.23.1" + "@lodestar/params": "^1.24.0", + "@lodestar/types": "^1.24.0", + "@lodestar/utils": "^1.24.0" } } diff --git a/packages/db/package.json b/packages/db/package.json index a332d316185b..c71fae529350 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -1,6 +1,6 @@ { "name": "@lodestar/db", - "version": "1.23.1", + "version": "1.24.0", "description": "DB modules of Lodestar", "author": "ChainSafe Systems", "homepage": "https://github.com/ChainSafe/lodestar#readme", @@ -36,12 +36,12 @@ }, "dependencies": { "@chainsafe/ssz": "^0.18.0", - "@lodestar/config": "^1.23.1", - "@lodestar/utils": "^1.23.1", + "@lodestar/config": "^1.24.0", + "@lodestar/utils": "^1.24.0", "classic-level": "^1.4.1", "it-all": "^3.0.4" }, "devDependencies": { - "@lodestar/logger": "^1.23.1" + "@lodestar/logger": "^1.24.0" } } diff --git a/packages/flare/package.json b/packages/flare/package.json index c3d262173321..a4fa6ca96399 100644 --- a/packages/flare/package.json +++ b/packages/flare/package.json @@ -1,6 +1,6 @@ { "name": "@lodestar/flare", - "version": "1.23.1", + "version": "1.24.0", "description": "Beacon chain debugging tool", "author": "ChainSafe Systems", "license": "Apache-2.0", @@ -60,12 +60,12 @@ "dependencies": { "@chainsafe/bls-keygen": "^0.4.0", "@chainsafe/blst": "^2.1.0", - "@lodestar/api": "^1.23.1", - "@lodestar/config": "^1.23.1", - "@lodestar/params": "^1.23.1", - "@lodestar/state-transition": "^1.23.1", - "@lodestar/types": "^1.23.1", - "@lodestar/utils": "^1.23.1", + "@lodestar/api": "^1.24.0", + "@lodestar/config": "^1.24.0", + "@lodestar/params": "^1.24.0", + "@lodestar/state-transition": "^1.24.0", + "@lodestar/types": "^1.24.0", + "@lodestar/utils": "^1.24.0", "source-map-support": "^0.5.21", "yargs": "^17.7.1" }, diff --git a/packages/fork-choice/package.json b/packages/fork-choice/package.json index cc86cd75b45f..a3d0470b21d2 100644 --- a/packages/fork-choice/package.json +++ b/packages/fork-choice/package.json @@ -11,7 +11,7 @@ "bugs": { "url": "https://github.com/ChainSafe/lodestar/issues" }, - "version": "1.23.1", + "version": "1.24.0", "type": "module", "exports": "./lib/index.js", "types": "./lib/index.d.ts", @@ -37,11 +37,11 @@ }, "dependencies": { "@chainsafe/ssz": "^0.18.0", - "@lodestar/config": "^1.23.1", - "@lodestar/params": "^1.23.1", - "@lodestar/state-transition": "^1.23.1", - "@lodestar/types": "^1.23.1", - "@lodestar/utils": "^1.23.1" + "@lodestar/config": "^1.24.0", + "@lodestar/params": "^1.24.0", + "@lodestar/state-transition": "^1.24.0", + "@lodestar/types": "^1.24.0", + "@lodestar/utils": "^1.24.0" }, "keywords": [ "ethereum", diff --git a/packages/light-client/README.md b/packages/light-client/README.md index 3cab0c12f13b..f9af65f23f98 100644 --- a/packages/light-client/README.md +++ b/packages/light-client/README.md @@ -18,7 +18,7 @@ The evolution of light clients is emblematic of the broader trajectory of Ethere ## Requirements for Running a Light-Client -Access to an beacon node that supports the light client specification is necessary. The client must support the following routes from the [consensus API spec](https://github.com/ethereum/beacon-APIs/tree/v2.5.0/apis/beacon/light_client): +Access to a beacon node that supports the light client specification is necessary. The client must support the following routes from the [consensus API spec](https://github.com/ethereum/beacon-APIs/tree/v2.5.0/apis/beacon/light_client): - [`GET /eth/v1/beacon/light_client/updates`](https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.5.0#/Beacon/getLightClientUpdatesByRange) - [`GET /eth/v1/beacon/light_client/optimistic_update`](https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.5.0#/Beacon/getLightClientOptimisticUpdate) @@ -32,7 +32,7 @@ You can find more information about the light-client protocol in the [specificat ## Getting started - Follow the [installation guide](https://chainsafe.github.io/lodestar/run/getting-started/installation) to install Lodestar. -- Quickly try out the whole stack by [starting a local testnet](https://chainsafe.github.io/lodestar/advanced-topics/setting-up-a-testnet). +- Quickly try out the whole stack by [starting a local testnet](https://chainsafe.github.io/lodestar/contribution/advanced-topics/setting-up-a-testnet). ## Light-Client CLI Example @@ -92,7 +92,7 @@ lightclient.emitter.on(LightclientEvent.lightClientOptimisticHeader, async (opti ## Browser Integration -If you want to use Lightclient in browser and facing some issues in building it with bundlers like webpack, vite. We suggest to use our distribution build. The support for single distribution build is started from `1.20.0` version. +If you want to use Lightclient in browser and are facing some issues in building it with bundlers like webpack, vite. We suggest using our distribution build. The support for single distribution build is started from `1.20.0` version. Directly link the dist build with the `