hardhat 2.11.0-dev.0 → 2.11.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/builtin-tasks/clean.js +2 -1
- package/builtin-tasks/clean.js.map +1 -1
- package/builtin-tasks/compile.js +52 -95
- package/builtin-tasks/compile.js.map +1 -1
- package/builtin-tasks/flatten.js +2 -21
- package/builtin-tasks/flatten.js.map +1 -1
- package/builtin-tasks/node.js +1 -1
- package/builtin-tasks/node.js.map +1 -1
- package/builtin-tasks/test.js +3 -3
- package/builtin-tasks/test.js.map +1 -1
- package/builtin-tasks/utils/solidity-files-cache.d.ts.map +1 -1
- package/builtin-tasks/utils/solidity-files-cache.js +5 -6
- package/builtin-tasks/utils/solidity-files-cache.js.map +1 -1
- package/internal/artifacts.d.ts +3 -11
- package/internal/artifacts.d.ts.map +1 -1
- package/internal/artifacts.js +266 -133
- package/internal/artifacts.js.map +1 -1
- package/internal/cli/cli.js +26 -12
- package/internal/cli/cli.js.map +1 -1
- package/internal/core/config/config-loading.js +2 -2
- package/internal/core/config/config-loading.js.map +1 -1
- package/internal/core/config/config-resolution.d.ts.map +1 -1
- package/internal/core/config/config-resolution.js +11 -31
- package/internal/core/config/config-resolution.js.map +1 -1
- package/internal/core/config/default-config.js +1 -1
- package/internal/core/config/default-config.js.map +1 -1
- package/internal/core/errors-list.d.ts +7 -0
- package/internal/core/errors-list.d.ts.map +1 -1
- package/internal/core/errors-list.js +28 -11
- package/internal/core/errors-list.js.map +1 -1
- package/internal/core/errors.d.ts +2 -1
- package/internal/core/errors.d.ts.map +1 -1
- package/internal/core/errors.js +5 -1
- package/internal/core/errors.js.map +1 -1
- package/internal/core/execution-mode.d.ts.map +1 -1
- package/internal/core/execution-mode.js +2 -21
- package/internal/core/execution-mode.js.map +1 -1
- package/internal/core/flamegraph.d.ts +4 -0
- package/internal/core/flamegraph.d.ts.map +1 -1
- package/internal/core/flamegraph.js +13 -3
- package/internal/core/flamegraph.js.map +1 -1
- package/internal/core/jsonrpc/types/base-types.d.ts.map +1 -1
- package/internal/core/jsonrpc/types/base-types.js +12 -12
- package/internal/core/jsonrpc/types/base-types.js.map +1 -1
- package/internal/core/params/hardhat-params.d.ts.map +1 -1
- package/internal/core/params/hardhat-params.js +18 -0
- package/internal/core/params/hardhat-params.js.map +1 -1
- package/internal/core/providers/accounts.js +9 -9
- package/internal/core/providers/accounts.js.map +1 -1
- package/internal/core/providers/construction.d.ts.map +1 -1
- package/internal/core/providers/construction.js +5 -6
- package/internal/core/providers/construction.js.map +1 -1
- package/internal/core/providers/gas-providers.d.ts +2 -2
- package/internal/core/providers/util.js +1 -1
- package/internal/core/providers/util.js.map +1 -1
- package/internal/core/runtime-environment.d.ts +6 -0
- package/internal/core/runtime-environment.d.ts.map +1 -1
- package/internal/core/runtime-environment.js +72 -6
- package/internal/core/runtime-environment.js.map +1 -1
- package/internal/core/typescript-support.d.ts +1 -1
- package/internal/core/typescript-support.d.ts.map +1 -1
- package/internal/core/typescript-support.js +6 -2
- package/internal/core/typescript-support.js.map +1 -1
- package/internal/hardhat-network/jsonrpc/client.d.ts +1 -1
- package/internal/hardhat-network/jsonrpc/client.d.ts.map +1 -1
- package/internal/hardhat-network/jsonrpc/client.js +10 -10
- package/internal/hardhat-network/jsonrpc/client.js.map +1 -1
- package/internal/hardhat-network/provider/BlockchainBase.d.ts +4 -4
- package/internal/hardhat-network/provider/BlockchainBase.d.ts.map +1 -1
- package/internal/hardhat-network/provider/BlockchainBase.js +31 -12
- package/internal/hardhat-network/provider/BlockchainBase.js.map +1 -1
- package/internal/hardhat-network/provider/BlockchainData.d.ts +3 -3
- package/internal/hardhat-network/provider/BlockchainData.d.ts.map +1 -1
- package/internal/hardhat-network/provider/BlockchainData.js +15 -15
- package/internal/hardhat-network/provider/BlockchainData.js.map +1 -1
- package/internal/hardhat-network/provider/HardhatBlockchain.d.ts +3 -3
- package/internal/hardhat-network/provider/HardhatBlockchain.d.ts.map +1 -1
- package/internal/hardhat-network/provider/HardhatBlockchain.js +2 -2
- package/internal/hardhat-network/provider/HardhatBlockchain.js.map +1 -1
- package/internal/hardhat-network/provider/PoolState.d.ts +1 -1
- package/internal/hardhat-network/provider/PoolState.d.ts.map +1 -1
- package/internal/hardhat-network/provider/PoolState.js +21 -2
- package/internal/hardhat-network/provider/PoolState.js.map +1 -1
- package/internal/hardhat-network/provider/TransactionQueue.d.ts +1 -1
- package/internal/hardhat-network/provider/TransactionQueue.d.ts.map +1 -1
- package/internal/hardhat-network/provider/TransactionQueue.js +22 -3
- package/internal/hardhat-network/provider/TransactionQueue.js.map +1 -1
- package/internal/hardhat-network/provider/TxPool.d.ts +4 -4
- package/internal/hardhat-network/provider/TxPool.d.ts.map +1 -1
- package/internal/hardhat-network/provider/TxPool.js +35 -16
- package/internal/hardhat-network/provider/TxPool.js.map +1 -1
- package/internal/hardhat-network/provider/ethereumjs-workarounds.js +4 -4
- package/internal/hardhat-network/provider/ethereumjs-workarounds.js.map +1 -1
- package/internal/hardhat-network/provider/filter.d.ts +1 -1
- package/internal/hardhat-network/provider/filter.d.ts.map +1 -1
- package/internal/hardhat-network/provider/filter.js +3 -3
- package/internal/hardhat-network/provider/filter.js.map +1 -1
- package/internal/hardhat-network/provider/fork/ForkBlockchain.d.ts +3 -3
- package/internal/hardhat-network/provider/fork/ForkBlockchain.d.ts.map +1 -1
- package/internal/hardhat-network/provider/fork/ForkBlockchain.js +13 -12
- package/internal/hardhat-network/provider/fork/ForkBlockchain.js.map +1 -1
- package/internal/hardhat-network/provider/fork/ForkStateManager.d.ts +3 -5
- package/internal/hardhat-network/provider/fork/ForkStateManager.d.ts.map +1 -1
- package/internal/hardhat-network/provider/fork/ForkStateManager.js +36 -40
- package/internal/hardhat-network/provider/fork/ForkStateManager.js.map +1 -1
- package/internal/hardhat-network/provider/fork/rpcToBlockData.d.ts +1 -1
- package/internal/hardhat-network/provider/fork/rpcToBlockData.d.ts.map +1 -1
- package/internal/hardhat-network/provider/fork/rpcToTxData.d.ts +2 -2
- package/internal/hardhat-network/provider/fork/rpcToTxData.d.ts.map +1 -1
- package/internal/hardhat-network/provider/fork/rpcToTxData.js.map +1 -1
- package/internal/hardhat-network/provider/modules/eth.d.ts +1 -1
- package/internal/hardhat-network/provider/modules/eth.d.ts.map +1 -1
- package/internal/hardhat-network/provider/modules/eth.js +22 -22
- package/internal/hardhat-network/provider/modules/eth.js.map +1 -1
- package/internal/hardhat-network/provider/modules/hardhat.d.ts +2 -0
- package/internal/hardhat-network/provider/modules/hardhat.d.ts.map +1 -1
- package/internal/hardhat-network/provider/modules/hardhat.js +20 -6
- package/internal/hardhat-network/provider/modules/hardhat.js.map +1 -1
- package/internal/hardhat-network/provider/modules/logger.d.ts +2 -2
- package/internal/hardhat-network/provider/modules/logger.d.ts.map +1 -1
- package/internal/hardhat-network/provider/modules/logger.js +14 -14
- package/internal/hardhat-network/provider/modules/logger.js.map +1 -1
- package/internal/hardhat-network/provider/modules/net.d.ts +1 -1
- package/internal/hardhat-network/provider/modules/net.d.ts.map +1 -1
- package/internal/hardhat-network/provider/modules/personal.js +3 -3
- package/internal/hardhat-network/provider/modules/personal.js.map +1 -1
- package/internal/hardhat-network/provider/modules/web3.d.ts.map +1 -1
- package/internal/hardhat-network/provider/modules/web3.js +4 -5
- package/internal/hardhat-network/provider/modules/web3.js.map +1 -1
- package/internal/hardhat-network/provider/node-types.d.ts +4 -4
- package/internal/hardhat-network/provider/node-types.d.ts.map +1 -1
- package/internal/hardhat-network/provider/node.d.ts +5 -4
- package/internal/hardhat-network/provider/node.d.ts.map +1 -1
- package/internal/hardhat-network/provider/node.js +71 -49
- package/internal/hardhat-network/provider/node.js.map +1 -1
- package/internal/hardhat-network/provider/output.d.ts +4 -4
- package/internal/hardhat-network/provider/output.d.ts.map +1 -1
- package/internal/hardhat-network/provider/output.js +24 -5
- package/internal/hardhat-network/provider/output.js.map +1 -1
- package/internal/hardhat-network/provider/provider.d.ts +2 -2
- package/internal/hardhat-network/provider/provider.d.ts.map +1 -1
- package/internal/hardhat-network/provider/provider.js +3 -3
- package/internal/hardhat-network/provider/provider.js.map +1 -1
- package/internal/hardhat-network/provider/return-data.d.ts +1 -1
- package/internal/hardhat-network/provider/return-data.d.ts.map +1 -1
- package/internal/hardhat-network/provider/return-data.js +5 -4
- package/internal/hardhat-network/provider/return-data.js.map +1 -1
- package/internal/hardhat-network/provider/transactions/FakeSenderAccessListEIP2930Transaction.d.ts +4 -4
- package/internal/hardhat-network/provider/transactions/FakeSenderAccessListEIP2930Transaction.d.ts.map +1 -1
- package/internal/hardhat-network/provider/transactions/FakeSenderAccessListEIP2930Transaction.js +8 -8
- package/internal/hardhat-network/provider/transactions/FakeSenderAccessListEIP2930Transaction.js.map +1 -1
- package/internal/hardhat-network/provider/transactions/FakeSenderEIP1559Transaction.d.ts +3 -3
- package/internal/hardhat-network/provider/transactions/FakeSenderEIP1559Transaction.d.ts.map +1 -1
- package/internal/hardhat-network/provider/transactions/FakeSenderEIP1559Transaction.js +8 -8
- package/internal/hardhat-network/provider/transactions/FakeSenderEIP1559Transaction.js.map +1 -1
- package/internal/hardhat-network/provider/transactions/FakeSenderTransaction.d.ts +3 -3
- package/internal/hardhat-network/provider/transactions/FakeSenderTransaction.d.ts.map +1 -1
- package/internal/hardhat-network/provider/transactions/FakeSenderTransaction.js +5 -5
- package/internal/hardhat-network/provider/transactions/FakeSenderTransaction.js.map +1 -1
- package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP1559Transaction.d.ts +4 -4
- package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP1559Transaction.d.ts.map +1 -1
- package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP1559Transaction.js +25 -6
- package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP1559Transaction.js.map +1 -1
- package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP2930Transaction.d.ts +3 -3
- package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP2930Transaction.d.ts.map +1 -1
- package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP2930Transaction.js +25 -6
- package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP2930Transaction.js.map +1 -1
- package/internal/hardhat-network/provider/transactions/ReadOnlyValidTransaction.d.ts +3 -3
- package/internal/hardhat-network/provider/transactions/ReadOnlyValidTransaction.d.ts.map +1 -1
- package/internal/hardhat-network/provider/transactions/ReadOnlyValidTransaction.js +2 -2
- package/internal/hardhat-network/provider/transactions/ReadOnlyValidTransaction.js.map +1 -1
- package/internal/hardhat-network/provider/types/HardhatBlockchainInterface.d.ts +2 -2
- package/internal/hardhat-network/provider/types/HardhatBlockchainInterface.d.ts.map +1 -1
- package/internal/hardhat-network/provider/utils/makeAccount.d.ts +1 -1
- package/internal/hardhat-network/provider/utils/makeAccount.d.ts.map +1 -1
- package/internal/hardhat-network/provider/utils/makeAccount.js +4 -4
- package/internal/hardhat-network/provider/utils/makeAccount.js.map +1 -1
- package/internal/hardhat-network/provider/utils/makeCommon.d.ts +1 -1
- package/internal/hardhat-network/provider/utils/makeCommon.d.ts.map +1 -1
- package/internal/hardhat-network/provider/utils/makeCommon.js +2 -2
- package/internal/hardhat-network/provider/utils/makeCommon.js.map +1 -1
- package/internal/hardhat-network/provider/utils/makeStateTrie.d.ts +1 -1
- package/internal/hardhat-network/provider/utils/makeStateTrie.d.ts.map +1 -1
- package/internal/hardhat-network/provider/utils/makeStateTrie.js +4 -4
- package/internal/hardhat-network/provider/utils/makeStateTrie.js.map +1 -1
- package/internal/hardhat-network/provider/utils/putGenesisBlock.d.ts +3 -3
- package/internal/hardhat-network/provider/utils/putGenesisBlock.d.ts.map +1 -1
- package/internal/hardhat-network/provider/utils/putGenesisBlock.js +4 -4
- package/internal/hardhat-network/provider/utils/putGenesisBlock.js.map +1 -1
- package/internal/hardhat-network/provider/utils/random.d.ts +2 -1
- package/internal/hardhat-network/provider/utils/random.d.ts.map +1 -1
- package/internal/hardhat-network/provider/utils/random.js +10 -9
- package/internal/hardhat-network/provider/utils/random.js.map +1 -1
- package/internal/hardhat-network/provider/utils/reorganizeTransactionsLists.js +21 -2
- package/internal/hardhat-network/provider/utils/reorganizeTransactionsLists.js.map +1 -1
- package/internal/hardhat-network/provider/utils/txMapToArray.d.ts +1 -1
- package/internal/hardhat-network/provider/utils/txMapToArray.d.ts.map +1 -1
- package/internal/hardhat-network/stack-traces/consoleLogger.js +45 -45
- package/internal/hardhat-network/stack-traces/consoleLogger.js.map +1 -1
- package/internal/hardhat-network/stack-traces/constants.d.ts +1 -1
- package/internal/hardhat-network/stack-traces/constants.d.ts.map +1 -1
- package/internal/hardhat-network/stack-traces/constants.js +1 -1
- package/internal/hardhat-network/stack-traces/constants.js.map +1 -1
- package/internal/hardhat-network/stack-traces/contracts-identifier.js +2 -2
- package/internal/hardhat-network/stack-traces/contracts-identifier.js.map +1 -1
- package/internal/hardhat-network/stack-traces/debug.js +13 -13
- package/internal/hardhat-network/stack-traces/debug.js.map +1 -1
- package/internal/hardhat-network/stack-traces/error-inferrer.js +2 -2
- package/internal/hardhat-network/stack-traces/error-inferrer.js.map +1 -1
- package/internal/hardhat-network/stack-traces/message-trace.d.ts +1 -1
- package/internal/hardhat-network/stack-traces/message-trace.d.ts.map +1 -1
- package/internal/hardhat-network/stack-traces/model.js +6 -6
- package/internal/hardhat-network/stack-traces/model.js.map +1 -1
- package/internal/hardhat-network/stack-traces/panic-errors.d.ts +1 -1
- package/internal/hardhat-network/stack-traces/panic-errors.js +9 -9
- package/internal/hardhat-network/stack-traces/panic-errors.js.map +1 -1
- package/internal/hardhat-network/stack-traces/solidity-errors.js +3 -3
- package/internal/hardhat-network/stack-traces/solidity-errors.js.map +1 -1
- package/internal/hardhat-network/stack-traces/solidity-stack-trace.d.ts +1 -1
- package/internal/hardhat-network/stack-traces/solidityTracer.d.ts +0 -2
- package/internal/hardhat-network/stack-traces/solidityTracer.d.ts.map +1 -1
- package/internal/hardhat-network/stack-traces/solidityTracer.js +2 -4
- package/internal/hardhat-network/stack-traces/solidityTracer.js.map +1 -1
- package/internal/hardhat-network/stack-traces/vm-debug-tracer.d.ts +1 -1
- package/internal/hardhat-network/stack-traces/vm-debug-tracer.d.ts.map +1 -1
- package/internal/hardhat-network/stack-traces/vm-debug-tracer.js +27 -25
- package/internal/hardhat-network/stack-traces/vm-debug-tracer.js.map +1 -1
- package/internal/hardhat-network/stack-traces/vm-tracer.d.ts +2 -2
- package/internal/hardhat-network/stack-traces/vm-tracer.d.ts.map +1 -1
- package/internal/hardhat-network/stack-traces/vm-tracer.js +15 -12
- package/internal/hardhat-network/stack-traces/vm-tracer.js.map +1 -1
- package/internal/lib/hardhat-lib.d.ts.map +1 -1
- package/internal/lib/hardhat-lib.js +0 -2
- package/internal/lib/hardhat-lib.js.map +1 -1
- package/internal/solidity/compilation-job.d.ts.map +1 -1
- package/internal/solidity/compilation-job.js +6 -7
- package/internal/solidity/compilation-job.js.map +1 -1
- package/internal/solidity/compiler/downloader.d.ts +66 -40
- package/internal/solidity/compiler/downloader.d.ts.map +1 -1
- package/internal/solidity/compiler/downloader.js +180 -154
- package/internal/solidity/compiler/downloader.js.map +1 -1
- package/internal/solidity/compiler/index.d.ts +8 -4
- package/internal/solidity/compiler/index.d.ts.map +1 -1
- package/internal/solidity/compiler/index.js +1 -1
- package/internal/solidity/compiler/index.js.map +1 -1
- package/internal/solidity/dependencyGraph.d.ts.map +1 -1
- package/internal/solidity/dependencyGraph.js +3 -5
- package/internal/solidity/dependencyGraph.js.map +1 -1
- package/internal/solidity/parse.d.ts.map +1 -1
- package/internal/solidity/parse.js +2 -58
- package/internal/solidity/parse.js.map +1 -1
- package/internal/solidity/resolver.d.ts +1 -0
- package/internal/solidity/resolver.d.ts.map +1 -1
- package/internal/solidity/resolver.js +33 -8
- package/internal/solidity/resolver.js.map +1 -1
- package/internal/util/bigint.d.ts +13 -24
- package/internal/util/bigint.d.ts.map +1 -1
- package/internal/util/bigint.js +22 -29
- package/internal/util/bigint.js.map +1 -1
- package/internal/util/download.d.ts.map +1 -1
- package/internal/util/download.js +1 -1
- package/internal/util/download.js.map +1 -1
- package/internal/util/fs-utils.d.ts +26 -9
- package/internal/util/fs-utils.d.ts.map +1 -1
- package/internal/util/fs-utils.js +111 -68
- package/internal/util/fs-utils.js.map +1 -1
- package/internal/util/glob.d.ts +13 -0
- package/internal/util/glob.d.ts.map +1 -1
- package/internal/util/glob.js +13 -0
- package/internal/util/glob.js.map +1 -1
- package/internal/util/keccak.d.ts +3 -0
- package/internal/util/keccak.d.ts.map +1 -0
- package/internal/util/keccak.js +12 -0
- package/internal/util/keccak.js.map +1 -0
- package/internal/util/scripts-runner.d.ts.map +1 -1
- package/internal/util/scripts-runner.js +7 -4
- package/internal/util/scripts-runner.js.map +1 -1
- package/package.json +15 -15
- package/register.js +1 -3
- package/register.js.map +1 -1
- package/sample-projects/javascript/contracts/Lock.sol +3 -3
- package/sample-projects/typescript/contracts/Lock.sol +3 -3
- package/src/builtin-tasks/clean.ts +9 -6
- package/src/builtin-tasks/compile.ts +96 -128
- package/src/builtin-tasks/flatten.ts +2 -3
- package/src/builtin-tasks/node.ts +2 -2
- package/src/builtin-tasks/test.ts +7 -3
- package/src/builtin-tasks/utils/solidity-files-cache.ts +9 -8
- package/src/internal/artifacts.ts +392 -182
- package/src/internal/cli/cli.ts +43 -17
- package/src/internal/core/config/config-loading.ts +1 -1
- package/src/internal/core/config/config-resolution.ts +12 -24
- package/src/internal/core/config/default-config.ts +1 -1
- package/src/internal/core/errors-list.ts +29 -13
- package/src/internal/core/errors.ts +10 -2
- package/src/internal/core/execution-mode.ts +2 -3
- package/src/internal/core/flamegraph.ts +270 -0
- package/src/internal/core/jsonrpc/types/base-types.ts +7 -3
- package/src/internal/core/params/hardhat-params.ts +18 -0
- package/src/internal/core/providers/accounts.ts +8 -8
- package/src/internal/core/providers/construction.ts +10 -8
- package/src/internal/core/providers/gas-providers.ts +2 -2
- package/src/internal/core/providers/util.ts +1 -1
- package/src/internal/core/runtime-environment.ts +103 -10
- package/src/internal/core/task-profiling.ts +56 -0
- package/src/internal/core/typescript-support.ts +11 -2
- package/src/internal/hardhat-network/jsonrpc/client.ts +1 -1
- package/src/internal/hardhat-network/provider/BlockchainBase.ts +6 -6
- package/src/internal/hardhat-network/provider/BlockchainData.ts +5 -5
- package/src/internal/hardhat-network/provider/HardhatBlockchain.ts +4 -4
- package/src/internal/hardhat-network/provider/PoolState.ts +2 -2
- package/src/internal/hardhat-network/provider/TransactionQueue.ts +2 -2
- package/src/internal/hardhat-network/provider/TxPool.ts +12 -5
- package/src/internal/hardhat-network/provider/ethereumjs-workarounds.ts +3 -3
- package/src/internal/hardhat-network/provider/filter.ts +2 -2
- package/src/internal/hardhat-network/provider/fork/ForkBlockchain.ts +10 -10
- package/src/internal/hardhat-network/provider/fork/ForkStateManager.ts +12 -18
- package/src/internal/hardhat-network/provider/fork/rpcToBlockData.ts +1 -1
- package/src/internal/hardhat-network/provider/fork/rpcToTxData.ts +5 -2
- package/src/internal/hardhat-network/provider/modules/eth.ts +10 -6
- package/src/internal/hardhat-network/provider/modules/hardhat.ts +25 -1
- package/src/internal/hardhat-network/provider/modules/logger.ts +3 -3
- package/src/internal/hardhat-network/provider/modules/net.ts +1 -1
- package/src/internal/hardhat-network/provider/modules/personal.ts +1 -1
- package/src/internal/hardhat-network/provider/modules/web3.ts +4 -6
- package/src/internal/hardhat-network/provider/node-types.ts +6 -6
- package/src/internal/hardhat-network/provider/node.ts +25 -12
- package/src/internal/hardhat-network/provider/output.ts +6 -6
- package/src/internal/hardhat-network/provider/provider.ts +7 -6
- package/src/internal/hardhat-network/provider/return-data.ts +9 -5
- package/src/internal/hardhat-network/provider/transactions/FakeSenderAccessListEIP2930Transaction.ts +9 -5
- package/src/internal/hardhat-network/provider/transactions/FakeSenderEIP1559Transaction.ts +8 -4
- package/src/internal/hardhat-network/provider/transactions/FakeSenderTransaction.ts +4 -4
- package/src/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP1559Transaction.ts +8 -5
- package/src/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP2930Transaction.ts +4 -4
- package/src/internal/hardhat-network/provider/transactions/ReadOnlyValidTransaction.ts +3 -3
- package/src/internal/hardhat-network/provider/types/HardhatBlockchainInterface.ts +2 -2
- package/src/internal/hardhat-network/provider/utils/makeAccount.ts +6 -1
- package/src/internal/hardhat-network/provider/utils/makeCommon.ts +1 -1
- package/src/internal/hardhat-network/provider/utils/makeStateTrie.ts +7 -3
- package/src/internal/hardhat-network/provider/utils/putGenesisBlock.ts +6 -6
- package/src/internal/hardhat-network/provider/utils/random.ts +17 -14
- package/src/internal/hardhat-network/provider/utils/reorganizeTransactionsLists.ts +1 -1
- package/src/internal/hardhat-network/stack-traces/consoleLogger.ts +1 -1
- package/src/internal/hardhat-network/stack-traces/constants.ts +2 -0
- package/src/internal/hardhat-network/stack-traces/contracts-identifier.ts +1 -1
- package/src/internal/hardhat-network/stack-traces/debug.ts +1 -1
- package/src/internal/hardhat-network/stack-traces/error-inferrer.ts +3 -3
- package/src/internal/hardhat-network/stack-traces/message-trace.ts +1 -1
- package/src/internal/hardhat-network/stack-traces/model.ts +1 -1
- package/src/internal/hardhat-network/stack-traces/panic-errors.ts +11 -11
- package/src/internal/hardhat-network/stack-traces/solidity-errors.ts +1 -1
- package/src/internal/hardhat-network/stack-traces/solidity-stack-trace.ts +1 -1
- package/src/internal/hardhat-network/stack-traces/solidityTracer.ts +1 -4
- package/src/internal/hardhat-network/stack-traces/vm-debug-tracer.ts +31 -17
- package/src/internal/hardhat-network/stack-traces/vm-tracer.ts +29 -14
- package/src/internal/lib/hardhat-lib.ts +0 -3
- package/src/internal/solidity/compilation-job.ts +11 -11
- package/src/internal/solidity/compiler/downloader.ts +271 -243
- package/src/internal/solidity/compiler/index.ts +13 -7
- package/src/internal/solidity/dependencyGraph.ts +12 -8
- package/src/internal/solidity/parse.ts +4 -70
- package/src/internal/solidity/resolver.ts +36 -8
- package/src/internal/util/bigint.ts +25 -43
- package/src/internal/util/download.ts +2 -2
- package/src/internal/util/fs-utils.ts +223 -0
- package/src/internal/util/glob.ts +13 -0
- package/src/internal/util/keccak.ts +5 -0
- package/src/internal/util/scripts-runner.ts +13 -4
- package/src/internal/util/wei-values.ts +1 -1
- package/src/internal/{hardhat-network/vendor → vendor}/await-semaphore/index.ts +0 -0
- package/src/profiling.ts +37 -0
- package/src/register.ts +1 -4
- package/src/types/artifacts.ts +21 -0
- package/src/types/config.ts +7 -7
- package/src/types/runtime.ts +2 -0
- package/src/utils/source-names.ts +36 -26
- package/types/artifacts.d.ts +19 -0
- package/types/artifacts.d.ts.map +1 -1
- package/types/config.d.ts +7 -7
- package/types/runtime.d.ts +2 -0
- package/types/runtime.d.ts.map +1 -1
- package/utils/source-names.d.ts.map +1 -1
- package/utils/source-names.js +25 -36
- package/utils/source-names.js.map +1 -1
- package/internal/hardhat-network/provider/fork/random.d.ts +0 -7
- package/internal/hardhat-network/provider/fork/random.d.ts.map +0 -1
- package/internal/hardhat-network/provider/fork/random.js +0 -32
- package/internal/hardhat-network/provider/fork/random.js.map +0 -1
- package/internal/hardhat-network/provider/utils/bnToHex.d.ts +0 -3
- package/internal/hardhat-network/provider/utils/bnToHex.d.ts.map +0 -1
- package/internal/hardhat-network/provider/utils/bnToHex.js +0 -9
- package/internal/hardhat-network/provider/utils/bnToHex.js.map +0 -1
- package/internal/hardhat-network/provider/utils/makeForkCommon.d.ts +0 -4
- package/internal/hardhat-network/provider/utils/makeForkCommon.d.ts.map +0 -1
- package/internal/hardhat-network/provider/utils/makeForkCommon.js +0 -16
- package/internal/hardhat-network/provider/utils/makeForkCommon.js.map +0 -1
- package/internal/hardhat-network/vendor/await-semaphore/index.d.ts +0 -12
- package/internal/hardhat-network/vendor/await-semaphore/index.d.ts.map +0 -1
- package/internal/hardhat-network/vendor/await-semaphore/index.js +0 -64
- package/internal/hardhat-network/vendor/await-semaphore/index.js.map +0 -1
- package/internal/util/antlr-prototype-pollution-workaround.d.ts +0 -16
- package/internal/util/antlr-prototype-pollution-workaround.d.ts.map +0 -1
- package/internal/util/antlr-prototype-pollution-workaround.js +0 -22
- package/internal/util/antlr-prototype-pollution-workaround.js.map +0 -1
- package/src/internal/util/antlr-prototype-pollution-workaround.ts +0 -17
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
2
|
|
|
3
3
|
import { SignTypedDataVersion, signTypedData } from "@metamask/eth-sig-util";
|
|
4
|
-
import { FeeMarketEIP1559Transaction } from "@
|
|
4
|
+
import { FeeMarketEIP1559Transaction } from "@nomicfoundation/ethereumjs-tx";
|
|
5
5
|
import { EIP1193Provider, RequestArguments } from "../../../types";
|
|
6
6
|
import { HardhatError } from "../errors";
|
|
7
7
|
import { ERRORS } from "../errors-list";
|
|
@@ -44,7 +44,7 @@ export class LocalAccountsProvider extends ProviderWrapperWithChainId {
|
|
|
44
44
|
|
|
45
45
|
public async request(args: RequestArguments): Promise<unknown> {
|
|
46
46
|
const { ecsign, hashPersonalMessage, toRpcSig, toBuffer, bufferToHex } =
|
|
47
|
-
await import("@
|
|
47
|
+
await import("@nomicfoundation/ethereumjs-util");
|
|
48
48
|
|
|
49
49
|
if (
|
|
50
50
|
args.method === "eth_accounts" ||
|
|
@@ -192,7 +192,7 @@ export class LocalAccountsProvider extends ProviderWrapperWithChainId {
|
|
|
192
192
|
bufferToHex,
|
|
193
193
|
toBuffer,
|
|
194
194
|
privateToAddress,
|
|
195
|
-
} = require("@
|
|
195
|
+
} = require("@nomicfoundation/ethereumjs-util");
|
|
196
196
|
|
|
197
197
|
const privateKeys: Buffer[] = localAccountsHexPrivateKeys.map((h) =>
|
|
198
198
|
toBuffer(h)
|
|
@@ -205,7 +205,7 @@ export class LocalAccountsProvider extends ProviderWrapperWithChainId {
|
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
private _getPrivateKeyForAddress(address: Buffer): Buffer {
|
|
208
|
-
const { bufferToHex } = require("@
|
|
208
|
+
const { bufferToHex } = require("@nomicfoundation/ethereumjs-util");
|
|
209
209
|
const pk = this._addressToPrivateKey.get(bufferToHex(address));
|
|
210
210
|
if (pk === undefined) {
|
|
211
211
|
throw new HardhatError(ERRORS.NETWORK.NOT_LOCAL_ACCOUNT, {
|
|
@@ -225,7 +225,7 @@ export class LocalAccountsProvider extends ProviderWrapperWithChainId {
|
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
private async _getNonce(address: Buffer): Promise<bigint> {
|
|
228
|
-
const { bufferToHex } = await import("@
|
|
228
|
+
const { bufferToHex } = await import("@nomicfoundation/ethereumjs-util");
|
|
229
229
|
|
|
230
230
|
const response = (await this._wrappedProvider.request({
|
|
231
231
|
method: "eth_getTransactionCount",
|
|
@@ -241,10 +241,10 @@ export class LocalAccountsProvider extends ProviderWrapperWithChainId {
|
|
|
241
241
|
privateKey: Buffer
|
|
242
242
|
): Promise<Buffer> {
|
|
243
243
|
const { AccessListEIP2930Transaction, Transaction } = await import(
|
|
244
|
-
"@
|
|
244
|
+
"@nomicfoundation/ethereumjs-tx"
|
|
245
245
|
);
|
|
246
246
|
|
|
247
|
-
const { Common } = await import("@
|
|
247
|
+
const { Common } = await import("@nomicfoundation/ethereumjs-common");
|
|
248
248
|
|
|
249
249
|
const txData = {
|
|
250
250
|
...transactionRequest,
|
|
@@ -308,7 +308,7 @@ export class HDWalletProvider extends LocalAccountsProvider {
|
|
|
308
308
|
passphrase
|
|
309
309
|
);
|
|
310
310
|
|
|
311
|
-
const { bufferToHex } = require("@
|
|
311
|
+
const { bufferToHex } = require("@nomicfoundation/ethereumjs-util");
|
|
312
312
|
const privateKeysAsHex = privateKeys.map((pk) => bufferToHex(pk));
|
|
313
313
|
super(provider, privateKeysAsHex);
|
|
314
314
|
}
|
|
@@ -11,14 +11,13 @@ import type {
|
|
|
11
11
|
ProjectPathsConfig,
|
|
12
12
|
} from "../../../types";
|
|
13
13
|
|
|
14
|
-
import {
|
|
15
|
-
import { ModulesLogger } from "../../hardhat-network/provider/modules/logger";
|
|
16
|
-
import {
|
|
14
|
+
import type {
|
|
17
15
|
ForkConfig,
|
|
18
16
|
MempoolOrder,
|
|
19
17
|
} from "../../hardhat-network/provider/node-types";
|
|
20
|
-
import
|
|
21
|
-
import
|
|
18
|
+
import type * as ModulesLoggerT from "../../hardhat-network/provider/modules/logger";
|
|
19
|
+
import type * as DiskCacheT from "../../hardhat-network/provider/utils/disk-cache";
|
|
20
|
+
import { HARDHAT_NETWORK_NAME } from "../../constants";
|
|
22
21
|
import { parseDateString } from "../../util/date";
|
|
23
22
|
|
|
24
23
|
import { normalizeHardhatNetworkAccountsConfig } from "./util";
|
|
@@ -72,9 +71,7 @@ export function createProvider(
|
|
|
72
71
|
) {
|
|
73
72
|
forkConfig = {
|
|
74
73
|
jsonRpcUrl: hardhatNetConfig.forking?.url,
|
|
75
|
-
blockNumber:
|
|
76
|
-
hardhatNetConfig.forking?.blockNumber
|
|
77
|
-
),
|
|
74
|
+
blockNumber: hardhatNetConfig.forking?.blockNumber,
|
|
78
75
|
httpHeaders: hardhatNetConfig.forking.httpHeaders,
|
|
79
76
|
};
|
|
80
77
|
}
|
|
@@ -83,6 +80,11 @@ export function createProvider(
|
|
|
83
80
|
hardhatNetConfig.accounts
|
|
84
81
|
);
|
|
85
82
|
|
|
83
|
+
const { ModulesLogger } =
|
|
84
|
+
require("../../hardhat-network/provider/modules/logger") as typeof ModulesLoggerT;
|
|
85
|
+
const { getForkCacheDirPath } =
|
|
86
|
+
require("../../hardhat-network/provider/utils/disk-cache") as typeof DiskCacheT;
|
|
87
|
+
|
|
86
88
|
eip1193Provider = new HardhatNetworkProvider(
|
|
87
89
|
hardhatNetConfig.hardfork,
|
|
88
90
|
HARDHAT_NETWORK_NAME,
|
|
@@ -10,7 +10,7 @@ import { ProviderWrapper } from "./wrapper";
|
|
|
10
10
|
const DEFAULT_GAS_MULTIPLIER = 1;
|
|
11
11
|
|
|
12
12
|
export class FixedGasProvider extends ProviderWrapper {
|
|
13
|
-
constructor(provider: EIP1193Provider, private readonly _gasLimit:
|
|
13
|
+
constructor(provider: EIP1193Provider, private readonly _gasLimit: number) {
|
|
14
14
|
super(provider);
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -30,7 +30,7 @@ export class FixedGasProvider extends ProviderWrapper {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export class FixedGasPriceProvider extends ProviderWrapper {
|
|
33
|
-
constructor(provider: EIP1193Provider, private readonly _gasPrice:
|
|
33
|
+
constructor(provider: EIP1193Provider, private readonly _gasPrice: number) {
|
|
34
34
|
super(provider);
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -53,7 +53,7 @@ export function normalizeHardhatNetworkAccountsConfig(
|
|
|
53
53
|
return accountsConfig;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
const { bufferToHex } = require("@
|
|
56
|
+
const { bufferToHex } = require("@nomicfoundation/ethereumjs-util");
|
|
57
57
|
|
|
58
58
|
return derivePrivateKeys(
|
|
59
59
|
accountsConfig.mnemonic,
|
|
@@ -25,13 +25,21 @@ import { HardhatError } from "./errors";
|
|
|
25
25
|
import { ERRORS } from "./errors-list";
|
|
26
26
|
import { createProvider } from "./providers/construction";
|
|
27
27
|
import { OverriddenTaskDefinition } from "./tasks/task-definitions";
|
|
28
|
+
import {
|
|
29
|
+
completeTaskProfile,
|
|
30
|
+
createParentTaskProfile,
|
|
31
|
+
createTaskProfile,
|
|
32
|
+
TaskProfile,
|
|
33
|
+
} from "./task-profiling";
|
|
28
34
|
|
|
29
35
|
const log = debug("hardhat:core:hre");
|
|
30
36
|
|
|
31
37
|
export class Environment implements HardhatRuntimeEnvironment {
|
|
32
38
|
private static readonly _BLACKLISTED_PROPERTIES: string[] = [
|
|
33
39
|
"injectToGlobal",
|
|
40
|
+
"entryTaskProfile",
|
|
34
41
|
"_runTaskDefinition",
|
|
42
|
+
"_extenders",
|
|
35
43
|
];
|
|
36
44
|
|
|
37
45
|
public network: Network;
|
|
@@ -40,6 +48,8 @@ export class Environment implements HardhatRuntimeEnvironment {
|
|
|
40
48
|
|
|
41
49
|
private readonly _extenders: EnvironmentExtender[];
|
|
42
50
|
|
|
51
|
+
public entryTaskProfile?: TaskProfile;
|
|
52
|
+
|
|
43
53
|
/**
|
|
44
54
|
* Initializes the Hardhat Runtime Environment and the given
|
|
45
55
|
* extender functions.
|
|
@@ -111,7 +121,11 @@ export class Environment implements HardhatRuntimeEnvironment {
|
|
|
111
121
|
* @throws a HH303 if there aren't any defined tasks with the given name.
|
|
112
122
|
* @returns a promise with the task's execution result.
|
|
113
123
|
*/
|
|
114
|
-
public readonly run: RunTaskFunction = async (
|
|
124
|
+
public readonly run: RunTaskFunction = async (
|
|
125
|
+
name,
|
|
126
|
+
taskArguments = {},
|
|
127
|
+
callerTaskProfile?: TaskProfile
|
|
128
|
+
) => {
|
|
115
129
|
const taskDefinition = this.tasks[name];
|
|
116
130
|
|
|
117
131
|
log("Running task %s", name);
|
|
@@ -127,16 +141,32 @@ export class Environment implements HardhatRuntimeEnvironment {
|
|
|
127
141
|
taskArguments
|
|
128
142
|
);
|
|
129
143
|
|
|
144
|
+
let taskProfile: TaskProfile | undefined;
|
|
145
|
+
if (this.hardhatArguments.flamegraph === true) {
|
|
146
|
+
taskProfile = createTaskProfile(name);
|
|
147
|
+
|
|
148
|
+
if (callerTaskProfile !== undefined) {
|
|
149
|
+
callerTaskProfile.children.push(taskProfile);
|
|
150
|
+
} else {
|
|
151
|
+
this.entryTaskProfile = taskProfile;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
130
155
|
try {
|
|
131
156
|
return await this._runTaskDefinition(
|
|
132
157
|
taskDefinition,
|
|
133
|
-
resolvedTaskArguments
|
|
158
|
+
resolvedTaskArguments,
|
|
159
|
+
taskProfile
|
|
134
160
|
);
|
|
135
161
|
} catch (e) {
|
|
136
162
|
analyzeModuleNotFoundError(e, this.config.paths.configFile);
|
|
137
163
|
|
|
138
164
|
// eslint-disable-next-line @nomiclabs/hardhat-internal-rules/only-hardhat-error
|
|
139
165
|
throw e;
|
|
166
|
+
} finally {
|
|
167
|
+
if (taskProfile !== undefined) {
|
|
168
|
+
completeTaskProfile(taskProfile);
|
|
169
|
+
}
|
|
140
170
|
}
|
|
141
171
|
};
|
|
142
172
|
|
|
@@ -178,10 +208,15 @@ export class Environment implements HardhatRuntimeEnvironment {
|
|
|
178
208
|
};
|
|
179
209
|
}
|
|
180
210
|
|
|
211
|
+
/**
|
|
212
|
+
* @param taskProfile Undefined if we aren't computing task profiles
|
|
213
|
+
* @private
|
|
214
|
+
*/
|
|
181
215
|
private async _runTaskDefinition(
|
|
182
216
|
taskDefinition: TaskDefinition,
|
|
183
|
-
taskArguments: TaskArguments
|
|
184
|
-
|
|
217
|
+
taskArguments: TaskArguments,
|
|
218
|
+
taskProfile?: TaskProfile
|
|
219
|
+
): Promise<any> {
|
|
185
220
|
let runSuperFunction: any;
|
|
186
221
|
|
|
187
222
|
if (taskDefinition instanceof OverriddenTaskDefinition) {
|
|
@@ -190,10 +225,25 @@ export class Environment implements HardhatRuntimeEnvironment {
|
|
|
190
225
|
) => {
|
|
191
226
|
log("Running %s's super", taskDefinition.name);
|
|
192
227
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
228
|
+
if (taskProfile === undefined) {
|
|
229
|
+
return this._runTaskDefinition(
|
|
230
|
+
taskDefinition.parentTaskDefinition,
|
|
231
|
+
_taskArguments
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
const parentTaskProfile = createParentTaskProfile(taskProfile);
|
|
236
|
+
taskProfile.children.push(parentTaskProfile);
|
|
237
|
+
|
|
238
|
+
try {
|
|
239
|
+
return await this._runTaskDefinition(
|
|
240
|
+
taskDefinition.parentTaskDefinition,
|
|
241
|
+
_taskArguments,
|
|
242
|
+
parentTaskProfile
|
|
243
|
+
);
|
|
244
|
+
} finally {
|
|
245
|
+
completeTaskProfile(parentTaskProfile);
|
|
246
|
+
}
|
|
197
247
|
};
|
|
198
248
|
|
|
199
249
|
runSuperFunction.isDefined = true;
|
|
@@ -213,10 +263,53 @@ export class Environment implements HardhatRuntimeEnvironment {
|
|
|
213
263
|
const previousRunSuper: any = globalAsAny.runSuper;
|
|
214
264
|
globalAsAny.runSuper = runSuper;
|
|
215
265
|
|
|
216
|
-
|
|
266
|
+
let modifiedHreWithParentTaskProfile: any | undefined;
|
|
267
|
+
if (this.hardhatArguments.flamegraph === true) {
|
|
268
|
+
// We create a modified version of `this`, as we want to keep track of the
|
|
269
|
+
// `taskProfile` and use it as `callerTaskProfile` if the action calls
|
|
270
|
+
// `run`, and add a few utility methods.
|
|
271
|
+
//
|
|
272
|
+
// Note that for this to work we need to set the prototype later
|
|
273
|
+
modifiedHreWithParentTaskProfile = {
|
|
274
|
+
...this,
|
|
275
|
+
run: (_name: string, _taskArguments: TaskArguments) =>
|
|
276
|
+
(this as any).run(_name, _taskArguments, taskProfile),
|
|
277
|
+
adhocProfile: async (_name: string, f: () => Promise<any>) => {
|
|
278
|
+
const adhocProfile = createTaskProfile(_name);
|
|
279
|
+
taskProfile!.children.push(adhocProfile);
|
|
280
|
+
try {
|
|
281
|
+
return await f();
|
|
282
|
+
} finally {
|
|
283
|
+
completeTaskProfile(adhocProfile);
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
adhocProfileSync: (_name: string, f: () => any) => {
|
|
287
|
+
const adhocProfile = createTaskProfile(_name);
|
|
288
|
+
taskProfile!.children.push(adhocProfile);
|
|
289
|
+
try {
|
|
290
|
+
return f();
|
|
291
|
+
} finally {
|
|
292
|
+
completeTaskProfile(adhocProfile);
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
Object.setPrototypeOf(
|
|
298
|
+
modifiedHreWithParentTaskProfile,
|
|
299
|
+
Object.getPrototypeOf(this)
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
const uninjectFromGlobal =
|
|
304
|
+
modifiedHreWithParentTaskProfile?.injectToGlobal() ??
|
|
305
|
+
this.injectToGlobal();
|
|
217
306
|
|
|
218
307
|
try {
|
|
219
|
-
return await taskDefinition.action(
|
|
308
|
+
return await taskDefinition.action(
|
|
309
|
+
taskArguments,
|
|
310
|
+
modifiedHreWithParentTaskProfile ?? this,
|
|
311
|
+
runSuper
|
|
312
|
+
);
|
|
220
313
|
} finally {
|
|
221
314
|
uninjectFromGlobal();
|
|
222
315
|
globalAsAny.runSuper = previousRunSuper;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export interface TaskProfile {
|
|
2
|
+
name: string;
|
|
3
|
+
start: bigint;
|
|
4
|
+
end?: bigint;
|
|
5
|
+
children: TaskProfile[];
|
|
6
|
+
parallel?: boolean;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function createTaskProfile(name: string): TaskProfile {
|
|
10
|
+
return {
|
|
11
|
+
name,
|
|
12
|
+
start: process.hrtime.bigint(),
|
|
13
|
+
children: [],
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function completeTaskProfile(taskProfile: TaskProfile) {
|
|
18
|
+
taskProfile.end = process.hrtime.bigint();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function createParentTaskProfile(taskProfile: TaskProfile): TaskProfile {
|
|
22
|
+
return createTaskProfile(`super::${taskProfile.name}`);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Sets `parallel` to `true` to any children that was running at the same time
|
|
27
|
+
* of another.
|
|
28
|
+
*
|
|
29
|
+
* We assume `children[]` is in chronological `start` order.
|
|
30
|
+
*/
|
|
31
|
+
export function flagParallelChildren(
|
|
32
|
+
profile: TaskProfile,
|
|
33
|
+
isParentParallel = false
|
|
34
|
+
) {
|
|
35
|
+
if (isParentParallel) {
|
|
36
|
+
profile.parallel = true;
|
|
37
|
+
for (const child of profile.children) {
|
|
38
|
+
child.parallel = true;
|
|
39
|
+
}
|
|
40
|
+
} else {
|
|
41
|
+
for (const [i, child] of profile.children.entries()) {
|
|
42
|
+
if (i === 0) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
const prevChild = profile.children[i - 1];
|
|
46
|
+
if (child.start < prevChild.end!) {
|
|
47
|
+
prevChild.parallel = true;
|
|
48
|
+
child.parallel = true;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
for (const child of profile.children) {
|
|
54
|
+
flagParallelChildren(child, child.parallel);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -38,7 +38,10 @@ export function isTypescriptSupported() {
|
|
|
38
38
|
return cachedIsTypescriptSupported;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
export function loadTsNode(
|
|
41
|
+
export function loadTsNode(
|
|
42
|
+
tsConfigPath?: string,
|
|
43
|
+
shouldTypecheck: boolean = false
|
|
44
|
+
) {
|
|
42
45
|
try {
|
|
43
46
|
require.resolve("typescript");
|
|
44
47
|
} catch {
|
|
@@ -67,8 +70,14 @@ export function loadTsNode(tsConfigPath?: string) {
|
|
|
67
70
|
process.env.TS_NODE_FILES = "true";
|
|
68
71
|
}
|
|
69
72
|
|
|
73
|
+
let tsNodeRequirement = "ts-node/register";
|
|
74
|
+
|
|
75
|
+
if (!shouldTypecheck) {
|
|
76
|
+
tsNodeRequirement += "/transpile-only";
|
|
77
|
+
}
|
|
78
|
+
|
|
70
79
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
71
|
-
require(
|
|
80
|
+
require(tsNodeRequirement);
|
|
72
81
|
}
|
|
73
82
|
|
|
74
83
|
function isTypescriptFile(path: string): boolean {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Block, BlockHeader } from "@
|
|
1
|
+
import { Block, BlockHeader } from "@nomicfoundation/ethereumjs-block";
|
|
2
2
|
import {
|
|
3
3
|
BlockchainInterface,
|
|
4
4
|
CasperConsensus,
|
|
5
5
|
CliqueConsensus,
|
|
6
6
|
Consensus,
|
|
7
7
|
EthashConsensus,
|
|
8
|
-
} from "@
|
|
9
|
-
import { Common, ConsensusAlgorithm } from "@
|
|
10
|
-
import { TypedTransaction } from "@
|
|
8
|
+
} from "@nomicfoundation/ethereumjs-blockchain";
|
|
9
|
+
import { Common, ConsensusAlgorithm } from "@nomicfoundation/ethereumjs-common";
|
|
10
|
+
import { TypedTransaction } from "@nomicfoundation/ethereumjs-tx";
|
|
11
11
|
|
|
12
12
|
import { assertHardhatInvariant } from "../../core/errors";
|
|
13
|
-
import
|
|
13
|
+
import * as BigIntUtils from "../../util/bigint";
|
|
14
14
|
import { BlockchainData } from "./BlockchainData";
|
|
15
15
|
import { RpcReceiptOutput } from "./output";
|
|
16
16
|
|
|
@@ -23,7 +23,7 @@ export abstract class BlockchainBase {
|
|
|
23
23
|
constructor(protected _common: Common) {
|
|
24
24
|
this._data = new BlockchainData(_common);
|
|
25
25
|
|
|
26
|
-
// copied from blockchain.ts in @
|
|
26
|
+
// copied from blockchain.ts in @nomicfoundation/ethereumjs-blockchain
|
|
27
27
|
switch (this._common.consensusAlgorithm()) {
|
|
28
28
|
case ConsensusAlgorithm.Casper:
|
|
29
29
|
this.consensus = new CasperConsensus();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Block } from "@
|
|
2
|
-
import { Common } from "@
|
|
3
|
-
import { TypedTransaction } from "@
|
|
4
|
-
import { bufferToHex } from "@
|
|
5
|
-
import { Bloom } from "@
|
|
1
|
+
import { Block } from "@nomicfoundation/ethereumjs-block";
|
|
2
|
+
import { Common } from "@nomicfoundation/ethereumjs-common";
|
|
3
|
+
import { TypedTransaction } from "@nomicfoundation/ethereumjs-tx";
|
|
4
|
+
import { bufferToHex } from "@nomicfoundation/ethereumjs-util";
|
|
5
|
+
import { Bloom } from "@nomicfoundation/ethereumjs-vm";
|
|
6
6
|
|
|
7
7
|
import { assertHardhatInvariant } from "../../core/errors";
|
|
8
8
|
import { bloomFilter, filterLogs } from "./filter";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Block } from "@
|
|
2
|
-
import { Common } from "@
|
|
3
|
-
import { TypedTransaction } from "@
|
|
4
|
-
import { zeros } from "@
|
|
1
|
+
import { Block } from "@nomicfoundation/ethereumjs-block";
|
|
2
|
+
import { Common } from "@nomicfoundation/ethereumjs-common";
|
|
3
|
+
import { TypedTransaction } from "@nomicfoundation/ethereumjs-tx";
|
|
4
|
+
import { zeros } from "@nomicfoundation/ethereumjs-util";
|
|
5
5
|
|
|
6
6
|
import { BlockchainBase } from "./BlockchainBase";
|
|
7
7
|
import { FilterParams } from "./node-types";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { TypedTransaction } from "@
|
|
1
|
+
import { TypedTransaction } from "@nomicfoundation/ethereumjs-tx";
|
|
2
2
|
import {
|
|
3
3
|
List as ImmutableList,
|
|
4
4
|
Map as ImmutableMap,
|
|
5
5
|
Record as ImmutableRecord,
|
|
6
6
|
} from "immutable";
|
|
7
7
|
|
|
8
|
-
import
|
|
8
|
+
import * as BigIntUtils from "../../util/bigint";
|
|
9
9
|
|
|
10
10
|
export interface OrderedTransaction {
|
|
11
11
|
orderId: number;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { TypedTransaction } from "@
|
|
1
|
+
import { TypedTransaction } from "@nomicfoundation/ethereumjs-tx";
|
|
2
2
|
import Heap from "mnemonist/heap";
|
|
3
3
|
|
|
4
4
|
import { InternalError, InvalidInputError } from "../../core/providers/errors";
|
|
5
|
-
import
|
|
5
|
+
import * as BigIntUtils from "../../util/bigint";
|
|
6
6
|
import { MempoolOrder } from "./node-types";
|
|
7
7
|
import { OrderedTransaction } from "./PoolState";
|
|
8
8
|
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import { Common } from "@
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { Common } from "@nomicfoundation/ethereumjs-common";
|
|
2
|
+
import {
|
|
3
|
+
TransactionFactory,
|
|
4
|
+
TypedTransaction,
|
|
5
|
+
} from "@nomicfoundation/ethereumjs-tx";
|
|
6
|
+
import { StateManager } from "@nomicfoundation/ethereumjs-statemanager";
|
|
7
|
+
import {
|
|
8
|
+
Address,
|
|
9
|
+
bufferToHex,
|
|
10
|
+
toBuffer,
|
|
11
|
+
} from "@nomicfoundation/ethereumjs-util";
|
|
5
12
|
import { List as ImmutableList, Record as ImmutableRecord } from "immutable";
|
|
6
13
|
|
|
7
14
|
import { InvalidInputError } from "../../core/providers/errors";
|
|
8
|
-
import
|
|
15
|
+
import * as BigIntUtils from "../../util/bigint";
|
|
9
16
|
|
|
10
17
|
import {
|
|
11
18
|
AddressToTransactions,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { TransactionFactory } from "@
|
|
2
|
-
import { BaseTransaction } from "@
|
|
1
|
+
import { TransactionFactory } from "@nomicfoundation/ethereumjs-tx";
|
|
2
|
+
import { BaseTransaction } from "@nomicfoundation/ethereumjs-tx/dist/baseTransaction";
|
|
3
3
|
import {
|
|
4
4
|
AccessListEIP2930TxData,
|
|
5
5
|
TxData,
|
|
6
6
|
TxOptions,
|
|
7
|
-
} from "@
|
|
7
|
+
} from "@nomicfoundation/ethereumjs-tx/dist/types";
|
|
8
8
|
|
|
9
9
|
// This is a hack to prevent Block.fromBlockData from recreating our
|
|
10
10
|
// transactions and changing their types. Note fromBlockData is used
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { bufferToHex, toBuffer } from "@
|
|
2
|
-
import { Bloom } from "@
|
|
1
|
+
import { bufferToHex, toBuffer } from "@nomicfoundation/ethereumjs-util";
|
|
2
|
+
import { Bloom } from "@nomicfoundation/ethereumjs-vm";
|
|
3
3
|
|
|
4
4
|
import { RpcLogOutput } from "./output";
|
|
5
5
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Block } from "@
|
|
2
|
-
import { Common } from "@
|
|
3
|
-
import { TypedTransaction } from "@
|
|
4
|
-
import { Address } from "@
|
|
1
|
+
import { Block } from "@nomicfoundation/ethereumjs-block";
|
|
2
|
+
import { Common } from "@nomicfoundation/ethereumjs-common";
|
|
3
|
+
import { TypedTransaction } from "@nomicfoundation/ethereumjs-tx";
|
|
4
|
+
import { Address } from "@nomicfoundation/ethereumjs-util";
|
|
5
5
|
|
|
6
|
-
import { FeeMarketEIP1559TxData } from "@
|
|
6
|
+
import { FeeMarketEIP1559TxData } from "@nomicfoundation/ethereumjs-tx/dist/types";
|
|
7
7
|
import { RpcBlockWithTransactions } from "../../../core/jsonrpc/types/output/block";
|
|
8
8
|
import { RpcTransactionReceipt } from "../../../core/jsonrpc/types/output/receipt";
|
|
9
9
|
import { RpcTransaction } from "../../../core/jsonrpc/types/output/transaction";
|
|
@@ -252,13 +252,13 @@ export class ForkBlockchain
|
|
|
252
252
|
return undefined;
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
-
const
|
|
256
|
-
const common = new Common({ chain: forkNetworkId });
|
|
257
|
-
|
|
255
|
+
const common = this._common.copy();
|
|
258
256
|
// We set the common's hardfork to Berlin if the remote block doesn't have
|
|
259
257
|
// EIP-1559 activated. The reason for this is that ethereumjs throws if we
|
|
260
258
|
// have a base fee for an older hardfork, and set a default one for London.
|
|
261
|
-
if (rpcBlock.baseFeePerGas
|
|
259
|
+
if (rpcBlock.baseFeePerGas !== undefined) {
|
|
260
|
+
common.setHardfork("london"); // TODO: consider changing this to "latest hardfork"
|
|
261
|
+
} else {
|
|
262
262
|
common.setHardfork("berlin");
|
|
263
263
|
}
|
|
264
264
|
|
|
@@ -276,7 +276,7 @@ export class ForkBlockchain
|
|
|
276
276
|
freeze: false,
|
|
277
277
|
|
|
278
278
|
// don't validate things like the size of `extraData` in the header
|
|
279
|
-
|
|
279
|
+
skipConsensusFormatValidation: true,
|
|
280
280
|
});
|
|
281
281
|
|
|
282
282
|
for (const transaction of rpcBlock.transactions) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StateManager } from "@
|
|
1
|
+
import { StateManager } from "@nomicfoundation/ethereumjs-statemanager";
|
|
2
2
|
import {
|
|
3
3
|
Account,
|
|
4
4
|
bigIntToHex,
|
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
KECCAK256_NULL,
|
|
9
9
|
toBuffer,
|
|
10
10
|
unpadBuffer,
|
|
11
|
-
} from "@
|
|
12
|
-
import { keccak256 } from "ethereum-cryptography/keccak";
|
|
11
|
+
} from "@nomicfoundation/ethereumjs-util";
|
|
13
12
|
import { Map as ImmutableMap, Record as ImmutableRecord } from "immutable";
|
|
14
13
|
|
|
15
14
|
import { assertHardhatInvariant } from "../../../core/errors";
|
|
16
15
|
import { InternalError } from "../../../core/providers/errors";
|
|
16
|
+
import { keccak256 } from "../../../util/keccak";
|
|
17
17
|
import { JsonRpcClient } from "../../jsonrpc/client";
|
|
18
18
|
import { GenesisAccount } from "../node-types";
|
|
19
19
|
import { makeAccount } from "../utils/makeAccount";
|
|
@@ -52,12 +52,6 @@ export class ForkStateManager implements StateManager {
|
|
|
52
52
|
private _contextBlockNumber = this._forkBlockNumber;
|
|
53
53
|
private _contextChanged = false;
|
|
54
54
|
|
|
55
|
-
// used by the DefaultStateManager calls
|
|
56
|
-
private _accessedStorage: Array<Map<string, Set<string>>> = [new Map()];
|
|
57
|
-
private _accessedStorageReverted: Array<Map<string, Set<string>>> = [
|
|
58
|
-
new Map(),
|
|
59
|
-
];
|
|
60
|
-
|
|
61
55
|
constructor(
|
|
62
56
|
private readonly _jsonRpcClient: JsonRpcClient,
|
|
63
57
|
private readonly _forkBlockNumber: bigint
|
|
@@ -258,7 +252,6 @@ export class ForkStateManager implements StateManager {
|
|
|
258
252
|
public async checkpoint(): Promise<void> {
|
|
259
253
|
const stateRoot = await this.getStateRoot();
|
|
260
254
|
this._stateCheckpoints.push(bufferToHex(stateRoot));
|
|
261
|
-
this._accessedStorage.push(new Map());
|
|
262
255
|
}
|
|
263
256
|
|
|
264
257
|
public async commit(): Promise<void> {
|
|
@@ -274,11 +267,6 @@ export class ForkStateManager implements StateManager {
|
|
|
274
267
|
throw notCheckpointedError("revert");
|
|
275
268
|
}
|
|
276
269
|
await this.setStateRoot(toBuffer(checkpointedRoot));
|
|
277
|
-
|
|
278
|
-
const lastItem = this._accessedStorage.pop();
|
|
279
|
-
if (lastItem !== undefined) {
|
|
280
|
-
this._accessedStorageReverted.push(lastItem);
|
|
281
|
-
}
|
|
282
270
|
}
|
|
283
271
|
|
|
284
272
|
public async getStateRoot(): Promise<Buffer> {
|
|
@@ -438,9 +426,15 @@ export class ForkStateManager implements StateManager {
|
|
|
438
426
|
}
|
|
439
427
|
|
|
440
428
|
public async modifyAccountFields(
|
|
441
|
-
|
|
442
|
-
|
|
429
|
+
address: Address,
|
|
430
|
+
accountFields: any
|
|
443
431
|
): Promise<void> {
|
|
444
|
-
//
|
|
432
|
+
// copied from BaseStateManager
|
|
433
|
+
const account = await this.getAccount(address);
|
|
434
|
+
account.nonce = accountFields.nonce ?? account.nonce;
|
|
435
|
+
account.balance = accountFields.balance ?? account.balance;
|
|
436
|
+
account.storageRoot = accountFields.storageRoot ?? account.storageRoot;
|
|
437
|
+
account.codeHash = accountFields.codeHash ?? account.codeHash;
|
|
438
|
+
await this.putAccount(address, account);
|
|
445
439
|
}
|
|
446
440
|
}
|