Skip to content

fix(sol): add priority fees to transaction builders - #9734

Open
Venkat-Annavazzala wants to merge 1 commit into
masterfrom
venkat/chalo-485-sol-priority-fee
Open

Venkat-Annavazzala wants to merge 1 commit into
masterfrom
venkat/chalo-485-sol-priority-fee

Conversation

@Venkat-Annavazzala

Copy link
Copy Markdown
Contributor

Ticket: CHALO-485

@Venkat-Annavazzala
Venkat-Annavazzala requested a review from a team as a code owner September 15, 2026 08:12
@linear-code

linear-code Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

CHALO-485

@Venkat-Annavazzala
Venkat-Annavazzala force-pushed the venkat/chalo-485-sol-priority-fee branch 2 times, most recently from c1bbcbe to 9d2cd8b Compare September 15, 2026 08:28
@Venkat-Annavazzala

Copy link
Copy Markdown
Contributor Author

@claude

@github-actions

github-actions Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Claude finished @Venkat-Annavazzala's task —— View job


Code Review Summary

I've completed my review of the priority fee implementation for Solana transaction builders. Overall, this is a well-implemented feature that consistently adds priority fee support across all transaction builders.

Todo List:

  • Read repository guidelines (CLAUDE.md)
  • Analyze changed files to understand priority fee implementation
  • Review transaction builder changes
  • Review test coverage
  • Provide comprehensive feedback

Review Feedback

Strengths

  1. Consistent Implementation Pattern: All transaction builders follow the same pattern for adding priority fee instructions:

    • Check if _priorityFee exists and is not zero
    • Add SetPriorityFee instruction as the first instruction
    • Maintain existing instruction order
  2. Proper Instruction Ordering: Priority fee instructions are correctly placed first in the transaction, which is required by Solana's compute budget program.

  3. Conditional Logic: The implementation properly handles cases where priority fee is 0 or undefined, avoiding unnecessary instructions.

  4. Test Coverage: Added test case verifies that priority fee instructions are properly included in the transaction.

  5. Clear Documentation: The comment in transferBuilder.ts:78-79 clearly explains the purpose (CHALO-485) and behavior.

🔍 Code Quality Observations

transferBuilderV2.ts - Improvement Applied ✅

  • Fixed: Removed overly complex conditional logic that only added priority fees for token transfers
  • Now: Consistently adds priority fees for all transfers when set, matching other builders

stakingDeactivateBuilder.ts - Consistent Method ✅

  • Good: Uses unshift() to prepend priority fee instruction to existing array
  • Consistent: Follows same pattern as stakingDelegateBuilder.ts

Conditional Pattern Consistency

All builders consistently use:

this._priorityFee && this._priorityFee !== Number(0)

📋 Architecture Review

  1. Integration: Priority fees integrate well with existing TransactionBuilder base class
  2. Solana Compatibility: Uses correct ComputeBudget111111111111111111111111111111 program ID
  3. Instruction Types: Proper use of InstructionBuilderTypes.SetPriorityFee

🧪 Test Analysis

The test case in transferBuilder.ts:236-250 properly verifies:

  • Transaction builds successfully with priority fee
  • Raw transaction is valid
  • Compute budget instruction is present in final transaction
  • Uses correct program ID for compute budget

📝 Minor Suggestions

  1. Consider adding more test cases for other builders (staking builders, ATA initialization) to ensure comprehensive coverage
  2. Edge case testing: Consider testing with very large priority fee values to ensure proper validation

Security & Best Practices

  • No security concerns identified
  • Follows Solana's compute budget instruction requirements
  • Proper validation of priority fee values
  • No potential for instruction injection or manipulation

Overall Assessment: ✅ APPROVED

This is a solid implementation that consistently adds priority fee support across all Solana transaction builders. The code follows established patterns, maintains good separation of concerns, and includes appropriate test coverage. The implementation correctly handles Solana's compute budget requirements and should help users prioritize their transactions during network congestion.


Job Run | Branch: venkat/chalo-485-sol-priority-fee

@github-actions

github-actions Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

⚠️ Unit tests are failing on Node 26.x (Current release line, non-blocking). This is not an LTS version yet, so it does not block merge, but it signals an incompatibility to fix before Node 26.x becomes LTS.

View run

@Venkat-Annavazzala
Venkat-Annavazzala force-pushed the venkat/chalo-485-sol-priority-fee branch from 9d2cd8b to 89884b5 Compare September 15, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant