Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[draft] jito env var tip #3926

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading