Skip to content

Commit 8d71209

Browse files
authored
Merge pull request #648 from onflow/mpeter/fix-hardhat-ignition-deployment
Set a non-zero `BaseFeePerGas` on block responses
2 parents 1d6f350 + e8ae478 commit 8d71209

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

api/api.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ import (
3232

3333
const maxFeeHistoryBlockCount = 1024
3434

35+
var baseFeesPerGas = big.NewInt(1)
36+
3537
// A map containing all the valid method names that are found
3638
// in the Ethereum JSON-RPC API specification.
3739
// Update accordingly if any new methods are added/removed.
@@ -937,7 +939,7 @@ func (b *BlockChainAPI) FeeHistory(
937939
oldestBlock = (*hexutil.Big)(big.NewInt(int64(block.Height)))
938940
}
939941

940-
baseFees = append(baseFees, (*hexutil.Big)(big.NewInt(0)))
942+
baseFees = append(baseFees, (*hexutil.Big)(baseFeesPerGas))
941943

942944
rewards = append(rewards, blockRewards)
943945

@@ -1053,7 +1055,7 @@ func (b *BlockChainAPI) prepareBlockResponse(
10531055
GasLimit: hexutil.Uint64(blockGasLimit),
10541056
Nonce: types.BlockNonce{0x1},
10551057
Timestamp: hexutil.Uint64(block.Timestamp),
1056-
BaseFeePerGas: hexutil.Big(*big.NewInt(0)),
1058+
BaseFeePerGas: hexutil.Big(*baseFeesPerGas),
10571059
LogsBloom: types.LogsBloom([]*types.Log{}),
10581060
Miner: evmTypes.CoinbaseAddress.ToCommon(),
10591061
Sha3Uncles: types.EmptyUncleHash,
@@ -1230,8 +1232,7 @@ func (b *BlockChainAPI) GetUncleByBlockNumberAndIndex(
12301232

12311233
// MaxPriorityFeePerGas returns a suggestion for a gas tip cap for dynamic fee transactions.
12321234
func (b *BlockChainAPI) MaxPriorityFeePerGas(ctx context.Context) (*hexutil.Big, error) {
1233-
fee := hexutil.Big(*big.NewInt(1))
1234-
return &fee, nil
1235+
return (*hexutil.Big)(b.config.GasPrice), nil
12351236
}
12361237

12371238
// Mining returns true if client is actively mining new blocks.

tests/web3js/eth_non_interactive_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ it('get fee history', async () => {
379379
{
380380
oldestBlock: 1n,
381381
reward: [['0x96'], ['0x96'], ['0x96']], // gas price is 150 during testing
382-
baseFeePerGas: [0n, 0n, 0n],
382+
baseFeePerGas: [1n, 1n, 1n],
383383
gasUsedRatio: [0, 0, 0.006205458333333334]
384384
}
385385
)

0 commit comments

Comments
 (0)