From b507b52d72b836a69442387bda2ac6ffcbed293b Mon Sep 17 00:00:00 2001 From: Oleksandr Hrab Date: Thu, 27 Jun 2024 12:02:34 +0300 Subject: [PATCH] feat: add timeout to avoid headers timeout error (#13) SCS failed to deploy on Hedera Mainnet without this timeout: ``` HeadersTimeoutError: Headers Timeout Error at Timeout.onParserTimeout [as callback] (/home/coder/usecase/node_modules/undici/lib/client.js:1048:28) at Timeout.onTimeout [as _onTimeout] (/home/coder/usecase/node_modules/undici/lib/timers.js:20:13) at listOnTimeout (node:internal/timers:573:17) at processTimers (node:internal/timers:514:7) { code: 'UND_ERR_HEADERS_TIMEOUT' } 14081 | console.warn("The node you are deploying to does not have access to a private key to sign this transaction."); 14082 | } 14083 | if (verify && import_lodash.isEmpty(process.env.ETHERSCAN_API_KEY)) { 14084 | throw new Error("It is not possible to verify the deployment on this network unless you supply an Etherscan API key in the hardht.config.ts file"); 14085 | } ``` https://github.com/NomicFoundation/hardhat/issues/2672 They have open issue to fix it: https://github.com/NomicFoundation/hardhat/issues/3136 This error happened for me only on Hedera Mainnet, testnet works fine. ## Summary by CodeRabbit - **New Features** - Added a `timeout` parameter with a value of `100_000` to the BTP configuration in the projects. - The `timeout` property affects the BTP RPC settings for improved functionality. --- hardhat.config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/hardhat.config.ts b/hardhat.config.ts index 8b70a187..7f9f3f84 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -18,6 +18,7 @@ const config: HardhatUserConfig = { btp: { url: process.env.BTP_RPC_URL || "", gasPrice: process.env.BTP_GAS_PRICE ? parseInt(process.env.BTP_GAS_PRICE) : "auto", + timeout: 100_000, }, }, etherscan: {