Skip to content

TransactionExecutionError: Headers Timeout Error #2672

@Pzixel

Description

@Pzixel

Bug Description

When running long tests on harhat network all transactions start failing and then it stalls.

Reproducible By

This snippet should do the trick:

for (let j = 0; j < 1000000; j++) {
    const amountIn = '1000';
    const [signer1] = await ethers.getSigners();
    const swapRouter = ISwapRouter__factory.connect('0xE592427A0AEce92De3Edee1F18E0157C05861564', signer1);
    const recipient = signer1.address;
    await waitEthersTx(swapRouter.exactInput({
        // WETH -> USDC 3000 fee
        path: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2000bb8A0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
        amountIn: amountIn,
        deadline: constants.MaxUint256,
        recipient,
        amountOutMinimum: 1,
    }, {
        value: amountIn,
    }));
}

Expected Behavior

It should be working without issues

Logs & Screenshots

Transaction fails with

TransactionExecutionError: Headers Timeout Error
    at HardhatNode.mineBlock (/Users/pzixel/Documents/Repos/test/node_modules/hardhat/src/internal/hardhat-network/provider/node.ts:478:15)
    at async EthModule._sendTransactionAndReturnHash (/Users/pzixel/Documents/Repos/test/node_modules/hardhat/src/internal/hardhat-network/provider/modules/eth.ts:1496:18)
    at async HardhatNetworkProvider.request (/Users/pzixel/Documents/Repos/test/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:118:18)
    at async EthersProviderWrapper.send (/Users/pzixel/Documents/Repos/test/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)

    Caused by: HeadersTimeoutError: Headers Timeout Error
        at Timeout.onParserTimeout [as _onTimeout] (/Users/pzixel/Documents/Repos/test/node_modules/undici/lib/client.js:1005:28)
        at listOnTimeout (node:internal/timers:561:11)
        at processTimers (node:internal/timers:502:7)

Environment

Node 16.5.0, Macos 12.3.1 M1 Pro (but I'm pretty sure it's doesn't matter)

Hardhat config if relevant:

const networks: NetworksUserConfig = {
    hardhat: {
        forking: {
            url: myurl,
        },
        chainId: 1,
    },
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions