Skip to content

Commit

Permalink
env var jito tip
Browse files Browse the repository at this point in the history
  • Loading branch information
tkporter committed Jun 7, 2024
1 parent b337063 commit 8c60f01
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rust/chains/hyperlane-sealevel/src/mailbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,14 +555,18 @@ 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::<u64>().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(
&payer.pubkey(),
// 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(
Expand Down

0 comments on commit 8c60f01

Please sign in to comment.