-
Notifications
You must be signed in to change notification settings - Fork 39
Closed
Labels
t:bugSomething isn't workingSomething isn't working
Description
Description
When call eth_estimateGas to estimate gas used, the gas calculation for create-tx, call-tx and tx.data are incorrect and duplicated.
Lines 81 to 85 in f692b86
| let base_gas = if to.is_some() { | |
| GAS_CALL_TRANSACTION + data_gas_cost(&data) | |
| } else { | |
| GAS_CREATE_TRANSACTION + GAS_CALL_TRANSACTION + data_gas_cost(&data) | |
| }; |
Line 100 in f692b86
| let used_gas = executor.used_gas() + base_gas; |
For Example
-
Do simplest transfer transaction.
Data Size1 Estimated in Axon Actual in Axon Estimated in Geth Actual in Geth 0 42000 21000 21000 21000 1 42084 21016 21016 21016 2 42168 21032 21032 21032
Appendix: More Unit Tests are Required
-
Call
eth_estimateGasfor a transaction whose gas is set to a value that greater thanu64::MAX, will cause Axon panic.Line 210 in f692b86
.map(|gas| gas.as_u64()) There is already an in-process PR.
I just record it here, and request a unit test for it, after that PR merged.
Footnotes
-
Set the
transaction.datato beNnon-zero bytes. ↩
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
t:bugSomething isn't workingSomething isn't working