Skip to content

Commit

Permalink
test: support .env.test to reuse env variables across the tests (#6408)
Browse files Browse the repository at this point in the history
* Variables using .env file

* Add env variable support to normal tests

* Fix the order of variables

* Update the order of jobs

* Export the varible using actions toolkit

* Update the workflow tasks

* Fix the sim workflow

* Add .env.test file support to tests

* Fix the lint

* Update the task description

* Move lodestar preset to env file

* Fix the directory path

* newline

* Update debugging spec tests section

* Update the env variable for preset

* Fix the path for setup files

* Update code as per feedback

* Fix the e2e variables

* Update doc

* Fix the bash script

* Fix sim geth runne

* Update the env file

* Fix e2e tests

* Update the script tasks

* Update the script tasks

* Add minimal for e2e tests

* Add minimal for e2e tests

* Update comments in preset tests

* Downgrade nethermind version

* Load env file in e2e env

* Add the issue link in env variable

* Update bash script for failsafe current dir

* Fix the mistaken genesis extension for el nodes

* Add missing capella wait for one test

* Downgrade the geth version

* Update .env.test

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
  • Loading branch information
nazarhussain and nflaig authored Feb 12, 2024
1 parent 1e67579 commit da0bcc8
Show file tree
Hide file tree
Showing 26 changed files with 115 additions and 47 deletions.
13 changes: 13 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# We use these images during sim and e2e tests
# TODO: Upgrade Geth once the Nethermind issue is resolved else it's causing following error
# Rejected peer id=134e2c1a76745626 addr=192.168.0.3:9052 conn=staticdial err="useless peer"
GETH_DOCKER_IMAGE=ethereum/client-go:v1.11.6
# Use either image or local binary for the testing
GETH_BINARY_DIR=
LIGHTHOUSE_DOCKER_IMAGE=sigp/lighthouse:v4.6.0-amd64-modern-dev
# We can't upgrade nethermind further due to genesis hash mismatch with the geth
# https://github.com/NethermindEth/nethermind/issues/6683
NETHERMIND_DOCKER_IMAGE=nethermind/nethermind:1.18.2
# We mostly use mainnet for unit testing
# Changing this value may impact the tests which are written with mainnet in mind
LODESTAR_PRESET=mainnet
5 changes: 5 additions & 0 deletions .github/actions/dotenv/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name: "Setup env variables using .env file"
description: "Load .env file from root of repo and setup for CI runner"
runs:
using: "node20"
main: index.js
29 changes: 29 additions & 0 deletions .github/actions/dotenv/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const fs = require("fs");
const core = require("@actions/core");
const dotEnv = require("dotenv");
const envFile = ".env.test";

if (!fs.existsSync(envFile)) {
core.setFailed("File .env not found");
}

const result = dotEnv.config({path: envFile});
if (result.error) {
core.setFailed(result.error.message);
} else {
core.setOutput("env", result.parsed);
core.info("Env file loaded");
core.info("Populating env variables...");

for (const key in result.parsed) {
const value = result.parsed[key];
core.info(`${key}=${value}`);

// Export variable
core.exportVariable(key, value);

// Set to output so it can be used in as the input for the next job/step
core.setOutput(key, value);

}
}
8 changes: 3 additions & 5 deletions .github/workflows/test-sim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ on:
type: number
default: 40

env:
GETH_DOCKER_IMAGE: ethereum/client-go:v1.13.11
LIGHTHOUSE_DOCKER_IMAGE: sigp/lighthouse:latest-amd64-modern-dev
NETHERMIND_DOCKER_IMAGE: nethermind/nethermind:1.25.3

jobs:
tests-sim:
name: Sim tests
Expand Down Expand Up @@ -58,6 +53,9 @@ jobs:
if: steps.cache-deps.outputs.cache-hit == 'true'
# </common-build>

- name: Load env variables
uses: ./.github/actions/dotenv

- name: Download required docker images before running tests
run: |
docker pull ${{env.GETH_DOCKER_IMAGE}}
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ on:
pull_request:
workflow_dispatch:

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

jobs:
build:
name: Build
Expand Down Expand Up @@ -230,6 +226,9 @@ jobs:
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ github.sha }}
fail-on-cache-miss: true

- name: Load env variables
uses: ./.github/actions/dotenv

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

Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ To run tests:
Note that to run `test:e2e`, first ensure that the environment is correctly setup by running the `run_e2e_env.sh` script.

```sh
GETH_DOCKER_IMAGE=ethereum/client-go:v1.11.6 NETHERMIND_DOCKER_IMAGE=nethermind/nethermind:1.18.0 ./scripts/run_e2e_env.sh start
./scripts/run_e2e_env.sh start
```

Similarly, run `yarn download-spec-tests` before running `yarn test:spec`.
Expand Down Expand Up @@ -63,9 +63,9 @@ If you observe following error running any of the test files that means you are
- Spec tests often compare full expected vs actual states in JSON format.
- A single logical error can cause many spec tests to fail. To focus on a single test at a time you can use vitest's option `--bail 1` to stop at the first failed test
- To then run only that failed test you can run against a specific file as use vitest's filters option `-t <pattern>` to run only one case
- Before running the tests, make sure to switch to the package directory (e.g. `packages/beacon-node`) to speed up test execution

```sh
cd packages/beacon-node
LODESTAR_PRESET=minimal yarn vitest --run --bail 1 --config vitest.spec.config.ts test/spec/presets/sanity.test.ts -t attester_slashing
```

Expand Down
14 changes: 4 additions & 10 deletions docs/pages/contribution/testing/simulation-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ There are a number of sim tests that are available and each has a slightly diffe

### Environment Variables

To see what typical values for these are check out the `test-sim.yaml` workflow file in the `.github/workflows` directory.
To see what typical values for these are check out the `.env.test` file in the root directory.

- `GETH_DOCKER_IMAGE`: The geth docker image that will be used
- `NETHERMIND_IMAGE`: The nethermind docker image that will be used
Expand All @@ -23,19 +23,15 @@ To see what typical values for these are check out the `test-sim.yaml` workflow
The multi-fork sim test checks most of the functionality Lodestar provides. Is verifies that Lodestar is capable of peering, moving through all of the forks and using various sync methods in a testnet environment. Lodestar is tested with both Geth and Nethermind as the execution client. It also checks a Lighthouse/Geth node for cross client compatibility.

```sh
GETH_DOCKER_IMAGE=ethereum/client-go:v1.11.6 \
LIGHTHOUSE_DOCKER_IMAGE=sigp/lighthouse:latest-amd64-modern-dev \
NETHERMIND_DOCKER_IMAGE=nethermind/nethermind:1.18.0 \
yarn workspace @chainsafe/lodestar test:sim:multifork
yarn workspace @chainsafe/lodestar test:sim:multifork
```

### `test:sim:endpoints`

This tests that various endpoints of the beacon node and validator client are working as expected.

```sh
GETH_DOCKER_IMAGE=ethereum/client-go:v1.11.6 \
yarn workspace @chainsafe/lodestar test:sim:endpoints
yarn workspace @chainsafe/lodestar test:sim:endpoints
```

### `test:sim:deneb`
Expand All @@ -47,9 +43,7 @@ This test is still included in our CI but is no longer as important as it once w
Checks that Lodestar is compatible with other consensus validators and vice-versa. All tests use Geth as the EL.

```sh
GETH_DOCKER_IMAGE=ethereum/client-go:v1.11.6 \
LIGHTHOUSE_DOCKER_IMAGE=sigp/lighthouse:latest-amd64-modern-dev \
yarn workspace @chainsafe/lodestar test:sim:mixedclient
yarn workspace @chainsafe/lodestar test:sim:mixedclient
```

## Sim Test Infrastructure
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@
"test-coverage:e2e-sim": "c8 --config .c8rc.json --report-dir coverage/e2e-sim/ --all npm run test:e2e:sim",
"test-coverage:spec": "c8 --config .c8rc.json --report-dir coverage/spec/ --all npm run test:spec",
"benchmark": "yarn benchmark:files 'packages/*/test/perf/**/*.test.ts'",
"benchmark:files": "LODESTAR_PRESET=mainnet NODE_OPTIONS='--max-old-space-size=4096 --loader=ts-node/esm' benchmark --config .benchrc.yaml --defaultBranch unstable",
"benchmark:files": "NODE_OPTIONS='--max-old-space-size=4096 --loader=ts-node/esm' benchmark --config .benchrc.yaml --defaultBranch unstable",
"release:create-rc": "node scripts/release/create_rc.mjs",
"release:tag-rc": "node scripts/release/tag_rc.mjs",
"release:tag-stable": "node scripts/release/tag_stable.mjs",
"release:publish": "lerna publish from-package --yes --no-verify-access"
},
"devDependencies": {
"@actions/core": "^1.10.1",
"@chainsafe/eslint-plugin-node": "^11.2.3",
"@dapplion/benchmark": "^0.2.4",
"@types/mocha": "^10.0.6",
Expand All @@ -54,6 +55,7 @@
"@vitest/coverage-v8": "^1.2.1",
"@vitest/browser": "^1.2.1",
"crypto-browserify": "^3.12.0",
"dotenv": "^16.4.1",
"electron": "^26.2.2",
"eslint": "^8.50.0",
"eslint-import-resolver-typescript": "^3.6.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/beacon-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
"lint": "eslint --color --ext .ts src/ test/",
"lint:fix": "yarn run lint --fix",
"test": "yarn test:unit && yarn test:e2e",
"test:unit:minimal": "vitest --run --segfaultRetry 3 --dir test/unit/",
"test:unit:mainnet": "LODESTAR_PRESET=mainnet vitest --run --dir test/unit-mainnet",
"test:unit:minimal": "LODESTAR_PRESET=minimal vitest --run --segfaultRetry 3 --dir test/unit/",
"test:unit:mainnet": "LODESTAR_PRESET=mainnet vitest --run --segfaultRetry 3 --dir test/unit-mainnet",
"test:unit": "wrapper() { yarn test:unit:minimal $@ && yarn test:unit:mainnet $@; }; wrapper",
"test:e2e": "LODESTAR_PRESET=minimal vitest --run --segfaultRetry 3 --config vitest.e2e.config.ts --dir test/e2e",
"test:sim": "vitest --run test/sim/**/*.test.ts",
Expand Down
10 changes: 5 additions & 5 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
"lint:fix": "yarn run lint --fix",
"test:unit": "vitest --run --dir test/unit/",
"test:e2e": "vitest --run --config vitest.e2e.config.ts --dir test/e2e/",
"test:sim:multifork": "LODESTAR_PRESET=minimal node --loader ts-node/esm test/sim/multi_fork.test.ts",
"test:sim:mixedclient": "LODESTAR_PRESET=minimal node --loader ts-node/esm test/sim/mixed_client.test.ts",
"test:sim:endpoints": "LODESTAR_PRESET=minimal node --loader ts-node/esm test/sim/endpoints.test.ts",
"test:sim:deneb": "LODESTAR_PRESET=minimal node --loader ts-node/esm test/sim/deneb.test.ts",
"test:sim:backup_eth_provider": "LODESTAR_PRESET=minimal node --loader ts-node/esm test/sim/backup_eth_provider.test.ts",
"test:sim:multifork": "LODESTAR_PRESET=minimal DOTENV_CONFIG_PATH=../../.env.test node -r dotenv/config --loader ts-node/esm test/sim/multi_fork.test.ts",
"test:sim:mixedclient": "LODESTAR_PRESET=minimal DOTENV_CONFIG_PATH=../../.env.test node -r dotenv/config --loader ts-node/esm test/sim/mixed_client.test.ts",
"test:sim:endpoints": "LODESTAR_PRESET=minimal DOTENV_CONFIG_PATH=../../.env.test node -r dotenv/config --loader ts-node/esm test/sim/endpoints.test.ts",
"test:sim:deneb": "LODESTAR_PRESET=minimal DOTENV_CONFIG_PATH=../../.env.test node -r dotenv/config --loader ts-node/esm test/sim/deneb.test.ts",
"test:sim:backup_eth_provider": "LODESTAR_PRESET=minimal DOTENV_CONFIG_PATH=../../.env.test node -r dotenv/config --loader ts-node/esm test/sim/backup_eth_provider.test.ts",
"test": "yarn test:unit && yarn test:e2e",
"check-readme": "typescript-docs-verifier"
},
Expand Down
1 change: 1 addition & 0 deletions packages/cli/test/scripts/e2e_test_env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const {forkConfig} = defineSimTestConfig({
BELLATRIX_FORK_EPOCH: bellatrixForkEpoch,
CAPELLA_FORK_EPOCH: capellaForkEpoch,
runTillEpoch: Infinity,
initialNodes: 2,
});

const env = await SimulationEnvironment.initWithDefaults(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const generateGethNode: ExecutionNodeGenerator<ExecutionClient.Geth> = (o
const {id, mode, ttd, address, mining, clientOptions, nodeIndex} = opts;
const ports = getNodePorts(nodeIndex);

const isDocker = process.env.GETH_DOCKER_IMAGE !== undefined;
const isDocker = !!process.env.GETH_DOCKER_IMAGE;
const binaryPath = isDocker ? "" : `${process.env.GETH_BINARY_DIR}/geth`;
const {rootDir, rootDirMounted, genesisFilePathMounted, logFilePath, jwtsecretFilePathMounted} = getNodeMountedPaths(
opts.paths,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/utils/simulation/utils/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function getNodePaths<
return {
rootDir: executionRootDir,
dataDir: path.join(executionRootDir, "data"),
genesisFilePath: path.join(executionRootDir, "genesis.ssz"),
genesisFilePath: path.join(executionRootDir, "genesis.json"),
jwtsecretFilePath: path.join(executionRootDir, "jwtsecret.txt"),
logFilePath: path.join(logsDir, `${id}-${client}.log`),
} as R;
Expand Down
2 changes: 1 addition & 1 deletion packages/logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"test:browsers:chrome": "vitest --run --browser chrome --config ./vitest.browser.config.ts --dir test/unit",
"test:browsers:firefox": "vitest --run --browser firefox --config ./vitest.browser.config.ts --dir test/unit",
"test:browsers:electron": "echo 'Electron tests will be introduced back in the future as soon vitest supports electron.'",
"test:e2e": "LODESTAR_PRESET=minimal vitest --run --config vitest.e2e.config.ts --dir test/e2e",
"test:e2e": "vitest --run --config vitest.e2e.config.ts --dir test/e2e",
"check-readme": "typescript-docs-verifier"
},
"types": "lib/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/params/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"test:browsers:chrome": "vitest --run --browser chrome --config ./vitest.browser.config.ts --dir test/unit",
"test:browsers:firefox": "vitest --run --browser firefox --config ./vitest.browser.config.ts --dir test/unit",
"test:browsers:electron": "echo 'Electron tests will be introduced back in the future as soon vitest supports electron.'",
"test:e2e": "LODESTAR_PRESET=minimal vitest --run --config vitest.e2e.config.ts --dir test/e2e/",
"test:e2e": "vitest --run --config vitest.e2e.config.ts --dir test/e2e/",
"check-readme": "typescript-docs-verifier"
},
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions packages/params/test/e2e/overridePreset.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ describe("Override preset", function () {
vi.setConfig({testTimeout: 30_000});

it("Should correctly override preset", async () => {
// These commands can not run with minimal preset
if (process.env.LODESTAR_PRESET === "minimal") delete process.env.LODESTAR_PRESET;
// `LODESTAR_PRESET` must not be set to properly test preset override
if (process.env.LODESTAR_PRESET) delete process.env.LODESTAR_PRESET;

await exec(`node --loader ts-node/esm ${path.join(__dirname, scriptNames.ok)}`);
});
Expand Down
4 changes: 2 additions & 2 deletions packages/params/test/e2e/setPreset.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ describe("setPreset", function () {
vi.setConfig({testTimeout: 30_000});

it("Should correctly set preset", async () => {
// These commands can not run with minimal preset
if (process.env.LODESTAR_PRESET === "minimal") delete process.env.LODESTAR_PRESET;
// `LODESTAR_PRESET` must not be set to properly test setting preset
if (process.env.LODESTAR_PRESET) delete process.env.LODESTAR_PRESET;

await exec(`node --loader ts-node/esm ${path.join(__dirname, scriptNames.ok)}`);
});
Expand Down
6 changes: 4 additions & 2 deletions packages/prover/test/e2e/web3_batch_request.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ import {describe, it, expect, beforeAll} from "vitest";
import Web3 from "web3";
import {LCTransport} from "../../src/interfaces.js";
import {createVerifiedExecutionProvider} from "../../src/web3_provider.js";
import {rpcUrl, beaconUrl, config} from "../utils/e2e_env.js";
import {rpcUrl, beaconUrl, config, waitForCapellaFork} from "../utils/e2e_env.js";
import {getVerificationFailedMessage} from "../../src/utils/json_rpc.js";

/* prettier-ignore */
describe("web3_batch_requests", function () {
let web3: Web3;

beforeAll(() => {
beforeAll(async () => {
await waitForCapellaFork();

const {provider} = createVerifiedExecutionProvider(new Web3.providers.HttpProvider(rpcUrl), {
transport: LCTransport.Rest,
urls: [beaconUrl],
Expand Down
2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"test": "yarn test:unit",
"test:constants:minimal": "LODESTAR_PRESET=minimal vitest --run --dir test/constants/",
"test:constants:mainnet": "LODESTAR_PRESET=mainnet vitest --run --dir test/constants/",
"test:unit": "wrapper() { yarn test:constants:minimal $@ && yarn test:constants:mainnet $@ && vitest --run --dir test/unit/ $@; }; wrapper",
"test:unit": "wrapper() { yarn test:constants:minimal $@ && yarn test:constants:mainnet $@ && LODESTAR_PRESET=mainnet vitest --run --dir test/unit/ $@; }; wrapper",
"test:browsers": "yarn test:browsers:chrome && yarn test:browsers:firefox && yarn test:browsers:electron",
"test:browsers:chrome": "vitest --run --browser chrome --config ./vitest.browser.config.ts --dir test/unit",
"test:browsers:firefox": "vitest --run --browser firefox --config ./vitest.browser.config.ts --dir test/unit",
Expand Down
2 changes: 1 addition & 1 deletion packages/validator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"test:unit": "vitest --run --dir test/unit/",
"test": "yarn test:unit && yarn test:e2e",
"test:spec": "vitest --run --config vitest.spec.config.ts --dir test/spec/",
"test:e2e": "LODESTAR_PRESET=mainnet vitest --run --config vitest.e2e.config.ts --dir test/e2e",
"test:e2e": "vitest --run --config vitest.e2e.config.ts --dir test/e2e",
"download-spec-tests": "node --loader=ts-node/esm test/spec/downloadTests.ts",
"check-readme": "typescript-docs-verifier"
},
Expand Down
9 changes: 5 additions & 4 deletions scripts/run_e2e_env.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
#!/bin/bash

DIR="$(CDPATH= cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

function start_app() {
mkdir -p test-logs/e2e-test-env
export LODESTAR_PRESET=minimal
nohup node --loader ts-node/esm packages/cli/test/scripts/e2e_test_env.ts > test-logs/e2e-test-env/simulation.out 2>&1 &
export DOTENV_CONFIG_PATH="$DIR/../.env.test"
nohup node -r dotenv/config --loader ts-node/esm packages/cli/test/scripts/e2e_test_env.ts > test-logs/e2e-test-env/simulation.out 2>&1 &
echo $! > test-logs/e2e-test-env/simulation.pid
echo "Wait for the node to be ready"
npx wait-port -t 120000 0.0.0.0:5001
}

function stop_app() {
kill -9 $(cat test-logs/e2e-test-env/simulation.pid)
# Incase the process pid file is not present
kill -9 $(lsof -t -i:5001)
kill -s TERM $(cat test-logs/e2e-test-env/simulation.pid)
}


Expand Down
File renamed without changes.
8 changes: 8 additions & 0 deletions scripts/vitest/setupFiles/dotenv.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import path from "node:path";
// It's a dev dependency
// eslint-disable-next-line import/no-extraneous-dependencies
import {config} from "dotenv";
// eslint-disable-next-line @typescript-eslint/naming-convention
const __dirname = new URL(".", import.meta.url).pathname;

config({path: path.join(__dirname, "../../../.env.test")});
2 changes: 1 addition & 1 deletion vitest.base.browser.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default defineConfig({
"**/.{idea,git,cache,output,temp}/**",
"**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*",
],
setupFiles: [path.join(__dirname, "./scripts/vitest/customMatchers.ts")],
setupFiles: [path.join(__dirname, "./scripts/vitest/setupFiles/customMatchers.ts")],
reporters: ["default", "hanging-process"],
coverage: {
enabled: false,
Expand Down
5 changes: 4 additions & 1 deletion vitest.base.unit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ export default defineConfig({
"**/.{idea,git,cache,output,temp}/**",
"**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*",
],
setupFiles: [path.join(__dirname, "./scripts/vitest/customMatchers.ts")],
setupFiles: [
path.join(__dirname, "./scripts/vitest/setupFiles/customMatchers.ts"),
path.join(__dirname, "./scripts/vitest/setupFiles/dotenv.ts"),
],
reporters: ["default", "hanging-process"],
coverage: {
enabled: process.env.CI === "true",
Expand Down
13 changes: 13 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
semver "^6.1.0"
uuid "^3.3.3"

"@actions/core@^1.10.1":
version "1.10.1"
resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.10.1.tgz#61108e7ac40acae95ee36da074fa5850ca4ced8a"
integrity sha512-3lBR9EDAY+iYIpTnTIXmWcNbX3T2kCkAEQGIQx4NVQ0575nk2k3GRZDTPQG+vVtS2izSLmINlxXf0uLtnrTP+g==
dependencies:
"@actions/http-client" "^2.0.1"
uuid "^8.3.2"

"@actions/core@^1.2.6":
version "1.10.0"
resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.10.0.tgz#44551c3c71163949a2f06e94d9ca2157a0cfac4f"
Expand Down Expand Up @@ -5600,6 +5608,11 @@ dotenv-expand@~10.0.0:
resolved "https://registry.yarnpkg.com/dotenv-expand/-/dotenv-expand-10.0.0.tgz#12605d00fb0af6d0a592e6558585784032e4ef37"
integrity sha512-GopVGCpVS1UKH75VKHGuQFqS1Gusej0z4FyQkPdwjil2gNIv+LNsqBlboOzpJFZKVT95GkCyWJbBSdFEFUWI2A==

dotenv@^16.4.1:
version "16.4.1"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.4.1.tgz#1d9931f1d3e5d2959350d1250efab299561f7f11"
integrity sha512-CjA3y+Dr3FyFDOAMnxZEGtnW9KBR2M0JvvUtXNW+dYJL5ROWxP9DUHCwgFqpMk0OXCc0ljhaNTr2w/kutYIcHQ==

dotenv@~16.3.1:
version "16.3.1"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.3.1.tgz#369034de7d7e5b120972693352a3bf112172cc3e"
Expand Down

1 comment on commit da0bcc8

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for some benchmarks.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold.

Benchmark suite Current: da0bcc8 Previous: 1e67579 Ratio
forkChoice updateHead vc 600000 bc 64 eq 300000 59.814 ms/op 15.421 ms/op 3.88
Full benchmark results
Benchmark suite Current: da0bcc8 Previous: 1e67579 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 584.31 us/op 650.20 us/op 0.90
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 103.46 us/op 96.996 us/op 1.07
BLS verify - blst-native 1.3286 ms/op 1.2933 ms/op 1.03
BLS verifyMultipleSignatures 3 - blst-native 2.7982 ms/op 2.7581 ms/op 1.01
BLS verifyMultipleSignatures 8 - blst-native 6.4121 ms/op 5.9589 ms/op 1.08
BLS verifyMultipleSignatures 32 - blst-native 22.588 ms/op 21.801 ms/op 1.04
BLS verifyMultipleSignatures 64 - blst-native 44.555 ms/op 42.893 ms/op 1.04
BLS verifyMultipleSignatures 128 - blst-native 88.253 ms/op 85.170 ms/op 1.04
BLS deserializing 10000 signatures 953.60 ms/op 922.96 ms/op 1.03
BLS deserializing 100000 signatures 9.1787 s/op 9.2309 s/op 0.99
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.3956 ms/op 1.3151 ms/op 1.06
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.5960 ms/op 1.4877 ms/op 1.07
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.3926 ms/op 2.5926 ms/op 0.92
BLS verifyMultipleSignatures - same message - 64 - blst-native 3.5314 ms/op 4.3018 ms/op 0.82
BLS verifyMultipleSignatures - same message - 128 - blst-native 5.9130 ms/op 7.1070 ms/op 0.83
BLS aggregatePubkeys 32 - blst-native 27.189 us/op 27.028 us/op 1.01
BLS aggregatePubkeys 128 - blst-native 104.69 us/op 99.352 us/op 1.05
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 74.780 ms/op 49.866 ms/op 1.50
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 77.285 ms/op 44.605 ms/op 1.73
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 61.405 ms/op 39.795 ms/op 1.54
getSlashingsAndExits - default max 413.90 us/op 189.44 us/op 2.18
getSlashingsAndExits - 2k 601.99 us/op 421.66 us/op 1.43
proposeBlockBody type=full, size=empty 7.3645 ms/op 5.0233 ms/op 1.47
isKnown best case - 1 super set check 603.00 ns/op 313.00 ns/op 1.93
isKnown normal case - 2 super set checks 638.00 ns/op 300.00 ns/op 2.13
isKnown worse case - 16 super set checks 600.00 ns/op 301.00 ns/op 1.99
CheckpointStateCache - add get delete 6.6010 us/op 5.0690 us/op 1.30
validate api signedAggregateAndProof - struct 2.8612 ms/op 2.7769 ms/op 1.03
validate gossip signedAggregateAndProof - struct 2.8658 ms/op 2.7756 ms/op 1.03
validate gossip attestation - vc 640000 1.5069 ms/op 1.3499 ms/op 1.12
batch validate gossip attestation - vc 640000 - chunk 32 178.65 us/op 157.41 us/op 1.13
batch validate gossip attestation - vc 640000 - chunk 64 166.95 us/op 139.73 us/op 1.19
batch validate gossip attestation - vc 640000 - chunk 128 174.67 us/op 136.40 us/op 1.28
batch validate gossip attestation - vc 640000 - chunk 256 149.41 us/op 125.61 us/op 1.19
pickEth1Vote - no votes 1.3603 ms/op 1.2398 ms/op 1.10
pickEth1Vote - max votes 10.938 ms/op 9.8650 ms/op 1.11
pickEth1Vote - Eth1Data hashTreeRoot value x2048 21.652 ms/op 21.357 ms/op 1.01
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 32.850 ms/op 28.873 ms/op 1.14
pickEth1Vote - Eth1Data fastSerialize value x2048 780.24 us/op 656.88 us/op 1.19
pickEth1Vote - Eth1Data fastSerialize tree x2048 7.3537 ms/op 7.4309 ms/op 0.99
bytes32 toHexString 788.00 ns/op 468.00 ns/op 1.68
bytes32 Buffer.toString(hex) 336.00 ns/op 274.00 ns/op 1.23
bytes32 Buffer.toString(hex) from Uint8Array 603.00 ns/op 401.00 ns/op 1.50
bytes32 Buffer.toString(hex) + 0x 353.00 ns/op 289.00 ns/op 1.22
Object access 1 prop 0.26000 ns/op 0.15300 ns/op 1.70
Map access 1 prop 0.16100 ns/op 0.14700 ns/op 1.10
Object get x1000 11.084 ns/op 7.0040 ns/op 1.58
Map get x1000 0.95400 ns/op 0.71000 ns/op 1.34
Object set x1000 82.526 ns/op 48.300 ns/op 1.71
Map set x1000 58.246 ns/op 38.068 ns/op 1.53
Return object 10000 times 0.35470 ns/op 0.22740 ns/op 1.56
Throw Error 10000 times 4.2510 us/op 3.6602 us/op 1.16
fastMsgIdFn sha256 / 200 bytes 3.5150 us/op 3.1240 us/op 1.13
fastMsgIdFn h32 xxhash / 200 bytes 373.00 ns/op 262.00 ns/op 1.42
fastMsgIdFn h64 xxhash / 200 bytes 424.00 ns/op 332.00 ns/op 1.28
fastMsgIdFn sha256 / 1000 bytes 12.307 us/op 10.825 us/op 1.14
fastMsgIdFn h32 xxhash / 1000 bytes 536.00 ns/op 386.00 ns/op 1.39
fastMsgIdFn h64 xxhash / 1000 bytes 520.00 ns/op 407.00 ns/op 1.28
fastMsgIdFn sha256 / 10000 bytes 110.36 us/op 99.433 us/op 1.11
fastMsgIdFn h32 xxhash / 10000 bytes 2.1120 us/op 1.7990 us/op 1.17
fastMsgIdFn h64 xxhash / 10000 bytes 1.5040 us/op 1.2460 us/op 1.21
send data - 1000 256B messages 28.096 ms/op 18.666 ms/op 1.51
send data - 1000 512B messages 30.978 ms/op 23.301 ms/op 1.33
send data - 1000 1024B messages 59.815 ms/op 40.566 ms/op 1.47
send data - 1000 1200B messages 50.763 ms/op 37.024 ms/op 1.37
send data - 1000 2048B messages 56.103 ms/op 46.508 ms/op 1.21
send data - 1000 4096B messages 55.215 ms/op 43.538 ms/op 1.27
send data - 1000 16384B messages 138.40 ms/op 110.41 ms/op 1.25
send data - 1000 65536B messages 569.69 ms/op 505.59 ms/op 1.13
enrSubnets - fastDeserialize 64 bits 1.9070 us/op 1.1700 us/op 1.63
enrSubnets - ssz BitVector 64 bits 599.00 ns/op 401.00 ns/op 1.49
enrSubnets - fastDeserialize 4 bits 236.00 ns/op 159.00 ns/op 1.48
enrSubnets - ssz BitVector 4 bits 629.00 ns/op 401.00 ns/op 1.57
prioritizePeers score -10:0 att 32-0.1 sync 2-0 133.11 us/op 98.301 us/op 1.35
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 169.56 us/op 123.42 us/op 1.37
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 216.55 us/op 155.34 us/op 1.39
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 418.85 us/op 279.87 us/op 1.50
prioritizePeers score 0:0 att 64-1 sync 4-1 438.79 us/op 326.14 us/op 1.35
array of 16000 items push then shift 1.9359 us/op 1.5585 us/op 1.24
LinkedList of 16000 items push then shift 11.645 ns/op 8.6730 ns/op 1.34
array of 16000 items push then pop 134.67 ns/op 74.326 ns/op 1.81
LinkedList of 16000 items push then pop 16.601 ns/op 8.4290 ns/op 1.97
array of 24000 items push then shift 3.1907 us/op 2.3215 us/op 1.37
LinkedList of 24000 items push then shift 11.260 ns/op 8.6050 ns/op 1.31
array of 24000 items push then pop 171.94 ns/op 101.17 ns/op 1.70
LinkedList of 24000 items push then pop 10.373 ns/op 8.3780 ns/op 1.24
intersect bitArray bitLen 8 8.4990 ns/op 5.5430 ns/op 1.53
intersect array and set length 8 128.21 ns/op 60.026 ns/op 2.14
intersect bitArray bitLen 128 47.090 ns/op 34.302 ns/op 1.37
intersect array and set length 128 1.2481 us/op 843.95 ns/op 1.48
bitArray.getTrueBitIndexes() bitLen 128 2.0650 us/op 1.5110 us/op 1.37
bitArray.getTrueBitIndexes() bitLen 248 3.5730 us/op 2.3920 us/op 1.49
bitArray.getTrueBitIndexes() bitLen 512 8.3480 us/op 4.6330 us/op 1.80
Buffer.concat 32 items 1.2530 us/op 1.0570 us/op 1.19
Uint8Array.set 32 items 3.3210 us/op 1.7890 us/op 1.86
Set add up to 64 items then delete first 6.0273 us/op 4.3007 us/op 1.40
OrderedSet add up to 64 items then delete first 8.1330 us/op 5.3977 us/op 1.51
Set add up to 64 items then delete last 6.7598 us/op 4.6015 us/op 1.47
OrderedSet add up to 64 items then delete last 8.0896 us/op 5.6946 us/op 1.42
Set add up to 64 items then delete middle 6.2399 us/op 4.6145 us/op 1.35
OrderedSet add up to 64 items then delete middle 10.031 us/op 6.8231 us/op 1.47
Set add up to 128 items then delete first 12.475 us/op 8.9721 us/op 1.39
OrderedSet add up to 128 items then delete first 16.317 us/op 11.928 us/op 1.37
Set add up to 128 items then delete last 12.098 us/op 8.8592 us/op 1.37
OrderedSet add up to 128 items then delete last 16.019 us/op 11.218 us/op 1.43
Set add up to 128 items then delete middle 12.104 us/op 8.8454 us/op 1.37
OrderedSet add up to 128 items then delete middle 25.909 us/op 16.385 us/op 1.58
Set add up to 256 items then delete first 24.704 us/op 18.316 us/op 1.35
OrderedSet add up to 256 items then delete first 35.228 us/op 24.553 us/op 1.43
Set add up to 256 items then delete last 23.556 us/op 17.911 us/op 1.32
OrderedSet add up to 256 items then delete last 34.129 us/op 22.680 us/op 1.50
Set add up to 256 items then delete middle 23.349 us/op 17.541 us/op 1.33
OrderedSet add up to 256 items then delete middle 64.899 us/op 43.454 us/op 1.49
transfer serialized Status (84 B) 2.2370 us/op 1.7370 us/op 1.29
copy serialized Status (84 B) 1.8340 us/op 1.2620 us/op 1.45
transfer serialized SignedVoluntaryExit (112 B) 2.6600 us/op 1.8900 us/op 1.41
copy serialized SignedVoluntaryExit (112 B) 1.6820 us/op 1.3230 us/op 1.27
transfer serialized ProposerSlashing (416 B) 3.1880 us/op 2.2810 us/op 1.40
copy serialized ProposerSlashing (416 B) 2.5990 us/op 2.0420 us/op 1.27
transfer serialized Attestation (485 B) 2.8750 us/op 2.3980 us/op 1.20
copy serialized Attestation (485 B) 3.1800 us/op 1.9870 us/op 1.60
transfer serialized AttesterSlashing (33232 B) 3.5950 us/op 2.4680 us/op 1.46
copy serialized AttesterSlashing (33232 B) 10.526 us/op 5.3190 us/op 1.98
transfer serialized Small SignedBeaconBlock (128000 B) 4.3980 us/op 3.2590 us/op 1.35
copy serialized Small SignedBeaconBlock (128000 B) 32.857 us/op 14.196 us/op 2.31
transfer serialized Avg SignedBeaconBlock (200000 B) 5.5130 us/op 3.6760 us/op 1.50
copy serialized Avg SignedBeaconBlock (200000 B) 50.285 us/op 20.300 us/op 2.48
transfer serialized BlobsSidecar (524380 B) 6.7480 us/op 3.6440 us/op 1.85
copy serialized BlobsSidecar (524380 B) 161.23 us/op 86.646 us/op 1.86
transfer serialized Big SignedBeaconBlock (1000000 B) 6.1200 us/op 3.2400 us/op 1.89
copy serialized Big SignedBeaconBlock (1000000 B) 274.53 us/op 146.37 us/op 1.88
pass gossip attestations to forkchoice per slot 4.7416 ms/op 4.2479 ms/op 1.12
forkChoice updateHead vc 100000 bc 64 eq 0 788.12 us/op 709.99 us/op 1.11
forkChoice updateHead vc 600000 bc 64 eq 0 5.5718 ms/op 4.5857 ms/op 1.22
forkChoice updateHead vc 1000000 bc 64 eq 0 8.6122 ms/op 6.9729 ms/op 1.24
forkChoice updateHead vc 600000 bc 320 eq 0 5.4914 ms/op 4.0485 ms/op 1.36
forkChoice updateHead vc 600000 bc 1200 eq 0 5.6945 ms/op 4.1289 ms/op 1.38
forkChoice updateHead vc 600000 bc 7200 eq 0 9.9126 ms/op 5.1432 ms/op 1.93
forkChoice updateHead vc 600000 bc 64 eq 1000 12.572 ms/op 10.973 ms/op 1.15
forkChoice updateHead vc 600000 bc 64 eq 10000 14.893 ms/op 11.913 ms/op 1.25
forkChoice updateHead vc 600000 bc 64 eq 300000 59.814 ms/op 15.421 ms/op 3.88
computeDeltas 500000 validators 300 proto nodes 8.2483 ms/op 6.4708 ms/op 1.27
computeDeltas 500000 validators 1200 proto nodes 7.6901 ms/op 6.3358 ms/op 1.21
computeDeltas 500000 validators 7200 proto nodes 6.9251 ms/op 6.3303 ms/op 1.09
computeDeltas 750000 validators 300 proto nodes 9.9810 ms/op 9.8315 ms/op 1.02
computeDeltas 750000 validators 1200 proto nodes 10.451 ms/op 9.3701 ms/op 1.12
computeDeltas 750000 validators 7200 proto nodes 10.065 ms/op 9.4572 ms/op 1.06
computeDeltas 1400000 validators 300 proto nodes 20.570 ms/op 18.929 ms/op 1.09
computeDeltas 1400000 validators 1200 proto nodes 19.252 ms/op 18.847 ms/op 1.02
computeDeltas 1400000 validators 7200 proto nodes 19.751 ms/op 18.322 ms/op 1.08
computeDeltas 2100000 validators 300 proto nodes 31.508 ms/op 28.114 ms/op 1.12
computeDeltas 2100000 validators 1200 proto nodes 32.215 ms/op 28.341 ms/op 1.14
computeDeltas 2100000 validators 7200 proto nodes 30.927 ms/op 28.462 ms/op 1.09
altair processAttestation - 250000 vs - 7PWei normalcase 2.5199 ms/op 2.1987 ms/op 1.15
altair processAttestation - 250000 vs - 7PWei worstcase 4.2263 ms/op 3.1161 ms/op 1.36
altair processAttestation - setStatus - 1/6 committees join 207.75 us/op 174.18 us/op 1.19
altair processAttestation - setStatus - 1/3 committees join 401.95 us/op 326.62 us/op 1.23
altair processAttestation - setStatus - 1/2 committees join 503.53 us/op 438.98 us/op 1.15
altair processAttestation - setStatus - 2/3 committees join 673.96 us/op 566.85 us/op 1.19
altair processAttestation - setStatus - 4/5 committees join 858.02 us/op 740.79 us/op 1.16
altair processAttestation - setStatus - 100% committees join 970.11 us/op 905.46 us/op 1.07
altair processBlock - 250000 vs - 7PWei normalcase 11.390 ms/op 10.437 ms/op 1.09
altair processBlock - 250000 vs - 7PWei normalcase hashState 45.452 ms/op 39.559 ms/op 1.15
altair processBlock - 250000 vs - 7PWei worstcase 42.842 ms/op 37.011 ms/op 1.16
altair processBlock - 250000 vs - 7PWei worstcase hashState 119.45 ms/op 95.252 ms/op 1.25
phase0 processBlock - 250000 vs - 7PWei normalcase 4.0276 ms/op 2.4136 ms/op 1.67
phase0 processBlock - 250000 vs - 7PWei worstcase 32.873 ms/op 29.210 ms/op 1.13
altair processEth1Data - 250000 vs - 7PWei normalcase 761.56 us/op 476.36 us/op 1.60
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 19.608 us/op 7.2670 us/op 2.70
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 97.580 us/op 60.431 us/op 1.61
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 37.925 us/op 18.666 us/op 2.03
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 24.529 us/op 11.064 us/op 2.22
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 287.11 us/op 124.65 us/op 2.30
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.6573 ms/op 1.0216 ms/op 1.62
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.5652 ms/op 1.5049 ms/op 1.70
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.9100 ms/op 1.7174 ms/op 1.11
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 4.9796 ms/op 3.3248 ms/op 1.50
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 3.1763 ms/op 2.3418 ms/op 1.36
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 6.3513 ms/op 4.6739 ms/op 1.36
Tree 40 250000 create 521.59 ms/op 345.70 ms/op 1.51
Tree 40 250000 get(125000) 222.92 ns/op 198.28 ns/op 1.12
Tree 40 250000 set(125000) 1.4545 us/op 968.93 ns/op 1.50
Tree 40 250000 toArray() 29.102 ms/op 18.472 ms/op 1.58
Tree 40 250000 iterate all - toArray() + loop 26.292 ms/op 18.356 ms/op 1.43
Tree 40 250000 iterate all - get(i) 75.958 ms/op 66.747 ms/op 1.14
MutableVector 250000 create 13.347 ms/op 11.626 ms/op 1.15
MutableVector 250000 get(125000) 6.6420 ns/op 6.4980 ns/op 1.02
MutableVector 250000 set(125000) 495.86 ns/op 264.52 ns/op 1.87
MutableVector 250000 toArray() 4.5560 ms/op 3.0971 ms/op 1.47
MutableVector 250000 iterate all - toArray() + loop 4.5750 ms/op 3.1784 ms/op 1.44
MutableVector 250000 iterate all - get(i) 1.5613 ms/op 1.4753 ms/op 1.06
Array 250000 create 3.3906 ms/op 2.6681 ms/op 1.27
Array 250000 clone - spread 1.3892 ms/op 1.2698 ms/op 1.09
Array 250000 get(125000) 1.1310 ns/op 1.0380 ns/op 1.09
Array 250000 set(125000) 4.4160 ns/op 4.0130 ns/op 1.10
Array 250000 iterate all - loop 170.57 us/op 160.11 us/op 1.07
effectiveBalanceIncrements clone Uint8Array 300000 44.535 us/op 30.084 us/op 1.48
effectiveBalanceIncrements clone MutableVector 300000 405.00 ns/op 384.00 ns/op 1.05
effectiveBalanceIncrements rw all Uint8Array 300000 204.05 us/op 193.73 us/op 1.05
effectiveBalanceIncrements rw all MutableVector 300000 94.994 ms/op 83.399 ms/op 1.14
phase0 afterProcessEpoch - 250000 vs - 7PWei 114.60 ms/op 108.21 ms/op 1.06
phase0 beforeProcessEpoch - 250000 vs - 7PWei 50.392 ms/op 52.048 ms/op 0.97
altair processEpoch - mainnet_e81889 587.64 ms/op 524.25 ms/op 1.12
mainnet_e81889 - altair beforeProcessEpoch 87.200 ms/op 82.481 ms/op 1.06
mainnet_e81889 - altair processJustificationAndFinalization 20.800 us/op 13.936 us/op 1.49
mainnet_e81889 - altair processInactivityUpdates 6.8303 ms/op 6.0660 ms/op 1.13
mainnet_e81889 - altair processRewardsAndPenalties 76.364 ms/op 59.976 ms/op 1.27
mainnet_e81889 - altair processRegistryUpdates 2.5830 us/op 2.4570 us/op 1.05
mainnet_e81889 - altair processSlashings 896.00 ns/op 420.00 ns/op 2.13
mainnet_e81889 - altair processEth1DataReset 1.1670 us/op 475.00 ns/op 2.46
mainnet_e81889 - altair processEffectiveBalanceUpdates 2.7135 ms/op 1.7177 ms/op 1.58
mainnet_e81889 - altair processSlashingsReset 9.9090 us/op 3.2830 us/op 3.02
mainnet_e81889 - altair processRandaoMixesReset 8.4300 us/op 5.2160 us/op 1.62
mainnet_e81889 - altair processHistoricalRootsUpdate 1.0360 us/op 848.00 ns/op 1.22
mainnet_e81889 - altair processParticipationFlagUpdates 2.8150 us/op 1.7530 us/op 1.61
mainnet_e81889 - altair processSyncCommitteeUpdates 883.00 ns/op 680.00 ns/op 1.30
mainnet_e81889 - altair afterProcessEpoch 124.13 ms/op 117.69 ms/op 1.05
capella processEpoch - mainnet_e217614 3.0721 s/op 2.0961 s/op 1.47
mainnet_e217614 - capella beforeProcessEpoch 646.41 ms/op 496.45 ms/op 1.30
mainnet_e217614 - capella processJustificationAndFinalization 25.497 us/op 15.204 us/op 1.68
mainnet_e217614 - capella processInactivityUpdates 26.025 ms/op 16.502 ms/op 1.58
mainnet_e217614 - capella processRewardsAndPenalties 441.35 ms/op 401.59 ms/op 1.10
mainnet_e217614 - capella processRegistryUpdates 27.680 us/op 17.813 us/op 1.55
mainnet_e217614 - capella processSlashings 922.00 ns/op 531.00 ns/op 1.74
mainnet_e217614 - capella processEth1DataReset 529.00 ns/op 402.00 ns/op 1.32
mainnet_e217614 - capella processEffectiveBalanceUpdates 4.5719 ms/op 5.5449 ms/op 0.82
mainnet_e217614 - capella processSlashingsReset 3.6690 us/op 2.9830 us/op 1.23
mainnet_e217614 - capella processRandaoMixesReset 5.2020 us/op 4.7380 us/op 1.10
mainnet_e217614 - capella processHistoricalRootsUpdate 811.00 ns/op 759.00 ns/op 1.07
mainnet_e217614 - capella processParticipationFlagUpdates 3.3180 us/op 1.5350 us/op 2.16
mainnet_e217614 - capella afterProcessEpoch 325.16 ms/op 323.96 ms/op 1.00
phase0 processEpoch - mainnet_e58758 517.88 ms/op 431.74 ms/op 1.20
mainnet_e58758 - phase0 beforeProcessEpoch 147.65 ms/op 110.94 ms/op 1.33
mainnet_e58758 - phase0 processJustificationAndFinalization 15.962 us/op 14.939 us/op 1.07
mainnet_e58758 - phase0 processRewardsAndPenalties 41.414 ms/op 55.044 ms/op 0.75
mainnet_e58758 - phase0 processRegistryUpdates 10.715 us/op 11.489 us/op 0.93
mainnet_e58758 - phase0 processSlashings 695.00 ns/op 560.00 ns/op 1.24
mainnet_e58758 - phase0 processEth1DataReset 502.00 ns/op 402.00 ns/op 1.25
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.2391 ms/op 1.1337 ms/op 1.09
mainnet_e58758 - phase0 processSlashingsReset 8.6120 us/op 2.7980 us/op 3.08
mainnet_e58758 - phase0 processRandaoMixesReset 7.9720 us/op 4.0300 us/op 1.98
mainnet_e58758 - phase0 processHistoricalRootsUpdate 920.00 ns/op 401.00 ns/op 2.29
mainnet_e58758 - phase0 processParticipationRecordUpdates 5.9000 us/op 3.2520 us/op 1.81
mainnet_e58758 - phase0 afterProcessEpoch 101.52 ms/op 94.696 ms/op 1.07
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.6733 ms/op 1.3581 ms/op 1.23
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.9521 ms/op 1.5381 ms/op 1.27
altair processInactivityUpdates - 250000 normalcase 29.944 ms/op 24.860 ms/op 1.20
altair processInactivityUpdates - 250000 worstcase 28.211 ms/op 25.061 ms/op 1.13
phase0 processRegistryUpdates - 250000 normalcase 14.414 us/op 8.2020 us/op 1.76
phase0 processRegistryUpdates - 250000 badcase_full_deposits 572.92 us/op 359.62 us/op 1.59
phase0 processRegistryUpdates - 250000 worstcase 0.5 139.71 ms/op 131.17 ms/op 1.07
altair processRewardsAndPenalties - 250000 normalcase 61.519 ms/op 57.121 ms/op 1.08
altair processRewardsAndPenalties - 250000 worstcase 61.884 ms/op 58.002 ms/op 1.07
phase0 getAttestationDeltas - 250000 normalcase 9.0644 ms/op 9.1989 ms/op 0.99
phase0 getAttestationDeltas - 250000 worstcase 8.8604 ms/op 8.7106 ms/op 1.02
phase0 processSlashings - 250000 worstcase 130.14 us/op 80.685 us/op 1.61
altair processSyncCommitteeUpdates - 250000 151.58 ms/op 150.36 ms/op 1.01
BeaconState.hashTreeRoot - No change 380.00 ns/op 351.00 ns/op 1.08
BeaconState.hashTreeRoot - 1 full validator 126.93 us/op 151.97 us/op 0.84
BeaconState.hashTreeRoot - 32 full validator 1.2962 ms/op 1.6425 ms/op 0.79
BeaconState.hashTreeRoot - 512 full validator 12.976 ms/op 16.438 ms/op 0.79
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 139.83 us/op 177.01 us/op 0.79
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.8468 ms/op 2.0899 ms/op 0.88
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 23.910 ms/op 25.788 ms/op 0.93
BeaconState.hashTreeRoot - 1 balances 108.18 us/op 138.84 us/op 0.78
BeaconState.hashTreeRoot - 32 balances 990.52 us/op 1.3987 ms/op 0.71
BeaconState.hashTreeRoot - 512 balances 10.556 ms/op 12.527 ms/op 0.84
BeaconState.hashTreeRoot - 250000 balances 216.91 ms/op 208.51 ms/op 1.04
aggregationBits - 2048 els - zipIndexesInBitList 18.685 us/op 16.885 us/op 1.11
byteArrayEquals 32 76.711 ns/op 73.140 ns/op 1.05
Buffer.compare 32 56.504 ns/op 54.056 ns/op 1.05
byteArrayEquals 1024 2.0921 us/op 1.9996 us/op 1.05
Buffer.compare 1024 71.583 ns/op 68.223 ns/op 1.05
byteArrayEquals 16384 33.282 us/op 31.893 us/op 1.04
Buffer.compare 16384 253.95 ns/op 265.63 ns/op 0.96
byteArrayEquals 123687377 262.41 ms/op 244.63 ms/op 1.07
Buffer.compare 123687377 8.5577 ms/op 6.0276 ms/op 1.42
byteArrayEquals 32 - diff last byte 85.578 ns/op 71.830 ns/op 1.19
Buffer.compare 32 - diff last byte 60.581 ns/op 54.162 ns/op 1.12
byteArrayEquals 1024 - diff last byte 2.3409 us/op 1.9796 us/op 1.18
Buffer.compare 1024 - diff last byte 74.334 ns/op 68.735 ns/op 1.08
byteArrayEquals 16384 - diff last byte 34.824 us/op 31.531 us/op 1.10
Buffer.compare 16384 - diff last byte 294.52 ns/op 247.72 ns/op 1.19
byteArrayEquals 123687377 - diff last byte 268.06 ms/op 240.47 ms/op 1.11
Buffer.compare 123687377 - diff last byte 8.3847 ms/op 6.1156 ms/op 1.37
byteArrayEquals 32 - random bytes 5.4650 ns/op 5.2470 ns/op 1.04
Buffer.compare 32 - random bytes 63.591 ns/op 60.360 ns/op 1.05
byteArrayEquals 1024 - random bytes 5.7690 ns/op 5.1720 ns/op 1.12
Buffer.compare 1024 - random bytes 62.113 ns/op 59.660 ns/op 1.04
byteArrayEquals 16384 - random bytes 5.7090 ns/op 5.1470 ns/op 1.11
Buffer.compare 16384 - random bytes 62.721 ns/op 59.679 ns/op 1.05
byteArrayEquals 123687377 - random bytes 9.0500 ns/op 8.3200 ns/op 1.09
Buffer.compare 123687377 - random bytes 73.230 ns/op 62.900 ns/op 1.16
regular array get 100000 times 46.242 us/op 44.048 us/op 1.05
wrappedArray get 100000 times 46.529 us/op 44.121 us/op 1.05
arrayWithProxy get 100000 times 14.781 ms/op 14.396 ms/op 1.03
ssz.Root.equals 55.281 ns/op 53.887 ns/op 1.03
byteArrayEquals 55.507 ns/op 52.595 ns/op 1.06
Buffer.compare 12.055 ns/op 10.787 ns/op 1.12
shuffle list - 16384 els 7.1632 ms/op 6.6680 ms/op 1.07
shuffle list - 250000 els 105.93 ms/op 97.784 ms/op 1.08
processSlot - 1 slots 20.794 us/op 16.945 us/op 1.23
processSlot - 32 slots 4.4451 ms/op 3.5918 ms/op 1.24
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 63.881 ms/op 59.667 ms/op 1.07
getCommitteeAssignments - req 1 vs - 250000 vc 2.5847 ms/op 2.4009 ms/op 1.08
getCommitteeAssignments - req 100 vs - 250000 vc 3.8028 ms/op 3.5311 ms/op 1.08
getCommitteeAssignments - req 1000 vs - 250000 vc 4.2971 ms/op 3.8633 ms/op 1.11
findModifiedValidators - 10000 modified validators 591.52 ms/op 527.54 ms/op 1.12
findModifiedValidators - 1000 modified validators 515.23 ms/op 408.11 ms/op 1.26
findModifiedValidators - 100 modified validators 578.79 ms/op 413.49 ms/op 1.40
findModifiedValidators - 10 modified validators 621.71 ms/op 393.97 ms/op 1.58
findModifiedValidators - 1 modified validators 563.91 ms/op 402.90 ms/op 1.40
findModifiedValidators - no difference 569.46 ms/op 371.34 ms/op 1.53
compare ViewDUs 7.0146 s/op 4.3519 s/op 1.61
compare each validator Uint8Array 2.8349 s/op 1.8178 s/op 1.56
compare ViewDU to Uint8Array 1.8915 s/op 1.0633 s/op 1.78
migrate state 1000000 validators, 24 modified, 0 new 1.1145 s/op 792.35 ms/op 1.41
migrate state 1000000 validators, 1700 modified, 1000 new 1.2479 s/op 1.1014 s/op 1.13
migrate state 1000000 validators, 3400 modified, 2000 new 1.5435 s/op 1.3152 s/op 1.17
migrate state 1500000 validators, 24 modified, 0 new 934.39 ms/op 806.30 ms/op 1.16
migrate state 1500000 validators, 1700 modified, 1000 new 1.4982 s/op 1.1001 s/op 1.36
migrate state 1500000 validators, 3400 modified, 2000 new 1.8684 s/op 1.3238 s/op 1.41
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 5.8100 ns/op 4.3900 ns/op 1.32
state getBlockRootAtSlot - 250000 vs - 7PWei 821.08 ns/op 711.08 ns/op 1.15
computeProposers - vc 250000 13.372 ms/op 9.4955 ms/op 1.41
computeEpochShuffling - vc 250000 126.25 ms/op 103.47 ms/op 1.22
getNextSyncCommittee - vc 250000 202.42 ms/op 145.28 ms/op 1.39
computeSigningRoot for AttestationData 35.716 us/op 30.195 us/op 1.18
hash AttestationData serialized data then Buffer.toString(base64) 2.6142 us/op 2.2767 us/op 1.15
toHexString serialized data 1.7479 us/op 1.0778 us/op 1.62
Buffer.toString(base64) 284.84 ns/op 206.07 ns/op 1.38

Please sign in to comment.