PlatONnetwork/PlatON-Go

Gas is not estimated, given a large gas, the delegation fails, and all the given gas is deducted

Closed this issue · 3 comments

Hi there,

please note that this is an issue tracker reserved for bug reports and feature requests.

System information

PlatON version: 0.14.0, 0.15.0, 0.15.1, 0.16.0
OS & Version: Windows/Linux/OSX
Commit hash : (if develop)

Expected behaviour

Commissioned transaction fails, the deducted gas fee is the gas fee generated if the transaction is successful .

Actual behaviour

The entrusted transaction fails, and the deducted gas is the given large gas.

Steps to reproduce the behaviour

  1. The setting does not estimate the gas, and a larger gas is given
  2. Initiate a failed commissioned transaction

Backtrace

[backtrace]

Personal understanding
Execution of a failed transaction does not calculate the possible consumption of gas, the normal calculation of the fee is based on Gaslimit.
If you want to count it the logic is very complicated, what transactions can't be counted and what transactions can be counted

0.13.2 is ok, the gas fee is deducted according to the estimated gas, and later versions will not work

如果交易回执的状态为0,会按照交易设置的gaslimit全额扣除手续费。
因此,在0.13.2及之前,委托失败后的交易的状态会被设置为1,仅扣除执行消耗的交易手续费。
在0.13.2之后,委托失败后的交易的状态会被设置为0,会按照交易设置的gaslimit全额扣除手续费。