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

Conversation

KamiD
Copy link

@KamiD KamiD commented Feb 3, 2021

Closes: #767

Description


For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@KamiD KamiD requested review from fedekunze and noot as code owners February 3, 2021 05:46
@KamiD KamiD changed the title Hotfix v0.4.1 fix error of timeout when using Truffle to deploy contract Feb 3, 2021
araskachoi
araskachoi previously approved these changes Feb 5, 2021
@araskachoi araskachoi dismissed their stale review February 5, 2021 06:38

maybe diff impl

@@ -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

@KamiD KamiD requested a review from araskachoi February 7, 2021 02:34
@araskachoi araskachoi merged commit 177574a into cosmos:development Feb 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

the transaction keep pending until timeout when i using truffle deploy contract
2 participants