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

Bugfix/add solana priority fees #4

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

mikhd
Copy link
Collaborator

@mikhd mikhd commented Mar 21, 2024

📝 Description

Issue:

https://support.ledger.com/hc/en-us/articles/17531561702813-Temporary-issue-with-Staking-and-Sending-Solana-SOL-in-Ledger-Live-Your-transaction-may-have-failed?support=true

Solution

Advised solution to mitigate this is

Note:

Required getRecentPrioritizationFees rpc call doesn't work correctly in @solana/[email protected].
Hence, @solana/web3.js and @solana/spl-token have been updated.

❓ Context

  • JIRA or GitHub link:

✅ Checklist

Pull Requests must pass the CI and be code reviewed. Set as Draft if the PR is not ready.

  • npx changeset was attached.
  • Covered by automatic tests.
  • Impact of the changes:
    • Check SOL transfer
    • Check staking

🧐 Checklist for the PR Reviewers

  • The code aligns with the requirements described in the linked JIRA or GitHub issue.
  • The PR description clearly documents the changes made and explains any technical trade-offs or design decisions.
  • There are no undocumented trade-offs, technical debt, or maintainability issues.
  • The PR has been tested thoroughly, and any potential edge cases have been considered and handled.
  • Any new dependencies have been justified and documented.
  • Performance considerations have been taken into account. (changes have been profiled or benchmarked if necessary)

Copy link

@hedi-edelbloute hedi-edelbloute left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

lockedWritableAccounts: uniqAccs,
});

return median(recentFees.map(item => item.prioritizationFee));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am no solana expert 😅 Would using lowest value work ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Hedi
Good question :)
I've been thinking about this as well, and after research it looked like median seem be good to approximate priority fees for a given transaction. This ensures that the priority fees is above the lowest but not too wasteful.

Helius Priority Fee API also uses 50th percentile (median) by default.
But it also provides other values, like low (25th) or UNSAFE_MAX (100th).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok thanks !

@mikhd mikhd force-pushed the bugfix/solana-priority-fees branch from c2a8189 to 9376144 Compare April 5, 2024 07:24
@mikhd mikhd force-pushed the bugfix/solana-priority-fees branch from 9376144 to 71f4ac4 Compare April 15, 2024 07:17
@mikhd mikhd force-pushed the bugfix/solana-priority-fees branch from 71f4ac4 to 7a2d926 Compare April 22, 2024 07:18
.catch(remapErrors);
},

getSimulationComputeUnits: async (instructions, payer) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice !!!

@mikhd mikhd force-pushed the bugfix/solana-priority-fees branch 3 times, most recently from 41adf76 to 6d1e120 Compare May 7, 2024 12:38
@mikhd mikhd force-pushed the bugfix/solana-priority-fees branch from 6d1e120 to b45e489 Compare May 13, 2024 08:18
@mikhd mikhd force-pushed the bugfix/solana-priority-fees branch 2 times, most recently from 1a94823 to 4264875 Compare May 27, 2024 08:20
@mikhd mikhd force-pushed the bugfix/solana-priority-fees branch 3 times, most recently from 666023e to cd8eca4 Compare June 4, 2024 08:50
@mikhd mikhd force-pushed the bugfix/solana-priority-fees branch 2 times, most recently from 7d2a396 to c44b62b Compare June 17, 2024 06:36
@mikhd mikhd force-pushed the bugfix/solana-priority-fees branch from c44b62b to 165d255 Compare June 24, 2024 06:24
@mikhd mikhd force-pushed the bugfix/solana-priority-fees branch from 165d255 to ffa441f Compare July 1, 2024 06:36
@mikhd mikhd force-pushed the bugfix/solana-priority-fees branch 2 times, most recently from b05a0c7 to 3368cc5 Compare July 12, 2024 06:38
@mikhd mikhd force-pushed the bugfix/solana-priority-fees branch 2 times, most recently from 9c2231a to 6a299cc Compare July 23, 2024 06:50
@mikhd mikhd force-pushed the bugfix/solana-priority-fees branch from 6a299cc to 67c2bc9 Compare July 29, 2024 11:27
@mikhd mikhd force-pushed the bugfix/solana-priority-fees branch 2 times, most recently from 253c3f0 to 16d5195 Compare August 8, 2024 10:47
@mikhd mikhd force-pushed the bugfix/solana-priority-fees branch from 16d5195 to 378d78b Compare August 20, 2024 07:40
@mikhd mikhd force-pushed the bugfix/solana-priority-fees branch from 378d78b to b3150f3 Compare August 28, 2024 13:27
@mikhd mikhd force-pushed the bugfix/solana-priority-fees branch from b3150f3 to f3de7d7 Compare September 10, 2024 06:11
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.

2 participants