Skip to content

Commit c653045

Browse files
authored
Merge pull request #7678 from wighawag/fix/network-without-extra-baseFeePerGas-value
Fix/network without extra base fee per gas value
2 parents e169a1d + 806ee5a commit c653045

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changeset/forty-rice-clap.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"hardhat": patch
3+
---
4+
5+
Fixed an issue caused by networks that don't implement `eth_feeHistory` correctly (https://github.com/NomicFoundation/hardhat/pull/7678)

v-next/hardhat/src/internal/builtin-plugins/network-manager/request-handlers/handlers/gas/automatic-gas-price-handler.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ export class AutomaticGasPriceHandler implements RequestHandler {
200200
// next N blocks here.
201201

202202
maxFeePerGas:
203-
(hexStringToBigInt(response.baseFeePerGas[1]) *
203+
(hexStringToBigInt(
204+
response.baseFeePerGas[response.baseFeePerGas.length - 1],
205+
) *
204206
9n **
205207
(AutomaticGasPriceHandler.EIP1559_BASE_FEE_MAX_FULL_BLOCKS_PREFERENCE -
206208
1n)) /

0 commit comments

Comments
 (0)