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 IGP gas oracles with new heuristics, get Cosmos gas prices from registry #3662

Merged
merged 30 commits into from
Apr 26, 2024

Conversation

tkporter
Copy link
Collaborator

Description

The original and main motivation of this PR was to feel confident when running deploy.ts -m igp off of main. Prior to this, running it off main could result in misconfiguring gas oracles, particularly when it came to non-EVM remotes. See https://github.com/hyperlane-xyz/issues/issues/1178 for some context.

This PR does a number of things:

  • Fetches Cosmos gas prices from the Cosmos registry
  • the gasPrices.json now lets you specify the decimals relating to the amount in there. There are 2 reasons for this: it's easier for us to deal with gwei values for EVM chains (as we often end up manually changing these instead of just relying on the script). The second reason is covered in the next bullet
  • Handles decimals when it comes to gas prices. The existing tooling assumed gas prices would always be denominated in wei. An extra weird situation arises with non-EVM chains: chains like Neutron have gas prices that are quotes in the smallest denomination (ie the equivalent of "wei" for NTRN), but the gas price is not an integer and is very small, e.g. 0.0053. This poses issues because the IGP contracts require the gas price that's configured onchain to be an integer. Simply rounding up from 0.0053 to 1 results in almost 2 orders of magnitude difference :(. So the solution here is to have some logic that accommodates really tiny gas prices by scaling up the configured gas price and scaling down the configured token exchange rate.
  • Applies some "non-linear" gas pricing heuristics. See https://github.com/hyperlane-xyz/issues/issues/1204 and https://discord.com/channels/935678348330434570/935678739663192184/1232293417309044818 for some context
  • Running update-agent-config.ts will fetch gas prices for Cosmos chains from the Cosmos registry and ensure they're accurate

Drive-by changes

Some logging messages when applying IGP gas oracle changes to make it more clear what the change actually does

Related issues

Backward compatibility

Fully backward compatible

Testing

Ran deploy.ts for the IGP on all chains!

nambrot and others added 27 commits March 31, 2024 12:34
@tkporter tkporter requested a review from daniel-savu as a code owner April 23, 2024 13:54
Copy link

changeset-bot bot commented Apr 23, 2024

⚠️ No Changeset found

Latest commit: e174780

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

codecov bot commented Apr 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.28%. Comparing base (d6f25ed) to head (e174780).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3662   +/-   ##
=======================================
  Coverage   74.28%   74.28%           
=======================================
  Files         108      108           
  Lines        1217     1217           
  Branches      132      132           
=======================================
  Hits          904      904           
  Misses        297      297           
  Partials       16       16           
Components Coverage Δ
core 84.61% <ø> (ø)
hooks 69.94% <ø> (ø)
isms 73.17% <ø> (ø)
token 63.77% <ø> (ø)
middlewares 77.48% <ø> (ø)

@tkporter tkporter enabled auto-merge (squash) April 26, 2024 13:21
@tkporter tkporter merged commit 21cd38c into main Apr 26, 2024
40 of 41 checks passed
@tkporter tkporter deleted the trevor/oracle-updates branch April 26, 2024 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
3 participants