From 8c60f01a52e30ac4c2851f5070c681855bb2e935 Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Fri, 7 Jun 2024 18:35:59 +0100 Subject: [PATCH] env var jito tip --- rust/chains/hyperlane-sealevel/src/mailbox.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rust/chains/hyperlane-sealevel/src/mailbox.rs b/rust/chains/hyperlane-sealevel/src/mailbox.rs index 1017805e6e..2a536473c3 100644 --- a/rust/chains/hyperlane-sealevel/src/mailbox.rs +++ b/rust/chains/hyperlane-sealevel/src/mailbox.rs @@ -555,6 +555,10 @@ impl Mailbox for SealevelMailbox { // If we're using Jito, we need to send a tip to the Jito fee account. // Otherwise, we need to set the compute unit price. if self.use_jito() { + let tip: u64 = std::env::var("JITO_TIP_LAMPORTS") + .ok() + .and_then(|s| s.parse::().ok()) + .unwrap_or(PROCESS_DESIRED_PRIORITIZATION_FEE_LAMPORTS_PER_TX); // The tip is a standalone transfer to a Jito fee account. // See https://github.com/jito-labs/mev-protos/blob/master/json_rpc/http.md#sendbundle. instructions.push(solana_sdk::system_instruction::transfer( @@ -562,7 +566,7 @@ impl Mailbox for SealevelMailbox { // A random Jito fee account, taken from the getFeeAccount RPC response: // https://github.com/jito-labs/mev-protos/blob/master/json_rpc/http.md#gettipaccounts &solana_sdk::pubkey!("DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh"), - PROCESS_DESIRED_PRIORITIZATION_FEE_LAMPORTS_PER_TX, + tip, )); } else { instructions.push(ComputeBudgetInstruction::set_compute_unit_price(