Skip to content

Commit

Permalink
fix: svm gas price multipliers, relayer image (#5140)
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 Jan 10, 2025
1 parent 2d4963c commit 1c652a6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
17 changes: 14 additions & 3 deletions rust/main/chains/hyperlane-sealevel/src/rpc/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ use crate::{
tx_submitter::TransactionSubmitter,
};

const COMPUTE_UNIT_MULTIPLIER_NUMERATOR: u32 = 11;
const COMPUTE_UNIT_MULTIPLIER_DENOMINATOR: u32 = 10;

const PRIORITY_FEE_MULTIPLIER_NUMERATOR: u64 = 125;
const PRIORITY_FEE_MULTIPLIER_DENOMINATOR: u64 = 100;

pub struct SealevelTxCostEstimate {
compute_units: u32,
compute_unit_price_micro_lamports: u64,
Expand Down Expand Up @@ -389,11 +395,16 @@ impl SealevelRpcClient {
));
}

// Bump the compute units by 10% to ensure we have enough, but cap it at the max.
let simulation_compute_units =
Self::MAX_COMPUTE_UNITS.min((simulation_compute_units * 11) / 10);
// Bump the compute units to be conservative
let simulation_compute_units = Self::MAX_COMPUTE_UNITS.min(
(simulation_compute_units * COMPUTE_UNIT_MULTIPLIER_NUMERATOR)
/ COMPUTE_UNIT_MULTIPLIER_DENOMINATOR,
);

let priority_fee = priority_fee_oracle.get_priority_fee(&simulation_tx).await?;
// Bump the priority fee to be conservative
let priority_fee = (priority_fee * PRIORITY_FEE_MULTIPLIER_NUMERATOR)
/ PRIORITY_FEE_MULTIPLIER_DENOMINATOR;

Ok(SealevelTxCostEstimate {
compute_units: simulation_compute_units,
Expand Down
4 changes: 2 additions & 2 deletions typescript/infra/config/environments/mainnet3/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ const hyperlane: RootAgentConfig = {
rpcConsensusType: RpcConsensusType.Fallback,
docker: {
repo,
tag: '286b4de-20250108-194715',
tag: 'df9c1ed-20250109-151923',
},
blacklist,
gasPaymentEnforcement: gasPaymentEnforcement,
Expand Down Expand Up @@ -665,7 +665,7 @@ const releaseCandidate: RootAgentConfig = {
rpcConsensusType: RpcConsensusType.Fallback,
docker: {
repo,
tag: '234704d-20241226-192528',
tag: 'df9c1ed-20250109-151923',
},
blacklist,
// We're temporarily (ab)using the RC relayer as a way to increase
Expand Down

0 comments on commit 1c652a6

Please sign in to comment.