hiero-ledger / hiero-ledger/hiero-consensus-node
Respect `transactionFee` when processing smart contract transactions
- Dominant language
- Java
- Stars
- 406
- Forks
- 226
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 210
Description
Currently, the `transactionFee` defined in the transaction body of a smart contract transaction seems to not be limiting the success of failure of the transaction.
In the following examples, if a `transactionFee` of 1 tiny bar is sent, then it is still possible to successfully process a smart contract transaction even though the fee is not enough to cover intrinsic gas:
- sending a `ContractCall` with 15M gas, 1 tinybar for transactionFee, the payer balance of 100 hbars succeeds
- sending an `EthereumTransaction` with 15M gas, 82770 tinybar for transactionFee(sufficient to pay node fees), the relay balance of 100 hbars succeeds
Also, one can imaging a case where the `transactionFee` is sufficient to pay for the gas and hapi fees for the transaction but less than the gas limit sent. In this case, the true gas limit should be the minimum of the `transactionFee` converted into gas and the gas limit.
Contributor guide
Research direction
Start by tracing processing for ContractCall and EthereumTransaction, focusing on how transactionFee, intrinsic gas, and the gas limit affect transaction success. Reproduce the two 15M-gas examples and verify that the effective gas limit is bounded by the fee-converted gas amount while preserving sufficient node and HAPI fees.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- blockchain
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100