diff --git a/.github/workflows/binarytree-build.yml b/.github/workflows/binarytree-build.yml index 9e2d50206e0..7b87c3852b1 100644 --- a/.github/workflows/binarytree-build.yml +++ b/.github/workflows/binarytree-build.yml @@ -32,7 +32,7 @@ jobs: steps: # We clone the repo and submodules if triggered from work-flow dispatch - if: inputs.submodule-cache-key == 'none' - uses: actions/checkout@v4 + uses: actions/checkout@v5 # We restore the code/deps from cache if triggered from workflow_call (i.e. have valid cache key) - if: inputs.dep-cache-key != 'none' @@ -42,10 +42,10 @@ jobs: path: ${{github.workspace}} key: ${{ inputs.dep-cache-key }} - - name: Use Node.js 20 - uses: actions/setup-node@v5 + - name: Use Node.js 24 + uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - name: Install Dependencies (if not restored from cache) diff --git a/.github/workflows/block-build.yml b/.github/workflows/block-build.yml index 974c7d8195d..4b8d0f07597 100644 --- a/.github/workflows/block-build.yml +++ b/.github/workflows/block-build.yml @@ -31,7 +31,7 @@ concurrency: jobs: test-block: runs-on: ubuntu-latest - steps: + steps: # We clone the repo and submodules if triggered from work-flow dispatch - if: inputs.submodule-cache-key == 'none' uses: actions/checkout@v5 @@ -39,22 +39,22 @@ jobs: submodules: recursive # We restore the code/deps from cache if triggered from workflow_call (i.e. have valid cache key) - - if: inputs.dep-cache-key != 'none' + - if: inputs.dep-cache-key != 'none' uses: actions/cache/restore@v4 id: dep-cache with: path: ${{github.workspace}} key: ${{ inputs.dep-cache-key }} - - - name: Use Node.js 20 - uses: actions/setup-node@v5 + + - name: Use Node.js 24 + uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - name: Install Dependencies (if called from workflow_dispatch) if: steps.dep-cache.outputs.cache-hit != 'true' - run: npm ci + run: npm ci working-directory: ${{ github.workspace }} - if: inputs.submodule-cache-key != 'none' diff --git a/.github/workflows/blockchain-build.yml b/.github/workflows/blockchain-build.yml index 2376d0035fc..e71b3a44751 100644 --- a/.github/workflows/blockchain-build.yml +++ b/.github/workflows/blockchain-build.yml @@ -33,24 +33,24 @@ jobs: - if: inputs.submodule-cache-key == 'none' uses: actions/checkout@v5 - # We restore the code/deps from cache if triggered from workflow_call (i.e. have valid cache key) + # We restore the code/deps from cache if triggered from workflow_call (i.e. have valid cache key) - uses: actions/cache/restore@v4 id: dep-cache with: path: ${{github.workspace}} key: ${{ inputs.dep-cache-key }} - - - name: Use Node.js 20 - uses: actions/setup-node@v5 + + - name: Use Node.js 24 + uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - name: Install Dependencies (if called from workflow_dispatch) if: steps.dep-cache.outputs.cache-hit != 'true' - run: npm ci + run: npm ci working-directory: ${{ github.workspace }} - + - run: npm run coverage - uses: codecov/codecov-action@v4 with: diff --git a/.github/workflows/browser.yml b/.github/workflows/browser.yml index e322ae6d0c9..ef3ca04b41a 100644 --- a/.github/workflows/browser.yml +++ b/.github/workflows/browser.yml @@ -38,22 +38,22 @@ jobs: submodules: recursive # We restore the code/deps from cache if triggered from workflow_call (i.e. have valid cache key) - - if: inputs.dep-cache-key != 'none' + - if: inputs.dep-cache-key != 'none' uses: actions/cache/restore@v4 id: dep-cache with: path: ${{github.workspace}} key: ${{ inputs.dep-cache-key }} - - - name: Use Node.js 20 - uses: actions/setup-node@v5 + + - name: Use Node.js 24 + uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - name: Install Dependencies (if called from workflow_dispatch) if: steps.dep-cache.outputs.cache-hit != 'true' - run: npm ci + run: npm ci working-directory: ${{ github.workspace }} - if: inputs.submodule-cache-key != 'none' diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 89dc757e8e7..da27c08ecc9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,10 +55,10 @@ jobs: path: ${{github.workspace}}/node_modules key: npm-${{ hashFiles('package-lock.json') }} - - name: Use Node.js 20 - uses: actions/setup-node@v5 + - name: Use Node.js 24 + uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - run: npm ci diff --git a/.github/workflows/client-build.yml b/.github/workflows/client-build.yml index e9b4e0ec4c5..9d19583efd8 100644 --- a/.github/workflows/client-build.yml +++ b/.github/workflows/client-build.yml @@ -36,22 +36,22 @@ jobs: - if: inputs.submodule-cache-key == 'none' uses: actions/checkout@v5 - - if: inputs.dep-cache-key != 'none' + - if: inputs.dep-cache-key != 'none' uses: actions/cache/restore@v4 id: dep-cache with: path: ${{github.workspace}} key: ${{ inputs.dep-cache-key }} - - name: Use Node.js 20 - uses: actions/setup-node@v5 + - name: Use Node.js 24 + uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - name: Install Dependencies (if not restored from cache) if: steps.dep-cache.outputs.cache-hit != 'true' - run: npm ci + run: npm ci working-directory: ${{ github.workspace }} - run: npm run coverage @@ -76,22 +76,22 @@ jobs: uses: actions/checkout@v5 # We restore the code/deps from cache if triggered from workflow_call (i.e. have valid cache key) - - if: inputs.dep-cache-key != 'none' + - if: inputs.dep-cache-key != 'none' uses: actions/cache/restore@v4 id: dep-cache with: path: ${{github.workspace}} key: ${{ inputs.dep-cache-key }} - - name: Use Node.js 20 - uses: actions/setup-node@v5 + - name: Use Node.js 24 + uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - name: Install Dependencies (if not restored from cache) if: steps.dep-cache.outputs.cache-hit != 'true' - run: npm ci + run: npm ci working-directory: ${{ github.workspace }} - run: cd ${{github.workspace}}/packages/client && npx vitest run test/cli/cli diff --git a/.github/workflows/common-build.yml b/.github/workflows/common-build.yml index e35c39640cc..dd08ec8d8cc 100644 --- a/.github/workflows/common-build.yml +++ b/.github/workflows/common-build.yml @@ -35,23 +35,23 @@ jobs: uses: actions/checkout@v5 # We restore the code/deps from cache if triggered from workflow_call (i.e. have valid cache key) - - if: inputs.dep-cache-key != 'none' + - if: inputs.dep-cache-key != 'none' uses: actions/cache/restore@v4 id: dep-cache with: path: ${{github.workspace}} key: ${{ inputs.dep-cache-key }} - - name: Use Node.js 20 - uses: actions/setup-node@v5 + - name: Use Node.js 24 + uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - name: Install Dependencies (if not restored from cache) if: steps.dep-cache.outputs.cache-hit != 'true' - run: npm ci - working-directory: ${{ github.workspace }} + run: npm ci + working-directory: ${{ github.workspace }} # Run coverage for common - run: npm run coverage @@ -64,7 +64,7 @@ jobs: # Run coverage for util - run: npm run coverage working-directory: ${{ github.workspace }}/packages/util - + - uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/devp2p-build.yml b/.github/workflows/devp2p-build.yml index 156ecbc7964..7ff61c68ff2 100644 --- a/.github/workflows/devp2p-build.yml +++ b/.github/workflows/devp2p-build.yml @@ -32,25 +32,25 @@ jobs: uses: actions/checkout@v5 # We restore the code/deps from cache if triggered from workflow_call (i.e. have valid cache key) - - if: inputs.dep-cache-key != 'none' + - if: inputs.dep-cache-key != 'none' uses: actions/cache/restore@v4 id: dep-cache with: path: ${{github.workspace}} key: ${{ inputs.dep-cache-key }} - - name: Use Node.js 20 - uses: actions/setup-node@v5 + - name: Use Node.js 24 + uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - name: Install Dependencies (if not restored from cache) if: steps.dep-cache.outputs.cache-hit != 'true' - run: npm ci + run: npm ci working-directory: ${{ github.workspace }} - + - run: npm run coverage working-directory: ${{ github.workspace }}/packages/devp2p - uses: codecov/codecov-action@v4 diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 09b628a665d..76d31f8ce50 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -32,7 +32,7 @@ jobs: - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v5 + uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-version }} cache: 'npm' diff --git a/.github/workflows/evm-build.yml b/.github/workflows/evm-build.yml index 051edd52c51..1b99f1e504d 100644 --- a/.github/workflows/evm-build.yml +++ b/.github/workflows/evm-build.yml @@ -39,24 +39,24 @@ jobs: submodules: recursive # We restore the code/deps from cache if triggered from workflow_call (i.e. have valid cache key) - - if: inputs.dep-cache-key != 'none' + - if: inputs.dep-cache-key != 'none' uses: actions/cache/restore@v4 id: dep-cache with: path: ${{github.workspace}} key: ${{ inputs.dep-cache-key }} - - name: Use Node.js 20 - uses: actions/setup-node@v5 + - name: Use Node.js 24 + uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - name: Install Dependencies (if not restored from cache) if: steps.dep-cache.outputs.cache-hit != 'true' - run: npm ci + run: npm ci working-directory: ${{ github.workspace }} - + - if: inputs.submodule-cache-key != 'none' uses: actions/cache/restore@v4 name: Initialize ethereum-tests diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 9bbad1c4576..4295d0c6b62 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -29,22 +29,22 @@ jobs: submodules: recursive # We restore the code/deps from cache if triggered from workflow_call (i.e. have valid cache key) - - if: inputs.dep-cache-key != 'none' + - if: inputs.dep-cache-key != 'none' uses: actions/cache/restore@v4 id: dep-cache with: path: ${{github.workspace}} key: ${{ inputs.dep-cache-key }} - - - name: Use Node.js 20 - uses: actions/setup-node@v5 + + - name: Use Node.js 24 + uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - name: Install Dependencies (if not restored from cache) if: steps.dep-cache.outputs.cache-hit != 'true' - run: npm ci + run: npm ci working-directory: ${{ github.workspace }} - + - run: npm run examples diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 80a11a66cab..e7354c0dced 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -27,24 +27,24 @@ jobs: uses: actions/checkout@v5 # We restore the code/deps from cache if triggered from workflow_call (i.e. have valid cache key) - - if: inputs.dep-cache-key != 'none' + - if: inputs.dep-cache-key != 'none' uses: actions/cache/restore@v4 id: dep-cache with: path: ${{github.workspace}} key: ${{ inputs.dep-cache-key }} - - - name: Use Node.js 20 - uses: actions/setup-node@v5 + + - name: Use Node.js 24 + uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - name: Install Dependencies (if not restored from cache) if: steps.dep-cache.outputs.cache-hit != 'true' - run: npm ci + run: npm ci working-directory: ${{ github.workspace }} - - + + - run: npm run lint working-directory: ${{ github.workspace }} diff --git a/.github/workflows/lockfile.yml b/.github/workflows/lockfile.yml index ba5c868c32a..e3d69c5665b 100644 --- a/.github/workflows/lockfile.yml +++ b/.github/workflows/lockfile.yml @@ -19,11 +19,11 @@ jobs: filters: | src: - 'package-lock.json' - - - name: Use Node.js 18 - uses: actions/setup-node@v5 + + - name: Use Node.js 24 + uses: actions/setup-node@v6 with: - node-version: 18 + node-version: 24 cache: 'npm' - if: steps.changes.outputs.src == 'true' diff --git a/.github/workflows/mpt-build.yml b/.github/workflows/mpt-build.yml index edbc1ef66f7..093f214d965 100644 --- a/.github/workflows/mpt-build.yml +++ b/.github/workflows/mpt-build.yml @@ -42,10 +42,10 @@ jobs: path: ${{github.workspace}} key: ${{ inputs.dep-cache-key }} - - name: Use Node.js 20 - uses: actions/setup-node@v5 + - name: Use Node.js 24 + uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - name: Install Dependencies (if not restored from cache) @@ -63,9 +63,9 @@ jobs: # mpt-benchmarks: # runs-on: ubuntu-latest # steps: - # - uses: actions/checkout@v4 + # - uses: actions/checkout@v5 - # - uses: actions/setup-node@v5 + # - uses: actions/setup-node@v6 # with: # node-version: 18 # cache: 'npm' diff --git a/.github/workflows/noCompile.yml b/.github/workflows/noCompile.yml index 80cc9957fa3..9db8faf86be 100644 --- a/.github/workflows/noCompile.yml +++ b/.github/workflows/noCompile.yml @@ -33,7 +33,7 @@ jobs: key: ${{ env.DEP_CACHE_KEY }} - name: Use Node.js 22 - uses: actions/setup-node@v5 + uses: actions/setup-node@v6 with: node-version: 22 cache: 'npm' diff --git a/.github/workflows/node-versions.yml b/.github/workflows/node-versions.yml index 92d75b43a89..2bc8f178ed6 100644 --- a/.github/workflows/node-versions.yml +++ b/.github/workflows/node-versions.yml @@ -18,7 +18,7 @@ jobs: submodules: recursive - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v5 + uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-version }} cache: 'npm' diff --git a/.github/workflows/other-nightly.yml b/.github/workflows/other-nightly.yml index c797e539b20..830e15abd9e 100644 --- a/.github/workflows/other-nightly.yml +++ b/.github/workflows/other-nightly.yml @@ -14,9 +14,9 @@ jobs: steps: - uses: actions/checkout@v5 - - uses: actions/setup-node@v4 + - uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - run: npm ci @@ -31,9 +31,9 @@ jobs: steps: - uses: actions/checkout@v5 - - uses: actions/setup-node@v4 + - uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - run: npm ci @@ -48,9 +48,9 @@ jobs: steps: - uses: actions/checkout@v5 - - uses: actions/setup-node@v4 + - uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - run: npm ci @@ -65,9 +65,9 @@ jobs: steps: - uses: actions/checkout@v5 - - uses: actions/setup-node@v4 + - uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - run: npm ci diff --git a/.github/workflows/rlp-ethash-genesis-wallet-build.yml b/.github/workflows/rlp-ethash-genesis-wallet-build.yml index 8cad49a3b32..e1513662629 100644 --- a/.github/workflows/rlp-ethash-genesis-wallet-build.yml +++ b/.github/workflows/rlp-ethash-genesis-wallet-build.yml @@ -30,22 +30,22 @@ jobs: uses: actions/checkout@v5 # We restore the code/deps from cache if triggered from workflow_call (i.e. have valid cache key) - - if: inputs.dep-cache-key != 'none' + - if: inputs.dep-cache-key != 'none' uses: actions/cache/restore@v4 id: dep-cache with: path: ${{github.workspace}} key: ${{ inputs.dep-cache-key }} - - name: Use Node.js 20 - uses: actions/setup-node@v5 + - name: Use Node.js 24 + uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - name: Install Dependencies (if not restored from cache) if: steps.dep-cache.outputs.cache-hit != 'true' - run: npm ci + run: npm ci working-directory: ${{ github.workspace }} # Run coverage for rlp diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml index e995dde2691..bc52e0577a6 100644 --- a/.github/workflows/spellcheck.yml +++ b/.github/workflows/spellcheck.yml @@ -14,9 +14,9 @@ jobs: steps: - uses: actions/checkout@v5 - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: - node-version: 18 + node-version: 24 cache: 'npm' - run: npm run spellcheck diff --git a/.github/workflows/statemanager-build.yml b/.github/workflows/statemanager-build.yml index 0d396e9d110..3c554157953 100644 --- a/.github/workflows/statemanager-build.yml +++ b/.github/workflows/statemanager-build.yml @@ -35,22 +35,22 @@ jobs: uses: actions/checkout@v5 # We restore the code/deps from cache if triggered from workflow_call (i.e. have valid cache key) - - if: inputs.dep-cache-key != 'none' + - if: inputs.dep-cache-key != 'none' uses: actions/cache/restore@v4 id: dep-cache with: path: ${{github.workspace}} key: ${{ inputs.dep-cache-key }} - - name: Use Node.js 20 - uses: actions/setup-node@v5 + - name: Use Node.js 24 + uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - name: Install Dependencies (if not restored from cache) if: steps.dep-cache.outputs.cache-hit != 'true' - run: npm ci + run: npm ci working-directory: ${{ github.workspace }} diff --git a/.github/workflows/tx-build.yml b/.github/workflows/tx-build.yml index e85845c7a05..a3d7e8dc87f 100644 --- a/.github/workflows/tx-build.yml +++ b/.github/workflows/tx-build.yml @@ -40,24 +40,24 @@ jobs: submodules: recursive # We restore the code/deps from cache if triggered from workflow_call (i.e. have valid cache key) - - if: inputs.dep-cache-key != 'none' + - if: inputs.dep-cache-key != 'none' uses: actions/cache/restore@v4 id: dep-cache with: path: ${{github.workspace}} key: ${{ inputs.dep-cache-key }} - - name: Use Node.js 20 - uses: actions/setup-node@v5 + - name: Use Node.js 24 + uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - name: Install Dependencies (if not restored from cache) if: steps.dep-cache.outputs.cache-hit != 'true' - run: npm ci + run: npm ci working-directory: ${{ github.workspace }} - + - if: inputs.submodule-cache-key != 'none' uses: actions/cache/restore@v4 name: Initialize ethereum-tests diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml index 11339b4e4c7..5ba4a115039 100644 --- a/.github/workflows/typecheck.yml +++ b/.github/workflows/typecheck.yml @@ -30,22 +30,22 @@ jobs: uses: actions/checkout@v5 # We restore the code/deps from cache if triggered from workflow_call (i.e. have valid cache key) - - if: inputs.dep-cache-key != 'none' + - if: inputs.dep-cache-key != 'none' uses: actions/cache/restore@v4 id: dep-cache with: path: ${{github.workspace}} key: ${{ inputs.dep-cache-key }} - - - name: Use Node.js 20 - uses: actions/setup-node@v5 + + - name: Use Node.js 24 + uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - name: Install Dependencies (if not restored from cache) if: steps.dep-cache.outputs.cache-hit != 'true' - run: npm ci + run: npm ci working-directory: ${{ github.workspace }} - if: inputs.submodule-cache-key != 'none' @@ -56,7 +56,7 @@ jobs: path: ${{github.workspace}}/packages/ethereum-tests key: ${{ inputs.submodule-cache-key}} fail-on-cache-miss: true - - + + - run: npm run tsc --workspaces working-directory: ${{ github.workspace }} diff --git a/.github/workflows/util-build.yml b/.github/workflows/util-build.yml index 997b49c20b9..fed82a4945f 100644 --- a/.github/workflows/util-build.yml +++ b/.github/workflows/util-build.yml @@ -34,22 +34,22 @@ jobs: uses: actions/checkout@v5 # We restore the code/deps from cache if triggered from workflow_call (i.e. have valid cache key) - - if: inputs.dep-cache-key != 'none' + - if: inputs.dep-cache-key != 'none' uses: actions/cache/restore@v4 id: dep-cache with: path: ${{github.workspace}} key: ${{ inputs.dep-cache-key }} - - name: Use Node.js 20 - uses: actions/setup-node@v5 + - name: Use Node.js 24 + uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - name: Install Dependencies (if not restored from cache) if: steps.dep-cache.outputs.cache-hit != 'true' - run: npm ci + run: npm ci working-directory: ${{ github.workspace }} - run: npm run coverage diff --git a/.github/workflows/vm-build.yml b/.github/workflows/vm-build.yml index 87261a7d5e8..4cb913aef8c 100644 --- a/.github/workflows/vm-build.yml +++ b/.github/workflows/vm-build.yml @@ -26,15 +26,15 @@ jobs: path: ${{github.workspace}} key: npm-${{ hashFiles('package-lock.json') }} - - name: Use Node.js 20 - uses: actions/setup-node@v5 + - name: Use Node.js 24 + uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - name: Install Dependencies (if not restored from cache) if: steps.dep-cache.outputs.cache-hit != 'true' - run: npm ci + run: npm ci working-directory: ${{ github.workspace }} - run: npm run test:state:newForks @@ -52,15 +52,15 @@ jobs: path: ${{github.workspace}} key: npm-${{ hashFiles('package-lock.json') }} - - name: Use Node.js 20 - uses: actions/setup-node@v5 + - name: Use Node.js 24 + uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - name: Install Dependencies (if not restored from cache) if: steps.dep-cache.outputs.cache-hit != 'true' - run: npm ci + run: npm ci working-directory: ${{ github.workspace }} - run: npm run test:blockchain diff --git a/.github/workflows/vm-nightly-test.yml b/.github/workflows/vm-nightly-test.yml index 58bf4f9facf..6838522325b 100644 --- a/.github/workflows/vm-nightly-test.yml +++ b/.github/workflows/vm-nightly-test.yml @@ -18,9 +18,9 @@ jobs: steps: - uses: actions/checkout@v5 - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - run: npm ci @@ -37,9 +37,9 @@ jobs: with: submodules: recursive - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - run: npm i @@ -55,9 +55,9 @@ jobs: with: submodules: recursive - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - run: npm i @@ -74,9 +74,9 @@ jobs: with: submodules: recursive - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - run: npm i diff --git a/.github/workflows/vm-pr.yml b/.github/workflows/vm-pr.yml index dfba113e6b2..b5fb0ada9d4 100644 --- a/.github/workflows/vm-pr.yml +++ b/.github/workflows/vm-pr.yml @@ -39,24 +39,24 @@ jobs: submodules: recursive # We restore the code/deps from cache if triggered from workflow_call (i.e. have valid cache key) - - if: inputs.dep-cache-key != 'none' + - if: inputs.dep-cache-key != 'none' uses: actions/cache/restore@v4 id: dep-cache with: path: ${{github.workspace}} key: ${{ inputs.dep-cache-key }} - - name: Use Node.js 20 - uses: actions/setup-node@v5 + - name: Use Node.js 24 + uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - name: Install Dependencies (if not restored from cache) if: steps.dep-cache.outputs.cache-hit != 'true' - run: npm ci + run: npm ci working-directory: ${{ github.workspace }} - + - if: inputs.submodule-cache-key != 'none' uses: actions/cache/restore@v4 name: Initialize ethereum-tests @@ -88,22 +88,22 @@ jobs: submodules: recursive # We restore the code/deps from cache if triggered from workflow_call (i.e. have valid cache key) - - if: inputs.dep-cache-key != 'none' + - if: inputs.dep-cache-key != 'none' uses: actions/cache/restore@v4 id: dep-cache with: path: ${{github.workspace}} key: ${{ inputs.dep-cache-key }} - - name: Use Node.js 20 - uses: actions/setup-node@v5 + - name: Use Node.js 24 + uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - name: Install Dependencies (if not restored from cache) if: steps.dep-cache.outputs.cache-hit != 'true' - run: npm ci + run: npm ci working-directory: ${{ github.workspace }} - if: inputs.submodule-cache-key != 'none' @@ -114,10 +114,10 @@ jobs: path: ${{github.workspace}}/packages/ethereum-tests key: ${{ inputs.submodule-cache-key}} fail-on-cache-miss: true - + - if: contains(join(github.event.pull_request.labels.*.name, ' '), 'skip most VM') == false run: npm run test:state -- --fork=${{ matrix.fork }} --verify-test-amount-alltests - + - if: contains(join(github.event.pull_request.labels.*.name, ' '), 'skip most VM') run: npm run test:buildIntegrity @@ -132,23 +132,23 @@ jobs: with: submodules: recursive - - name: Use Node.js 20 - uses: actions/setup-node@v4 + - name: Use Node.js 24 + uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - name: Install Dependencies (if not restored from cache) if: steps.dep-cache.outputs.cache-hit != 'true' - run: npm ci + run: npm ci working-directory: ${{ github.workspace }} - + - if: contains(join(github.event.pull_request.labels.*.name, ' '), 'skip most VM') == false run: npm run test:osaka:state - + - if: contains(join(github.event.pull_request.labels.*.name, ' '), 'skip most VM') run: npm run test:buildIntegrity - + vm-osaka-blockchain: runs-on: ubuntu-latest strategy: @@ -160,23 +160,23 @@ jobs: with: submodules: recursive - - name: Use Node.js 20 - uses: actions/setup-node@v4 + - name: Use Node.js 24 + uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - name: Install Dependencies (if not restored from cache) if: steps.dep-cache.outputs.cache-hit != 'true' - run: npm ci + run: npm ci working-directory: ${{ github.workspace }} - + - if: contains(join(github.event.pull_request.labels.*.name, ' '), 'skip most VM') == false run: npm run test:osaka:blockchain - + - if: contains(join(github.event.pull_request.labels.*.name, ' '), 'skip most VM') run: npm run test:buildIntegrity - + vm-state-extended: if: contains(join(github.event.pull_request.labels.*.name, ' '), 'test all hardforks') runs-on: ubuntu-latest @@ -208,22 +208,22 @@ jobs: submodules: recursive # We restore the code/deps from cache if triggered from workflow_call (i.e. have valid cache key) - - if: inputs.dep-cache-key != 'none' + - if: inputs.dep-cache-key != 'none' uses: actions/cache/restore@v4 id: dep-cache with: path: ${{github.workspace}} key: ${{ inputs.dep-cache-key }} - - name: Use Node.js 20 - uses: actions/setup-node@v5 + - name: Use Node.js 24 + uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - name: Install Dependencies (if not restored from cache) if: steps.dep-cache.outputs.cache-hit != 'true' - run: npm ci + run: npm ci working-directory: ${{ github.workspace }} @@ -235,7 +235,7 @@ jobs: path: ${{github.workspace}}/packages/ethereum-tests key: ${{ inputs.submodule-cache-key}} fail-on-cache-miss: true - + - run: npm run test:state -- --fork=${{ matrix.fork }} --verify-test-amount-alltests @@ -260,24 +260,24 @@ jobs: submodules: recursive # We restore the code/deps from cache if triggered from workflow_call (i.e. have valid cache key) - - if: inputs.dep-cache-key != 'none' + - if: inputs.dep-cache-key != 'none' uses: actions/cache/restore@v4 id: dep-cache with: path: ${{github.workspace}} key: ${{ inputs.dep-cache-key }} - - name: Use Node.js 20 - uses: actions/setup-node@v5 + - name: Use Node.js 24 + uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - name: Install Dependencies (if not restored from cache) if: steps.dep-cache.outputs.cache-hit != 'true' - run: npm ci + run: npm ci working-directory: ${{ github.workspace }} - + - if: inputs.submodule-cache-key != 'none' uses: actions/cache/restore@v4 name: Initialize ethereum-tests @@ -331,24 +331,24 @@ jobs: submodules: recursive # We restore the code/deps from cache if triggered from workflow_call (i.e. have valid cache key) - - if: inputs.dep-cache-key != 'none' + - if: inputs.dep-cache-key != 'none' uses: actions/cache/restore@v4 id: dep-cache with: path: ${{github.workspace}} key: ${{ inputs.dep-cache-key }} - - name: Use Node.js 20 - uses: actions/setup-node@v5 + - name: Use Node.js 24 + uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - name: Install Dependencies (if not restored from cache) if: steps.dep-cache.outputs.cache-hit != 'true' - run: npm ci + run: npm ci working-directory: ${{ github.workspace }} - + - if: inputs.submodule-cache-key != 'none' uses: actions/cache/restore@v4 name: Initialize ethereum-tests @@ -368,22 +368,22 @@ jobs: uses: actions/checkout@v5 # We restore the code/deps from cache if triggered from workflow_call (i.e. have valid cache key) - - if: inputs.dep-cache-key != 'none' + - if: inputs.dep-cache-key != 'none' uses: actions/cache/restore@v4 id: dep-cache with: path: ${{github.workspace}} key: ${{ inputs.dep-cache-key }} - - name: Use Node.js 20 - uses: actions/setup-node@v5 + - name: Use Node.js 24 + uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 cache: 'npm' - name: Install Dependencies (if not restored from cache) if: steps.dep-cache.outputs.cache-hit != 'true' - run: npm ci + run: npm ci working-directory: ${{ github.workspace }} - run: npm run build:benchmarks diff --git a/package-lock.json b/package-lock.json index b1a21987580..650437412d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,8 +39,8 @@ "vitest": "3.2.4" }, "engines": { - "node": ">=18", - "npm": ">=7" + "node": ">=20", + "npm": ">=9" }, "optionalDependencies": { "@rollup/rollup-linux-x64-gnu": "*" @@ -11717,7 +11717,7 @@ "@types/debug": "^4.1.12" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "packages/binarytree/node_modules/lru-cache": { @@ -11745,7 +11745,7 @@ "micro-eth-signer": "^0.15.0" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "packages/blockchain": { @@ -11767,7 +11767,7 @@ "@types/debug": "^4.1.12" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "packages/blockchain/node_modules/lru-cache": { @@ -11843,7 +11843,7 @@ "ws": "^8.18.1" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "packages/common": { @@ -11885,7 +11885,7 @@ "testdouble": "^3.20.2" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "packages/devp2p/node_modules/lru-cache": { @@ -11912,7 +11912,7 @@ "@types/snappyjs": "^0.7.1" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "packages/ethash": { @@ -11930,7 +11930,7 @@ "@ethereumjs/common": "^10.1.0" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "packages/evm": { @@ -11966,7 +11966,7 @@ "split": "^1.0.1" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "packages/genesis": { @@ -11978,7 +11978,7 @@ "@ethereumjs/util": "^10.1.0" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "packages/mpt": { @@ -12003,7 +12003,7 @@ "micro-bmark": "0.4.0" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "packages/mpt/node_modules/lru-cache": { @@ -12025,7 +12025,7 @@ "benchmark": "^2.1.4" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "packages/statemanager": { @@ -12088,7 +12088,7 @@ "yargs": "^17.7.2" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "packages/util": { @@ -12105,7 +12105,7 @@ "micro-eth-signer": "^0.15.0" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "packages/vm": { @@ -12146,7 +12146,7 @@ "yargs": "^17.7.2" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "packages/wallet": { @@ -12168,7 +12168,7 @@ "lodash.zip": "^4.2.0" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "packages/wallet/node_modules/uuid": { diff --git a/package.json b/package.json index 6639aef405e..e821059d512 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "@rollup/rollup-linux-x64-gnu": "*" }, "engines": { - "node": ">=18", - "npm": ">=7" + "node": ">=20", + "npm": ">=9" } } diff --git a/packages/binarytree/package.json b/packages/binarytree/package.json index 8647300e79c..b3c4143ddac 100644 --- a/packages/binarytree/package.json +++ b/packages/binarytree/package.json @@ -65,6 +65,6 @@ "@types/debug": "^4.1.12" }, "engines": { - "node": ">=18" + "node": ">=20" } } diff --git a/packages/block/package.json b/packages/block/package.json index 6af52446440..8cc31942acd 100644 --- a/packages/block/package.json +++ b/packages/block/package.json @@ -63,6 +63,6 @@ "micro-eth-signer": "^0.15.0" }, "engines": { - "node": ">=18" + "node": ">=20" } } diff --git a/packages/blockchain/package.json b/packages/blockchain/package.json index 0e96086e3f8..92b8e6a3f4b 100644 --- a/packages/blockchain/package.json +++ b/packages/blockchain/package.json @@ -64,6 +64,6 @@ "@types/debug": "^4.1.12" }, "engines": { - "node": ">=18" + "node": ">=20" } } diff --git a/packages/client/package.json b/packages/client/package.json index 564bc8e2ebc..756d5d6a6ab 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -109,6 +109,6 @@ "ws": "^8.18.1" }, "engines": { - "node": ">=18" + "node": ">=20" } } diff --git a/packages/devp2p/package.json b/packages/devp2p/package.json index 4ea0c4cd735..01c9284f73e 100644 --- a/packages/devp2p/package.json +++ b/packages/devp2p/package.json @@ -86,6 +86,6 @@ "testdouble": "^3.20.2" }, "engines": { - "node": ">=18" + "node": ">=20" } } diff --git a/packages/e2store/package.json b/packages/e2store/package.json index d88d1037eaa..8b9c64219d8 100644 --- a/packages/e2store/package.json +++ b/packages/e2store/package.json @@ -67,6 +67,6 @@ "@types/snappyjs": "^0.7.1" }, "engines": { - "node": ">=18" + "node": ">=20" } } diff --git a/packages/ethash/package.json b/packages/ethash/package.json index 67f4376054a..5c44eb52949 100644 --- a/packages/ethash/package.json +++ b/packages/ethash/package.json @@ -58,6 +58,6 @@ "@ethereumjs/common": "^10.1.0" }, "engines": { - "node": ">=18" + "node": ">=20" } } diff --git a/packages/evm/package.json b/packages/evm/package.json index 0f3ae2b1b06..e7d6ecc8bde 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -82,6 +82,6 @@ "split": "^1.0.1" }, "engines": { - "node": ">=18" + "node": ">=20" } } diff --git a/packages/evm/test/precompiles/09-blake2f.spec.ts b/packages/evm/test/precompiles/09-blake2f.spec.ts index f99743f766d..ed092b5eba6 100644 --- a/packages/evm/test/precompiles/09-blake2f.spec.ts +++ b/packages/evm/test/precompiles/09-blake2f.spec.ts @@ -108,7 +108,7 @@ describe('Precompiles: BLAKE2F', () => { 'should generate expected value', ) assert.deepEqual(result.executionGasUsed, BigInt(t.gas), 'should use expected amount of gas') - }, 20_000) + }, 40_000) } for (const t of malformedCases) { diff --git a/packages/genesis/package.json b/packages/genesis/package.json index 1848a04eb0d..f247fc872dd 100644 --- a/packages/genesis/package.json +++ b/packages/genesis/package.json @@ -82,6 +82,6 @@ "@ethereumjs/util": "^10.1.0" }, "engines": { - "node": ">=18" + "node": ">=20" } } diff --git a/packages/mpt/package.json b/packages/mpt/package.json index 0d004f44a94..a0ba959cc72 100644 --- a/packages/mpt/package.json +++ b/packages/mpt/package.json @@ -70,6 +70,6 @@ "micro-bmark": "0.4.0" }, "engines": { - "node": ">=18" + "node": ">=20" } } diff --git a/packages/mpt/test/util/genesisState.spec.ts b/packages/mpt/test/util/genesisState.spec.ts index 186481560ae..a8ae354b336 100644 --- a/packages/mpt/test/util/genesisState.spec.ts +++ b/packages/mpt/test/util/genesisState.spec.ts @@ -27,4 +27,4 @@ it('should correctly derive mainnet stateRoot from ethereumjs genesis', async () '0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544', 'mainnet stateRoot matches', ) -}, 20_000) +}, 40_000) diff --git a/packages/rlp/package.json b/packages/rlp/package.json index 4538e8b002e..a6fc6a64096 100644 --- a/packages/rlp/package.json +++ b/packages/rlp/package.json @@ -62,7 +62,7 @@ "tsc": "../../config/cli/ts-compile.sh" }, "engines": { - "node": ">=18" + "node": ">=20" }, "devDependencies": { "@types/benchmark": "^2.1.5", diff --git a/packages/tx/package.json b/packages/tx/package.json index 64db743490b..cd88cf085d9 100644 --- a/packages/tx/package.json +++ b/packages/tx/package.json @@ -78,6 +78,6 @@ "yargs": "^17.7.2" }, "engines": { - "node": ">=18" + "node": ">=20" } } diff --git a/packages/util/package.json b/packages/util/package.json index d3b13961731..7dd0d9f3961 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -103,6 +103,6 @@ "micro-eth-signer": "^0.15.0" }, "engines": { - "node": ">=18" + "node": ">=20" } } diff --git a/packages/vm/package.json b/packages/vm/package.json index 12b84e05b20..173bacdbbc3 100644 --- a/packages/vm/package.json +++ b/packages/vm/package.json @@ -99,6 +99,6 @@ "yargs": "^17.7.2" }, "engines": { - "node": ">=18" + "node": ">=20" } } diff --git a/packages/vm/test/api/EIPs/eip-1153.spec.ts b/packages/vm/test/api/EIPs/eip-1153.spec.ts index 7f4c121213f..814a9bf7530 100644 --- a/packages/vm/test/api/EIPs/eip-1153.spec.ts +++ b/packages/vm/test/api/EIPs/eip-1153.spec.ts @@ -5,6 +5,7 @@ import { assert, describe, it } from 'vitest' import { createVM, runTx } from '../../../src/index.ts' +import type { InterpreterStep } from '@ethereumjs/evm' import type { TypedTransaction } from '@ethereumjs/tx' import type { PrefixedHexString } from '@ethereumjs/util' @@ -25,7 +26,7 @@ describe('EIP 1153: transient storage', () => { let currentGas = initialGas const vm = await createVM({ common }) - vm.evm.events!.on('step', function (step, resolve) { + const handler = function (step: InterpreterStep) { const gasUsed = currentGas - step.gasLeft currentGas = step.gasLeft @@ -52,8 +53,8 @@ describe('EIP 1153: transient storage', () => { ) } i++ - resolve?.() - }) + } + vm.evm.events!.on('step', handler) for (const { code, address } of test.contracts) { await vm.stateManager.putCode(address, hexToBytes(code as PrefixedHexString)) @@ -67,6 +68,7 @@ describe('EIP 1153: transient storage', () => { results.push(result) } + vm.evm.events!.removeListener('step', handler) return results } diff --git a/packages/vm/test/api/EIPs/eip-2929.spec.ts b/packages/vm/test/api/EIPs/eip-2929.spec.ts index b289843bd57..4fc90daa03c 100644 --- a/packages/vm/test/api/EIPs/eip-2929.spec.ts +++ b/packages/vm/test/api/EIPs/eip-2929.spec.ts @@ -5,6 +5,7 @@ import { assert, describe, it } from 'vitest' import { createVM, runTx } from '../../../src/index.ts' +import type { InterpreterStep } from '@ethereumjs/evm' import type { PrefixedHexString } from '@ethereumjs/util' // Test cases source: https://gist.github.com/holiman/174548cad102096858583c6fbbb0649a @@ -18,7 +19,7 @@ describe('EIP 2929: gas cost tests', () => { let i = 0 let currentGas = initialGas const vm = await createVM({ common }) - vm.evm.events!.on('step', function (step, resolve) { + const handler = function (step: InterpreterStep) { const gasUsed = currentGas - step.gasLeft currentGas = step.gasLeft @@ -45,8 +46,8 @@ describe('EIP 2929: gas cost tests', () => { } } i++ - resolve?.() - }) + } + vm.evm.events!.on('step', handler) await vm.stateManager.putCode(address, hexToBytes(test.code)) @@ -61,6 +62,7 @@ describe('EIP 2929: gas cost tests', () => { const totalGasUsed = initialGas - currentGas assert.strictEqual(true, totalGasUsed === BigInt(test.totalGasUsed) + BigInt(21000)) // Add tx upfront cost. + vm.evm.events!.removeListener('step', handler) return result } diff --git a/packages/vm/test/api/EIPs/eip-2930-accesslists.spec.ts b/packages/vm/test/api/EIPs/eip-2930-accesslists.spec.ts index 296c7231f4a..d344af107f4 100644 --- a/packages/vm/test/api/EIPs/eip-2930-accesslists.spec.ts +++ b/packages/vm/test/api/EIPs/eip-2930-accesslists.spec.ts @@ -11,6 +11,8 @@ import { assert, describe, it } from 'vitest' import { createVM, runTx } from '../../../src/index.ts' +import type { InterpreterStep } from '@ethereumjs/evm' + const common = new Common({ eips: [2718, 2929, 2930], chain: Mainnet, @@ -65,12 +67,12 @@ describe('EIP-2930 Optional Access Lists tests', () => { createAccount({ ...account, balance: initialBalance }), ) - let trace: any = [] + let trace: Array<[string, bigint]> = [] - vm.evm.events!.on('step', (o, resolve) => { + const handler = (o: InterpreterStep) => { trace.push([o.opcode.name, o.gasLeft]) - resolve?.() - }) + } + vm.evm.events!.on('step', handler) await runTx(vm, { tx: txnWithAccessList }) assert.strictEqual(trace[1][0], 'SLOAD') @@ -82,5 +84,6 @@ describe('EIP-2930 Optional Access Lists tests', () => { assert.strictEqual(trace[1][0], 'SLOAD') gasUsed = trace[1][1] - trace[2][1] assert.strictEqual(Number(gasUsed), 2100, 'charge cold sload gas') + vm.evm.events!.removeListener('step', handler) }) }) diff --git a/packages/vm/test/api/EIPs/eip-3198-BaseFee.spec.ts b/packages/vm/test/api/EIPs/eip-3198-BaseFee.spec.ts index c8e97748ee7..44eadeb606c 100644 --- a/packages/vm/test/api/EIPs/eip-3198-BaseFee.spec.ts +++ b/packages/vm/test/api/EIPs/eip-3198-BaseFee.spec.ts @@ -6,6 +6,7 @@ import { assert, describe, it } from 'vitest' import { createVM, runTx } from '../../../src/index.ts' +import type { InterpreterStep } from '@ethereumjs/evm' import type { TypedTransaction } from '@ethereumjs/tx' const common = new Common({ @@ -76,13 +77,13 @@ describe('EIP3198 tests', () => { // Track stack - let stack: any = [] - vm.evm.events!.on('step', (iStep, resolve) => { + let stack: bigint[] = [] + const handler = (iStep: InterpreterStep) => { if (iStep.opcode.name === 'STOP') { stack = iStep.stack } - resolve?.() - }) + } + vm.evm.events!.on('step', handler) const results = await runTx(vm, { tx: block.transactions[0], @@ -92,5 +93,6 @@ describe('EIP3198 tests', () => { const gasUsed = results.totalGasSpent - txBaseFee assert.strictEqual(gasUsed, BigInt(2), 'gas used correct') assert.strictEqual(stack[0], fee, 'right item pushed on stack') + vm.evm.events!.removeListener('step', handler) }) }) diff --git a/packages/vm/test/api/EIPs/eip-3529.spec.ts b/packages/vm/test/api/EIPs/eip-3529.spec.ts index b2ac71c5b50..bc4dc627699 100644 --- a/packages/vm/test/api/EIPs/eip-3529.spec.ts +++ b/packages/vm/test/api/EIPs/eip-3529.spec.ts @@ -5,6 +5,7 @@ import { assert, describe, it } from 'vitest' import { createVM, runTx } from '../../../src/index.ts' +import type { InterpreterStep } from '@ethereumjs/evm' import type { PrefixedHexString } from '@ethereumjs/util' const address = new Address(hexToBytes(`0x${'11'.repeat(20)}`)) @@ -117,13 +118,13 @@ describe('EIP-3529 tests', () => { let gasRefund: bigint let gasLeft: bigint - vm.evm.events!.on('step', (step, resolve) => { + const handler = (step: InterpreterStep) => { if (step.opcode.name === 'STOP') { gasRefund = step.gasRefund gasLeft = step.gasLeft } - resolve?.() - }) + } + vm.evm.events!.on('step', handler) const gasLimit = BigInt(100000) const key = hexToBytes(`0x${'00'.repeat(32)}`) @@ -155,6 +156,7 @@ describe('EIP-3529 tests', () => { // clear the storage cache, otherwise next test will use current original value vm.stateManager.originalStorageCache.clear() } + vm.evm.events!.removeListener('step', handler) }) it('should not refund selfdestructs', async () => { @@ -188,15 +190,15 @@ describe('EIP-3529 tests', () => { let startGas: bigint let finalGas: bigint - vm.evm.events!.on('step', (step, resolve) => { + const handler = (step: InterpreterStep) => { if (startGas === undefined) { startGas = step.gasLeft } if (step.opcode.name === 'STOP') { finalGas = step.gasLeft } - resolve?.() - }) + } + vm.evm.events!.on('step', handler) const address = new Address(hexToBytes(`0x${'20'.repeat(20)}`)) @@ -229,5 +231,6 @@ describe('EIP-3529 tests', () => { const minGasUsed = actualGasUsed - maxRefund assert.isTrue(result.gasRefund! > maxRefund, 'refund is larger than the max refund') assert.isTrue(result.totalGasSpent >= minGasUsed, 'gas used respects the max refund quotient') + vm.evm.events!.removeListener('step', handler) }) }) diff --git a/packages/vm/test/api/EIPs/eip-3541.spec.ts b/packages/vm/test/api/EIPs/eip-3541.spec.ts index 2664588cb29..45daf6728cc 100644 --- a/packages/vm/test/api/EIPs/eip-3541.spec.ts +++ b/packages/vm/test/api/EIPs/eip-3541.spec.ts @@ -5,6 +5,7 @@ import { assert, describe, it } from 'vitest' import { createVM, runTx } from '../../../src/index.ts' +import type { InterpreterStep } from '@ethereumjs/evm' import type { Address } from '@ethereumjs/util' const pkey = hexToBytes(`0x${'20'.repeat(32)}`) @@ -70,12 +71,12 @@ describe('EIP 3541 tests', () => { const vm = await createVM({ common }) let address: Address - vm.evm.events!.on('step', (step, resolve) => { + const handler = (step: InterpreterStep) => { if (step.depth === 1) { address = step.address } - resolve?.() - }) + } + vm.evm.events!.on('step', handler) await runTx(vm, { tx, skipHardForkValidation: true }) @@ -95,6 +96,7 @@ describe('EIP 3541 tests', () => { code = await vm.stateManager.getCode(address!) assert.isNotEmpty(code, 'did deposit code') + vm.evm.events!.removeListener('step', handler) }) it('deploy contracts starting with 0xEF using CREATE2', async () => { @@ -106,12 +108,12 @@ describe('EIP 3541 tests', () => { const vm = await createVM({ common }) let address: Address - vm.evm.events!.on('step', (step, resolve) => { + const handler = (step: InterpreterStep) => { if (step.depth === 1) { address = step.address } - resolve?.() - }) + } + vm.evm.events!.on('step', handler) await runTx(vm, { tx, skipHardForkValidation: true }) @@ -131,5 +133,6 @@ describe('EIP 3541 tests', () => { code = await vm.stateManager.getCode(address!) assert.isNotEmpty(code, 'did deposit code') + vm.evm.events!.removeListener('step', handler) }) }) diff --git a/packages/vm/test/api/EIPs/eip-3855.spec.ts b/packages/vm/test/api/EIPs/eip-3855.spec.ts index 2e35d74666f..e72f9256cf1 100644 --- a/packages/vm/test/api/EIPs/eip-3855.spec.ts +++ b/packages/vm/test/api/EIPs/eip-3855.spec.ts @@ -2,7 +2,7 @@ import { Common, Hardfork, Mainnet } from '@ethereumjs/common' import { hexToBytes } from '@ethereumjs/util' import { assert, describe, it } from 'vitest' -import { EVMError } from '@ethereumjs/evm' +import { EVMError, type InterpreterStep } from '@ethereumjs/evm' import { createVM } from '../../../src/index.ts' describe('EIP 3855 tests', () => { @@ -16,10 +16,10 @@ describe('EIP 3855 tests', () => { it('should correctly use push0 opcode', async () => { const vm = await createVM({ common }) let stack: bigint[] - vm.evm.events!.on('step', (e, resolve) => { + const handler = (e: InterpreterStep) => { stack = e.stack - resolve?.() - }) + } + vm.evm.events!.on('step', handler) const result = await vm.evm.runCode!({ code: hexToBytes('0x5F00'), @@ -29,15 +29,16 @@ describe('EIP 3855 tests', () => { assert.strictEqual(stack!.length, 1) assert.strictEqual(stack![0], BigInt(0)) assert.strictEqual(result.executionGasUsed, common.param('push0Gas')) + vm.evm.events!.removeListener('step', handler) }) it('should correctly use push0 to create a stack with stack limit length', async () => { const vm = await createVM({ common }) let stack: bigint[] = [] - vm.evm.events!.on('step', (e, resolve) => { + const handler = (e: InterpreterStep) => { stack = e.stack - resolve?.() - }) + } + vm.evm.events!.on('step', handler) const depth = Number(common.param('stackLimit')) @@ -53,6 +54,7 @@ describe('EIP 3855 tests', () => { } } assert.strictEqual(result.executionGasUsed, common.param('push0Gas')! * BigInt(depth)) + vm.evm.events!.removeListener('step', handler) }) it('should correctly use push0 to create a stack with stack limit + 1 length', async () => { diff --git a/packages/vm/test/api/EIPs/eip-4399-supplant-difficulty-opcode-with-prevrando.spec.ts b/packages/vm/test/api/EIPs/eip-4399-supplant-difficulty-opcode-with-prevrando.spec.ts index 4e8cb8de8f4..397234016c7 100644 --- a/packages/vm/test/api/EIPs/eip-4399-supplant-difficulty-opcode-with-prevrando.spec.ts +++ b/packages/vm/test/api/EIPs/eip-4399-supplant-difficulty-opcode-with-prevrando.spec.ts @@ -6,6 +6,8 @@ import { assert, describe, it } from 'vitest' import { createVM } from '../../../src/index.ts' +import type { InterpreterStep } from '@ethereumjs/evm' + describe('EIP-4399 -> 0x44 (DIFFICULTY) should return PREVRANDAO', () => { it('should return the right values', async () => { const common = new Common({ chain: Mainnet, hardfork: Hardfork.London }) @@ -22,13 +24,13 @@ describe('EIP-4399 -> 0x44 (DIFFICULTY) should return PREVRANDAO', () => { let block = createBlock({ header }, { common, calcDifficultyFromHeader: genesis.header }) // Track stack - let stack: any = [] - vm.evm.events!.on('step', (iStep, resolve) => { + let stack: bigint[] = [] + const handler = (iStep: InterpreterStep) => { if (iStep.opcode.name === 'STOP') { stack = iStep.stack } - resolve?.() - }) + } + vm.evm.events!.on('step', handler) const runCodeArgs = { code: hexToBytes('0x4400'), @@ -50,5 +52,6 @@ describe('EIP-4399 -> 0x44 (DIFFICULTY) should return PREVRANDAO', () => { ) await vm.evm.runCode!({ ...runCodeArgs, block }) assert.strictEqual(stack[0], prevRandao, '0x44 returns PREVRANDAO (Merge)') + vm.evm.events!.removeListener('step', handler) }) }) diff --git a/packages/vm/test/api/EIPs/eip-4895-withdrawals.spec.ts b/packages/vm/test/api/EIPs/eip-4895-withdrawals.spec.ts index 02daa8fa7cd..b2eefef832e 100644 --- a/packages/vm/test/api/EIPs/eip-4895-withdrawals.spec.ts +++ b/packages/vm/test/api/EIPs/eip-4895-withdrawals.spec.ts @@ -113,9 +113,10 @@ describe('EIP4895 tests', () => { ) let result: Uint8Array - vm.events.on('afterTx', (e) => { + const handler = (e: any) => { result = e.execResult.returnValue - }) + } + vm.events.once('afterTx', handler) await runBlock(vm, { block, generate: true }) diff --git a/packages/vm/test/api/EIPs/eip-7002.spec.ts b/packages/vm/test/api/EIPs/eip-7002.spec.ts index 7778833a323..30c7e29cc0c 100644 --- a/packages/vm/test/api/EIPs/eip-7002.spec.ts +++ b/packages/vm/test/api/EIPs/eip-7002.spec.ts @@ -106,9 +106,10 @@ describe('EIP-7002 tests', () => { ) let generatedBlock: Block - vm.events.on('afterBlock', (e) => { + const handler = (e: any) => { generatedBlock = e.block - }) + } + vm.events.once('afterBlock', handler) let runBlockResults = await runBlock(vm, { block: block2, diff --git a/packages/vm/test/api/events.spec.ts b/packages/vm/test/api/events.spec.ts index 1c985602529..6696447251b 100644 --- a/packages/vm/test/api/events.spec.ts +++ b/packages/vm/test/api/events.spec.ts @@ -12,9 +12,10 @@ describe('VM events', () => { const vm = await createVM() let emitted - vm.events.on('beforeBlock', (val) => { + const handler = (val: any) => { emitted = val - }) + } + vm.events.once('beforeBlock', handler) const block = new Block() @@ -31,9 +32,10 @@ describe('VM events', () => { const vm = await createVM() let emitted - vm.events.on('afterBlock', (val) => { + const handler = (val: any) => { emitted = val - }) + } + vm.events.once('afterBlock', handler) const block = new Block() @@ -51,9 +53,10 @@ describe('VM events', () => { const vm = await createVM() let emitted - vm.events.on('beforeTx', (val) => { + const handler = (val: any) => { emitted = val - }) + } + vm.events.once('beforeTx', handler) const tx = createFeeMarket1559Tx({ gasLimit: 90000, @@ -71,9 +74,10 @@ describe('VM events', () => { const address = createAddressFromPrivateKey(privKey) await vm.stateManager.putAccount(address, new Account(BigInt(0), BigInt(0x11111111))) let emitted: any - vm.events.on('afterTx', (val: any) => { + const handler = (val: any) => { emitted = val - }) + } + vm.events.once('afterTx', handler) const tx = createFeeMarket1559Tx({ gasLimit: 90000, @@ -92,10 +96,11 @@ describe('VM events', () => { const address = createAddressFromPrivateKey(privKey) await vm.stateManager.putAccount(address, new Account(BigInt(0), BigInt(0x11111111))) let emitted: any - vm.evm.events!.on('beforeMessage', (val, resolve) => { + const handler = (val: any, resolve?: () => void) => { emitted = val resolve?.() - }) + } + vm.evm.events!.once('beforeMessage', handler) const tx = createFeeMarket1559Tx({ gasLimit: 90000, @@ -115,10 +120,11 @@ describe('VM events', () => { const address = createAddressFromPrivateKey(privKey) await vm.stateManager.putAccount(address, new Account(BigInt(0), BigInt(0x11111111))) let emitted: any - vm.evm.events!.on('afterMessage', (val, resolve) => { + const handler = (val: any, resolve?: () => void) => { emitted = val resolve?.() - }) + } + vm.evm.events!.once('afterMessage', handler) const tx = createFeeMarket1559Tx({ gasLimit: 90000, @@ -135,11 +141,11 @@ describe('VM events', () => { it('should emit InterpreterStep on each step', async () => { const vm = await createVM() - let lastEmitted: any - vm.evm.events!.on('step', (val, resolve) => { + let lastEmitted + const handler = (val: unknown) => { lastEmitted = val - resolve?.() - }) + } + vm.evm.events!.on('step', handler) // This is a deployment transaction that pushes 0x41 (i.e. ascii A) followed by 31 0s to // the stack, stores that in memory, and then returns the first byte from memory. @@ -152,17 +158,19 @@ describe('VM events', () => { await runTx(vm, { tx, skipBalance: true, skipHardForkValidation: true }) - assert.strictEqual(lastEmitted.opcode.name, 'RETURN') + assert.strictEqual((lastEmitted as any).opcode.name, 'RETURN') + vm.evm.events!.removeListener('step', handler) }) it('should emit a NewContractEvent on new contracts', async () => { const vm = await createVM() let emitted: any - vm.evm.events!.on('newContract', (val, resolve) => { + const handler = (val: any, resolve?: () => void) => { emitted = val resolve?.() - }) + } + vm.evm.events!.once('newContract', handler) // This is a deployment transaction that pushes 0x41 (i.e. ascii A) followed by 31 0s to // the stack, stores that in memory, and then returns the first byte from memory. diff --git a/packages/vm/test/api/t8ntool/t8ntool.spec.ts b/packages/vm/test/api/t8ntool/t8ntool.spec.ts index c4224cf61e7..58e2724ff0b 100644 --- a/packages/vm/test/api/t8ntool/t8ntool.spec.ts +++ b/packages/vm/test/api/t8ntool/t8ntool.spec.ts @@ -14,7 +14,8 @@ import { randomBytes, } from '@ethereumjs/util' -import { createVM, runTx } from '../../../src/index.ts' +import type { InterpreterStep } from '@ethereumjs/evm' +import { type AfterTxEvent, createVM, runTx } from '../../../src/index.ts' import { stepTraceJSON, summaryTraceJSON } from '../../t8n/helpers.ts' import type { T8NOptions } from '../../t8n/types.ts' const t8nDir = 'test/t8n/testdata/' @@ -65,13 +66,15 @@ describe('trace tests', async () => { await vm.stateManager.putAccount(contractAddress) await vm.stateManager.putCode(contractAddress, bytecode) const trace: string[] = [] - vm.evm.events!.on('step', (step) => { + const stepHandler = (step: InterpreterStep) => { trace.push(JSON.stringify(stepTraceJSON(step, true))) - }) - vm.events!.on('afterTx', async (event) => { + } + const afterTxHandler = async (event: AfterTxEvent) => { trace.push(JSON.stringify(await summaryTraceJSON(event, vm))) - }) - const tx = await createTx({ + } + vm.evm.events!.on('step', stepHandler) + vm.events!.on('afterTx', afterTxHandler) + const tx = createTx({ to: contractAddress, data: bytecode, gasLimit: 0xffffffff, @@ -80,6 +83,8 @@ describe('trace tests', async () => { await runTx(vm, { tx, skipBalance: true, skipBlockGasLimitValidation: true, skipNonce: true }) assert.strictEqual(trace.length, 7, 'trace length is 7') assert.strictEqual(JSON.parse(trace[6]).gasUsed, 21154) + vm.evm.events!.removeListener('step', stepHandler) + vm.events!.removeListener('afterTx', afterTxHandler) }) it('should produce a trace of the correct length', async () => { const common = new Common({ @@ -104,12 +109,14 @@ describe('trace tests', async () => { to: contractAddress, }).sign(pk) const trace: string[] = [] - vm.evm.events!.on('step', (step) => { + const stepHandler = (step: InterpreterStep) => { trace.push(JSON.stringify(stepTraceJSON(step, true))) - }) - vm.events!.on('afterTx', async (event) => { + } + const afterTxHandler = async (event: AfterTxEvent) => { trace.push(JSON.stringify(await summaryTraceJSON(event, vm))) - }) + } + vm.evm.events!.on('step', stepHandler) + vm.events!.on('afterTx', afterTxHandler) const result = await runTx(vm, { tx, skipBalance: true, @@ -118,6 +125,8 @@ describe('trace tests', async () => { }) assert.strictEqual(result.execResult.executionGasUsed, BigInt(4)) assert.strictEqual(trace.length, 4) + vm.evm.events!.removeListener('step', stepHandler) + vm.events!.removeListener('afterTx', afterTxHandler) }) it('should execute an EOF contract with 2 code sections linked by CALLF', async () => { const common = new Common({ @@ -187,12 +196,14 @@ describe('trace tests', async () => { }).sign(pk) const trace: string[] = [] - vm.evm.events!.on('step', (step) => { + const stepHandler = (step: InterpreterStep) => { trace.push(JSON.stringify(stepTraceJSON(step, true))) - }) - vm.events!.on('afterTx', async (event) => { + } + const afterTxHandler = async (event: AfterTxEvent) => { trace.push(JSON.stringify(await summaryTraceJSON(event, vm))) - }) + } + vm.evm.events!.on('step', stepHandler) + vm.events!.on('afterTx', afterTxHandler) const result = await runTx(vm, { tx, @@ -217,5 +228,7 @@ describe('trace tests', async () => { assert.strictEqual(result.execResult.executionGasUsed, BigInt(19)) const immediate = JSON.parse(trace[2]).immediate assert.strictEqual(immediate, '0x0001') // Verifies that CALLF immediate matches + vm.evm.events!.removeListener('step', stepHandler) + vm.events!.removeListener('afterTx', afterTxHandler) }) }) diff --git a/packages/vm/vitest.config.coverage.ts b/packages/vm/vitest.config.coverage.ts index 37a90957435..d850a8af76b 100644 --- a/packages/vm/vitest.config.coverage.ts +++ b/packages/vm/vitest.config.coverage.ts @@ -2,7 +2,7 @@ import topLevelAwait from 'vite-plugin-top-level-await' import { defineConfig } from 'vitest/config' export default defineConfig({ - plugins: [topLevelAwait()], + plugins: [topLevelAwait], optimizeDeps: { exclude: ['kzg-wasm'], }, diff --git a/packages/wallet/package.json b/packages/wallet/package.json index b41a9d6004e..2fd144ee2dc 100644 --- a/packages/wallet/package.json +++ b/packages/wallet/package.json @@ -64,6 +64,6 @@ "lodash.zip": "^4.2.0" }, "engines": { - "node": ">=18" + "node": ">=20" } }