chore: use GasOracle before the GasEscalator middleware

dan/gas-escalator-middleware
Daniel Savu 3 weeks ago
parent ba6df0cf15
commit 2cd101010b
No known key found for this signature in database
GPG Key ID: 795E587829AF7E08
  1. 20
      rust/main/Cargo.lock
  2. 10
      rust/main/Cargo.toml
  3. 6
      rust/main/chains/hyperlane-ethereum/src/rpc_clients/trait_builder.rs

20
rust/main/Cargo.lock generated

@ -2900,7 +2900,7 @@ dependencies = [
[[package]] [[package]]
name = "ethers" name = "ethers"
version = "1.0.2" version = "1.0.2"
source = "git+https://github.com/hyperlane-xyz/ethers-rs?tag=2024-11-07-2#eab0225acb793161a4aa28af5e875791ca40be92" source = "git+https://github.com/hyperlane-xyz/ethers-rs?tag=2024-11-08#0773c2af5eeec3394c24f8271d7680b7a5855e98"
dependencies = [ dependencies = [
"ethers-addressbook", "ethers-addressbook",
"ethers-contract", "ethers-contract",
@ -2914,7 +2914,7 @@ dependencies = [
[[package]] [[package]]
name = "ethers-addressbook" name = "ethers-addressbook"
version = "1.0.2" version = "1.0.2"
source = "git+https://github.com/hyperlane-xyz/ethers-rs?tag=2024-11-07-2#eab0225acb793161a4aa28af5e875791ca40be92" source = "git+https://github.com/hyperlane-xyz/ethers-rs?tag=2024-11-08#0773c2af5eeec3394c24f8271d7680b7a5855e98"
dependencies = [ dependencies = [
"ethers-core", "ethers-core",
"once_cell", "once_cell",
@ -2925,7 +2925,7 @@ dependencies = [
[[package]] [[package]]
name = "ethers-contract" name = "ethers-contract"
version = "1.0.2" version = "1.0.2"
source = "git+https://github.com/hyperlane-xyz/ethers-rs?tag=2024-11-07-2#eab0225acb793161a4aa28af5e875791ca40be92" source = "git+https://github.com/hyperlane-xyz/ethers-rs?tag=2024-11-08#0773c2af5eeec3394c24f8271d7680b7a5855e98"
dependencies = [ dependencies = [
"ethers-contract-abigen", "ethers-contract-abigen",
"ethers-contract-derive", "ethers-contract-derive",
@ -2943,7 +2943,7 @@ dependencies = [
[[package]] [[package]]
name = "ethers-contract-abigen" name = "ethers-contract-abigen"
version = "1.0.2" version = "1.0.2"
source = "git+https://github.com/hyperlane-xyz/ethers-rs?tag=2024-11-07-2#eab0225acb793161a4aa28af5e875791ca40be92" source = "git+https://github.com/hyperlane-xyz/ethers-rs?tag=2024-11-08#0773c2af5eeec3394c24f8271d7680b7a5855e98"
dependencies = [ dependencies = [
"Inflector", "Inflector",
"cfg-if", "cfg-if",
@ -2967,7 +2967,7 @@ dependencies = [
[[package]] [[package]]
name = "ethers-contract-derive" name = "ethers-contract-derive"
version = "1.0.2" version = "1.0.2"
source = "git+https://github.com/hyperlane-xyz/ethers-rs?tag=2024-11-07-2#eab0225acb793161a4aa28af5e875791ca40be92" source = "git+https://github.com/hyperlane-xyz/ethers-rs?tag=2024-11-08#0773c2af5eeec3394c24f8271d7680b7a5855e98"
dependencies = [ dependencies = [
"ethers-contract-abigen", "ethers-contract-abigen",
"ethers-core", "ethers-core",
@ -2981,7 +2981,7 @@ dependencies = [
[[package]] [[package]]
name = "ethers-core" name = "ethers-core"
version = "1.0.2" version = "1.0.2"
source = "git+https://github.com/hyperlane-xyz/ethers-rs?tag=2024-11-07-2#eab0225acb793161a4aa28af5e875791ca40be92" source = "git+https://github.com/hyperlane-xyz/ethers-rs?tag=2024-11-08#0773c2af5eeec3394c24f8271d7680b7a5855e98"
dependencies = [ dependencies = [
"arrayvec", "arrayvec",
"bytes", "bytes",
@ -3011,7 +3011,7 @@ dependencies = [
[[package]] [[package]]
name = "ethers-etherscan" name = "ethers-etherscan"
version = "1.0.2" version = "1.0.2"
source = "git+https://github.com/hyperlane-xyz/ethers-rs?tag=2024-11-07-2#eab0225acb793161a4aa28af5e875791ca40be92" source = "git+https://github.com/hyperlane-xyz/ethers-rs?tag=2024-11-08#0773c2af5eeec3394c24f8271d7680b7a5855e98"
dependencies = [ dependencies = [
"ethers-core", "ethers-core",
"getrandom 0.2.15", "getrandom 0.2.15",
@ -3027,7 +3027,7 @@ dependencies = [
[[package]] [[package]]
name = "ethers-middleware" name = "ethers-middleware"
version = "1.0.2" version = "1.0.2"
source = "git+https://github.com/hyperlane-xyz/ethers-rs?tag=2024-11-07-2#eab0225acb793161a4aa28af5e875791ca40be92" source = "git+https://github.com/hyperlane-xyz/ethers-rs?tag=2024-11-08#0773c2af5eeec3394c24f8271d7680b7a5855e98"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"auto_impl 0.5.0", "auto_impl 0.5.0",
@ -3075,7 +3075,7 @@ dependencies = [
[[package]] [[package]]
name = "ethers-providers" name = "ethers-providers"
version = "1.0.2" version = "1.0.2"
source = "git+https://github.com/hyperlane-xyz/ethers-rs?tag=2024-11-07-2#eab0225acb793161a4aa28af5e875791ca40be92" source = "git+https://github.com/hyperlane-xyz/ethers-rs?tag=2024-11-08#0773c2af5eeec3394c24f8271d7680b7a5855e98"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"auto_impl 1.2.0", "auto_impl 1.2.0",
@ -3111,7 +3111,7 @@ dependencies = [
[[package]] [[package]]
name = "ethers-signers" name = "ethers-signers"
version = "1.0.2" version = "1.0.2"
source = "git+https://github.com/hyperlane-xyz/ethers-rs?tag=2024-11-07-2#eab0225acb793161a4aa28af5e875791ca40be92" source = "git+https://github.com/hyperlane-xyz/ethers-rs?tag=2024-11-08#0773c2af5eeec3394c24f8271d7680b7a5855e98"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"coins-bip32 0.7.0", "coins-bip32 0.7.0",

@ -211,27 +211,27 @@ overflow-checks = true
[workspace.dependencies.ethers] [workspace.dependencies.ethers]
features = [] features = []
git = "https://github.com/hyperlane-xyz/ethers-rs" git = "https://github.com/hyperlane-xyz/ethers-rs"
tag = "2024-11-07-2" tag = "2024-11-08"
[workspace.dependencies.ethers-contract] [workspace.dependencies.ethers-contract]
features = ["legacy"] features = ["legacy"]
git = "https://github.com/hyperlane-xyz/ethers-rs" git = "https://github.com/hyperlane-xyz/ethers-rs"
tag = "2024-11-07-2" tag = "2024-11-08"
[workspace.dependencies.ethers-core] [workspace.dependencies.ethers-core]
features = [] features = []
git = "https://github.com/hyperlane-xyz/ethers-rs" git = "https://github.com/hyperlane-xyz/ethers-rs"
tag = "2024-11-07-2" tag = "2024-11-08"
[workspace.dependencies.ethers-providers] [workspace.dependencies.ethers-providers]
features = [] features = []
git = "https://github.com/hyperlane-xyz/ethers-rs" git = "https://github.com/hyperlane-xyz/ethers-rs"
tag = "2024-11-07-2" tag = "2024-11-08"
[workspace.dependencies.ethers-signers] [workspace.dependencies.ethers-signers]
features = ["aws"] features = ["aws"]
git = "https://github.com/hyperlane-xyz/ethers-rs" git = "https://github.com/hyperlane-xyz/ethers-rs"
tag = "2024-11-07-2" tag = "2024-11-08"
[patch.crates-io.curve25519-dalek] [patch.crates-io.curve25519-dalek]
branch = "v3.2.2-relax-zeroize" branch = "v3.2.2-relax-zeroize"

@ -198,8 +198,7 @@ pub trait BuildableWithProvider {
where where
P: JsonRpcClient + 'static, P: JsonRpcClient + 'static,
{ {
let provider = wrap_with_gas_oracle(Provider::new(client), locator.domain)?; self.build_with_signer(Provider::new(client), conn, locator, signer)
self.build_with_signer(provider, conn, locator, signer)
.await .await
} }
@ -223,8 +222,9 @@ pub trait BuildableWithProvider {
.await .await
.map_err(ChainCommunicationError::from_other)?; .map_err(ChainCommunicationError::from_other)?;
let gas_escalator_provider = wrap_with_gas_escalator(signing_provider); let gas_escalator_provider = wrap_with_gas_escalator(signing_provider);
let gas_oracle_provider = wrap_with_gas_oracle(gas_escalator_provider, locator.domain)?;
let nonce_manager_provider = let nonce_manager_provider =
wrap_with_nonce_manager(gas_escalator_provider, signer.address()) wrap_with_nonce_manager(gas_oracle_provider, signer.address())
.await .await
.map_err(ChainCommunicationError::from_other)?; .map_err(ChainCommunicationError::from_other)?;

Loading…
Cancel
Save