Skip to content

Commit

Permalink
feat: set nautilus gas price via env var (#3901)
Browse files Browse the repository at this point in the history
### Description

<!--
What's included in this PR?
-->

### Drive-by changes

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

### Related issues

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

### Backward compatibility

<!--
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
-->

### Testing

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

None/Manual/Unit Tests
-->
  • Loading branch information
daniel-savu authored Jun 5, 2024
1 parent 3813233 commit b337063
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
15 changes: 13 additions & 2 deletions rust/chains/hyperlane-ethereum/src/mailbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use async_trait::async_trait;
use ethers::abi::AbiEncode;
use ethers::prelude::Middleware;
use ethers_contract::builders::ContractCall;
use tracing::instrument;
use tracing::{debug, instrument};

use hyperlane_core::accumulator::incremental::IncrementalMerkle;
use hyperlane_core::accumulator::TREE_DEPTH;
Expand Down Expand Up @@ -261,6 +261,7 @@ where

/// Returns a ContractCall that processes the provided message.
/// If the provided tx_gas_limit is None, gas estimation occurs.
#[instrument]
async fn process_contract_call(
&self,
message: &HyperlaneMessage,
Expand All @@ -271,7 +272,17 @@ where
metadata.to_vec().into(),
RawHyperlaneMessage::from(message).to_vec().into(),
);
fill_tx_gas_params(tx, tx_gas_limit, self.provider.clone()).await
let mut tx = fill_tx_gas_params(tx, tx_gas_limit, self.provider.clone()).await?;
if self.domain.id() == 22222 {
if let Ok(gas_price) = std::env::var("NAUTILUS_GAS_PRICE")
.unwrap_or_default()
.parse::<U256>()
{
debug!(%gas_price, "Using custom gas price for Nautilus");
tx = tx.gas_price(gas_price);
}
}
Ok(tx)
}
}

Expand Down
10 changes: 1 addition & 9 deletions typescript/infra/config/environments/mainnet2/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,7 @@ const hyperlane: RootAgentConfig = {
validators: {
docker: {
repo,
tag: 'c30f471-20240530-150953',
},
chainDockerOverrides: {
[chainMetadata.solana.name]: {
tag: 'c30f471-20240530-150953',
},
[chainMetadata.nautilus.name]: {
tag: 'c30f471-20240530-150953',
},
tag: 'aaee5f2-20240605-130143',
},
connectionType: AgentConnectionType.HttpQuorum,
chains: validatorChainConfig(Contexts.Hyperlane),
Expand Down

0 comments on commit b337063

Please sign in to comment.