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

Unhelpful fee-related error messages #1400

Closed
3 of 7 tasks
Tracked by #1397
adizere opened this issue Sep 30, 2021 · 0 comments · Fixed by #2261
Closed
3 of 7 tasks
Tracked by #1397

Unhelpful fee-related error messages #1400

adizere opened this issue Sep 30, 2021 · 0 comments · Fixed by #2261
Assignees
Labels
I: configuration Internal: related to Hermes configuration I: dependencies Internal: related to dependencies O: usability Objective: cause to improve the user experience (UX) and ease using the product
Milestone

Comments

@adizere
Copy link
Member

adizere commented Sep 30, 2021

Summary

From a Hermes user:

We had this in logs:

insufficient fees; got: 5000uixo required: 12500uixo: insufficient fee

Increasing max_gas [i.e., permitting more gas to be used, with unchanged gas price] to absurd values just increases the required gas:

insufficient fees; got: 5000000000uixo required: 12500000000uixo: insufficient fee

In the end, changing the price from 0.01 to 0.025 solved the issue

Problem Definition

The error messages

insufficient fees; got: 5000uixo required: 12500uixo: insufficient fee

and

insufficient fees; got: 5000000000uixo required: 12500000000uixo: insufficient fee

seems to suggest that the user should increase the amount of gas that they allocate to their transaction. But that doesn't really fix it. In case of non-experts who do not know the fee = gas * price equation, this error message is not helpful.

We can also recreate a similar problem, using gm:

gm.toml
[global]
gaiad_binary="/opt/bin/gaiad"

[global.hermes]
binary="/home/adizere/bin/hermes"


[a]
  add_to_hermes = true
  ports_start_at = 27000

[b]
  add_to_hermes = true
  ports_start_at = 27030
  1. use the above gm config
  2. gm start, gm hermes config gm hermes keys
  3. replace the gas configuration for chain a in the .hermes/config.toml
    • gas_price = { price = 0.00, denom = 'stake' } (notice the zeroes) and
    • max_gas = 5000
  4. hermes create client a b
    • now we should see an error

Success: ChainError(
"deliver_tx for 5BAD14EDB7754697047623FB5FCF1F097B32B78F3F604512DFED2A195C3A3725 reports error: code=Err(11), log=Log("out of gas in location: WritePerByte; gasWanted: 50000, gasUsed: 52357: out of gas")",
)

Again, the error message is not really helpful. The problem is that the gas price is zero, so even if we increase max_gas, we'll encounter the same problem over and over, until we change the price = 0.00 to price = 0.001 or something non-zero.

Proposal

At the relayer level, improving this error message is possible because we know the error codes.
The relayer also knows how to compute the fees and whether it is using zero gas price.

Acceptance criteria

  • categorize and differentiate between insufficient fee and out of gas errors. the underlying cause, i.e., price vs. amount of gas should be clear from logs
  • parse (and help standardize) the code=Err(11) from crate tendermint-rs so that Hermes can reliably detect the error message and infer that the problem is with a misconfiguration on the fees
  • more helpful error message: If price is zero, Hermes should signal that in the error log

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@adizere adizere added I: dependencies Internal: related to dependencies O: usability Objective: cause to improve the user experience (UX) and ease using the product I: configuration Internal: related to Hermes configuration labels Sep 30, 2021
@adizere adizere added this to the 10.2021 milestone Sep 30, 2021
@adizere adizere modified the milestones: 10.2021, 12.2021 Nov 2, 2021
@adizere adizere modified the milestones: v1.0.0, v0.13.0 Feb 22, 2022
@adizere adizere modified the milestones: v0.15.0, v1.0.0 Apr 30, 2022
@adizere adizere self-assigned this May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I: configuration Internal: related to Hermes configuration I: dependencies Internal: related to dependencies O: usability Objective: cause to improve the user experience (UX) and ease using the product
Projects
No open projects
Status: Closed
Development

Successfully merging a pull request may close this issue.

2 participants