Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

fix error of timeout when using Truffle to deploy contract #768

Merged
merged 13 commits into from
Feb 8, 2021
Merged
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (evm) [\#670](https://github.com/cosmos/ethermint/pull/670) Migrate types to the ones defined by the protobuf messages, which are required for the stargate release.

### Bug Fixes

* (evm) [\#767](https://github.com/cosmos/ethermint/issues/767) Fix error of timeout when using Truffle to deploy contract.
* (evm) [\#751](https://github.com/cosmos/ethermint/issues/751) Fix misused method to calculate block hash in evm related function.
* (evm) [\#721](https://github.com/cosmos/ethermint/issues/721) Fix mismatch block hash in rpc response when use eht.getBlock.
* (evm) [\#730](https://github.com/cosmos/ethermint/issues/730) Fix 'EIP2028' not open when Istanbul version has been enabled.
Expand Down
2 changes: 1 addition & 1 deletion rpc/types/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func EthTransactionsFromTendermint(clientCtx clientcontext.CLIContext, txs []tmt
continue
}
// TODO: Remove gas usage calculation if saving gasUsed per block
gasUsed.Add(gasUsed, ethTx.Fee())
gasUsed.Add(gasUsed, big.NewInt(int64(ethTx.GetGas())))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetGas() just gives the gas limit correct?
would it be better to use:
gasUsed.Add(gasUsed, ethTx.Fee().Int64())

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think here need return gas used, not gas fee used, also, the number of Fee() is too big to return to the interface of web3.js, that will be crashed in web3.js lib cause too large number transform

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ethTx.Fee() return gaslimit * gasPrice, its much larger than real number of gas costed

transactionHashes = append(transactionHashes, common.BytesToHash(tx.Hash()))
}

Expand Down