Description
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
- use the above gm config
gm start
,gm hermes config
gm hermes keys
- replace the gas configuration for chain
a
in the .hermes/config.tomlgas_price = { price = 0.00, denom = 'stake' }
(notice the zeroes) andmax_gas = 5000
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
andout of gas
errors. the underlying cause, i.e.,price
vs. amount ofgas
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