hardhat 3.4.4 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -0
- package/dist/src/config.d.ts +0 -1
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +0 -3
- package/dist/src/config.js.map +1 -1
- package/dist/src/hre.d.ts +0 -1
- package/dist/src/hre.d.ts.map +1 -1
- package/dist/src/hre.js +0 -3
- package/dist/src/hre.js.map +1 -1
- package/dist/src/index.d.ts +0 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +0 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal/builtin-global-options.d.ts.map +1 -1
- package/dist/src/internal/builtin-global-options.js +1 -1
- package/dist/src/internal/builtin-global-options.js.map +1 -1
- package/dist/src/internal/builtin-plugins/artifacts/index.d.ts +1 -1
- package/dist/src/internal/builtin-plugins/artifacts/index.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/artifacts/index.js +0 -1
- package/dist/src/internal/builtin-plugins/artifacts/index.js.map +1 -1
- package/dist/src/internal/builtin-plugins/clean/index.d.ts +1 -1
- package/dist/src/internal/builtin-plugins/clean/index.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/clean/index.js +0 -1
- package/dist/src/internal/builtin-plugins/clean/index.js.map +1 -1
- package/dist/src/internal/builtin-plugins/clean/type-extensions.d.ts +1 -1
- package/dist/src/internal/builtin-plugins/clean/type-extensions.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/clean/type-extensions.js +1 -1
- package/dist/src/internal/builtin-plugins/clean/type-extensions.js.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/hook-handlers/solidity.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/hook-handlers/solidity.js +7 -10
- package/dist/src/internal/builtin-plugins/coverage/hook-handlers/solidity.js.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/index.d.ts +1 -1
- package/dist/src/internal/builtin-plugins/coverage/index.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/index.js +0 -1
- package/dist/src/internal/builtin-plugins/coverage/index.js.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/instrumentation.d.ts +1 -4
- package/dist/src/internal/builtin-plugins/coverage/instrumentation.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/instrumentation.js +2 -4
- package/dist/src/internal/builtin-plugins/coverage/instrumentation.js.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/type-extensions.d.ts +1 -1
- package/dist/src/internal/builtin-plugins/coverage/type-extensions.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/type-extensions.js +1 -1
- package/dist/src/internal/builtin-plugins/coverage/type-extensions.js.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/index.d.ts +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/index.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/index.js +0 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/index.js.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/snapshot-cheatcodes.d.ts +21 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/snapshot-cheatcodes.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/snapshot-cheatcodes.js +49 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/snapshot-cheatcodes.js.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/tasks/solidity-test/task-action.d.ts +2 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/tasks/solidity-test/task-action.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/tasks/solidity-test/task-action.js +12 -2
- package/dist/src/internal/builtin-plugins/gas-analytics/tasks/solidity-test/task-action.js.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/type-extensions.d.ts +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/type-extensions.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/type-extensions.js +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/type-extensions.js.map +1 -1
- package/dist/src/internal/builtin-plugins/index.d.ts +8 -8
- package/dist/src/internal/builtin-plugins/index.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/config-resolution.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/config-resolution.js +9 -2
- package/dist/src/internal/builtin-plugins/network-manager/config-resolution.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/edr-constants.d.ts +1 -0
- package/dist/src/internal/builtin-plugins/network-manager/edr/edr-constants.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/edr-constants.js +1 -0
- package/dist/src/internal/builtin-plugins/network-manager/edr/edr-constants.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/edr-provider.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/edr-provider.js +25 -5
- package/dist/src/internal/builtin-plugins/network-manager/edr/edr-provider.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-solidity-errors.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-solidity-errors.js +7 -6
- package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-solidity-errors.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/utils/convert-to-edr.d.ts +16 -0
- package/dist/src/internal/builtin-plugins/network-manager/edr/utils/convert-to-edr.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/utils/convert-to-edr.js +28 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/utils/convert-to-edr.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/index.d.ts +4 -4
- package/dist/src/internal/builtin-plugins/network-manager/index.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/index.js +0 -4
- package/dist/src/internal/builtin-plugins/network-manager/index.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/network-manager.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/network-manager.js +2 -6
- package/dist/src/internal/builtin-plugins/network-manager/network-manager.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/type-extensions/config.d.ts +5 -4
- package/dist/src/internal/builtin-plugins/network-manager/type-extensions/config.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/type-extensions/config.js +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/type-extensions/config.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/type-extensions/global-options.d.ts +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/type-extensions/global-options.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/type-extensions/global-options.js +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/type-extensions/global-options.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/type-extensions/hooks.d.ts +0 -1
- package/dist/src/internal/builtin-plugins/network-manager/type-extensions/hooks.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/type-extensions/hooks.js +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/type-extensions/hooks.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/type-extensions/hre.d.ts +0 -1
- package/dist/src/internal/builtin-plugins/network-manager/type-extensions/hre.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/type-extensions/hre.js +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/type-extensions/hre.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/type-validation.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/type-validation.js +3 -1
- package/dist/src/internal/builtin-plugins/network-manager/type-validation.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/utils/apply-coverage-network-overrides.d.ts +18 -0
- package/dist/src/internal/builtin-plugins/network-manager/utils/apply-coverage-network-overrides.d.ts.map +1 -0
- package/dist/src/internal/builtin-plugins/network-manager/utils/apply-coverage-network-overrides.js +27 -0
- package/dist/src/internal/builtin-plugins/network-manager/utils/apply-coverage-network-overrides.js.map +1 -0
- package/dist/src/internal/builtin-plugins/node/json-rpc/handler.js +6 -5
- package/dist/src/internal/builtin-plugins/node/json-rpc/handler.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.js +22 -9
- package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.js +7 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/constants.d.ts +10 -0
- package/dist/src/internal/builtin-plugins/solidity/constants.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/constants.js +10 -0
- package/dist/src/internal/builtin-plugins/solidity/constants.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/index.d.ts +1 -1
- package/dist/src/internal/builtin-plugins/solidity/index.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/index.js +1 -1
- package/dist/src/internal/builtin-plugins/solidity/index.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/tasks/compile.d.ts +9 -0
- package/dist/src/internal/builtin-plugins/solidity/tasks/compile.d.ts.map +1 -0
- package/dist/src/internal/builtin-plugins/solidity/tasks/compile.js +10 -0
- package/dist/src/internal/builtin-plugins/solidity/tasks/compile.js.map +1 -0
- package/dist/src/internal/builtin-plugins/solidity/type-extensions.d.ts +0 -4
- package/dist/src/internal/builtin-plugins/solidity/type-extensions.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/type-extensions.js +1 -4
- package/dist/src/internal/builtin-plugins/solidity/type-extensions.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/config.d.ts +4 -3
- package/dist/src/internal/builtin-plugins/solidity-test/config.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/config.js +55 -8
- package/dist/src/internal/builtin-plugins/solidity-test/config.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/eip712/ast-walker.d.ts +58 -0
- package/dist/src/internal/builtin-plugins/solidity-test/eip712/ast-walker.d.ts.map +1 -0
- package/dist/src/internal/builtin-plugins/solidity-test/eip712/ast-walker.js +226 -0
- package/dist/src/internal/builtin-plugins/solidity-test/eip712/ast-walker.js.map +1 -0
- package/dist/src/internal/builtin-plugins/solidity-test/eip712/canonicalize.d.ts +29 -0
- package/dist/src/internal/builtin-plugins/solidity-test/eip712/canonicalize.d.ts.map +1 -0
- package/dist/src/internal/builtin-plugins/solidity-test/eip712/canonicalize.js +244 -0
- package/dist/src/internal/builtin-plugins/solidity-test/eip712/canonicalize.js.map +1 -0
- package/dist/src/internal/builtin-plugins/solidity-test/eip712/glob.d.ts +7 -0
- package/dist/src/internal/builtin-plugins/solidity-test/eip712/glob.d.ts.map +1 -0
- package/dist/src/internal/builtin-plugins/solidity-test/eip712/glob.js +204 -0
- package/dist/src/internal/builtin-plugins/solidity-test/eip712/glob.js.map +1 -0
- package/dist/src/internal/builtin-plugins/solidity-test/eip712/index.d.ts +21 -0
- package/dist/src/internal/builtin-plugins/solidity-test/eip712/index.d.ts.map +1 -0
- package/dist/src/internal/builtin-plugins/solidity-test/eip712/index.js +77 -0
- package/dist/src/internal/builtin-plugins/solidity-test/eip712/index.js.map +1 -0
- package/dist/src/internal/builtin-plugins/solidity-test/helpers.d.ts +4 -3
- package/dist/src/internal/builtin-plugins/solidity-test/helpers.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/helpers.js +20 -3
- package/dist/src/internal/builtin-plugins/solidity-test/helpers.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/index.d.ts +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/index.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/index.js +0 -1
- package/dist/src/internal/builtin-plugins/solidity-test/index.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/inline-config/constants.d.ts +4 -2
- package/dist/src/internal/builtin-plugins/solidity-test/inline-config/constants.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/inline-config/constants.js +5 -1
- package/dist/src/internal/builtin-plugins/solidity-test/inline-config/constants.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/inline-config/helpers.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/inline-config/helpers.js +15 -3
- package/dist/src/internal/builtin-plugins/solidity-test/inline-config/helpers.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/inline-config/validation.d.ts +3 -2
- package/dist/src/internal/builtin-plugins/solidity-test/inline-config/validation.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/inline-config/validation.js +18 -4
- package/dist/src/internal/builtin-plugins/solidity-test/inline-config/validation.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/task-action.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/task-action.js +5 -1
- package/dist/src/internal/builtin-plugins/solidity-test/task-action.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/test-profiles.d.ts +2 -0
- package/dist/src/internal/builtin-plugins/solidity-test/test-profiles.d.ts.map +1 -0
- package/dist/src/internal/builtin-plugins/solidity-test/test-profiles.js +2 -0
- package/dist/src/internal/builtin-plugins/solidity-test/test-profiles.js.map +1 -0
- package/dist/src/internal/builtin-plugins/solidity-test/type-extensions.d.ts +91 -33
- package/dist/src/internal/builtin-plugins/solidity-test/type-extensions.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/type-extensions.js +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/type-extensions.js.map +1 -1
- package/dist/src/internal/builtin-plugins/test/index.d.ts +1 -1
- package/dist/src/internal/builtin-plugins/test/index.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/test/index.js +0 -1
- package/dist/src/internal/builtin-plugins/test/index.js.map +1 -1
- package/dist/src/internal/builtin-plugins/test/type-extensions.d.ts +0 -1
- package/dist/src/internal/builtin-plugins/test/type-extensions.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/test/type-extensions.js +1 -1
- package/dist/src/internal/builtin-plugins/test/type-extensions.js.map +1 -1
- package/dist/src/internal/cli/init/init.d.ts +31 -6
- package/dist/src/internal/cli/init/init.d.ts.map +1 -1
- package/dist/src/internal/cli/init/init.js +121 -10
- package/dist/src/internal/cli/init/init.js.map +1 -1
- package/dist/src/internal/cli/main.d.ts.map +1 -1
- package/dist/src/internal/cli/main.js +41 -1
- package/dist/src/internal/cli/main.js.map +1 -1
- package/dist/src/types/arguments.d.ts +1 -0
- package/dist/src/types/arguments.d.ts.map +1 -1
- package/dist/src/types/arguments.js +1 -0
- package/dist/src/types/arguments.js.map +1 -1
- package/dist/src/types/artifacts.d.ts +1 -0
- package/dist/src/types/artifacts.d.ts.map +1 -1
- package/dist/src/types/artifacts.js +1 -1
- package/dist/src/types/artifacts.js.map +1 -1
- package/dist/src/types/builtin-plugin-type-extensions.d.ts +2 -0
- package/dist/src/types/builtin-plugin-type-extensions.d.ts.map +1 -0
- package/dist/src/types/builtin-plugin-type-extensions.js +2 -0
- package/dist/src/types/builtin-plugin-type-extensions.js.map +1 -0
- package/dist/src/types/config.d.ts +1 -1
- package/dist/src/types/config.d.ts.map +1 -1
- package/dist/src/types/config.js +1 -3
- package/dist/src/types/config.js.map +1 -1
- package/dist/src/types/global-options.d.ts +1 -0
- package/dist/src/types/global-options.d.ts.map +1 -1
- package/dist/src/types/global-options.js +1 -1
- package/dist/src/types/global-options.js.map +1 -1
- package/dist/src/types/hooks.d.ts +1 -0
- package/dist/src/types/hooks.d.ts.map +1 -1
- package/dist/src/types/hooks.js +1 -1
- package/dist/src/types/hooks.js.map +1 -1
- package/dist/src/types/hre.d.ts +1 -0
- package/dist/src/types/hre.d.ts.map +1 -1
- package/dist/src/types/hre.js +1 -1
- package/dist/src/types/hre.js.map +1 -1
- package/dist/src/types/index.d.ts +1 -0
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/index.js +1 -0
- package/dist/src/types/index.js.map +1 -1
- package/dist/src/types/network.d.ts +1 -0
- package/dist/src/types/network.d.ts.map +1 -1
- package/dist/src/types/network.js +1 -1
- package/dist/src/types/network.js.map +1 -1
- package/dist/src/types/plugins.d.ts +1 -1
- package/dist/src/types/plugins.d.ts.map +1 -1
- package/dist/src/types/plugins.js +1 -3
- package/dist/src/types/plugins.js.map +1 -1
- package/dist/src/types/providers.d.ts +1 -0
- package/dist/src/types/providers.d.ts.map +1 -1
- package/dist/src/types/providers.js +1 -1
- package/dist/src/types/providers.js.map +1 -1
- package/dist/src/types/solidity.d.ts +1 -0
- package/dist/src/types/solidity.d.ts.map +1 -1
- package/dist/src/types/solidity.js +1 -0
- package/dist/src/types/solidity.js.map +1 -1
- package/dist/src/types/tasks.d.ts +1 -0
- package/dist/src/types/tasks.d.ts.map +1 -1
- package/dist/src/types/tasks.js +1 -0
- package/dist/src/types/tasks.js.map +1 -1
- package/dist/src/types/test.d.ts +1 -0
- package/dist/src/types/test.d.ts.map +1 -1
- package/dist/src/types/test.js +1 -1
- package/dist/src/types/test.js.map +1 -1
- package/dist/src/types/user-interruptions.d.ts +1 -0
- package/dist/src/types/user-interruptions.d.ts.map +1 -1
- package/dist/src/types/user-interruptions.js +1 -1
- package/dist/src/types/user-interruptions.js.map +1 -1
- package/package.json +12 -12
- package/src/config.ts +0 -3
- package/src/hre.ts +0 -4
- package/src/index.ts +0 -4
- package/src/internal/builtin-global-options.ts +2 -1
- package/src/internal/builtin-plugins/artifacts/index.ts +1 -1
- package/src/internal/builtin-plugins/clean/index.ts +1 -1
- package/src/internal/builtin-plugins/clean/type-extensions.ts +0 -1
- package/src/internal/builtin-plugins/coverage/hook-handlers/solidity.ts +8 -13
- package/src/internal/builtin-plugins/coverage/index.ts +1 -1
- package/src/internal/builtin-plugins/coverage/instrumentation.ts +0 -5
- package/src/internal/builtin-plugins/coverage/type-extensions.ts +0 -1
- package/src/internal/builtin-plugins/gas-analytics/index.ts +1 -1
- package/src/internal/builtin-plugins/gas-analytics/snapshot-cheatcodes.ts +90 -1
- package/src/internal/builtin-plugins/gas-analytics/tasks/solidity-test/task-action.ts +24 -2
- package/src/internal/builtin-plugins/gas-analytics/type-extensions.ts +0 -1
- package/src/internal/builtin-plugins/index.ts +10 -10
- package/src/internal/builtin-plugins/network-manager/config-resolution.ts +11 -3
- package/src/internal/builtin-plugins/network-manager/edr/edr-constants.ts +2 -0
- package/src/internal/builtin-plugins/network-manager/edr/edr-provider.ts +38 -8
- package/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-solidity-errors.ts +10 -11
- package/src/internal/builtin-plugins/network-manager/edr/utils/convert-to-edr.ts +43 -1
- package/src/internal/builtin-plugins/network-manager/index.ts +4 -4
- package/src/internal/builtin-plugins/network-manager/network-manager.ts +5 -6
- package/src/internal/builtin-plugins/network-manager/type-extensions/config.ts +5 -4
- package/src/internal/builtin-plugins/network-manager/type-extensions/global-options.ts +0 -1
- package/src/internal/builtin-plugins/network-manager/type-extensions/hooks.ts +0 -1
- package/src/internal/builtin-plugins/network-manager/type-extensions/hre.ts +0 -1
- package/src/internal/builtin-plugins/network-manager/type-validation.ts +7 -1
- package/src/internal/builtin-plugins/network-manager/utils/apply-coverage-network-overrides.ts +32 -0
- package/src/internal/builtin-plugins/node/json-rpc/handler.ts +7 -5
- package/src/internal/builtin-plugins/solidity/build-system/build-system.ts +32 -16
- package/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.ts +8 -2
- package/src/internal/builtin-plugins/solidity/constants.ts +11 -0
- package/src/internal/builtin-plugins/solidity/index.ts +2 -1
- package/src/internal/builtin-plugins/solidity/tasks/compile.ts +12 -0
- package/src/internal/builtin-plugins/solidity/type-extensions.ts +0 -4
- package/src/internal/builtin-plugins/solidity-test/config.ts +85 -12
- package/src/internal/builtin-plugins/solidity-test/eip712/ast-walker.ts +324 -0
- package/src/internal/builtin-plugins/solidity-test/eip712/canonicalize.ts +317 -0
- package/src/internal/builtin-plugins/solidity-test/eip712/glob.ts +225 -0
- package/src/internal/builtin-plugins/solidity-test/eip712/index.ts +120 -0
- package/src/internal/builtin-plugins/solidity-test/helpers.ts +28 -4
- package/src/internal/builtin-plugins/solidity-test/index.ts +1 -1
- package/src/internal/builtin-plugins/solidity-test/inline-config/constants.ts +6 -2
- package/src/internal/builtin-plugins/solidity-test/inline-config/helpers.ts +15 -4
- package/src/internal/builtin-plugins/solidity-test/inline-config/validation.ts +25 -4
- package/src/internal/builtin-plugins/solidity-test/task-action.ts +12 -1
- package/src/internal/builtin-plugins/solidity-test/test-profiles.ts +1 -0
- package/src/internal/builtin-plugins/solidity-test/type-extensions.ts +100 -34
- package/src/internal/builtin-plugins/test/index.ts +1 -1
- package/src/internal/builtin-plugins/test/type-extensions.ts +0 -1
- package/src/internal/cli/init/init.ts +198 -16
- package/src/internal/cli/main.ts +64 -1
- package/src/types/arguments.ts +2 -0
- package/src/types/artifacts.ts +2 -0
- package/src/types/builtin-plugin-type-extensions.ts +15 -0
- package/src/types/config.ts +1 -3
- package/src/types/global-options.ts +2 -0
- package/src/types/hooks.ts +2 -0
- package/src/types/hre.ts +2 -0
- package/src/types/index.ts +2 -0
- package/src/types/network.ts +2 -0
- package/src/types/plugins.ts +1 -3
- package/src/types/providers.ts +2 -0
- package/src/types/solidity.ts +2 -0
- package/src/types/tasks.ts +2 -0
- package/src/types/test.ts +2 -0
- package/src/types/user-interruptions.ts +2 -0
- package/templates/hardhat-3/01-node-test-runner-viem/package.json +12 -12
- package/templates/hardhat-3/01-node-test-runner-viem/tsconfig.json +4 -7
- package/templates/hardhat-3/02-mocha-ethers/package.json +15 -15
- package/templates/hardhat-3/02-mocha-ethers/tsconfig.json +4 -7
- package/templates/hardhat-3/03-minimal/package.json +2 -2
- package/templates/hardhat-3/03-minimal/tsconfig.json +4 -7
- package/coverage.sol +0 -38
|
@@ -20,8 +20,6 @@ import {
|
|
|
20
20
|
* @param sourceName The source name of the file, as present in the compilation
|
|
21
21
|
* job.
|
|
22
22
|
* @param fileContent The contents of the file.
|
|
23
|
-
* @param coverageLibraryPath The path to the coverage library. i.e. where to
|
|
24
|
-
* import it from.
|
|
25
23
|
* @returns An object with the instrumented source and its metadata, and the
|
|
26
24
|
* solidity version used to instrument the sources.
|
|
27
25
|
*/
|
|
@@ -29,12 +27,10 @@ export function instrumentSolidityFileForCompilationJob({
|
|
|
29
27
|
compilationJobSolcVersion,
|
|
30
28
|
sourceName,
|
|
31
29
|
fileContent,
|
|
32
|
-
coverageLibraryPath,
|
|
33
30
|
}: {
|
|
34
31
|
compilationJobSolcVersion: string;
|
|
35
32
|
sourceName: string;
|
|
36
33
|
fileContent: string;
|
|
37
|
-
coverageLibraryPath: string;
|
|
38
34
|
}): {
|
|
39
35
|
source: string;
|
|
40
36
|
metadata: InstrumentationMetadata[];
|
|
@@ -64,7 +60,6 @@ export function instrumentSolidityFileForCompilationJob({
|
|
|
64
60
|
fileContent,
|
|
65
61
|
sourceName,
|
|
66
62
|
instrumentationVersion,
|
|
67
|
-
coverageLibraryPath,
|
|
68
63
|
);
|
|
69
64
|
|
|
70
65
|
return { source, metadata, instrumentationVersion };
|
|
@@ -3,7 +3,7 @@ import type { HardhatPlugin } from "../../../types/plugins.js";
|
|
|
3
3
|
import { ArgumentType } from "../../../types/arguments.js";
|
|
4
4
|
import { globalFlag, globalOption, overrideTask } from "../../core/config.js";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
export type * from "./type-extensions.js";
|
|
7
7
|
|
|
8
8
|
const hardhatPlugin: HardhatPlugin = {
|
|
9
9
|
id: "builtin:gas-analytics",
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
remove,
|
|
14
14
|
writeJsonFile,
|
|
15
15
|
} from "@nomicfoundation/hardhat-utils/fs";
|
|
16
|
+
import { sanitizeFilename } from "@nomicfoundation/hardhat-utils/path";
|
|
16
17
|
|
|
17
18
|
import {
|
|
18
19
|
getFullyQualifiedName,
|
|
@@ -23,6 +24,16 @@ import { formatSectionHeader, getUserFqn } from "./helpers/utils.js";
|
|
|
23
24
|
|
|
24
25
|
export const SNAPSHOT_CHEATCODES_DIR = "snapshots";
|
|
25
26
|
|
|
27
|
+
export interface RenamedSnapshotGroup {
|
|
28
|
+
original: string;
|
|
29
|
+
sanitized: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface SanitizedSnapshotCheatcodes {
|
|
33
|
+
snapshotCheatcodes: SnapshotCheatcodesWithMetadataMap;
|
|
34
|
+
renamedGroups: RenamedSnapshotGroup[];
|
|
35
|
+
}
|
|
36
|
+
|
|
26
37
|
export type SnapshotCheatcodesMap = Map<
|
|
27
38
|
string, // group
|
|
28
39
|
Record<
|
|
@@ -68,6 +79,7 @@ export interface SnapshotCheatcodesCheckResult {
|
|
|
68
79
|
passed: boolean;
|
|
69
80
|
comparison: SnapshotCheatcodesComparison;
|
|
70
81
|
written: boolean;
|
|
82
|
+
renamedGroups: RenamedSnapshotGroup[];
|
|
71
83
|
}
|
|
72
84
|
|
|
73
85
|
export function getSnapshotCheatcodesPath(
|
|
@@ -77,6 +89,53 @@ export function getSnapshotCheatcodesPath(
|
|
|
77
89
|
return path.join(basePath, SNAPSHOT_CHEATCODES_DIR, filename);
|
|
78
90
|
}
|
|
79
91
|
|
|
92
|
+
/**
|
|
93
|
+
* Rekeys {@link snapshotCheatcodes} so each group name is safe to use as a
|
|
94
|
+
* filename component, returning the rekeyed map alongside the list of names
|
|
95
|
+
* that were actually changed by sanitization.
|
|
96
|
+
*
|
|
97
|
+
* @throws `SOLIDITY_TESTS.SNAPSHOT_GROUP_NAME_COLLISION` if two distinct
|
|
98
|
+
* original names sanitize to the same on-disk filename. Originals are
|
|
99
|
+
* sorted by codepoint in the error message so the same input always
|
|
100
|
+
* produces the same error text.
|
|
101
|
+
*/
|
|
102
|
+
export function sanitizeSnapshotCheatcodes(
|
|
103
|
+
snapshotCheatcodes: SnapshotCheatcodesWithMetadataMap,
|
|
104
|
+
): SanitizedSnapshotCheatcodes {
|
|
105
|
+
const sanitizedSnapshotCheatcodes: SnapshotCheatcodesWithMetadataMap =
|
|
106
|
+
new Map();
|
|
107
|
+
const originalBySanitized = new Map<string, string>();
|
|
108
|
+
const renamedGroups: RenamedSnapshotGroup[] = [];
|
|
109
|
+
|
|
110
|
+
for (const [original, entries] of snapshotCheatcodes) {
|
|
111
|
+
const sanitizedName = sanitizeFilename(original);
|
|
112
|
+
|
|
113
|
+
const previousOriginal = originalBySanitized.get(sanitizedName);
|
|
114
|
+
if (previousOriginal !== undefined) {
|
|
115
|
+
const [nameA, nameB] =
|
|
116
|
+
previousOriginal < original
|
|
117
|
+
? [previousOriginal, original]
|
|
118
|
+
: [original, previousOriginal];
|
|
119
|
+
throw new HardhatError(
|
|
120
|
+
HardhatError.ERRORS.CORE.SOLIDITY_TESTS.SNAPSHOT_GROUP_NAME_COLLISION,
|
|
121
|
+
{ nameA, nameB, sanitized: sanitizedName },
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
originalBySanitized.set(sanitizedName, original);
|
|
126
|
+
sanitizedSnapshotCheatcodes.set(sanitizedName, entries);
|
|
127
|
+
|
|
128
|
+
if (sanitizedName !== original) {
|
|
129
|
+
renamedGroups.push({ original, sanitized: sanitizedName });
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return {
|
|
134
|
+
snapshotCheatcodes: sanitizedSnapshotCheatcodes,
|
|
135
|
+
renamedGroups,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
80
139
|
export function extractSnapshotCheatcodes(
|
|
81
140
|
suiteResults: SuiteResult[],
|
|
82
141
|
): SnapshotCheatcodesWithMetadataMap {
|
|
@@ -295,7 +354,9 @@ export async function checkSnapshotCheatcodes(
|
|
|
295
354
|
basePath: string,
|
|
296
355
|
suiteResults: SuiteResult[],
|
|
297
356
|
): Promise<SnapshotCheatcodesCheckResult> {
|
|
298
|
-
const snapshotCheatcodes =
|
|
357
|
+
const { snapshotCheatcodes, renamedGroups } = sanitizeSnapshotCheatcodes(
|
|
358
|
+
extractSnapshotCheatcodes(suiteResults),
|
|
359
|
+
);
|
|
299
360
|
|
|
300
361
|
let previousSnapshotCheatcodes;
|
|
301
362
|
try {
|
|
@@ -316,6 +377,7 @@ export async function checkSnapshotCheatcodes(
|
|
|
316
377
|
changed: [],
|
|
317
378
|
},
|
|
318
379
|
written,
|
|
380
|
+
renamedGroups,
|
|
319
381
|
};
|
|
320
382
|
}
|
|
321
383
|
|
|
@@ -338,6 +400,7 @@ export async function checkSnapshotCheatcodes(
|
|
|
338
400
|
passed: comparison.changed.length === 0,
|
|
339
401
|
comparison,
|
|
340
402
|
written: hasAddedOrRemoved,
|
|
403
|
+
renamedGroups,
|
|
341
404
|
};
|
|
342
405
|
}
|
|
343
406
|
|
|
@@ -448,3 +511,29 @@ export function printSnapshotCheatcodeChanges(
|
|
|
448
511
|
}
|
|
449
512
|
}
|
|
450
513
|
}
|
|
514
|
+
|
|
515
|
+
export function logSnapshotRenameWarnings(
|
|
516
|
+
renamedGroups: RenamedSnapshotGroup[],
|
|
517
|
+
logger: typeof console.log = console.log,
|
|
518
|
+
): void {
|
|
519
|
+
if (renamedGroups.length === 0) {
|
|
520
|
+
return;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
logger(
|
|
524
|
+
styleText(
|
|
525
|
+
"yellow",
|
|
526
|
+
`Renamed ${renamedGroups.length} snapshot group name(s) for safe filesystem use:`,
|
|
527
|
+
),
|
|
528
|
+
);
|
|
529
|
+
for (const { original, sanitized } of renamedGroups) {
|
|
530
|
+
logger(styleText("yellow", ` "${original}" → "${sanitized}"`));
|
|
531
|
+
}
|
|
532
|
+
logger(
|
|
533
|
+
styleText(
|
|
534
|
+
"yellow",
|
|
535
|
+
"If you'd like the on-disk filename(s) to match exactly, consider renaming the group(s) in Solidity.",
|
|
536
|
+
),
|
|
537
|
+
);
|
|
538
|
+
logger();
|
|
539
|
+
}
|
|
@@ -2,7 +2,10 @@ import type { TaskOverrideActionFunction } from "../../../../../types/tasks.js";
|
|
|
2
2
|
import type { Result } from "../../../../../types/utils.js";
|
|
3
3
|
import type { SolidityTestRunResult } from "../../../solidity-test/task-action.js";
|
|
4
4
|
import type { FunctionGasSnapshotCheckResult } from "../../function-gas-snapshots.js";
|
|
5
|
-
import type {
|
|
5
|
+
import type {
|
|
6
|
+
SnapshotCheatcodesCheckResult,
|
|
7
|
+
RenamedSnapshotGroup,
|
|
8
|
+
} from "../../snapshot-cheatcodes.js";
|
|
6
9
|
import type { SuiteResult } from "@nomicfoundation/edr";
|
|
7
10
|
|
|
8
11
|
import { styleText } from "node:util";
|
|
@@ -20,6 +23,8 @@ import {
|
|
|
20
23
|
checkSnapshotCheatcodes,
|
|
21
24
|
extractSnapshotCheatcodes,
|
|
22
25
|
logSnapshotCheatcodesSection,
|
|
26
|
+
logSnapshotRenameWarnings,
|
|
27
|
+
sanitizeSnapshotCheatcodes,
|
|
23
28
|
writeSnapshotCheatcodes,
|
|
24
29
|
} from "../../snapshot-cheatcodes.js";
|
|
25
30
|
|
|
@@ -30,6 +35,7 @@ interface GasAnalyticsTestActionArguments {
|
|
|
30
35
|
|
|
31
36
|
export interface SnapshotResult {
|
|
32
37
|
functionGasSnapshotsWritten: boolean;
|
|
38
|
+
renamedGroups: RenamedSnapshotGroup[];
|
|
33
39
|
}
|
|
34
40
|
|
|
35
41
|
export interface SnapshotCheckResult {
|
|
@@ -91,11 +97,14 @@ export async function handleSnapshot(
|
|
|
91
97
|
await writeFunctionGasSnapshots(basePath, functionGasSnapshots);
|
|
92
98
|
}
|
|
93
99
|
|
|
94
|
-
const snapshotCheatcodes =
|
|
100
|
+
const { snapshotCheatcodes, renamedGroups } = sanitizeSnapshotCheatcodes(
|
|
101
|
+
extractSnapshotCheatcodes(suiteResults),
|
|
102
|
+
);
|
|
95
103
|
await writeSnapshotCheatcodes(basePath, snapshotCheatcodes);
|
|
96
104
|
|
|
97
105
|
return {
|
|
98
106
|
functionGasSnapshotsWritten: testsPassed,
|
|
107
|
+
renamedGroups,
|
|
99
108
|
};
|
|
100
109
|
}
|
|
101
110
|
|
|
@@ -107,6 +116,7 @@ export function logSnapshotResult(
|
|
|
107
116
|
logger(styleText("green", "Function gas snapshots written successfully"));
|
|
108
117
|
logger();
|
|
109
118
|
}
|
|
119
|
+
logSnapshotRenameWarnings(result.renamedGroups, logger);
|
|
110
120
|
}
|
|
111
121
|
|
|
112
122
|
export async function handleSnapshotCheck(
|
|
@@ -164,6 +174,18 @@ export function logSnapshotCheckResult(
|
|
|
164
174
|
|
|
165
175
|
logSnapshotCheatcodesSection(snapshotCheatcodesCheck, logger);
|
|
166
176
|
|
|
177
|
+
// Add an extra newline if only the rename warnings have output
|
|
178
|
+
// (logSnapshotCheatcodesSection adds one if it has output)
|
|
179
|
+
if (
|
|
180
|
+
!functionGasHasOutput &&
|
|
181
|
+
!snapshotCheatcodesHasOutput &&
|
|
182
|
+
snapshotCheatcodesCheck.renamedGroups.length > 0
|
|
183
|
+
) {
|
|
184
|
+
logger();
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
logSnapshotRenameWarnings(snapshotCheatcodesCheck.renamedGroups, logger);
|
|
188
|
+
|
|
167
189
|
if (!functionGasSnapshotsCheck.passed || !snapshotCheatcodesCheck.passed) {
|
|
168
190
|
logger(
|
|
169
191
|
styleText(
|
|
@@ -14,21 +14,21 @@ import solidityTest from "./solidity-test/index.js";
|
|
|
14
14
|
import telemetry from "./telemetry/index.js";
|
|
15
15
|
import test from "./test/index.js";
|
|
16
16
|
|
|
17
|
-
//
|
|
18
|
-
// type extensions
|
|
17
|
+
// NOTE: We export the built-in plugin types to have a centralized way to
|
|
18
|
+
// re-export them and force their type extensions to be loaded.
|
|
19
19
|
export type * from "./artifacts/index.js";
|
|
20
|
-
export type * from "./solidity/index.js";
|
|
21
|
-
export type * from "./test/index.js";
|
|
22
|
-
export type * from "./solidity-test/index.js";
|
|
23
|
-
export type * from "./gas-analytics/index.js";
|
|
24
|
-
export type * from "./network-manager/index.js";
|
|
25
20
|
export type * from "./clean/index.js";
|
|
26
21
|
export type * from "./console/index.js";
|
|
27
|
-
export type * from "./run/index.js";
|
|
28
|
-
export type * from "./node/index.js";
|
|
29
|
-
export type * from "./flatten/index.js";
|
|
30
22
|
export type * from "./coverage/index.js";
|
|
23
|
+
export type * from "./flatten/index.js";
|
|
24
|
+
export type * from "./gas-analytics/index.js";
|
|
25
|
+
export type * from "./network-manager/index.js";
|
|
26
|
+
export type * from "./node/index.js";
|
|
27
|
+
export type * from "./run/index.js";
|
|
28
|
+
export type * from "./solidity/index.js";
|
|
29
|
+
export type * from "./solidity-test/index.js";
|
|
31
30
|
export type * from "./telemetry/index.js";
|
|
31
|
+
export type * from "./test/index.js";
|
|
32
32
|
|
|
33
33
|
// This array should be kept in order, respecting the dependencies between the
|
|
34
34
|
// plugins.
|
|
@@ -83,9 +83,12 @@ export function resolveEdrNetwork(
|
|
|
83
83
|
|
|
84
84
|
allowBlocksWithSameTimestamp:
|
|
85
85
|
networkConfig.allowBlocksWithSameTimestamp ?? false,
|
|
86
|
-
allowUnlimitedContractSize:
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
allowUnlimitedContractSize: networkConfig.allowUnlimitedContractSize,
|
|
87
|
+
blockGasLimit:
|
|
88
|
+
typeof networkConfig.blockGasLimit === "number" ||
|
|
89
|
+
typeof networkConfig.blockGasLimit === "bigint"
|
|
90
|
+
? toBigInt(networkConfig.blockGasLimit)
|
|
91
|
+
: networkConfig.blockGasLimit,
|
|
89
92
|
coinbase: resolveCoinbase(networkConfig.coinbase),
|
|
90
93
|
|
|
91
94
|
forking: resolveForkingConfig(
|
|
@@ -108,6 +111,11 @@ export function resolveEdrNetwork(
|
|
|
108
111
|
throwOnCallFailures: networkConfig.throwOnCallFailures ?? true,
|
|
109
112
|
throwOnTransactionFailures:
|
|
110
113
|
networkConfig.throwOnTransactionFailures ?? true,
|
|
114
|
+
transactionGasCap:
|
|
115
|
+
typeof networkConfig.transactionGasCap === "number" ||
|
|
116
|
+
typeof networkConfig.transactionGasCap === "bigint"
|
|
117
|
+
? toBigInt(networkConfig.transactionGasCap)
|
|
118
|
+
: networkConfig.transactionGasCap,
|
|
111
119
|
};
|
|
112
120
|
}
|
|
113
121
|
|
|
@@ -8,6 +8,8 @@ import { DEFAULT_HD_ACCOUNTS_CONFIG_PARAMS } from "../accounts/constants.js";
|
|
|
8
8
|
export const EDR_NETWORK_DEFAULT_COINBASE =
|
|
9
9
|
"0xc014ba5ec014ba5ec014ba5ec014ba5ec014ba5e";
|
|
10
10
|
|
|
11
|
+
export const DEFAULT_EDR_NETWORK_BLOCK_GAS_LIMIT = 60_000_000n;
|
|
12
|
+
|
|
11
13
|
interface EdrNetworkDefaultHDAccountsConfigParams
|
|
12
14
|
extends DefaultHDAccountsConfigParams {
|
|
13
15
|
mnemonic: string;
|
|
@@ -45,6 +45,7 @@ import {
|
|
|
45
45
|
UnknownError,
|
|
46
46
|
} from "../provider-errors.js";
|
|
47
47
|
|
|
48
|
+
import { DEFAULT_EDR_NETWORK_BLOCK_GAS_LIMIT } from "./edr-constants.js";
|
|
48
49
|
import { getGenesisStateAndOwnedAccounts } from "./genesis-state.js";
|
|
49
50
|
import { EdrProviderStackTraceGenerationError } from "./stack-traces/stack-trace-generation-errors.js";
|
|
50
51
|
import { createSolidityErrorWithStackTrace } from "./stack-traces/stack-trace-solidity-errors.js";
|
|
@@ -56,6 +57,7 @@ import {
|
|
|
56
57
|
hardhatMempoolOrderToEdrMineOrdering,
|
|
57
58
|
hardhatHardforkToEdrSpecId,
|
|
58
59
|
hardhatForkingConfigToEdrForkConfig,
|
|
60
|
+
resolveDefaultTransactionGasLimit,
|
|
59
61
|
} from "./utils/convert-to-edr.js";
|
|
60
62
|
import { printLine, replaceLastLine } from "./utils/logger.js";
|
|
61
63
|
|
|
@@ -457,6 +459,15 @@ export async function getProviderConfig(
|
|
|
457
459
|
networkConfig.chainType,
|
|
458
460
|
);
|
|
459
461
|
|
|
462
|
+
const genesisBlockGasLimit =
|
|
463
|
+
typeof networkConfig.blockGasLimit === "bigint"
|
|
464
|
+
? networkConfig.blockGasLimit
|
|
465
|
+
: DEFAULT_EDR_NETWORK_BLOCK_GAS_LIMIT;
|
|
466
|
+
|
|
467
|
+
// EDR's mining block gas limit can be disabled in user config explicitly
|
|
468
|
+
const miningBlockGasLimit =
|
|
469
|
+
networkConfig.blockGasLimit === false ? undefined : genesisBlockGasLimit;
|
|
470
|
+
|
|
460
471
|
const { genesisState, ownedAccounts } = await getGenesisStateAndOwnedAccounts(
|
|
461
472
|
networkConfig.accounts,
|
|
462
473
|
networkConfig.forking,
|
|
@@ -464,26 +475,43 @@ export async function getProviderConfig(
|
|
|
464
475
|
specId,
|
|
465
476
|
);
|
|
466
477
|
|
|
478
|
+
const forkConfig = await hardhatForkingConfigToEdrForkConfig(
|
|
479
|
+
networkConfig.forking,
|
|
480
|
+
chainDescriptors,
|
|
481
|
+
networkConfig.chainType,
|
|
482
|
+
);
|
|
483
|
+
|
|
484
|
+
const network =
|
|
485
|
+
forkConfig !== undefined
|
|
486
|
+
? forkConfig
|
|
487
|
+
: {
|
|
488
|
+
genesisBlockGasLimit,
|
|
489
|
+
genesisBlockTime: BigInt(toSeconds(networkConfig.initialDate)),
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
const defaultTransactionGasLimit = resolveDefaultTransactionGasLimit({
|
|
493
|
+
chainType: networkConfig.chainType,
|
|
494
|
+
hardfork: networkConfig.hardfork,
|
|
495
|
+
blockGasLimit: genesisBlockGasLimit,
|
|
496
|
+
transactionGasCap: networkConfig.transactionGasCap,
|
|
497
|
+
});
|
|
498
|
+
|
|
467
499
|
return {
|
|
468
500
|
allowBlocksWithSameTimestamp: networkConfig.allowBlocksWithSameTimestamp,
|
|
469
|
-
allowUnlimitedContractSize:
|
|
501
|
+
allowUnlimitedContractSize:
|
|
502
|
+
networkConfig.allowUnlimitedContractSize ?? false,
|
|
470
503
|
bailOnCallFailure: networkConfig.throwOnCallFailures,
|
|
471
504
|
bailOnTransactionFailure: networkConfig.throwOnTransactionFailures,
|
|
472
|
-
blockGasLimit: networkConfig.blockGasLimit,
|
|
473
505
|
chainId: BigInt(networkConfig.chainId),
|
|
474
506
|
coinbase: networkConfig.coinbase,
|
|
475
|
-
|
|
476
|
-
networkConfig.forking,
|
|
477
|
-
chainDescriptors,
|
|
478
|
-
networkConfig.chainType,
|
|
479
|
-
),
|
|
507
|
+
defaultTransactionGasLimit,
|
|
480
508
|
genesisState: Array.from(genesisState.values()),
|
|
481
509
|
hardfork: specId,
|
|
482
510
|
initialBaseFeePerGas: networkConfig.initialBaseFeePerGas,
|
|
483
|
-
initialDate: BigInt(toSeconds(networkConfig.initialDate)),
|
|
484
511
|
minGasPrice: networkConfig.minGasPrice,
|
|
485
512
|
mining: {
|
|
486
513
|
autoMine: networkConfig.mining.auto,
|
|
514
|
+
blockGasLimit: miningBlockGasLimit,
|
|
487
515
|
interval: hardhatMiningIntervalToEdrMiningInterval(
|
|
488
516
|
networkConfig.mining.interval,
|
|
489
517
|
),
|
|
@@ -493,6 +521,7 @@ export async function getProviderConfig(
|
|
|
493
521
|
),
|
|
494
522
|
},
|
|
495
523
|
},
|
|
524
|
+
network,
|
|
496
525
|
networkId: BigInt(networkConfig.networkId),
|
|
497
526
|
observability: {
|
|
498
527
|
codeCoverage: coverageConfig,
|
|
@@ -501,5 +530,6 @@ export async function getProviderConfig(
|
|
|
501
530
|
},
|
|
502
531
|
ownedAccounts: ownedAccounts.map((account) => account.secretKey),
|
|
503
532
|
precompileOverrides: [],
|
|
533
|
+
transactionGasCap: networkConfig.transactionGasCap,
|
|
504
534
|
};
|
|
505
535
|
}
|
package/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-solidity-errors.ts
CHANGED
|
@@ -29,24 +29,23 @@ export function createSolidityErrorWithStackTrace(
|
|
|
29
29
|
): SolidityError {
|
|
30
30
|
const originalPrepareStackTrace = Error.prepareStackTrace;
|
|
31
31
|
|
|
32
|
+
assertHardhatInvariant(
|
|
33
|
+
originalPrepareStackTrace !== undefined,
|
|
34
|
+
"Error.prepareStackTrace should be defined",
|
|
35
|
+
);
|
|
36
|
+
|
|
32
37
|
try {
|
|
33
38
|
Error.prepareStackTrace = (error, stack) => {
|
|
34
39
|
// Skip error management related stack traces
|
|
35
|
-
const adjustedStack = stack
|
|
40
|
+
const [, ...adjustedStack] = stack;
|
|
36
41
|
|
|
42
|
+
const prefix = [];
|
|
37
43
|
for (const entry of stackTrace) {
|
|
38
44
|
const callsite = encodeStackTraceEntry(entry);
|
|
39
|
-
if (callsite !== undefined)
|
|
40
|
-
adjustedStack.unshift(callsite);
|
|
41
|
-
}
|
|
45
|
+
if (callsite !== undefined) prefix.push(callsite);
|
|
42
46
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
originalPrepareStackTrace !== undefined,
|
|
46
|
-
"Error.prepareStackTrace should be defined",
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
return originalPrepareStackTrace(error, adjustedStack);
|
|
47
|
+
prefix.reverse();
|
|
48
|
+
return originalPrepareStackTrace(error, [...prefix, ...adjustedStack]);
|
|
50
49
|
};
|
|
51
50
|
|
|
52
51
|
const message =
|
|
@@ -62,7 +62,11 @@ import {
|
|
|
62
62
|
EDR_NETWORK_DEFAULT_PRIVATE_KEYS,
|
|
63
63
|
isDefaultEdrNetworkHDAccountsConfig,
|
|
64
64
|
} from "../edr-constants.js";
|
|
65
|
-
import {
|
|
65
|
+
import {
|
|
66
|
+
hardforkGte,
|
|
67
|
+
L1HardforkName,
|
|
68
|
+
OpHardforkName,
|
|
69
|
+
} from "../types/hardfork.js";
|
|
66
70
|
|
|
67
71
|
import { getL1HardforkName, getOpHardforkName } from "./hardfork.js";
|
|
68
72
|
|
|
@@ -382,6 +386,44 @@ export async function hardhatForkingConfigToEdrForkConfig(
|
|
|
382
386
|
return fork;
|
|
383
387
|
}
|
|
384
388
|
|
|
389
|
+
/**
|
|
390
|
+
* Resolves the default transaction gas limit used by RPC call and
|
|
391
|
+
* transaction requests that omit a `gas` field.
|
|
392
|
+
*
|
|
393
|
+
* When `transactionGasCap` is a bigint, that value wins. When it is
|
|
394
|
+
* `false`, the per-transaction cap is disabled and the block gas limit is
|
|
395
|
+
* used. When it is undefined, the hardfork-specific default applies:
|
|
396
|
+
* from L1's Osaka hardfork onwards, the EIP-7825 transaction gas cap of
|
|
397
|
+
* 16,777,216; otherwise the block gas limit.
|
|
398
|
+
*/
|
|
399
|
+
export function resolveDefaultTransactionGasLimit(params: {
|
|
400
|
+
chainType: ChainType;
|
|
401
|
+
hardfork: string;
|
|
402
|
+
blockGasLimit: bigint;
|
|
403
|
+
transactionGasCap: bigint | false | undefined;
|
|
404
|
+
}): bigint {
|
|
405
|
+
const { chainType, hardfork, blockGasLimit, transactionGasCap } = params;
|
|
406
|
+
|
|
407
|
+
if (typeof transactionGasCap === "bigint") {
|
|
408
|
+
return transactionGasCap;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
if (transactionGasCap === false) {
|
|
412
|
+
return blockGasLimit;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
// TODO: OP UPGRADE 19 - update OP to also set a default transaction gas once enabled
|
|
416
|
+
if (chainType === OPTIMISM_CHAIN_TYPE) {
|
|
417
|
+
return blockGasLimit;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
if (hardforkGte(hardfork, L1HardforkName.OSAKA, chainType)) {
|
|
421
|
+
return 16_777_216n; // EIP-7825 transaction gas cap
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
return blockGasLimit;
|
|
425
|
+
}
|
|
426
|
+
|
|
385
427
|
/**
|
|
386
428
|
* Converts EDR's nested GasReport structure into a flat array of gas entries.
|
|
387
429
|
* Filters out reverted transactions.
|
|
@@ -3,10 +3,10 @@ import type { HardhatPlugin } from "../../../types/plugins.js";
|
|
|
3
3
|
import { ArgumentType } from "../../../types/arguments.js";
|
|
4
4
|
import { globalOption } from "../../core/config.js";
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
export type * from "./type-extensions/config.js";
|
|
7
|
+
export type * from "./type-extensions/global-options.js";
|
|
8
|
+
export type * from "./type-extensions/hooks.js";
|
|
9
|
+
export type * from "./type-extensions/hre.js";
|
|
10
10
|
|
|
11
11
|
const hardhatPlugin: HardhatPlugin = {
|
|
12
12
|
id: "builtin:network-manager",
|
|
@@ -42,6 +42,7 @@ import { edrGasReportToHardhatGasMeasurements } from "./edr/utils/convert-to-edr
|
|
|
42
42
|
import { verbosityToIncludeTraces } from "./edr/utils/trace-formatters.js";
|
|
43
43
|
import { HttpProvider } from "./http-provider.js";
|
|
44
44
|
import { NetworkConnectionImplementation } from "./network-connection.js";
|
|
45
|
+
import { applyCoverageNetworkOverrides } from "./utils/apply-coverage-network-overrides.js";
|
|
45
46
|
|
|
46
47
|
export type JsonRpcRequestWrapperFunction = (
|
|
47
48
|
request: JsonRpcRequest,
|
|
@@ -360,12 +361,10 @@ export class NetworkManagerImplementation implements NetworkManager {
|
|
|
360
361
|
// The resolvedNetworkConfig can have its chainType set to `undefined`
|
|
361
362
|
// so we default to the default chain type here.
|
|
362
363
|
networkConfig: {
|
|
363
|
-
...
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
? true
|
|
368
|
-
: resolvedNetworkConfig.allowUnlimitedContractSize,
|
|
364
|
+
...applyCoverageNetworkOverrides(
|
|
365
|
+
resolvedNetworkConfig,
|
|
366
|
+
shouldEnableCoverage,
|
|
367
|
+
),
|
|
369
368
|
chainType: resolvedChainType,
|
|
370
369
|
},
|
|
371
370
|
jsonRpcRequestWrapper,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ChainType, DefaultChainType } from "../../../../types/network.js";
|
|
2
2
|
|
|
3
|
-
import "../../../../types/config.js";
|
|
4
3
|
declare module "../../../../types/config.js" {
|
|
5
4
|
export interface HardhatUserConfig {
|
|
6
5
|
chainDescriptors?: ChainDescriptorsUserConfig;
|
|
@@ -112,7 +111,7 @@ declare module "../../../../types/config.js" {
|
|
|
112
111
|
// EDR network specific
|
|
113
112
|
allowBlocksWithSameTimestamp?: boolean;
|
|
114
113
|
allowUnlimitedContractSize?: boolean;
|
|
115
|
-
blockGasLimit?: number | bigint;
|
|
114
|
+
blockGasLimit?: number | bigint | false;
|
|
116
115
|
coinbase?: string;
|
|
117
116
|
forking?: EdrNetworkForkingUserConfig;
|
|
118
117
|
hardfork?: string;
|
|
@@ -124,6 +123,7 @@ declare module "../../../../types/config.js" {
|
|
|
124
123
|
networkId?: number;
|
|
125
124
|
throwOnCallFailures?: boolean;
|
|
126
125
|
throwOnTransactionFailures?: boolean;
|
|
126
|
+
transactionGasCap?: number | bigint | false;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
export type EdrNetworkAccountsUserConfig =
|
|
@@ -256,8 +256,8 @@ declare module "../../../../types/config.js" {
|
|
|
256
256
|
|
|
257
257
|
// EDR network specific
|
|
258
258
|
allowBlocksWithSameTimestamp: boolean;
|
|
259
|
-
allowUnlimitedContractSize
|
|
260
|
-
blockGasLimit
|
|
259
|
+
allowUnlimitedContractSize?: boolean;
|
|
260
|
+
blockGasLimit?: bigint | false;
|
|
261
261
|
coinbase: Uint8Array;
|
|
262
262
|
forking?: EdrNetworkForkingConfig;
|
|
263
263
|
hardfork: string;
|
|
@@ -269,6 +269,7 @@ declare module "../../../../types/config.js" {
|
|
|
269
269
|
networkId: number;
|
|
270
270
|
throwOnCallFailures: boolean;
|
|
271
271
|
throwOnTransactionFailures: boolean;
|
|
272
|
+
transactionGasCap?: bigint | false;
|
|
272
273
|
}
|
|
273
274
|
|
|
274
275
|
export type EdrNetworkAccountsConfig =
|
|
@@ -9,7 +9,6 @@ import type {
|
|
|
9
9
|
import type { CoverageData } from "../../coverage/types.js";
|
|
10
10
|
import type { GasMeasurement } from "../../gas-analytics/types.js";
|
|
11
11
|
|
|
12
|
-
import "../../../../types/hooks.js";
|
|
13
12
|
declare module "../../../../types/hooks.js" {
|
|
14
13
|
export interface HardhatHooks {
|
|
15
14
|
network: NetworkHooks;
|
|
@@ -220,6 +220,11 @@ const gasUnitUserConfigSchema = unionType(
|
|
|
220
220
|
"Expected a positive safe int or a positive bigint",
|
|
221
221
|
);
|
|
222
222
|
|
|
223
|
+
const gasLimitWithDisableUserConfigSchema = unionType(
|
|
224
|
+
[gasUnitUserConfigSchema, z.literal(false)],
|
|
225
|
+
"Expected `false`, a positive safe int, or a positive bigint",
|
|
226
|
+
);
|
|
227
|
+
|
|
223
228
|
const gasUserConfigSchema = unionType(
|
|
224
229
|
[z.literal("auto"), gasUnitUserConfigSchema],
|
|
225
230
|
"Expected 'auto', a positive safe int, or positive bigint",
|
|
@@ -311,7 +316,7 @@ const edrNetworkUserConfigSchema = z.object({
|
|
|
311
316
|
// EDR network specific
|
|
312
317
|
allowBlocksWithSameTimestamp: z.optional(z.boolean()),
|
|
313
318
|
allowUnlimitedContractSize: z.optional(z.boolean()),
|
|
314
|
-
blockGasLimit: z.optional(
|
|
319
|
+
blockGasLimit: z.optional(gasLimitWithDisableUserConfigSchema),
|
|
315
320
|
coinbase: z.optional(z.string()),
|
|
316
321
|
forking: z.optional(edrNetworkForkingUserConfigSchema),
|
|
317
322
|
hardfork: z.optional(z.string()),
|
|
@@ -325,6 +330,7 @@ const edrNetworkUserConfigSchema = z.object({
|
|
|
325
330
|
networkId: z.optional(chainIdSchema),
|
|
326
331
|
throwOnCallFailures: z.optional(z.boolean()),
|
|
327
332
|
throwOnTransactionFailures: z.optional(z.boolean()),
|
|
333
|
+
transactionGasCap: z.optional(gasLimitWithDisableUserConfigSchema),
|
|
328
334
|
});
|
|
329
335
|
|
|
330
336
|
const networkUserConfigSchema = z.discriminatedUnion("type", [
|