Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 2cefc84

Browse files
committed
single-pool: remove minimum delegation check
this check is an artifact of a previous design. we used to include the minimum in our pool stake total and burned tokens when initializing so that it could not be withdrawn. later we changed to treating it as separate from pool stake entirely. therefore a post_pool_stake below minimum_delegation is valid in the case where the first deposit is below 1 sol. this fix allows such a deposit instead of returning a very frightening error message
1 parent 919d563 commit 2cefc84

File tree

4 files changed

+3
-8
lines changed

4 files changed

+3
-8
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ In addition, one program is planned for deployment to Solana Mainnet Beta:
3232

3333
| Program | Version |
3434
| --- | --- |
35-
| [single-pool](https://github.com/solana-labs/solana-program-library/tree/master/single-pool/program) | [1.0.0](https://github.com/solana-labs/solana-program-library/releases/tag/single-pool-v1.0.0) |
35+
| [single-pool](https://github.com/solana-labs/solana-program-library/tree/master/single-pool/program) | [1.0.1](https://github.com/solana-labs/solana-program-library/releases/tag/single-pool-v1.0.1) |
3636

3737
## Audits
3838

single-pool/program/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "spl-single-pool"
3-
version = "1.0.0"
3+
version = "1.0.1"
44
description = "Solana Program Library Single-Validator Stake Pool"
55
authors = ["Solana Labs Maintainers <[email protected]>"]
66
repository = "https://github.com/solana-labs/solana-program-library"

single-pool/program/src/processor.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -862,11 +862,6 @@ impl Processor {
862862
.and_then(|amount| amount.checked_sub(pool_stake_meta.rent_exempt_reserve))
863863
.ok_or(SinglePoolError::ArithmeticOverflow)?;
864864

865-
// sanity check: we have not somehow gone below the minimum
866-
if post_pool_stake < minimum_delegation {
867-
return Err(SinglePoolError::UnexpectedMathError.into());
868-
}
869-
870865
// sanity check: the user stake account is empty
871866
if user_stake_info.lamports() != 0 {
872867
return Err(SinglePoolError::UnexpectedMathError.into());

0 commit comments

Comments
 (0)