Closed yangby-cryptape closed 10 months ago
When call eth_estimateGas to estimate gas used, the gas calculation for create-tx, call-tx and tx.data are incorrect and duplicated.
eth_estimateGas
create-tx
call-tx
tx.data
https://github.com/axonweb3/axon/blob/f692b865bda85cbd0c8f028f8aca8ae0d793465b/core/executor/src/lib.rs#L81-L85
https://github.com/axonweb3/axon/blob/f692b865bda85cbd0c8f028f8aca8ae0d793465b/core/executor/src/lib.rs#L100
[^1]: Set the transaction.data to be N non-zero bytes.
transaction.data
N
Call eth_estimateGas for a transaction whose gas is set to a value that greater than u64::MAX, will cause Axon panic.
u64::MAX
https://github.com/axonweb3/axon/blob/f692b865bda85cbd0c8f028f8aca8ae0d793465b/core/api/src/adapter.rs#L210
There is already an in-process PR.
I just record it here, and request a unit test for it, after that PR merged.
Description
When call
eth_estimateGas
to estimate gas used, the gas calculation forcreate-tx
,call-tx
andtx.data
are incorrect and duplicated.https://github.com/axonweb3/axon/blob/f692b865bda85cbd0c8f028f8aca8ae0d793465b/core/executor/src/lib.rs#L81-L85
https://github.com/axonweb3/axon/blob/f692b865bda85cbd0c8f028f8aca8ae0d793465b/core/executor/src/lib.rs#L100
For Example
[^1]: Set the
transaction.data
to beN
non-zero bytes.Appendix: More Unit Tests are Required
Call
eth_estimateGas
for a transaction whose gas is set to a value that greater thanu64::MAX
, will cause Axon panic.https://github.com/axonweb3/axon/blob/f692b865bda85cbd0c8f028f8aca8ae0d793465b/core/api/src/adapter.rs#L210
There is already an in-process PR.
I just record it here, and request a unit test for it, after that PR merged.