Skip to content

baseFeeperGas need to be a calculated value #5130

@Ferparishuertas

Description

@Ferparishuertas

x## Problem

baseFeePerGas in Ethereum is the fee applied at block level. On Hiero transactions can have different gasPrice within the same block.
Added to this, standard ethereum tooling uses latest baseFeePerGas on ethFeeHistory, to calculate next gasPrice.

A wrong calculated value can lead to transaction sending problem within tools, if value set is lower than network gasprice, or value 0 in empty block

Added to this, nowadays we set the value to the latest gasprice, indepently if the block information is the latest or historical.

Solution

Implement the following

  • eth_getBlockByNumber or hash: The value for baseFeePerGas will be the average gasPrice applied. having known it should be a value, that multiplied to the total gasused its equal to totall charge hbar ( PLEASE review possible decimals issues, rounding) . In case of any empty block, the value will be the price of the blockNumber latest timestamp, echange value of GET
    /api/v1/network/fees

  • eth_feeHistory. If latest is passed as param, latest = this moment gas price, to avoid any race condition. On other blocks we should answer with the latest gasprice applied, within the block ( latest transaction within the block). In case of any empty block, the value will be the price of the blockNumber latest timestamp, echange value of GET
    /api/v1/network/fees

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions