Skip to content

Commit

Permalink
Use Polygon gas oracle (#2965)
Browse files Browse the repository at this point in the history
After investigating #2959, I found the following

this is a known problem with Polygon, explanation here
ethers-io/ethers.js#2828 (comment)

Fun fact Asa looked into this once
#771

Here's a discussion it in Foundry, which I found hoping that ethers-rs
folks had ran into this before
foundry-rs/foundry#1703

Foundry fixed this by using the Polygon gas station oracle which seems
to be recommended path
https://github.com/foundry-rs/foundry/pull/3368/files#diff-c89a4bbf7a90da118dcf00c5fe70eba78f8e5d95662bb5f039a353113e95042bR205

There's actually a polygon ethers middleware for this
https://docs.rs/ethers/latest/ethers/middleware/gas_oracle/polygon/struct.Polygon.html

So I (originally) borrowed this code from Foundry
https://github.com/foundry-rs/foundry/blob/master/crates/common/src/provider.rs#L254-L290

Changed to use Middlewares

This also means we can remove our existing janky Polygon logic

<!--
Are there any minor or drive-by changes also included?
-->

<!--
- Fixes #[issue number here]
-->

<!--
Are these changes backward compatible? Are there any infrastructure
implications, e.g. changes that would prohibit deploying older commits
using this infra tooling?

Yes/No
-->

<!--
What kind of testing have these changes undergone?

None/Manual/Unit Tests
-->
  • Loading branch information
tkporter authored and nambrot committed Dec 1, 2023
1 parent 1d58541 commit dc8a4b4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
20 changes: 10 additions & 10 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -148,28 +148,28 @@ which = "4.3"

[workspace.dependencies.ethers]
git = "https://github.com/hyperlane-xyz/ethers-rs"
tag = "2023-06-01"
features = []
tag = "2023-11-29-01"

[workspace.dependencies.ethers-contract]
git = "https://github.com/hyperlane-xyz/ethers-rs"
tag = "2023-06-01"
features = ["legacy"]
tag = "2023-11-29-01"

[workspace.dependencies.ethers-core]
git = "https://github.com/hyperlane-xyz/ethers-rs"
tag = "2023-06-01"
features = []
tag = "2023-11-29-01"

[workspace.dependencies.ethers-providers]
git = "https://github.com/hyperlane-xyz/ethers-rs"
tag = "2023-06-01"
features = []
tag = "2023-11-29-01"

[workspace.dependencies.ethers-signers]
git = "https://github.com/hyperlane-xyz/ethers-rs"
tag = "2023-06-01"
features = ["aws"]
tag = "2023-11-29-01"

[patch.crates-io.curve25519-dalek]
version = "3.2.2"
Expand Down

0 comments on commit dc8a4b4

Please sign in to comment.