Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .changeset/full-otters-say.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
"@nomicfoundation/hardhat-ethers-chai-matchers": patch
"@nomicfoundation/hardhat-network-helpers": patch
"@nomicfoundation/hardhat-typechain": patch
"@nomicfoundation/hardhat-ignition": patch
"@nomicfoundation/hardhat-keystore": patch
"@nomicfoundation/hardhat-vendored": patch
"@nomicfoundation/hardhat-ethers": patch
"@nomicfoundation/hardhat-ledger": patch
"@nomicfoundation/hardhat-verify": patch
"@nomicfoundation/hardhat-mocha": patch
"@nomicfoundation/hardhat-utils": patch
"@nomicfoundation/ignition-core": patch
"hardhat": patch
---

Improved performance by replacing the debug logging library with a lightweight in-tree implementation.
1 change: 0 additions & 1 deletion packages/hardhat-ethers-chai-matchers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"@nomicfoundation/hardhat-node-test-reporter": "workspace:^3.0.5",
"@nomicfoundation/hardhat-test-utils": "workspace:^",
"@types/chai": "^5.2.3",
"@types/debug": "^4.1.7",
"@types/deep-eql": "^4.0.2",
"@types/mocha": ">=10.0.10",
"@types/node": "^22.0.0",
Expand Down
2 changes: 0 additions & 2 deletions packages/hardhat-ethers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"devDependencies": {
"@nomicfoundation/hardhat-node-test-reporter": "workspace:^3.0.5",
"@nomicfoundation/hardhat-test-utils": "workspace:^",
"@types/debug": "^4.1.7",
"@types/node": "^22.0.0",
"c8": "^9.1.0",
"eslint": "9.25.1",
Expand All @@ -59,7 +58,6 @@
"dependencies": {
"@nomicfoundation/hardhat-errors": "workspace:^3.0.11",
"@nomicfoundation/hardhat-utils": "workspace:^4.0.4",
"debug": "^4.3.2",
"ethereum-cryptography": "^2.2.1",
"ethers": "^6.14.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import {
assertHardhatInvariant,
HardhatError,
} from "@nomicfoundation/hardhat-errors";
import { createDebug } from "@nomicfoundation/hardhat-utils/debug";
import { ensureError } from "@nomicfoundation/hardhat-utils/error";
import { numberToHexString } from "@nomicfoundation/hardhat-utils/hex";
import { deepEqual } from "@nomicfoundation/hardhat-utils/lang";
import debug from "debug";
import {
Block,
FeeData,
Expand All @@ -52,7 +52,7 @@ import {
} from "../ethers-utils/ethers-utils.js";
import { HardhatEthersSigner } from "../signers/signers.js";

const log = debug("hardhat:hardhat-ethers:provider");
const log = createDebug("hardhat:hardhat-ethers:provider");

// The default number of confirmations when waiting for a transaction
const DEFAULT_TRANSACTION_CONFIRMS = 1;
Expand Down
2 changes: 0 additions & 2 deletions packages/hardhat-ignition/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
"@nomicfoundation/hardhat-test-utils": "workspace:^",
"@types/chai": "^5.2.3",
"@types/chai-as-promised": "^8.0.1",
"@types/debug": "^4.1.7",
"@types/mocha": ">=10.0.10",
"@types/node": "^22.0.0",
"@types/prompts": "^2.4.2",
Expand All @@ -89,7 +88,6 @@
"@nomicfoundation/ignition-ui": "workspace:^3.1.2",
"@nomicfoundation/hardhat-utils": "workspace:^4.0.4",
"chalk": "^5.3.0",
"debug": "^4.3.2",
"prompts": "^2.4.2",
"json5": "^2.2.3"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/hardhat-ignition/src/internal/utils/load-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import path from "node:path";
import { pathToFileURL } from "node:url";

import { HardhatError } from "@nomicfoundation/hardhat-errors";
import { createDebug } from "@nomicfoundation/hardhat-utils/debug";
import { exists } from "@nomicfoundation/hardhat-utils/fs";
import setupDebug from "debug";

const debug = setupDebug("hardhat-ignition:modules");
const debug = createDebug("hardhat-ignition:modules");

const MODULES_FOLDER = "modules";

Expand Down
2 changes: 0 additions & 2 deletions packages/hardhat-keystore/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"devDependencies": {
"@nomicfoundation/hardhat-node-test-reporter": "workspace:^3.0.5",
"@nomicfoundation/hardhat-test-utils": "workspace:^",
"@types/debug": "^4.1.7",
"@types/node": "^22.0.0",
"c8": "^9.1.0",
"eslint": "9.25.1",
Expand All @@ -61,7 +60,6 @@
"@noble/ciphers": "1.2.1",
"@noble/hashes": "1.7.1",
"chalk": "^5.3.0",
"debug": "^4.3.2",
"zod": "^3.23.8"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import type { ConfigHooks } from "hardhat/types/hooks";

import debug from "debug";
import { createDebug } from "@nomicfoundation/hardhat-utils/debug";

import {
getDevKeystoreFilePath,
getDevKeystorePasswordFilePath,
getKeystoreFilePath,
} from "../utils/get-keystore-file-path.js";

const log = debug("hardhat:keystore:hooks:config");
const log = createDebug("hardhat:keystore:hooks:config");

export default async (): Promise<Partial<ConfigHooks>> => {
const handlers: Partial<ConfigHooks> = {
Expand Down
2 changes: 0 additions & 2 deletions packages/hardhat-ledger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"devDependencies": {
"@nomicfoundation/hardhat-node-test-reporter": "workspace:^3.0.5",
"@nomicfoundation/hardhat-test-utils": "workspace:^",
"@types/debug": "^4.1.7",
"@types/node": "^22.0.0",
"c8": "^9.1.0",
"eslint": "9.25.1",
Expand All @@ -68,7 +67,6 @@
"@nomicfoundation/hardhat-errors": "workspace:^3.0.11",
"@nomicfoundation/hardhat-utils": "workspace:^4.0.4",
"@nomicfoundation/hardhat-zod-utils": "workspace:^3.0.4",
"debug": "^4.3.2",
"micro-eth-signer": "^0.14.0",
"zod": "^3.23.8"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/hardhat-ledger/src/internal/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
HardhatError,
} from "@nomicfoundation/hardhat-errors";
import { toBigInt } from "@nomicfoundation/hardhat-utils/bigint";
import { createDebug } from "@nomicfoundation/hardhat-utils/debug";
import { ensureError } from "@nomicfoundation/hardhat-utils/error";
import { isAddress } from "@nomicfoundation/hardhat-utils/eth";
import {
Expand All @@ -30,7 +31,6 @@ import {
rpcTransactionRequest,
validateParams,
} from "@nomicfoundation/hardhat-zod-utils/rpc";
import debug from "debug";

import * as cache from "./cache.js";
import {
Expand All @@ -53,7 +53,7 @@ import { getRequestParams } from "./rpc-helpers.js";
// This is not a standard ISO 7816-4 code, but a Ledger-specific error meaning "no app context".
const APP_NOT_OPEN_STATUS_CODE = 0x6511;

const log = debug("hardhat:hardhat-ledger:handler");
const log = createDebug("hardhat:hardhat-ledger:handler");

// micro-eth-signer is known to be slow to load, so we lazy load it
let microEthSigner: typeof MicroEthSignerT | undefined;
Expand Down
2 changes: 0 additions & 2 deletions packages/hardhat-mocha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"devDependencies": {
"@nomicfoundation/hardhat-node-test-reporter": "workspace:^3.0.5",
"@nomicfoundation/hardhat-test-utils": "workspace:^",
"@types/debug": "^4.1.7",
"@types/mocha": ">=10.0.10",
"@types/node": "^22.0.0",
"c8": "^9.1.0",
Expand All @@ -61,7 +60,6 @@
"@nomicfoundation/hardhat-utils": "workspace:^4.0.4",
"@nomicfoundation/hardhat-zod-utils": "workspace:^3.0.4",
"chalk": "^5.3.0",
"debug": "^4.3.2",
"tsx": "^4.19.3",
"zod": "^3.23.8"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/hardhat-mocha/src/task-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import type { MochaOptions } from "mocha";
import { resolve as pathResolve } from "node:path";

import { HardhatError } from "@nomicfoundation/hardhat-errors";
import { createDebug } from "@nomicfoundation/hardhat-utils/debug";
import { setGlobalOptionsAsEnvVariables } from "@nomicfoundation/hardhat-utils/env";
import { getAllFilesMatching } from "@nomicfoundation/hardhat-utils/fs";
import debug from "debug";
import { errorResult, successfulResult } from "hardhat/utils/result";
import Mocha from "mocha";

Expand All @@ -31,7 +31,7 @@ type PerformancePhase =
| "Reporting";

const performanceScope = "hardhat:mocha:performance";
const performanceLog = debug(performanceScope);
const performanceLog = createDebug(performanceScope);
const perf = createPerformanceTracker<PerformancePhase>(
performanceScope,
"Mocha test task",
Expand Down
1 change: 0 additions & 1 deletion packages/hardhat-network-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"devDependencies": {
"@nomicfoundation/hardhat-node-test-reporter": "workspace:^3.0.5",
"@nomicfoundation/hardhat-test-utils": "workspace:^",
"@types/debug": "^4.1.7",
"@types/node": "^22.0.0",
"c8": "^9.1.0",
"eslint": "9.25.1",
Expand Down
2 changes: 0 additions & 2 deletions packages/hardhat-solx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
"devDependencies": {
"@nomicfoundation/hardhat-node-test-reporter": "workspace:^3.0.5",
"@nomicfoundation/hardhat-test-utils": "workspace:^",
"@types/debug": "^4.1.7",
"@types/node": "^22.0.0",
"c8": "^9.1.0",
"eslint": "9.25.1",
Expand All @@ -61,7 +60,6 @@
"@nomicfoundation/hardhat-errors": "workspace:^3.0.11",
"@nomicfoundation/hardhat-utils": "workspace:^4.0.4",
"@nomicfoundation/hardhat-zod-utils": "workspace:^3.0.4",
"debug": "^4.3.2",
"zod": "^3.23.8"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/hardhat-solx/src/internal/downloader.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import path from "node:path";

import { HardhatError } from "@nomicfoundation/hardhat-errors";
import { createDebug } from "@nomicfoundation/hardhat-utils/debug";
import { ensureError } from "@nomicfoundation/hardhat-utils/error";
import {
chmod,
Expand All @@ -11,12 +12,11 @@ import {
import { getCacheDir } from "@nomicfoundation/hardhat-utils/global-dir";
import { download, getRequest } from "@nomicfoundation/hardhat-utils/request";
import { MultiProcessMutex } from "@nomicfoundation/hardhat-utils/synchronization";
import debug from "debug";

import { SOLX_RELEASES_BASE_URL } from "./constants.js";
import { getSolxAssetName } from "./platform.js";

const log = debug("hardhat:solx:downloader");
const log = createDebug("hardhat:solx:downloader");

const DOWNLOAD_RETRY_COUNT = 3;
const DOWNLOAD_RETRY_DELAY_MS = 2000;
Expand Down
4 changes: 2 additions & 2 deletions packages/hardhat-solx/src/internal/hook-handlers/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import type {
HardhatUserConfigValidationError,
} from "hardhat/types/hooks";

import { createDebug } from "@nomicfoundation/hardhat-utils/debug";
import { isObject } from "@nomicfoundation/hardhat-utils/lang";
import {
conditionalUnionType,
validateUserConfigZodType,
} from "@nomicfoundation/hardhat-zod-utils";
import debug from "debug";
import { z } from "zod";

import {
Expand All @@ -24,7 +24,7 @@ import {
SUPPORTED_SOLX_EVM_VERSIONS,
} from "../constants.js";

const log = debug("hardhat:solx:hook-handlers:config");
const log = createDebug("hardhat:solx:hook-handlers:config");

// These zod types need to be aligned in shape with the ones of the solidity
// builtin plugin, but don't need to revalidate everything.
Expand Down
4 changes: 2 additions & 2 deletions packages/hardhat-solx/src/internal/hook-handlers/solidity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {
HardhatError,
assertHardhatInvariant,
} from "@nomicfoundation/hardhat-errors";
import { createDebug } from "@nomicfoundation/hardhat-utils/debug";
import { exists } from "@nomicfoundation/hardhat-utils/fs";
import debug from "debug";

import {
DEFAULT_SOLX_SETTINGS,
Expand All @@ -18,7 +18,7 @@ import {
import { downloadSolx, getSolxBinaryPath } from "../downloader.js";
import { SolxCompiler } from "../solx-compiler.js";

const log = debug("hardhat:solx:hook-handlers:solidity");
const log = createDebug("hardhat:solx:hook-handlers:solidity");

const execFileAsync = promisify(execFile);

Expand Down
2 changes: 0 additions & 2 deletions packages/hardhat-typechain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
"devDependencies": {
"@nomicfoundation/hardhat-node-test-reporter": "workspace:^3.0.5",
"@nomicfoundation/hardhat-test-utils": "workspace:^",
"@types/debug": "^4.1.7",
"@types/node": "^22.0.0",
"c8": "^9.1.0",
"eslint": "9.25.1",
Expand All @@ -65,7 +64,6 @@
"@nomicfoundation/hardhat-utils": "workspace:^4.0.4",
"@nomicfoundation/hardhat-zod-utils": "workspace:^3.0.4",
"@typechain/ethers-v6": "^0.5.0",
"debug": "^4.3.2",
"typechain": "^8.3.1",
"zod": "^3.23.8"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/hardhat-typechain/src/internal/generate-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import type { OutputTransformer } from "typechain/dist/codegen/outputTransformer
import path from "node:path";

import { assertHardhatInvariant } from "@nomicfoundation/hardhat-errors";
import debug from "debug";
import { createDebug } from "@nomicfoundation/hardhat-utils/debug";
import { runTypeChain } from "typechain";
import { outputTransformers as typechainOutputTransformers } from "typechain/dist/codegen/outputTransformers/index.js";

const log = debug("hardhat:typechain:generate-types");
const log = createDebug("hardhat:typechain:generate-types");

const PRETTIER_TRANSFORMER_NAME = "prettierOutputTransformer";

Expand Down
2 changes: 0 additions & 2 deletions packages/hardhat-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
"devDependencies": {
"@nomicfoundation/hardhat-node-test-reporter": "workspace:^3.0.5",
"@types/bn.js": "^5.1.5",
"@types/debug": "^4.1.7",
"@types/node": "^22.0.0",
"c8": "^9.1.0",
"eslint": "9.25.1",
Expand All @@ -80,7 +79,6 @@
},
"dependencies": {
"@streamparser/json-node": "^0.0.22",
"debug": "^4.3.2",
"env-paths": "^2.2.0",
"ethereum-cryptography": "^2.2.1",
"fast-equals": "^5.4.0",
Expand Down
Loading
Loading