Bump deps and improve getRecentPriorityFee for Orca#68
Conversation
Introduce Jito tipping utilities and wire them into Solana swap flow, plus improve priority-fee retrieval. - Add packages/swapper/src/chain/solana/jito.ts: new JITO_TIP_ACCOUNTS, fetchTipFloorLamports(), getJitoBudget(), and createJitoTipInstruction() to compute/construct Jito tips (with a minimum tip fallback and recommended split logic). - Add tests packages/swapper/src/mayan/solana.test.ts covering getJitoBudget() behavior and createJitoTipInstruction() correctness. - Update tx_builder.ts: let getRecentPriorityFee accept lockedWritableAccounts when calling connection.getRecentPrioritizationFees(), and use the desired percentile index (with bounds) when computing a recommended fee. - Wire Jito into swap construction (mayan/solana.ts): fetch tip floor earlier, append a Jito tip transfer when applicable, then fetch recent blockhash and build the MessageV0 with the swapper as fee payer. Adjust imports accordingly. - Update orca/provider.ts to pass the Whirlpool program address as a locked writable account when querying recent priority fees. These changes enable optional on-chain tipping to Jito, make priority-fee estimation respect locked accounts and percentile selection, and include unit tests for the new Jito helpers.
Changed Files
|
Summary of ChangesHello @0xh3rman, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request integrates Jito tipping into the Solana transaction building process, specifically for Mayan swaps. The primary goal is to enable users to include Jito tip instructions, which can help prioritize their transactions on the Solana blockchain. The changes involve adding new Jito-specific utilities, updating how priority fees are calculated, and ensuring these new instructions are correctly incorporated into versioned transactions, while acknowledging that Jito instructions are currently only compatible with legacy messages for Mayan. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces Jito tipping for Mayan swaps on Solana. It adds a new jito.ts utility file for fetching tip data and creating tip instructions, and integrates this into the Mayan swap flow. The changes also include updating Solana dependencies and improving priority fee estimation. My review focuses on a potential critical issue regarding the safety of adding instructions to Mayan's versioned transactions, as well as opportunities for performance and type safety improvements in the new Jito utility functions.
Cache JITO tip account PublicKey instances and use node:crypto.randomInt for selection instead of recreating PublicKey objects on each call. Add a JitoTipFloorEntry interface and cast the fetched JSON to improve typing for fetchTipFloorLamports. Also add the required randomInt import. These changes reduce allocations and improve type safety when creating Jito tip transfer instructions.
No description provided.