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

stake-pool: Ceiling all fee calculations (HAL-01) #6153

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

joncinque
Copy link
Contributor

Problem

During deposit and withdrawal functions, if the SOL or pool token amount is small, it is possible the fee calculations floor to zero due to loss of precision, preventing fee collection.

Solution

This scenario is not economically viable, and the cost of fee avoidance would outweigh the benefit of depositing such a small amount to the stake pool, but it's better to fix things up.

The change takes the ceiling of all fee calculations by adding denominator - 1 to the numerator.

@2501babe
Copy link
Member

seems straightforward!

@joncinque joncinque merged commit a17fffe into solana-labs:master Jan 24, 2024
9 checks passed
@joncinque joncinque deleted the spceil branch January 24, 2024 11:33
billythedummy pushed a commit to igneous-labs/sanctum-spl-stake-pool that referenced this pull request Feb 9, 2024
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.

None yet

2 participants