conflux-rust icon indicating copy to clipboard operation
conflux-rust copied to clipboard

Return the correct `is_gas_sponsored` when a tx execution fails.

Open ChenxingLi opened this issue 5 years ago • 2 comments

When a tx execution fails, is_gas_sponsored should be set correctly other than simply set to false. Because in this case, the gas fee has been charged.

ChenxingLi avatar Jul 11 '20 09:07 ChenxingLi

We should not use assigning as a way to catch attention here. Let's see whether @yangzhe1990 wants to self-assign on this.

What's the source code line number around this?

fanlong avatar Jul 13 '20 06:07 fanlong

I have discussed it with zhe offline before. So I assign zhe for remark.

The logic is in function process_epoch_transactions() of ConsensusExecutionHandler, after transact(). In case the execution outcome is ExecutionErrorBumpNonce, the is_gas_sponsored should be record correctly because the gas fee has been charged. The is_storage_sponsored can be set to false by default because no storage change in this case.

Btw, if the outcome is NotExecuted.., the gas fee is not charged and the is_gas_sponsored is set to false by default. This logic is correct.

ChenxingLi avatar Jul 13 '20 08:07 ChenxingLi