diff --git a/.changeset/fuzzy-eyes-collect.md b/.changeset/fuzzy-eyes-collect.md deleted file mode 100644 index dc057aca7f..0000000000 --- a/.changeset/fuzzy-eyes-collect.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@nomicfoundation/hardhat-verify": patch ---- - -Make the `--force` flag override the check of any existing verification, even in the presence of errors. diff --git a/.changeset/fuzzy-mangos-behave.md b/.changeset/fuzzy-mangos-behave.md deleted file mode 100644 index ea406edfdc..0000000000 --- a/.changeset/fuzzy-mangos-behave.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"hardhat": patch ---- - -Add `debug` logs to Hardhat Network initialization process. diff --git a/.changeset/great-crabs-hug.md b/.changeset/great-crabs-hug.md deleted file mode 100644 index 3b4d56eb12..0000000000 --- a/.changeset/great-crabs-hug.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"hardhat": patch ---- - -Added an `enableRip7212` optional flag to the Hardhat Network config that enables [RIP-7212 (Precompile for secp256r1 Curve Support)](https://github.com/ethereum/RIPs/blob/master/RIPS/rip-7212.md). diff --git a/.changeset/grumpy-dragons-shop.md b/.changeset/grumpy-dragons-shop.md deleted file mode 100644 index b9d778100c..0000000000 --- a/.changeset/grumpy-dragons-shop.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"hardhat": patch ---- - -Bump EDR to [v0.4.2](https://github.com/NomicFoundation/edr/releases/tag/%40nomicfoundation%2Fedr%400.4.2). diff --git a/.changeset/loud-cooks-obey.md b/.changeset/loud-cooks-obey.md new file mode 100644 index 0000000000..8e4dc17a8e --- /dev/null +++ b/.changeset/loud-cooks-obey.md @@ -0,0 +1,5 @@ +--- +"hardhat": patch +--- + +Fixed `debug` logs in Hardhat Network initialization process. diff --git a/.changeset/modern-points-cover.md b/.changeset/modern-points-cover.md deleted file mode 100644 index 740a900c37..0000000000 --- a/.changeset/modern-points-cover.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"hardhat": patch ---- - -Bumped EDR to [v0.5.0](https://github.com/NomicFoundation/edr/releases/tag/%40nomicfoundation%2Fedr%400.5.0). diff --git a/.changeset/violet-apes-kick.md b/.changeset/violet-apes-kick.md new file mode 100644 index 0000000000..4e45db1ae7 --- /dev/null +++ b/.changeset/violet-apes-kick.md @@ -0,0 +1,5 @@ +--- +"hardhat": patch +--- + +Removed the experimentalAddHardhatNetworkMessageTraceHook API diff --git a/.github/actions/setup-env/action.yml b/.github/actions/setup-env/action.yml new file mode 100644 index 0000000000..4a1d77f36b --- /dev/null +++ b/.github/actions/setup-env/action.yml @@ -0,0 +1,43 @@ +name: Setup env +description: Sets up node and pnpm + +inputs: + pnpm-version: + description: Version of pnpm to install + required: false + default: "9" + node-version: + description: Version of node to install + required: false + default: "18" + cache-save: + description: Whether to save the pnpm cache + required: false + default: "false" +outputs: + cache-hit: + description: Whether the cache was restored + value: ${{ steps.setup-node.outputs.cache-hit || steps.cache-restore.outputs.cache-hit }} + +runs: + using: composite + steps: + - uses: pnpm/action-setup@v4 + with: + version: ${{ inputs.pnpm-version }} + - uses: actions/setup-node@v4 + id: setup-node + with: + node-version: ${{ inputs.node-version }} + cache: ${{ inputs.cache-save == 'true' && 'pnpm' || '' }} + cache-dependency-path: "**/pnpm-lock.yaml" + - id: pnpm + if: inputs.cache-save == 'false' + run: pnpm store path --silent | xargs -I {} -0 echo "path={}" | tee -a $GITHUB_OUTPUT + shell: bash + - uses: actions/cache/restore@v4 + id: cache-restore + if: inputs.cache-save == 'false' + with: + path: ${{ steps.pnpm.outputs.path }} + key: node-cache-${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} diff --git a/.github/workflows/LATEST_DEPENDENCY_VERSIONS.yml b/.github/workflows/LATEST_DEPENDENCY_VERSIONS.yml index f5e4b8a397..fcdf19ce3a 100644 --- a/.github/workflows/LATEST_DEPENDENCY_VERSIONS.yml +++ b/.github/workflows/LATEST_DEPENDENCY_VERSIONS.yml @@ -14,13 +14,7 @@ jobs: runs-on: ${{ matrix.system }} steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" + - uses: ./.github/actions/setup-env - name: Delete pnpm-lock.yaml run: "rm pnpm-lock.yaml" - name: Install @@ -34,7 +28,7 @@ jobs: run: pnpm test || (echo "===== Retry =====" && pnpm test) - name: Notify failures if: failure() - uses: slackapi/slack-github-action@v1.18.0 + uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0 with: payload: | { diff --git a/.github/workflows/add-issue-to-project.yml b/.github/workflows/add-issue-to-project.yml index 5ab3e0b2db..566c37f177 100644 --- a/.github/workflows/add-issue-to-project.yml +++ b/.github/workflows/add-issue-to-project.yml @@ -10,7 +10,7 @@ jobs: add-to-project: runs-on: ubuntu-latest steps: - - uses: actions/add-to-project@v0.4.0 + - uses: actions/add-to-project@244f685bbc3b7adfa8466e08b698b5577571133e # v1.0.2 with: project-url: https://github.com/orgs/NomicFoundation/projects/4 github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} diff --git a/.github/workflows/add-label-to-new-issue.yml b/.github/workflows/add-label-to-new-issue.yml index a6c6c5345d..2bd47099b5 100644 --- a/.github/workflows/add-label-to-new-issue.yml +++ b/.github/workflows/add-label-to-new-issue.yml @@ -13,7 +13,7 @@ jobs: issues: write pull-requests: write steps: - - uses: actions/github-script@v6 + - uses: actions/github-script@v7 with: script: | const issue = await github.rest.issues.get({ diff --git a/.github/workflows/autoassign-issues.yml b/.github/workflows/autoassign-issues.yml index efd4be5620..318b21074a 100644 --- a/.github/workflows/autoassign-issues.yml +++ b/.github/workflows/autoassign-issues.yml @@ -10,7 +10,7 @@ jobs: permissions: issues: write steps: - - uses: actions/github-script@v6 + - uses: actions/github-script@v7 with: script: | // each user has a chance of (p - (previousP ?? 0)) to be assigned diff --git a/.github/workflows/autoassign-prs.yml b/.github/workflows/autoassign-prs.yml index df5441a02f..f98c9f4f09 100644 --- a/.github/workflows/autoassign-prs.yml +++ b/.github/workflows/autoassign-prs.yml @@ -10,7 +10,7 @@ jobs: permissions: pull-requests: write steps: - - uses: actions/github-script@v6 + - uses: actions/github-script@v7 with: script: | const externalPrTriager = "kanej"; diff --git a/.github/workflows/cache.yml b/.github/workflows/cache.yml new file mode 100644 index 0000000000..3e70415997 --- /dev/null +++ b/.github/workflows/cache.yml @@ -0,0 +1,48 @@ +name: Cache + +on: + push: + branches: + - main + - pre-release-testing-branch + - changeset-release/main + - v-next + paths: + - ".github/workflows/cache.yml" + - "**/pnpm-lock.yaml" + pull_request: + paths: + - ".github/workflows/cache.yml" + - "**/pnpm-lock.yaml" + workflow_dispatch: + +concurrency: + group: ${{github.workflow}}-${{github.ref}} + cancel-in-progress: true + +defaults: + run: + shell: bash + +jobs: + cache: + name: Cache + runs-on: ${{ matrix.runner }} + strategy: + fail-fast: false + matrix: + runner: ["ubuntu-latest", "macos-latest", "windows-latest"] + steps: + - uses: actions/checkout@v4 + - id: env + uses: ./.github/actions/setup-env + with: + cache-save: true + - name: Install + if: steps.env.outputs.cache-hit != 'true' + run: | + for lockfile in $(find "$(pwd)" -name pnpm-lock.yaml); do + pushd "$(dirname "$lockfile")" + pnpm install --frozen-lockfile --prefer-offline + popd + done diff --git a/.github/workflows/check-changeset-added.yml b/.github/workflows/check-changeset-added.yml index 475fd48ec5..143e1adb39 100644 --- a/.github/workflows/check-changeset-added.yml +++ b/.github/workflows/check-changeset-added.yml @@ -21,7 +21,7 @@ jobs: # don't run this check in the changesets PR if: github.head_ref != 'changeset-release/main' steps: - - uses: actions/github-script@v6 + - uses: actions/github-script@v7 with: script: | const pullNumber = context.issue.number; diff --git a/.github/workflows/check-docs-site.yml b/.github/workflows/check-docs-site.yml index 3f4af679cb..696a24d439 100644 --- a/.github/workflows/check-docs-site.yml +++ b/.github/workflows/check-docs-site.yml @@ -3,7 +3,16 @@ name: Check Docs Site on: push: branches: - - "**" + - main + paths: + - ".github/workflows/check-docs-site.yml" + - "docs/**" + - "packages/**" + pull_request: + paths: + - ".github/workflows/check-docs-site.yml" + - "docs/**" + - "packages/**" workflow_dispatch: concurrency: @@ -11,23 +20,17 @@ concurrency: cancel-in-progress: true jobs: - lint: - name: Lint + build: + name: Build Docs runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" + - uses: ./.github/actions/setup-env - name: Install run: pnpm install --frozen-lockfile --prefer-offline - name: Install Docs - run: cd docs && pnpm install --frozen-lockfile --prefer-offline - - name: lint - run: cd docs && pnpm lint - - name: Build - run: cd docs && pnpm build + working-directory: docs/ + run: pnpm install --frozen-lockfile --prefer-offline + - name: Build Docs + working-directory: docs/ + run: pnpm build diff --git a/.github/workflows/close-stale-issues.yml b/.github/workflows/close-stale-issues.yml index 9d84321d06..1040604e94 100644 --- a/.github/workflows/close-stale-issues.yml +++ b/.github/workflows/close-stale-issues.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Close stale issues - uses: actions/stale@v8 + uses: actions/stale@v9 with: repo-token: ${{ secrets.GITHUB_TOKEN }} stale-issue-message: "This issue has been automatically closed due to inactivity. If you still need help, please reopen the issue and provide the requested information." diff --git a/.github/workflows/comment-on-linter-error.yml b/.github/workflows/comment-on-linter-error.yml deleted file mode 100644 index 79a8036e0d..0000000000 --- a/.github/workflows/comment-on-linter-error.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Comment on lint failure - -on: - pull_request_target: - types: - - opened - branches: - - $default-branch - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - comment_on_lint_failure: - name: Comment on lint failure - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v4 - with: - ref: "refs/pull/${{ github.event.number }}/merge" - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: lint - run: pnpm lint - - name: Check dependency versions - run: node scripts/check-dependencies.js - - name: Install website - working-directory: docs/ - run: pnpm install --frozen-lockfile --prefer-offline - - name: Lint website - working-directory: docs/ - run: pnpm lint - - uses: actions/github-script@v6 - name: Comment on failure - if: ${{ failure() }} - with: - script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: "Thanks for submitting this PR!\n\nUnfortunately, it has some linter errors, so we can't merge it yet. Can you please fix them?\n\nRunning pnpm lint:fix in the root of the repository may fix them automatically." - }) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 08f1e47d12..d45099b81a 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -3,10 +3,10 @@ name: E2E tests on: push: branches: - - "main" + - main pull_request: branches: - - "main" + - main jobs: run-e2e: @@ -29,12 +29,7 @@ jobs: IS_WINDOWS: ${{ matrix.os == 'windows-latest' }} steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 + - uses: ./.github/actions/setup-env - name: Run fixture-projects script run: | cd e2e diff --git a/.github/workflows/hardhat-chai-matchers-ci.yml b/.github/workflows/hardhat-chai-matchers-ci.yml deleted file mode 100644 index 8a8c3383e4..0000000000 --- a/.github/workflows/hardhat-chai-matchers-ci.yml +++ /dev/null @@ -1,92 +0,0 @@ -name: hardhat-chai-matchers CI - -on: - push: - branches: [$default-branch] - paths: - - "packages/hardhat-chai-matchers/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - "packages/hardhat-chai-matchers/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-chai-matchers - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-chai-matchers on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - env: - FORCE_COLOR: 3 - run: pnpm test:ci - - test_on_macos: - name: Test hardhat-chai-matchers on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - env: - FORCE_COLOR: 3 - run: pnpm test:ci - - test_on_linux: - name: Test hardhat-chai-matchers on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20, 22] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - env: - FORCE_COLOR: 3 - run: pnpm test:ci diff --git a/.github/workflows/hardhat-ci.yml b/.github/workflows/hardhat-ci.yml new file mode 100644 index 0000000000..c4cec0a8cf --- /dev/null +++ b/.github/workflows/hardhat-ci.yml @@ -0,0 +1,110 @@ +name: CI + +on: + push: + branches: main + paths: + - ".github/workflows/hardhat-ci.yml" + - "packages/**" + - "config/**" + - "pnpm-lock.yaml" + pull_request: + paths: + - ".github/workflows/hardhat-ci.yml" + - "packages/**" + - "config/**" + - "pnpm-lock.yaml" + workflow_dispatch: + +concurrency: + group: ${{github.workflow}}-${{github.ref}} + cancel-in-progress: true + +jobs: + list-packages: + name: List packages + runs-on: ubuntu-latest + outputs: + packages: ${{ steps.filter.outputs.changes }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 18 + - run: yq -p yaml -o json pnpm-lock.yaml | tee pnpm-lock.json + - id: generate + env: + PACKAGE_IGNORE: | + [ + ".", + "v-next/", + "packages/common", + "packages/eslint-plugin-hardhat-internal-rules", + "packages/eslint-plugin-slow-imports", + "packages/hardhat-core" + ] + COMMON_FILTERS: | + [ + ".github/workflows/hardhat-ci.yml", + "config/**", + "packages/common/**", + "pnpm-lock.yaml" + ] + run: | + echo "filters<> $GITHUB_OUTPUT + node scripts/generate-filters.js | + yq -Po yaml 'with_entries(.key |= sub("^packages/", ""))' | + tee -a $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + - id: filter + uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 + with: + filters: ${{ steps.generate.outputs.filters }} + + ci: + needs: list-packages + + if: needs.list-packages.outputs.packages != '[]' + + strategy: + fail-fast: false + matrix: + package: ${{ fromJson(needs.list-packages.outputs.packages) }} + os: [ubuntu-latest, macos-latest, windows-latest] + node: [18, 20, 22] + exclude: + - package: hardhat-vyper + os: windows-latest + - package: hardhat-vyper + os: macos-latest + - os: windows-latest + node: 20 + - os: macos-latest + node: 20 + - os: windows-latest + node: 22 + - os: macos-latest + node: 22 + + name: "[${{ matrix.package }}] ci on ${{ matrix.os }} (Node ${{ matrix.node }})" + runs-on: ${{ matrix.os }} + defaults: + run: + working-directory: packages/${{ matrix.package }} + + steps: + - uses: actions/checkout@v4 + - name: Install pnpm + uses: pnpm/action-setup@v3 + with: + version: 9 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + cache: "pnpm" + - name: Install dependencies + run: pnpm install --frozen-lockfile --prefer-offline + - name: Build + run: pnpm build + - name: Run tests + run: pnpm run ${{ matrix.package == 'hardhat-chai-matchers' && 'test:ci' || 'test' }} diff --git a/.github/workflows/hardhat-core-ci.yml b/.github/workflows/hardhat-core-ci.yml index a3394316b2..ec018487a7 100644 --- a/.github/workflows/hardhat-core-ci.yml +++ b/.github/workflows/hardhat-core-ci.yml @@ -12,8 +12,6 @@ on: - "packages/hardhat-core/**" - "packages/hardhat-common/**" pull_request: - branches: - - "**" paths: - ".github/workflows/hardhat-core-ci.yml" - "config/**" @@ -39,16 +37,11 @@ jobs: node: [18.15] os: ["macos-13", "ubuntu-latest", "windows-latest"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - name: Install Node - uses: actions/setup-node@v4 + - uses: ./.github/actions/setup-env with: node-version: ${{ matrix.node }} - cache: pnpm - name: Install package run: pnpm install --frozen-lockfile --prefer-offline @@ -81,22 +74,17 @@ jobs: node: [18.15] os: ["macos-13", "ubuntu-latest", "windows-latest"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - name: Install Node - uses: actions/setup-node@v4 + - uses: ./.github/actions/setup-env with: node-version: ${{ matrix.node }} - cache: pnpm - name: Install package run: pnpm install --frozen-lockfile --prefer-offline - name: Cache EDR RPC cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: | packages/hardhat-core/test/internal/hardhat-network/edr-cache @@ -123,13 +111,9 @@ jobs: node: [18, 20] steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 + - uses: ./.github/actions/setup-env with: node-version: ${{ matrix.node }} - cache: pnpm - name: Install run: pnpm install --frozen-lockfile --prefer-offline - name: Install @types/node diff --git a/.github/workflows/hardhat-ethers-ci.yml b/.github/workflows/hardhat-ethers-ci.yml deleted file mode 100644 index ed6bc1a7bb..0000000000 --- a/.github/workflows/hardhat-ethers-ci.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: hardhat-ethers CI - -on: - push: - branches: [$default-branch] - paths: - - "packages/hardhat-ethers/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - "packages/hardhat-ethers/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-ethers - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-ethers on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_macos: - name: Test hardhat-ethers on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_linux: - name: Test hardhat-ethers on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20, 22] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test diff --git a/.github/workflows/hardhat-foundry-ci.yml b/.github/workflows/hardhat-foundry-ci.yml deleted file mode 100644 index 7d5eb8c5c9..0000000000 --- a/.github/workflows/hardhat-foundry-ci.yml +++ /dev/null @@ -1,92 +0,0 @@ -name: hardhat-foundry CI - -on: - push: - branches: [$default-branch] - paths: - - "packages/hardhat-foundry/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - "packages/hardhat-foundry/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-foundry - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-foundry on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - env: - FORCE_COLOR: 3 - run: pnpm test - - test_on_macos: - name: Test hardhat-foundry on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - env: - FORCE_COLOR: 3 - run: pnpm test - - test_on_linux: - name: Test hardhat-foundry on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20, 22] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - env: - FORCE_COLOR: 3 - run: pnpm test diff --git a/.github/workflows/hardhat-ledger-ci.yml b/.github/workflows/hardhat-ledger-ci.yml deleted file mode 100644 index 095739e069..0000000000 --- a/.github/workflows/hardhat-ledger-ci.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: hardhat-ledger CI - -on: - push: - branches: - - main - paths: - - "packages/hardhat-ledger/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - "packages/hardhat-ledger/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-ledger - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-ledger on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_macos: - name: Test hardhat-ledger on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_linux: - name: Test hardhat-ledger on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20, 22] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test diff --git a/.github/workflows/hardhat-network-helpers-ci.yml b/.github/workflows/hardhat-network-helpers-ci.yml deleted file mode 100644 index cf565d7f56..0000000000 --- a/.github/workflows/hardhat-network-helpers-ci.yml +++ /dev/null @@ -1,94 +0,0 @@ -name: hardhat-network-helpers CI - -on: - push: - branches: [$default-branch] - paths: - - "packages/hardhat-core/**" - - "packages/hardhat-network-helpers/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - "packages/hardhat-core/**" - - "packages/hardhat-network-helpers/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-network-helpers - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-network-helpers on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - env: - FORCE_COLOR: 3 - run: pnpm test - - test_on_macos: - name: Test hardhat-network-helpers on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - env: - FORCE_COLOR: 3 - run: pnpm test - - test_on_linux: - name: Test hardhat-network-helpers on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20, 22] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - env: - FORCE_COLOR: 3 - run: pnpm test diff --git a/.github/workflows/hardhat-network-tracing-all-solc-versions.yml b/.github/workflows/hardhat-network-tracing-all-solc-versions.yml deleted file mode 100644 index 1dde30263f..0000000000 --- a/.github/workflows/hardhat-network-tracing-all-solc-versions.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Hardhat Network Tracing Capabilities, scheduled runs for all solc versions - -on: - schedule: - - cron: "0 0 * * *" # every day at midnight - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-core - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_tracing: - name: Test tracing capabilities on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20, 22] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Cache artifacts - uses: actions/cache@v2 - with: - path: | - packages/hardhat-core/test/internal/hardhat-network/stack-traces/test-files/artifacts - key: hardhat-network-stack-traces-tests-${{ hashFiles('pnpm-lock.yaml') }}-${{ hashFiles('packages/hardhat-core/test/internal/hardhat-network/stack-traces/test-files/**/*.sol') }}-${{ hashFiles('packages/hardhat-core/test/internal/hardhat-network/stack-traces/test-files/**/test.json') }}-${{ hashFiles('packages/hardhat-core/test/internal/hardhat-network/stack-traces/**/*.ts') }} - - name: Run tests - env: - DO_NOT_SET_THIS_ENV_VAR____IS_HARDHAT_CI: true - FORCE_COLOR: 3 - NODE_OPTIONS: "--max-old-space-size=4096" - HARDHAT_TESTS_ALL_SOLC_VERSIONS: true - run: pnpm test:tracing diff --git a/.github/workflows/hardhat-shorthand-ci.yml b/.github/workflows/hardhat-shorthand-ci.yml deleted file mode 100644 index 7801a82cbe..0000000000 --- a/.github/workflows/hardhat-shorthand-ci.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: hardhat-shorthand CI - -on: - push: - branches: [$default-branch] - paths: - - "packages/hardhat-shorthand/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - "packages/hardhat-shorthand/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-shorthand - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-shorthand on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_macos: - name: Test hardhat-shorthand on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_linux: - name: Test hardhat-shorthand on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20, 22] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test diff --git a/.github/workflows/hardhat-solhint-ci.yml b/.github/workflows/hardhat-solhint-ci.yml deleted file mode 100644 index ec06a1a480..0000000000 --- a/.github/workflows/hardhat-solhint-ci.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: hardhat-solhint CI - -on: - push: - branches: [$default-branch] - paths: - - "packages/hardhat-solhint/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - "packages/hardhat-solhint/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-solhint - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-solhint on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_macos: - name: Test hardhat-solhint on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_linux: - name: Test hardhat-solhint on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20, 22] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test diff --git a/.github/workflows/hardhat-solpp-ci.yml b/.github/workflows/hardhat-solpp-ci.yml deleted file mode 100644 index 2709a47215..0000000000 --- a/.github/workflows/hardhat-solpp-ci.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: hardhat-solpp CI - -on: - push: - branches: [$default-branch] - paths: - - "packages/hardhat-solpp/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - "packages/hardhat-solpp/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-solpp - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_macos: - name: Test hardhat-solpp on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_linux: - name: Test hardhat-solpp on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20, 22] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test diff --git a/.github/workflows/hardhat-toolbox-ci.yml b/.github/workflows/hardhat-toolbox-ci.yml deleted file mode 100644 index 83e9613128..0000000000 --- a/.github/workflows/hardhat-toolbox-ci.yml +++ /dev/null @@ -1,96 +0,0 @@ -name: hardhat-toolbox CI - -on: - push: - branches: [$default-branch] - paths: - - "packages/hardhat-toolbox/**" - - "packages/hardhat-core/**" - - "packages/hardhat-chai-matchers/**" - - "packages/hardhat-network-helpers/**" - - "packages/hardhat-ethers/**" - - "packages/hardhat-verify/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - "packages/hardhat-toolbox/**" - - "packages/hardhat-core/**" - - "packages/hardhat-chai-matchers/**" - - "packages/hardhat-network-helpers/**" - - "packages/hardhat-ethers/**" - - "packages/hardhat-verify/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-toolbox - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-toolbox on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_macos: - name: Test hardhat-toolbox on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_linux: - name: Test hardhat-toolbox on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20, 22] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test diff --git a/.github/workflows/hardhat-truffle4-ci.yml b/.github/workflows/hardhat-truffle4-ci.yml deleted file mode 100644 index f813ca4ccd..0000000000 --- a/.github/workflows/hardhat-truffle4-ci.yml +++ /dev/null @@ -1,90 +0,0 @@ -name: hardhat-truffle4 CI - -on: - push: - branches: [$default-branch] - paths: - - "packages/hardhat-truffle4/**" - - "packages/hardhat-web3-legacy/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - "packages/hardhat-truffle4/**" - - "packages/hardhat-web3-legacy/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-truffle4 - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-truffle4 on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_macos: - name: Test hardhat-truffle4 on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_linux: - name: Test hardhat-truffle4 on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20, 22] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test diff --git a/.github/workflows/hardhat-truffle5-ci.yml b/.github/workflows/hardhat-truffle5-ci.yml deleted file mode 100644 index 90cc0974ea..0000000000 --- a/.github/workflows/hardhat-truffle5-ci.yml +++ /dev/null @@ -1,90 +0,0 @@ -name: hardhat-truffle5 CI - -on: - push: - branches: [$default-branch] - paths: - - "packages/hardhat-truffle5/**" - - "packages/hardhat-web3/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - "packages/hardhat-truffle5/**" - - "packages/hardhat-web3/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-truffle5 - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-truffle5 on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_macos: - name: Test hardhat-truffle5 on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_linux: - name: Test hardhat-truffle5 on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20, 22] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test diff --git a/.github/workflows/hardhat-verify-ci.yml b/.github/workflows/hardhat-verify-ci.yml deleted file mode 100644 index e20471d196..0000000000 --- a/.github/workflows/hardhat-verify-ci.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: hardhat-verify CI - -on: - push: - branches: [$default-branch] - paths: - - "packages/hardhat-verify/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - "packages/hardhat-verify/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-verify - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-verify on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_macos: - name: Test hardhat-verify on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_linux: - name: Test hardhat-verify on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20, 22] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test diff --git a/.github/workflows/hardhat-viem-ci.yml b/.github/workflows/hardhat-viem-ci.yml deleted file mode 100644 index 8ec4a4083a..0000000000 --- a/.github/workflows/hardhat-viem-ci.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: hardhat-viem CI - -on: - push: - branches: main - paths: - - "packages/hardhat-viem/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - "packages/hardhat-viem/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-viem - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-viem on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_macos: - name: Test hardhat-viem on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_linux: - name: Test hardhat-viem on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20, 22] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test diff --git a/.github/workflows/hardhat-vyper-ci.yml b/.github/workflows/hardhat-vyper-ci.yml deleted file mode 100644 index 1c4f5d3f2b..0000000000 --- a/.github/workflows/hardhat-vyper-ci.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: hardhat-vyper CI - -on: - push: - branches: [$default-branch] - paths: - - "packages/hardhat-vyper/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - "packages/hardhat-vyper/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-vyper - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_linux: - name: Test hardhat-vyper on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20, 22] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test diff --git a/.github/workflows/hardhat-web3-ci.yml b/.github/workflows/hardhat-web3-ci.yml deleted file mode 100644 index afc7e4e024..0000000000 --- a/.github/workflows/hardhat-web3-ci.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: hardhat-web3 CI - -on: - push: - branches: [$default-branch] - paths: - - "packages/hardhat-web3/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - "packages/hardhat-web3/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-web3 - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-web3 on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_macos: - name: Test hardhat-web3 on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_linux: - name: Test hardhat-web3 on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20, 22] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test diff --git a/.github/workflows/hardhat-web3-legacy-ci.yml b/.github/workflows/hardhat-web3-legacy-ci.yml deleted file mode 100644 index 18e7e54903..0000000000 --- a/.github/workflows/hardhat-web3-legacy-ci.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: hardhat-web3-legacy CI - -on: - push: - branches: [$default-branch] - paths: - - "packages/hardhat-web3-legacy/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**/*" - - "config/**" - pull_request: - branches: - - "**" - paths: - - "packages/hardhat-web3-legacy/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-web3-legacy - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-web3-legacy on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_macos: - name: Test hardhat-web3-legacy on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_linux: - name: Test hardhat-web3-legacy on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20, 22] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test diff --git a/.github/workflows/hardhat-web3-v4-ci.yml b/.github/workflows/hardhat-web3-v4-ci.yml deleted file mode 100644 index 746413aa6e..0000000000 --- a/.github/workflows/hardhat-web3-v4-ci.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: hardhat-web3-v4 CI - -on: - push: - branches: [$default-branch] - paths: - - "packages/hardhat-web3-v4/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - "packages/hardhat-web3-v4/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-web3-v4 - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-web3-v4 on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: pnpm - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_macos: - name: Test hardhat-web3-v4 on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: pnpm - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_linux: - name: Test hardhat-web3-v4 on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20, 22] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: pnpm - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 760e0495f0..f55ec6d638 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -2,10 +2,17 @@ name: Lint on: push: - branches: [$default-branch] - pull_request: branches: - - "**" + - main + paths: + - ".github/workflows/lint.yml" + - "docs/**" + - "packages/**" + pull_request: + paths: + - ".github/workflows/lint.yml" + - "docs/**" + - "packages/**" workflow_dispatch: concurrency: @@ -16,18 +23,25 @@ jobs: lint: name: Lint runs-on: ubuntu-latest + permissions: + contents: read steps: + # NOTE: When running on a pull_request_target, we're checking out the repo + # twice. The first checkout is for the base branch of the PR. The second, + # for the merge commit. We do this to be able to use the `setup-env` + # action that's on the base branch. - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 with: - version: 9 - - uses: actions/setup-node@v4 + persist-credentials: false + - uses: actions/checkout@v4 + if: github.event_name == 'pull_request_target' with: - node-version: 18 - cache: "pnpm" - cache-dependency-path: | - pnpm-lock.yaml - docs/pnpm-lock.yaml + ref: "refs/pull/${{ github.event.number }}/merge" + persist-credentials: false + - if: github.event_name == 'pull_request_target' + name: Check out setup-env action from the base branch + run: git checkout --no-overlay $GITHUB_SHA -- .github/actions/setup-env + - uses: ./.github/actions/setup-env - name: Install run: pnpm install --frozen-lockfile --prefer-offline - name: Build @@ -42,3 +56,21 @@ jobs: - name: Lint website working-directory: docs/ run: pnpm lint + comment: + needs: [lint] + if: failure() && github.event_name == 'pull_request_target' && needs.lint.result == 'failure' + name: Comment + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - uses: actions/github-script@v7 + name: Comment on failure + with: + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: "Thanks for submitting this PR!\n\nUnfortunately, it has some linter errors, so we can't merge it yet. Can you please fix them?\n\nRunning pnpm lint:fix in the root of the repository may fix them automatically." + }) diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 113315dfc2..1b90eae439 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -16,7 +16,8 @@ jobs: action: runs-on: ubuntu-latest steps: - - uses: dessant/lock-threads@e460dfeb36e731f3aeb214be6b0c9a9d9a67eda6 + - uses: dessant/lock-threads@1bf7ec25051fe7c00bdd17e6a7cf3d7bfb7dc771 # v5.0.1 with: issue-inactive-days: "90" pr-inactive-days: "90" + process-only: "issues, prs" diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 1db35d8a33..345d54c747 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -17,13 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" + - uses: ./.github/actions/setup-env - name: Install run: pnpm install --frozen-lockfile --prefer-offline - name: Build @@ -31,7 +25,7 @@ jobs: - name: lint run: pnpm lint - name: Cache artifacts - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: | packages/hardhat-core/test/internal/hardhat-network/stack-traces/test-files/artifacts @@ -52,17 +46,11 @@ jobs: working-directory: packages/hardhat-core steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" + - uses: ./.github/actions/setup-env - name: Install run: pnpm install --frozen-lockfile --prefer-offline - name: Cache network requests - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: | packages/hardhat-core/test/internal/hardhat-network/provider/.hardhat_node_test_cache diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8d49ad9b64..afc3d2560e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,16 +19,7 @@ jobs: # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits fetch-depth: 0 - - name: Setup pnpm - uses: pnpm/action-setup@v4 - with: - version: 9 - - - name: Setup Node.js 18.x - uses: actions/setup-node@v4 - with: - node-version: 18.x - cache: "pnpm" + - uses: ./.github/actions/setup-env - name: Install Dependencies run: pnpm install --frozen-lockfile --prefer-offline diff --git a/.github/workflows/review-approved-slack-notification.yml b/.github/workflows/review-approved-slack-notification.yml deleted file mode 100644 index 71bbd3352b..0000000000 --- a/.github/workflows/review-approved-slack-notification.yml +++ /dev/null @@ -1,8 +0,0 @@ -name: PR reviewed Slack notification -on: - pull_request_review: - types: [submitted] -jobs: - reviewed: - uses: NomicFoundation/github-actions-workflows/.github/workflows/review-submitted-slack-notification.yml@main - secrets: inherit diff --git a/.github/workflows/review-requested-slack-notification.yml b/.github/workflows/review-requested-slack-notification.yml deleted file mode 100644 index 0734a8e907..0000000000 --- a/.github/workflows/review-requested-slack-notification.yml +++ /dev/null @@ -1,8 +0,0 @@ -name: PR review requested Slack notification -on: - pull_request_target: - types: [review_requested] -jobs: - requested: - uses: NomicFoundation/github-actions-workflows/.github/workflows/review-requested-slack-notification.yml@main - secrets: inherit diff --git a/.github/workflows/test-slow-imports-rule.yml b/.github/workflows/test-slow-imports-rule.yml index 6f6d2a3847..6846e721a0 100644 --- a/.github/workflows/test-slow-imports-rule.yml +++ b/.github/workflows/test-slow-imports-rule.yml @@ -22,13 +22,7 @@ jobs: runs-on: "ubuntu-latest" steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" + - uses: ./.github/actions/setup-env - name: Install run: pnpm install --frozen-lockfile --prefer-offline - name: Add slow import diff --git a/.gitignore b/.gitignore index 797af0ccc7..90d8e1e986 100644 --- a/.gitignore +++ b/.gitignore @@ -100,3 +100,6 @@ Brewfile.lock.json # Performance profiling application .clinic + +# Input to scripts/generate-filters.js; generated in CI +pnpm-lock.json diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e27b7da2fa..a0827f65db 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -119,8 +119,8 @@ Unlike linking, if you make a change in the code, you'll need to repeat the proc An even more realistic way of using your local changes in a project is to use [`pnpm pack`](https://pnpm.io/cli/pack): -1. Go to `packages/hardhat-core` and run `pnpm pack`. This will create a `nomiclabs-hardhat-x.y.z.tgz` file in that directory. -2. Go to some hardhat project and run `npm install /path/to/hardhat/packages/hardhat/nomiclabs-hardhat-x.y.z.tgz`. +1. Go to `packages/hardhat-core` and run `pnpm pack`. This will create a `hardhat-x.y.z.tgz` file in that directory. +2. Go to some hardhat project and run `npm install /path/to/hardhat/packages/hardhat-core/hardhat-x.y.z.tgz`. Unlike linking, if you make a change in the code, you'll need to repeat the process. diff --git a/docs/src/content/hardhat-runner/docs/advanced/artifacts.md b/docs/src/content/hardhat-runner/docs/advanced/artifacts.md index 4a2c84b991..69152accb9 100644 --- a/docs/src/content/hardhat-runner/docs/advanced/artifacts.md +++ b/docs/src/content/hardhat-runner/docs/advanced/artifacts.md @@ -55,8 +55,8 @@ artifacts    │   ├── Bar.json    │   └── Bar.dbg.json    └── Qux.sol -    ├── Foo.json -    └── Foo.dbg.json +    ├── Qux.json +    └── Qux.dbg.json ``` Each Solidity file in your source will get a directory in the artifacts structure. Each of these directories contains one artifact (`.json`) file and one debug (`.dbg.json`) file for each _contract_ in that file. `Foo.sol`, for example, contains two contracts inside. diff --git a/packages/hardhat-core/CHANGELOG.md b/packages/hardhat-core/CHANGELOG.md index 8c6d015169..b4f9f9a958 100644 --- a/packages/hardhat-core/CHANGELOG.md +++ b/packages/hardhat-core/CHANGELOG.md @@ -1,5 +1,27 @@ # hardhat +## 2.22.9 + +### Patch Changes + +- 6771f00: Do not send `http_setLedgerOutputEnabled` messages beyond the HTTP Provider to prevent unwanted warnings in the logs of the local hardhat node + +## 2.22.8 + +### Patch Changes + +- f5d5d15: Fixed an issue with `debug_traceTransaction` when large responses were generated +- 31d9d77: Upgraded EDR to v0.5.2 + +## 2.22.7 + +### Patch Changes + +- f944cd5: Added an `enableRip7212` optional flag to the Hardhat Network config that enables [RIP-7212 (Precompile for secp256r1 Curve Support)](https://github.com/ethereum/RIPs/blob/master/RIPS/rip-7212.md). +- f6ddc92: Add `debug` logs to Hardhat Network initialization process. +- 6c943bb: Fix message for error HH206 +- f944cd5: Bumped EDR to [v0.5.0](https://github.com/NomicFoundation/edr/releases/tag/%40nomicfoundation%2Fedr%400.5.0). + ## 2.22.6 ### Patch Changes diff --git a/packages/hardhat-core/package.json b/packages/hardhat-core/package.json index 92fabe7c15..4dbd5a9d15 100644 --- a/packages/hardhat-core/package.json +++ b/packages/hardhat-core/package.json @@ -1,6 +1,6 @@ { "name": "hardhat", - "version": "2.22.6", + "version": "2.22.9", "author": "Nomic Labs LLC", "license": "MIT", "homepage": "https://hardhat.org", @@ -102,7 +102,7 @@ "dependencies": { "@ethersproject/abi": "^5.1.2", "@metamask/eth-sig-util": "^4.0.0", - "@nomicfoundation/edr": "^0.5.0", + "@nomicfoundation/edr": "^0.5.2", "@nomicfoundation/ethereumjs-common": "4.0.4", "@nomicfoundation/ethereumjs-tx": "5.0.4", "@nomicfoundation/ethereumjs-util": "9.0.4", diff --git a/packages/hardhat-core/src/internal/cli/cli.ts b/packages/hardhat-core/src/internal/cli/cli.ts index 967c5dc857..f31f1c8aec 100755 --- a/packages/hardhat-core/src/internal/cli/cli.ts +++ b/packages/hardhat-core/src/internal/cli/cli.ts @@ -234,7 +234,6 @@ async function main() { taskDefinitions, scopesDefinitions, envExtenders, - ctx.experimentalHardhatNetworkMessageTraceHooks, userConfig, providerExtenders ); diff --git a/packages/hardhat-core/src/internal/context.ts b/packages/hardhat-core/src/internal/context.ts index c144662acd..983c41d6b5 100644 --- a/packages/hardhat-core/src/internal/context.ts +++ b/packages/hardhat-core/src/internal/context.ts @@ -1,7 +1,6 @@ import { ConfigExtender, EnvironmentExtender, - ExperimentalHardhatNetworkMessageTraceHook, HardhatRuntimeEnvironment, ProviderExtender, } from "../types"; @@ -60,10 +59,6 @@ export class HardhatContext { public readonly configExtenders: ConfigExtender[] = []; - // NOTE: This is experimental and will be removed. Please contact our team if - // you are planning to use it. - public readonly experimentalHardhatNetworkMessageTraceHooks: ExperimentalHardhatNetworkMessageTraceHook[] = - []; private _filesLoadedBeforeConfig?: string[]; private _filesLoadedAfterConfig?: string[]; diff --git a/packages/hardhat-core/src/internal/core/config/config-env.ts b/packages/hardhat-core/src/internal/core/config/config-env.ts index 9db4535ff4..585bf41ad9 100644 --- a/packages/hardhat-core/src/internal/core/config/config-env.ts +++ b/packages/hardhat-core/src/internal/core/config/config-env.ts @@ -4,7 +4,6 @@ import { ConfigurableScopeDefinition, ConfigurableTaskDefinition, EnvironmentExtender, - ExperimentalHardhatNetworkMessageTraceHook, ProviderExtender, TaskArguments, } from "../../../types"; @@ -167,15 +166,6 @@ export function extendProvider(extender: ProviderExtender) { ctx.providerExtenders.push(extender); } -// NOTE: This is experimental and will be removed. Please contact our team -// if you are planning to use it. -export function experimentalAddHardhatNetworkMessageTraceHook( - hook: ExperimentalHardhatNetworkMessageTraceHook -) { - const ctx = HardhatContext.getHardhatContext(); - ctx.experimentalHardhatNetworkMessageTraceHooks.push(hook); -} - /** * This object provides methods to interact with the configuration variables. */ diff --git a/packages/hardhat-core/src/internal/core/errors-list.ts b/packages/hardhat-core/src/internal/core/errors-list.ts index 45f5195087..2deacda8a7 100644 --- a/packages/hardhat-core/src/internal/core/errors-list.ts +++ b/packages/hardhat-core/src/internal/core/errors-list.ts @@ -552,7 +552,7 @@ Please use \`runSuper.isDefined\` to make sure that you can call it.`, DEFAULT_VALUE_WRONG_TYPE: { number: 206, message: - "Default value for param %paramName% of task %taskName% doesn't match the default one, try specifying it.", + "Default value for param %paramName% of task %taskName% doesn't match its expected type.", title: "Default value has incorrect type", description: `One of your tasks has a parameter whose default value doesn't match the expected type. diff --git a/packages/hardhat-core/src/internal/core/providers/construction.ts b/packages/hardhat-core/src/internal/core/providers/construction.ts index 59ac2c3439..f64d787a95 100644 --- a/packages/hardhat-core/src/internal/core/providers/construction.ts +++ b/packages/hardhat-core/src/internal/core/providers/construction.ts @@ -1,6 +1,5 @@ import type { Artifacts, - BoundExperimentalHardhatNetworkMessageTraceHook, EIP1193Provider, EthereumProvider, HardhatConfig, @@ -50,7 +49,6 @@ export async function createProvider( config: HardhatConfig, networkName: string, artifacts?: Artifacts, - experimentalHardhatNetworkMessageTraceHooks: BoundExperimentalHardhatNetworkMessageTraceHook[] = [], extenders: ProviderExtender[] = [] ): Promise { let eip1193Provider: EIP1193Provider; @@ -108,7 +106,6 @@ export async function createProvider( hardhatNetConfig.initialDate !== undefined ? parseDateString(hardhatNetConfig.initialDate) : undefined, - experimentalHardhatNetworkMessageTraceHooks, forkConfig, forkCachePath: paths !== undefined ? getForkCacheDirPath(paths) : undefined, diff --git a/packages/hardhat-core/src/internal/core/providers/http.ts b/packages/hardhat-core/src/internal/core/providers/http.ts index 09add550c5..10cc8e0901 100644 --- a/packages/hardhat-core/src/internal/core/providers/http.ts +++ b/packages/hardhat-core/src/internal/core/providers/http.ts @@ -86,6 +86,17 @@ export class HttpProvider extends EventEmitter implements EIP1193Provider { } public async request(args: RequestArguments): Promise { + // This is a temporary fix to an issue with noisy warnings in the logs + // of a local node (#5406). This will be fixed in the next major release. + if (args.method === "hardhat_setLedgerOutputEnabled") { + const error = new ProviderError( + "hardhat_setLedgerOutputEnabled - Method not supported", + -32004 + ); + // eslint-disable-next-line @nomicfoundation/hardhat-internal-rules/only-hardhat-error + throw error; + } + const jsonRpcRequest = this._getJsonRpcRequest( args.method, args.params as any[] diff --git a/packages/hardhat-core/src/internal/core/runtime-environment.ts b/packages/hardhat-core/src/internal/core/runtime-environment.ts index 8266ac7260..3d4979e1d1 100644 --- a/packages/hardhat-core/src/internal/core/runtime-environment.ts +++ b/packages/hardhat-core/src/internal/core/runtime-environment.ts @@ -1,11 +1,8 @@ -import type { MessageTrace } from "../hardhat-network/stack-traces/message-trace"; - import debug from "debug"; import { Artifacts as IArtifacts, EnvironmentExtender, - ExperimentalHardhatNetworkMessageTraceHook, HardhatArguments, HardhatConfig, HardhatRuntimeEnvironment, @@ -78,7 +75,6 @@ export class Environment implements HardhatRuntimeEnvironment { public readonly tasks: TasksMap, public readonly scopes: ScopesMap, environmentExtenders: EnvironmentExtender[] = [], - experimentalHardhatNetworkMessageTraceHooks: ExperimentalHardhatNetworkMessageTraceHook[] = [], public readonly userConfig: HardhatUserConfig = {}, providerExtenders: ProviderExtender[] = [] ) { @@ -105,10 +101,6 @@ export class Environment implements HardhatRuntimeEnvironment { config, networkName, this.artifacts, - experimentalHardhatNetworkMessageTraceHooks.map( - (hook) => (trace: MessageTrace, isCallMessageTrace: boolean) => - hook(this, trace, isCallMessageTrace) - ), providerExtenders ); }); diff --git a/packages/hardhat-core/src/internal/hardhat-network/provider/provider.ts b/packages/hardhat-core/src/internal/hardhat-network/provider/provider.ts index bbd5dc1a91..a175467c05 100644 --- a/packages/hardhat-core/src/internal/hardhat-network/provider/provider.ts +++ b/packages/hardhat-core/src/internal/hardhat-network/provider/provider.ts @@ -1,6 +1,5 @@ import type { Artifacts, - BoundExperimentalHardhatNetworkMessageTraceHook, CompilerInput, CompilerOutput, EIP1193Provider, @@ -118,7 +117,6 @@ interface HardhatNetworkProviderConfig { initialBaseFeePerGas?: number; initialDate?: Date; coinbase?: string; - experimentalHardhatNetworkMessageTraceHooks?: BoundExperimentalHardhatNetworkMessageTraceHook[]; forkConfig?: ForkConfig; forkCachePath?: string; enableTransientStorage: boolean; @@ -356,7 +354,13 @@ export class EdrProviderWrapper const responseObject: Response = await this._provider.handleRequest( stringifiedArgs ); - const response = JSON.parse(responseObject.json); + + let response; + if (typeof responseObject.data === "string") { + response = JSON.parse(responseObject.data); + } else { + response = responseObject.data; + } const needsTraces = this._node._vm.evm.events.eventNames().length > 0 || @@ -613,7 +617,7 @@ export async function createHardhatNetworkProvider( log("Making tracing config"); const tracingConfig = await makeTracingConfig(artifacts); log("Creating EDR provider"); - const provider = EdrProviderWrapper.create( + const provider = await EdrProviderWrapper.create( hardhatNetworkProviderConfig, loggerConfig, tracingConfig diff --git a/packages/hardhat-core/src/internal/hardhat-network/provider/vm/minimal-vm.ts b/packages/hardhat-core/src/internal/hardhat-network/provider/vm/minimal-vm.ts index bf75d7d30a..f80fa55d61 100644 --- a/packages/hardhat-core/src/internal/hardhat-network/provider/vm/minimal-vm.ts +++ b/packages/hardhat-core/src/internal/hardhat-network/provider/vm/minimal-vm.ts @@ -82,7 +82,12 @@ export function getMinimalEthereumJsVm( }) ); - const response = JSON.parse(responseObject.json); + let response; + if (typeof responseObject.data === "string") { + response = JSON.parse(responseObject.data); + } else { + response = responseObject.data; + } return Buffer.from(response.result.slice(2), "hex"); }, diff --git a/packages/hardhat-core/src/internal/lib/hardhat-lib.ts b/packages/hardhat-core/src/internal/lib/hardhat-lib.ts index d0dc6c4488..4ac144e060 100644 --- a/packages/hardhat-core/src/internal/lib/hardhat-lib.ts +++ b/packages/hardhat-core/src/internal/lib/hardhat-lib.ts @@ -42,7 +42,6 @@ if (HardhatContext.isCreated()) { ctx.tasksDSL.getTaskDefinitions(), ctx.tasksDSL.getScopesDefinitions(), ctx.environmentExtenders, - ctx.experimentalHardhatNetworkMessageTraceHooks, userConfig, ctx.providerExtenders ); diff --git a/packages/hardhat-core/src/register.ts b/packages/hardhat-core/src/register.ts index 7ef908a321..37cc7159b9 100644 --- a/packages/hardhat-core/src/register.ts +++ b/packages/hardhat-core/src/register.ts @@ -44,7 +44,6 @@ if (!HardhatContext.isCreated()) { ctx.tasksDSL.getTaskDefinitions(), ctx.tasksDSL.getScopesDefinitions(), ctx.environmentExtenders, - ctx.experimentalHardhatNetworkMessageTraceHooks, userConfig, ctx.providerExtenders ); diff --git a/packages/hardhat-core/src/types/experimental.ts b/packages/hardhat-core/src/types/experimental.ts deleted file mode 100644 index 1c51706924..0000000000 --- a/packages/hardhat-core/src/types/experimental.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { MessageTrace } from "../internal/hardhat-network/stack-traces/message-trace"; - -import { HardhatRuntimeEnvironment } from "./runtime"; - -// NOTE: This is experimental and will be removed. Please contact our team -// if you are planning to use it. -export type ExperimentalHardhatNetworkMessageTraceHook = ( - hre: HardhatRuntimeEnvironment, - trace: MessageTrace, - isMessageTraceFromACall: boolean -) => Promise; - -// NOTE: This is experimental and will be removed. Please contact our team -// if you are planning to use it. -export type BoundExperimentalHardhatNetworkMessageTraceHook = ( - trace: MessageTrace, - isMessageTraceFromACall: boolean -) => Promise; diff --git a/packages/hardhat-core/src/types/index.ts b/packages/hardhat-core/src/types/index.ts index 3f7d1f4f2a..47a3ab37c7 100644 --- a/packages/hardhat-core/src/types/index.ts +++ b/packages/hardhat-core/src/types/index.ts @@ -1,5 +1,4 @@ export * from "./config"; -export * from "./experimental"; export * from "./provider"; export * from "./runtime"; export * from "./artifacts"; diff --git a/packages/hardhat-core/test/internal/core/providers/construction.ts b/packages/hardhat-core/test/internal/core/providers/construction.ts index b49311af36..510d1c01ef 100644 --- a/packages/hardhat-core/test/internal/core/providers/construction.ts +++ b/packages/hardhat-core/test/internal/core/providers/construction.ts @@ -8,10 +8,7 @@ import { import { ERRORS } from "../../../../src/internal/core/errors-list"; import { numberToRpcQuantity } from "../../../../src/internal/core/jsonrpc/types/base-types"; import { BackwardsCompatibilityProviderAdapter } from "../../../../src/internal/core/providers/backwards-compatibility"; -import { - BoundExperimentalHardhatNetworkMessageTraceHook, - HardhatConfig, -} from "../../../../src/types"; +import { HardhatConfig } from "../../../../src/types"; import { applyProviderWrappers, createProvider, @@ -46,7 +43,6 @@ describe("Base provider creation", () => { it("Should extend the base provider by calling each supplied extender", async () => { const artifacts = undefined; - const hooks: BoundExperimentalHardhatNetworkMessageTraceHook[] = []; const identity = (obj: any) => obj; const extenders = [sinon.spy(identity), sinon.spy(identity)]; @@ -60,13 +56,7 @@ describe("Base provider creation", () => { }, paths: undefined, } as unknown as HardhatConfig; - const provider = await createProvider( - config, - "net", - artifacts, - hooks, - extenders - ); + const provider = await createProvider(config, "net", artifacts, extenders); assert.instanceOf(provider, BackwardsCompatibilityProviderAdapter); for (const extender of extenders) { diff --git a/packages/hardhat-core/test/internal/core/providers/http.ts b/packages/hardhat-core/test/internal/core/providers/http.ts index 11d2f156d4..2c92844672 100644 --- a/packages/hardhat-core/test/internal/core/providers/http.ts +++ b/packages/hardhat-core/test/internal/core/providers/http.ts @@ -1,10 +1,11 @@ -import { assert } from "chai"; +import { assert, expect } from "chai"; import { MockAgent, MockPool } from "undici"; import { HttpProvider } from "../../../../src/internal/core/providers/http"; import { ERRORS } from "../../../../src/internal/core/errors-list"; import { SuccessfulJsonRpcResponse } from "../../../../src/internal/util/jsonrpc"; import { expectHardhatError } from "../../../helpers/errors"; +import { ProviderError } from "../../../../src/internal/core/providers/errors"; const TOO_MANY_REQUEST_STATUS = 429; @@ -93,5 +94,19 @@ describe("HttpProvider", function () { assert.equal(result, successResponse.result); assert(tooManyRequestsReturned); }); + + it("should throw an error if it receives hardhat_setLedgerOutputEnabled as a method", async function () { + const mockPool = makeMockPool(url); + mockPool + .intercept({ method: "POST", path: "/" }) + .reply(200, successResponse); + const provider = new HttpProvider(url, networkName, {}, 20000, mockPool); + await expect( + provider.request({ method: "hardhat_setLedgerOutputEnabled" }) + ).to.be.eventually.rejectedWith( + ProviderError, + "hardhat_setLedgerOutputEnabled - Method not supported" + ); + }); }); }); diff --git a/packages/hardhat-ethers/CHANGELOG.md b/packages/hardhat-ethers/CHANGELOG.md index 41ff718ced..fcf67a69f2 100644 --- a/packages/hardhat-ethers/CHANGELOG.md +++ b/packages/hardhat-ethers/CHANGELOG.md @@ -1,5 +1,11 @@ # @nomiclabs/hardhat-ethers +## 3.0.7 + +### Patch Changes + +- 93b30d5: Fix for `getSigners` against networks where `eth_accounts` is deprecated. + ## 3.0.6 ### Patch Changes diff --git a/packages/hardhat-ethers/package.json b/packages/hardhat-ethers/package.json index ea34428d36..017e5b3ba7 100644 --- a/packages/hardhat-ethers/package.json +++ b/packages/hardhat-ethers/package.json @@ -1,6 +1,6 @@ { "name": "@nomicfoundation/hardhat-ethers", - "version": "3.0.6", + "version": "3.0.7", "description": "Hardhat plugin for ethers", "homepage": "https://github.com/nomicfoundation/hardhat/tree/main/packages/hardhat-ethers", "repository": "github:nomicfoundation/hardhat", diff --git a/packages/hardhat-ethers/src/internal/helpers.ts b/packages/hardhat-ethers/src/internal/helpers.ts index bd3bc89ff2..3710b05b73 100644 --- a/packages/hardhat-ethers/src/internal/helpers.ts +++ b/packages/hardhat-ethers/src/internal/helpers.ts @@ -40,7 +40,20 @@ function isArtifact(artifact: any): artifact is Artifact { export async function getSigners( hre: HardhatRuntimeEnvironment ): Promise { - const accounts: string[] = await hre.ethers.provider.send("eth_accounts", []); + let accounts: string[]; + + try { + accounts = await hre.ethers.provider.send("eth_accounts", []); + } catch (error) { + if ( + error instanceof Error && + /the method has been deprecated: eth_accounts/.test(error.message) + ) { + return []; + } + + throw error; + } const signersWithAddress = await Promise.all( accounts.map((account) => getSigner(hre, account)) diff --git a/packages/hardhat-ethers/test/index.ts b/packages/hardhat-ethers/test/index.ts index 46afc46c1a..e66915735f 100644 --- a/packages/hardhat-ethers/test/index.ts +++ b/packages/hardhat-ethers/test/index.ts @@ -73,6 +73,25 @@ describe("Ethers plugin", function () { "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" ); }); + + it("should return an empty array of signers if `eth_accounts` is deprecated", async function () { + const originalSend = this.env.ethers.provider.send; + + this.env.ethers.provider.send = async function ( + method: string, + params: any + ) { + if (method === "eth_accounts") { + throw new Error("the method has been deprecated: eth_accounts"); + } + + return originalSend.call(this, method, params); + }; + + const sigs = await this.env.ethers.getSigners(); + + assert.deepStrictEqual(sigs, []); + }); }); describe("getImpersonatedSigner", function () { diff --git a/packages/hardhat-solhint/CHANGELOG.md b/packages/hardhat-solhint/CHANGELOG.md index ba6db27189..dad2228dc3 100644 --- a/packages/hardhat-solhint/CHANGELOG.md +++ b/packages/hardhat-solhint/CHANGELOG.md @@ -1,5 +1,12 @@ # @nomiclabs/hardhat-solhint +## 4.0.0 + +### Major Changes + +- cc79bd7: Ensured the check task exits with exit code 1 when solhint raises any errors; this is a breaking change since the check task would previously always exit with exit code 0 +- 9cae5e7: Updated solhint dependency to [v5.0.2](https://github.com/protofire/solhint/releases/tag/v5.0.2) + ## 3.1.0 ### Minor Changes diff --git a/packages/hardhat-solhint/package.json b/packages/hardhat-solhint/package.json index 22779b859e..9085ba6fbf 100644 --- a/packages/hardhat-solhint/package.json +++ b/packages/hardhat-solhint/package.json @@ -1,6 +1,6 @@ { "name": "@nomiclabs/hardhat-solhint", - "version": "3.1.0", + "version": "4.0.0", "description": "Hardhat plugin for solhint", "repository": "github:nomiclabs/hardhat", "homepage": "https://github.com/nomiclabs/hardhat/tree/main/packages/hardhat-solhint", @@ -35,7 +35,7 @@ "README.md" ], "dependencies": { - "solhint": "^3.4.0" + "solhint": "^5.0.2" }, "devDependencies": { "@nomicfoundation/eslint-plugin-hardhat-internal-rules": "workspace:^", diff --git a/packages/hardhat-solhint/src/index.ts b/packages/hardhat-solhint/src/index.ts index 8d730ecaf8..5b5c6a514e 100644 --- a/packages/hardhat-solhint/src/index.ts +++ b/packages/hardhat-solhint/src/index.ts @@ -127,4 +127,16 @@ task("check", async (_, { run }, runSuper) => { const reports = await run("hardhat-solhint:run-solhint"); printReport(reports); + + const errorsCount = reports.reduce( + (acc: number, i: { errorCount: number }) => { + return acc + i.errorCount; + }, + 0 + ); + + if (errorsCount > 0) { + process.exitCode = 1; + return; + } }); diff --git a/packages/hardhat-solhint/test/fixture-projects/no-errors-project/.solhint.json b/packages/hardhat-solhint/test/fixture-projects/no-errors-project/.solhint.json new file mode 100644 index 0000000000..3b8ee84ad4 --- /dev/null +++ b/packages/hardhat-solhint/test/fixture-projects/no-errors-project/.solhint.json @@ -0,0 +1,3 @@ +{ + "extends": "solhint:all" +} diff --git a/packages/hardhat-solhint/test/fixture-projects/no-errors-project/contracts/Greeter.sol b/packages/hardhat-solhint/test/fixture-projects/no-errors-project/contracts/Greeter.sol new file mode 100644 index 0000000000..6ea1753d90 --- /dev/null +++ b/packages/hardhat-solhint/test/fixture-projects/no-errors-project/contracts/Greeter.sol @@ -0,0 +1,15 @@ +pragma solidity ^0.8.0; + + +contract Greeter { + + string greeting; + constructor(string memory _greeting) public { + greeting = _greeting; + } + + function greet() public view returns (string memory) { + return greeting; + } + +} diff --git a/packages/hardhat-solhint/test/fixture-projects/no-errors-project/hardhat.config.js b/packages/hardhat-solhint/test/fixture-projects/no-errors-project/hardhat.config.js new file mode 100644 index 0000000000..d851e726c8 --- /dev/null +++ b/packages/hardhat-solhint/test/fixture-projects/no-errors-project/hardhat.config.js @@ -0,0 +1,5 @@ +require("../../../src/index"); + +module.exports = { + solidity: "0.5.15", +}; diff --git a/packages/hardhat-solhint/test/tests.ts b/packages/hardhat-solhint/test/tests.ts index 1bbd7e499e..9247b33774 100644 --- a/packages/hardhat-solhint/test/tests.ts +++ b/packages/hardhat-solhint/test/tests.ts @@ -36,11 +36,24 @@ describe("Solhint plugin", function () { ); }); - it("should run the check task without throwing an error", async function () { + it("should run the check task and set the exit code to 1", async function () { const consoleLogStub = sinon.stub(console, "log"); await this.env.run("check"); assert.isTrue(consoleLogStub.calledOnce); + assert.strictEqual(process.exitCode, 1); consoleLogStub.restore(); + process.exitCode = undefined; + }); + }); + + describe("Project with no errors", function () { + useEnvironment("no-errors-project"); + + it("should run the check task and not set the exit code", async function () { + const consoleLogStub = sinon.stub(console, "log"); + await this.env.run("check"); + assert.isTrue(consoleLogStub.calledOnce); + assert.strictEqual(process.exitCode, undefined); }); }); diff --git a/packages/hardhat-verify/CHANGELOG.md b/packages/hardhat-verify/CHANGELOG.md index 512a330b19..0ab8a258f7 100644 --- a/packages/hardhat-verify/CHANGELOG.md +++ b/packages/hardhat-verify/CHANGELOG.md @@ -1,5 +1,11 @@ # @nomicfoundation/hardhat-verify +## 2.0.9 + +### Patch Changes + +- 88e57fa: Make the `--force` flag override the check of any existing verification, even in the presence of errors. + ## 2.0.8 ### Patch Changes diff --git a/packages/hardhat-verify/package.json b/packages/hardhat-verify/package.json index 4ad685717b..4d0d2e2bcb 100644 --- a/packages/hardhat-verify/package.json +++ b/packages/hardhat-verify/package.json @@ -1,6 +1,6 @@ { "name": "@nomicfoundation/hardhat-verify", - "version": "2.0.8", + "version": "2.0.9", "description": "Hardhat plugin for verifying contracts", "keywords": [ "ethereum", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6f19284bb4..de1ad182ad 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -201,8 +201,8 @@ importers: specifier: ^4.0.0 version: 4.0.1 '@nomicfoundation/edr': - specifier: ^0.5.0 - version: 0.5.0 + specifier: ^0.5.2 + version: 0.5.2 '@nomicfoundation/ethereumjs-common': specifier: 4.0.4 version: 4.0.4 @@ -861,8 +861,8 @@ importers: packages/hardhat-solhint: dependencies: solhint: - specifier: ^3.4.0 - version: 3.6.2(typescript@5.0.4) + specifier: ^5.0.2 + version: 5.0.2(typescript@5.0.4) devDependencies: '@nomicfoundation/eslint-plugin-hardhat-internal-rules': specifier: workspace:^ @@ -2332,36 +2332,36 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} - '@nomicfoundation/edr-darwin-arm64@0.5.0': - resolution: {integrity: sha512-G6OX/PESdfU4ZOyJ4MDh4eevW0wt2mduuxA+thXtTcStOiQTtPuV205h4kLOR5wRB1Zz6Zy0LedTMax7TzOtGw==} + '@nomicfoundation/edr-darwin-arm64@0.5.2': + resolution: {integrity: sha512-Gm4wOPKhbDjGTIRyFA2QUAPfCXA1AHxYOKt3yLSGJkQkdy9a5WW+qtqKeEKHc/+4wpJSLtsGQfpzyIzggFfo/A==} engines: {node: '>= 18'} - '@nomicfoundation/edr-darwin-x64@0.5.0': - resolution: {integrity: sha512-fI7uHfHqPtdPZjkFUTpotc/F5gGv41ws+jSZy9+2AR9RDMOAIXMEArOx9rGLBcevWu8SFnyH/l/77kG/5FXbDw==} + '@nomicfoundation/edr-darwin-x64@0.5.2': + resolution: {integrity: sha512-ClyABq2dFCsrYEED3/UIO0c7p4H1/4vvlswFlqUyBpOkJccr75qIYvahOSJRM62WgUFRhbSS0OJXFRwc/PwmVg==} engines: {node: '>= 18'} - '@nomicfoundation/edr-linux-arm64-gnu@0.5.0': - resolution: {integrity: sha512-eMC3sWPkBZILg2/YB4Xv6IR0nggCLt5hS8K8jjHeGEeUs9pf8poBF2Oy+G4lSu0YLLjexGzHypz9/P+pIuxZHw==} + '@nomicfoundation/edr-linux-arm64-gnu@0.5.2': + resolution: {integrity: sha512-HWMTVk1iOabfvU2RvrKLDgtFjJZTC42CpHiw2h6rfpsgRqMahvIlx2jdjWYzFNy1jZKPTN1AStQ/91MRrg5KnA==} engines: {node: '>= 18'} - '@nomicfoundation/edr-linux-arm64-musl@0.5.0': - resolution: {integrity: sha512-yPK0tKjYRxe5ktggFr8aBHH0DCI9uafuaD8QuzyrQAfSf/m/ebTdgthROdbYp6eRk5mJyfAQT/45fM3tnlYsWw==} + '@nomicfoundation/edr-linux-arm64-musl@0.5.2': + resolution: {integrity: sha512-CwsQ10xFx/QAD5y3/g5alm9+jFVuhc7uYMhrZAu9UVF+KtVjeCvafj0PaVsZ8qyijjqVuVsJ8hD1x5ob7SMcGg==} engines: {node: '>= 18'} - '@nomicfoundation/edr-linux-x64-gnu@0.5.0': - resolution: {integrity: sha512-Hds8CRYi4DEyuErjcwUNSvNpMzmOYUihW4qYCoKgSBUVS5saX1PyPYvFYuYpeU5J8/T2iMk6yAPVLCxtKbgnKg==} + '@nomicfoundation/edr-linux-x64-gnu@0.5.2': + resolution: {integrity: sha512-CWVCEdhWJ3fmUpzWHCRnC0/VLBDbqtqTGTR6yyY1Ep3S3BOrHEAvt7h5gx85r2vLcztisu2vlDq51auie4IU1A==} engines: {node: '>= 18'} - '@nomicfoundation/edr-linux-x64-musl@0.5.0': - resolution: {integrity: sha512-1hXMDSzdyh5ojwO3ZSRbt7t5KKYycGUlFdC3lgJRZ7gStB8xjb7RA3hZn2csn9OydS950Ne4nh+puNq91iXApw==} + '@nomicfoundation/edr-linux-x64-musl@0.5.2': + resolution: {integrity: sha512-+aJDfwhkddy2pP5u1ISg3IZVAm0dO836tRlDTFWtvvSMQ5hRGqPcWwlsbobhDQsIxhPJyT7phL0orCg5W3WMeA==} engines: {node: '>= 18'} - '@nomicfoundation/edr-win32-x64-msvc@0.5.0': - resolution: {integrity: sha512-CFagD423400xXkRmACIR13FoocN48qi4ogRnuFQIvBDtEE3aMEajfFj4bycmQQDqnqChsZy/jwD4OxbX6oaNJw==} + '@nomicfoundation/edr-win32-x64-msvc@0.5.2': + resolution: {integrity: sha512-CcvvuA3sAv7liFNPsIR/68YlH6rrybKzYttLlMr80d4GKJjwJ5OKb3YgE6FdZZnOfP19HEHhsLcE0DPLtY3r0w==} engines: {node: '>= 18'} - '@nomicfoundation/edr@0.5.0': - resolution: {integrity: sha512-nAUyjGhxntXje/1AkDX9POfH+pqUxdi4XHzIhaf/dJYs7fgAFxL3STBK1OYcA3LR7vtiylLHMz7wxjqLzlLGKg==} + '@nomicfoundation/edr@0.5.2': + resolution: {integrity: sha512-hW/iLvUQZNTVjFyX/I40rtKvvDOqUEyIi96T28YaLfmPL+3LW2lxmYLUXEJ6MI14HzqxDqrLyhf6IbjAa2r3Dw==} engines: {node: '>= 18'} '@nomicfoundation/ethereumjs-block@5.0.4': @@ -2511,6 +2511,18 @@ packages: resolution: {integrity: sha512-WadzXP6rXSQT51BgsmVT5OVxWS9+DWSsn8ebhtFBKb60Z3S8KA0wo5wiM7AQIrhNb4qfcQqk6HpYo6Fmpum4ew==} hasBin: true + '@pnpm/config.env-replace@1.1.0': + resolution: {integrity: sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==} + engines: {node: '>=12.22.0'} + + '@pnpm/network.ca-file@1.0.2': + resolution: {integrity: sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA==} + engines: {node: '>=12.22.0'} + + '@pnpm/npm-conf@2.2.2': + resolution: {integrity: sha512-UA91GwWPhFExt3IizW6bOeY/pQ0BkuNwKjk9iQW9KqxluGCrg4VenZ0/L+2Y0+ZOtme72EVvg6v0zo3AMQRCeA==} + engines: {node: '>=12'} + '@scure/base@1.1.6': resolution: {integrity: sha512-ok9AWwhcgYuGG3Zfhyqg+zwl+Wn5uE+dwC0NV/2qQkx4dABbb/bx96vWu8NSj+BNjjSjno+JRYRjle1jV08k3g==} @@ -2582,9 +2594,6 @@ packages: '@solidity-parser/parser@0.14.5': resolution: {integrity: sha512-6dKnHZn7fg/iQATVEzqyUOyEidbn05q7YA2mQ9hC0MMXhhV3/JrsxmFSYZAcr7j1yUP700LLhTruvJ3MiQmjJg==} - '@solidity-parser/parser@0.16.2': - resolution: {integrity: sha512-PI9NfoA3P8XK2VBkK5oIfRgKDsicwDZfkVq9ZTBCQYGOP1N2owgY2dyLGyU5/J/hQs8KRk55kdmvTLjy3Mu3vg==} - '@solidity-parser/parser@0.18.0': resolution: {integrity: sha512-yfORGUIPgLck41qyN7nbwJRAx17/jAIXCTanHOJZhB6PJ1iAk/84b/xlsVKFSyNyLXIj0dhppoE0+CRws7wlzA==} @@ -3550,6 +3559,9 @@ packages: resolution: {integrity: sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==} engines: {'0': node >= 0.8} + config-chain@1.1.13: + resolution: {integrity: sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==} + constant-case@2.0.0: resolution: {integrity: sha512-eS0N9WwmjTqrOmR3o83F5vW8Z+9R1HnVz3xmzT2PMFug9ly+Au/fxRWlEBSb6LcZwspSsEn9Xs1uw9YgzAg1EQ==} @@ -4540,6 +4552,9 @@ packages: resolution: {integrity: sha512-hBv2ty9QN2RdbJJMK3hesmSkFTjVIHyIDDbssCKnSmq62edGgImJWD10Eb1k77TiV1bxloxqcFAVK8+9pkhOig==} engines: {node: '>=14.16'} + graceful-fs@4.2.10: + resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} + graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} @@ -5077,6 +5092,10 @@ packages: resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==} engines: {node: '>=6'} + latest-version@7.0.0: + resolution: {integrity: sha512-KvNT4XqAMzdcL6ka6Tl3i2lYeFDgXNCuIX+xNx6ZMVR1dFq+idXd9FLKNMOIx0t9mJ9/HudyX4oZWXZQ0UJHeg==} + engines: {node: '>=14.16'} + lcid@1.0.0: resolution: {integrity: sha512-YiGkH6EnGrDGqLMITnGjXtGmNtjoXw9SVUzcaos8RBi7Ps0VBylkq+vOcY9QE5poLasPCR849ucFUkl0UzUyOw==} engines: {node: '>=0.10.0'} @@ -5623,6 +5642,10 @@ packages: resolution: {integrity: sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==} engines: {node: '>=8'} + package-json@8.1.1: + resolution: {integrity: sha512-cbH9IAIJHNj9uXi196JVsRlt7cHKak6u/e6AkL/bkRelZ7rlL3X1YKxsZwa36xipOEKAsdtmaG6aAJoM1fx2zA==} + engines: {node: '>=14.16'} + pako@1.0.11: resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==} @@ -5807,6 +5830,9 @@ packages: resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} engines: {node: '>= 6'} + proto-list@1.2.4: + resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==} + proxy-addr@2.0.7: resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} engines: {node: '>= 0.10'} @@ -5945,6 +5971,14 @@ packages: resolution: {integrity: sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==} engines: {node: '>= 0.4'} + registry-auth-token@5.0.2: + resolution: {integrity: sha512-o/3ikDxtXaA59BmZuZrJZDJv8NMDGSj+6j6XaeBmHw8eY1i1qd9+6H+LjVvQXx3HN6aRCGa1cUdJ9RaJZUugnQ==} + engines: {node: '>=14'} + + registry-url@6.0.1: + resolution: {integrity: sha512-+crtS5QjFRqFCoQmvGduwYWEBng99ZvmFvF+cUJkGYF1L1BfU8C6Zp9T7f5vPAwyLkUExpvK+ANVZmGU49qi4Q==} + engines: {node: '>=12'} + release-zalgo@1.0.0: resolution: {integrity: sha512-gUAyHVHPPC5wdqX/LG4LWtRYtgjxyX78oanFNTMMyFEfOqdC54s3eE82imuWKbOeqYht2CrNf64Qb8vgmmtZGA==} engines: {node: '>=4'} @@ -6220,8 +6254,8 @@ packages: engines: {node: '>=10.0.0'} hasBin: true - solhint@3.6.2: - resolution: {integrity: sha512-85EeLbmkcPwD+3JR7aEMKsVC9YrRSxd4qkXuMzrlf7+z2Eqdfm1wHWq1ffTuo5aDhoZxp2I9yF3QkxZOxOL7aQ==} + solhint@5.0.2: + resolution: {integrity: sha512-fDoflGz1jztGRqEDiLI25wSvpjGu0fIqeRXXYKYt4qBOA0EJi8RZwlM11+K2ZAcGFW2K8bevJ2A/wtZ0lDi/bw==} hasBin: true solidity-coverage@0.8.12: @@ -8150,29 +8184,29 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 - '@nomicfoundation/edr-darwin-arm64@0.5.0': {} + '@nomicfoundation/edr-darwin-arm64@0.5.2': {} - '@nomicfoundation/edr-darwin-x64@0.5.0': {} + '@nomicfoundation/edr-darwin-x64@0.5.2': {} - '@nomicfoundation/edr-linux-arm64-gnu@0.5.0': {} + '@nomicfoundation/edr-linux-arm64-gnu@0.5.2': {} - '@nomicfoundation/edr-linux-arm64-musl@0.5.0': {} + '@nomicfoundation/edr-linux-arm64-musl@0.5.2': {} - '@nomicfoundation/edr-linux-x64-gnu@0.5.0': {} + '@nomicfoundation/edr-linux-x64-gnu@0.5.2': {} - '@nomicfoundation/edr-linux-x64-musl@0.5.0': {} + '@nomicfoundation/edr-linux-x64-musl@0.5.2': {} - '@nomicfoundation/edr-win32-x64-msvc@0.5.0': {} + '@nomicfoundation/edr-win32-x64-msvc@0.5.2': {} - '@nomicfoundation/edr@0.5.0': + '@nomicfoundation/edr@0.5.2': dependencies: - '@nomicfoundation/edr-darwin-arm64': 0.5.0 - '@nomicfoundation/edr-darwin-x64': 0.5.0 - '@nomicfoundation/edr-linux-arm64-gnu': 0.5.0 - '@nomicfoundation/edr-linux-arm64-musl': 0.5.0 - '@nomicfoundation/edr-linux-x64-gnu': 0.5.0 - '@nomicfoundation/edr-linux-x64-musl': 0.5.0 - '@nomicfoundation/edr-win32-x64-msvc': 0.5.0 + '@nomicfoundation/edr-darwin-arm64': 0.5.2 + '@nomicfoundation/edr-darwin-x64': 0.5.2 + '@nomicfoundation/edr-linux-arm64-gnu': 0.5.2 + '@nomicfoundation/edr-linux-arm64-musl': 0.5.2 + '@nomicfoundation/edr-linux-x64-gnu': 0.5.2 + '@nomicfoundation/edr-linux-x64-musl': 0.5.2 + '@nomicfoundation/edr-win32-x64-msvc': 0.5.2 '@nomicfoundation/ethereumjs-block@5.0.4': dependencies: @@ -8358,6 +8392,18 @@ snapshots: transitivePeerDependencies: - encoding + '@pnpm/config.env-replace@1.1.0': {} + + '@pnpm/network.ca-file@1.0.2': + dependencies: + graceful-fs: 4.2.10 + + '@pnpm/npm-conf@2.2.2': + dependencies: + '@pnpm/config.env-replace': 1.1.0 + '@pnpm/network.ca-file': 1.0.2 + config-chain: 1.1.13 + '@scure/base@1.1.6': {} '@scure/bip32@1.1.5': @@ -8466,10 +8512,6 @@ snapshots: dependencies: antlr4ts: 0.5.0-alpha.4 - '@solidity-parser/parser@0.16.2': - dependencies: - antlr4ts: 0.5.0-alpha.4 - '@solidity-parser/parser@0.18.0': {} '@szmarczak/http-timer@4.0.6': @@ -9547,6 +9589,11 @@ snapshots: readable-stream: 2.3.8 typedarray: 0.0.6 + config-chain@1.1.13: + dependencies: + ini: 1.3.8 + proto-list: 1.2.4 + constant-case@2.0.0: dependencies: snake-case: 2.1.0 @@ -10871,6 +10918,8 @@ snapshots: p-cancelable: 3.0.0 responselike: 2.0.1 + graceful-fs@4.2.10: {} + graceful-fs@4.2.11: {} grapheme-splitter@1.0.4: {} @@ -11383,6 +11432,10 @@ snapshots: kleur@4.1.5: {} + latest-version@7.0.0: + dependencies: + package-json: 8.1.1 + lcid@1.0.0: dependencies: invert-kv: 1.0.0 @@ -11948,6 +12001,13 @@ snapshots: lodash.flattendeep: 4.4.0 release-zalgo: 1.0.0 + package-json@8.1.1: + dependencies: + got: 12.1.0 + registry-auth-token: 5.0.2 + registry-url: 6.0.1 + semver: 7.6.2 + pako@1.0.11: {} param-case@2.1.1: @@ -12118,6 +12178,8 @@ snapshots: kleur: 3.0.3 sisteransi: 1.0.5 + proto-list@1.2.4: {} + proxy-addr@2.0.7: dependencies: forwarded: 0.2.0 @@ -12271,6 +12333,14 @@ snapshots: es-errors: 1.3.0 set-function-name: 2.0.2 + registry-auth-token@5.0.2: + dependencies: + '@pnpm/npm-conf': 2.2.2 + + registry-url@6.0.1: + dependencies: + rc: 1.2.8 + release-zalgo@1.0.0: dependencies: es6-error: 4.1.1 @@ -12616,9 +12686,9 @@ snapshots: transitivePeerDependencies: - debug - solhint@3.6.2(typescript@5.0.4): + solhint@5.0.2(typescript@5.0.4): dependencies: - '@solidity-parser/parser': 0.16.2 + '@solidity-parser/parser': 0.18.0 ajv: 6.12.6 antlr4: 4.13.1 ast-parents: 0.0.1 @@ -12629,6 +12699,7 @@ snapshots: glob: 8.1.0 ignore: 5.3.1 js-yaml: 4.1.0 + latest-version: 7.0.0 lodash: 4.17.21 pluralize: 8.0.0 semver: 7.6.2 diff --git a/scripts/generate-filters.js b/scripts/generate-filters.js new file mode 100644 index 0000000000..8218059b29 --- /dev/null +++ b/scripts/generate-filters.js @@ -0,0 +1,76 @@ +// @ts-check +/** + * This script generates filters for https://github.com/dorny/paths-filter + * + * It is used in CI to find all the packages which have been modified or + * have a dependency (including transitive) that has been modified. + * + * This enables running checks only for the packages affected by the changes. + */ +const fs = require("fs"); +const path = require("path"); + +function main() { + const packageIgnore = JSON.parse(process.env.PACKAGE_IGNORE || "[]"); + const commonFilters = JSON.parse(process.env.COMMON_FILTERS || "[]"); + + const pnpmLockfilePath = path.join(__dirname, "..", "pnpm-lock.json"); + if (!fs.existsSync(pnpmLockfilePath)) { + console.warn( + `${pnpmLockfilePath} doesn't exist, please run: yq -p yaml -o json pnpm-lock.yaml | tee pnpm-lock.json` + ); + process.exit(1); + } + + const pnpmLockfile = JSON.parse(fs.readFileSync(pnpmLockfilePath, "utf8")); + + // Find all direct internal dependencies for all packages + const internalDependenciesMap = {}; + for (const [package, allDependencies] of Object.entries( + pnpmLockfile.importers + )) { + const internalDependencies = Object.values(allDependencies) + .flatMap((dependencies) => Object.values(dependencies)) + .map((dependency) => dependency.version) + .filter((version) => version.startsWith("link:")) + .map((version) => version.replace("link:", "")) + .map((version) => path.join(package, version)); + internalDependenciesMap[package] = internalDependencies; + } + + // Add transitive internal dependencies + for (const dependencies of Object.values(internalDependenciesMap)) { + const dependencyQueue = [...dependencies]; + while (dependencyQueue.length !== 0) { + const dependency = dependencyQueue.pop(); + for (const transitiveDependency of internalDependenciesMap[dependency]) { + if (!dependencies.includes(transitiveDependency)) { + dependencies.push(transitiveDependency); + dependencyQueue.push(transitiveDependency); + } + } + } + } + + // Generate filters + const filters = {}; + for (const [package, dependencies] of Object.entries( + internalDependenciesMap + )) { + // Ignore packages that start with one of the prefixes in PACKAGE_IGNORE + if (packageIgnore.some((prefix) => package.startsWith(prefix))) { + continue; + } + // Calculate glob patterns for the package and its dependencies + const packageFilters = [package, ...dependencies].map((dependency) => + path.join(dependency, "**") + ); + // Set filters for the package + filters[package] = [...commonFilters, ...packageFilters]; + } + + // Pretty print the filters + console.log(JSON.stringify(filters, null, 2)); +} + +main();