Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluate use of Tx simulate to determine the fees #930

Closed
5 tasks
ancazamfir opened this issue May 12, 2021 · 0 comments · Fixed by #1091
Closed
5 tasks

Evaluate use of Tx simulate to determine the fees #930

ancazamfir opened this issue May 12, 2021 · 0 comments · Fixed by #1091
Assignees
Labels
I: logic Internal: related to the relaying logic O: new-feature Objective: cause to add a new feature or support
Milestone

Comments

@ancazamfir
Copy link
Collaborator

Crate

relayer

Summary

Big Tx-es (e.g. including 30 msgs which is the default maximum) are sometimes rejected with out of gas error.

Problem Definition

We currently use the gas and fee_amount in the config file when sending a Tx. The Tx is sometimes rejected with out of gas error. Current workaround is to increase the value in the config file.
Instead we should evaluate the gas/ fee parameters at the moment we send the Tx.

Proposal

@andynog made this analysis earlier:
The REST API has a /cosmos/tx/v1beta1/simulate endpoint that you can submit a tx and it returns the gas used, you can craft a 'fake' transaction e.g. MsgSend but it does enforce a few validation (address needs to exist on chain, account sequence number) and it will return something like:

{
  "gas_info": {
    "gas_wanted": "0",
    "gas_used": "50682"
  },
  "result": {
    "data": "CgYKBHNlbmQ=",

and this just simulates and doesn't execute the transaction. Anyways, this is probably the best way found so far to find how much gas a tx will use.

Acceptance Criteria


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate milestone (priority) applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I: logic Internal: related to the relaying logic O: new-feature Objective: cause to add a new feature or support
Projects
None yet
2 participants