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

Update dynamic gas fee to work with FeeMarket #4004

Merged
merged 11 commits into from
May 29, 2024

Conversation

ljoss17
Copy link
Contributor

@ljoss17 ljoss17 commented May 28, 2024

Closes: #4000

Description

This PR updates the dynamic gas fee query to query the Osmosis endpoint only if the chain is Osmosis. Else it will query the Fee Market endpoint, using the configured gas denom.


PR author checklist:

  • Added changelog entry, using unclog.
  • Added tests: integration (for Hermes) or unit/mock tests (for modules).
  • Linked to GitHub issue.
  • Updated code comments and documentation (e.g., docs/).
  • Tagged one reviewer who will be the one responsible for shepherding this PR.

Reviewer checklist:

  • Reviewed Files changed in the GitHub PR explorer.
  • Manually tested (in case integration/unit/mock tests are absent).

@ljoss17 ljoss17 requested a review from romac May 28, 2024 14:18
@ljoss17 ljoss17 marked this pull request as ready for review May 28, 2024 14:23
crates/relayer/src/chain/cosmos/eip_base_fee.rs Outdated Show resolved Hide resolved
crates/relayer/src/chain/cosmos/eip_base_fee.rs Outdated Show resolved Hide resolved
crates/relayer/src/chain/cosmos/eip_base_fee.rs Outdated Show resolved Hide resolved
crates/relayer/src/chain/cosmos/gas.rs Outdated Show resolved Hide resolved
Co-authored-by: Romain Ruetschi <romain@informal.systems>
Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com>
let dynamic_gas_price = query_eip_base_fee(rpc_address)
let url = if chain_id.name().contains("osmosis") {
format!(
"{}abci_query?path=\"/osmosis.txfees.v1beta1.Query/GetEipBaseFee\"",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to have the query paths in the chain config?

Copy link
Member

@romac romac May 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed this with Luca today and felt like we'd rather avoid introducing one more knob only for osmosis, and that special casing would be enough until they move to Skip's fee market module (if ever).

Also, we can't just add this in the config and issue the query blindly, because we have to know whether we are doing an osmosis or fee market query in order to deserialize the response.

We thought about having a config like fee_market_module with values like Osmosis and FeeMarket, but we felt like this might be confusing to users and would rather avoid doing this if we can help it.

Happy to change my mind, but just want to understand what that would bring us?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was asking because I find it awkward to have hardcoded strings like this and would be nice if we can avoid it. The fee_market_module would be something like EIP-1559 (in case other chains use the same) or FeeMarket but yes the fact that the query response is different in the first place is another annoyance and I wish they could be aligned. They are not that much different actually and maybe it wouldn't be hard to ask/ have a consistent response.

But we can wait and see if there is convergence on the skip's module or we start seeing more dynamic fee impls.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! But just to recap my point was that there is no benefit to making this configurable because we need bespoke code for handling the potentially different responses format and we cannot just try and deserialize the response o to one format or the other as the various responses might all be proto if compatible and deserialize into each other but with wrong results.

But we can wait and see if there is convergence on the skip's module or we start seeing more dynamic fee impls.

Agreed, I think we should indeed wait until we see how many different impls we end up with. Until then I suggest we hide this from users and only special case osmosis for now. After we'll see if we need a more generic way of configuring this or if everybody converges on Skip's module.

@romac romac enabled auto-merge May 29, 2024 07:06
Co-authored-by: Romain Ruetschi <romain@informal.systems>
Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com>
Copy link
Member

@romac romac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick turnaround! 🚀

@romac romac added this pull request to the merge queue May 29, 2024
Merged via the queue into master with commit 6d377ab May 29, 2024
30 checks passed
@romac romac deleted the luca_joss/update-dynamic-gas-fee-feature branch May 29, 2024 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve Dynamic Gas Fees
3 participants