Skip to content

Commit

Permalink
feat: add timeout to avoid headers timeout error (#13)
Browse files Browse the repository at this point in the history
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 |     }
```
NomicFoundation/hardhat#2672

They have open issue to fix it:
NomicFoundation/hardhat#3136

This error happened for me only on Hedera Mainnet, testnet works fine.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## 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.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
insider89 authored Jun 27, 2024
1 parent 07beff9 commit 9c1869d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 9c1869d

Please sign in to comment.