-
Notifications
You must be signed in to change notification settings - Fork 329
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
Configuration and problems with gas_adjustment parameter #2174
Comments
Thanks for documenting this request! Currently,
At first glance, it looks easier to increase the upper-limit on Would the upper-bound |
Also adding |
Hi @loredanacirstea I am exploring potential solutions for the gas_adjustment configuration. One of them would be having a special experimental Hermes binary, which would have looser configuration bounds. This would give access to a Hermes which could be used with gas_adjustment parameter between 0 and 10, without having any impact on the release version. |
Here's a proposal:
Meaning that when we previously had I believe we should enforce a lower bound of What do you think @loredanacirstea @ljoss17? |
@romac that's perfect. Your proposal is also consistent with how cosmos sdk uses the |
…2353) # Description This PR does the following: (cf. #2174 (comment)) 1. Let's deprecate `gas_adjustment`. The name of the setting does not properly convey what is used for imho, and its semantics (multiply the estimated gas by the value and add it to the estimation) are confusing. 2. Instead, replace it with a `gas_multiplier` setting, with the following semantics: take the estimated gas and multiply it by the value of the setting. Meaning that when we previously had `gas_adjustment = 0.1`, which increases the gas by 10%, we would now have `gas_multiplier = 1.1`. This PR enforces a lower bound of `1.0` for the new setting but no upper bound so that people are free to use as high gas as they want. # Commits * Deprecate `gas_adjustment` in favor of new `gas_multiplier` setting * Add changelog entry * Add tests for `adjust_gas` * Fix `unused_variable` warning * Improve tests * Fix typo in test code * Use 1.1 gas_multiplier in mock tests * Return zero when `gas_amount` is zero, instead of max_gas * Short-circuit when gas_amount = 0 or gas_multiplier = 1
…nformalsystems#2353) # Description This PR does the following: (cf. informalsystems#2174 (comment)) 1. Let's deprecate `gas_adjustment`. The name of the setting does not properly convey what is used for imho, and its semantics (multiply the estimated gas by the value and add it to the estimation) are confusing. 2. Instead, replace it with a `gas_multiplier` setting, with the following semantics: take the estimated gas and multiply it by the value of the setting. Meaning that when we previously had `gas_adjustment = 0.1`, which increases the gas by 10%, we would now have `gas_multiplier = 1.1`. This PR enforces a lower bound of `1.0` for the new setting but no upper bound so that people are free to use as high gas as they want. # Commits * Deprecate `gas_adjustment` in favor of new `gas_multiplier` setting * Add changelog entry * Add tests for `adjust_gas` * Fix `unused_variable` warning * Improve tests * Fix typo in test code * Use 1.1 gas_multiplier in mock tests * Return zero when `gas_amount` is zero, instead of max_gas * Short-circuit when gas_amount = 0 or gas_multiplier = 1
Summary
Allow configurable gas limits beyond the
gas_adjustment = 1.0
ibc-rs
tries to do a gas estimation before sending a transaction. If a gas estimation can be computed, then the gas limit value can only be tweaked withgas_adjustment
(0.0.
-1.0
). If you need to increase this gas estimation more, you need to change the code and rebuild from source.Problem Definition
I personally needed to have custom gas because I was testing cutting-edge code and the gas estimation was off -
gas_adjustment = 1.0
was not enough.I don't see drawbacks to introducing a gas limit overwrite variable that is properly commented.
Proposal
gas_adjustment
range (I am not aware of the drawbacks that made the team limit this value)gas_overwite
variable that can be used to provide a custom value that overrides all gas estimationsAcceptance Criteria
gas_adjustment
is currently set to1.0
, and it should reflect the actual default (0.1
)gas_adjustment = 0.0
leads to a panic. We should disallow that value0.0
foribc-0
, leave it default foribc-1
hermes create client ibc-0 ibc-1
-- this should workhermes create client ibc-1 ibc-0
-- this should panicFor Admin Use
The text was updated successfully, but these errors were encountered: