stake-pool: Reduce maximum pool size (#2654)

* stake-pool: Reduce huge pool size in tests

* stake-pool: Reduce supported maximum size
This commit is contained in:
Jon Cinque 2021-12-21 13:10:12 +01:00 committed by GitHub
parent 28d0aa7759
commit 8c9f8a0088
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View File

@ -99,7 +99,7 @@ to create a new stake pool, and include:
* withdrawal fee, expressed as two different flags, numerator and denominator
* deposit fee, expressed as two different flags, numerator and denominator
* referral fee, expressed as a number between 0 and 100, inclusive
* maximum number of validators (highest possible is 3,950 currently)
* maximum number of validators (highest possible is 3,825 currently)
* (Optional) deposit authority, for restricted pools
Although fees may seem uninteresting or scammy at this point, consider the costs
@ -111,12 +111,12 @@ to worry about being locked in to any choices.
Modify the parameters to suit your needs. In our example, we will use fees
of 0.3%, a referral fee of 50%, opt to *not* set a deposit authority, and have
the maximum number of validators (3,950). Next, run the script:
the maximum number of validators (3,825). Next, run the script:
```bash
$ ./setup-stake-pool.sh
Creating pool
+ spl-stake-pool create-pool --epoch-fee-numerator 3 --epoch-fee-denominator 1000 --withdrawal-fee-numerator 3 --withdrawal-fee-denominator 1000 --deposit-fee-numerator 3 --deposit-fee-denominator 1000 --referral-fee 50 --max-validators 3950 --pool-keypair keys/stake-pool.json --validator-list-keypair keys/validator-list.json --mint-keypair keys/mint.json --reserve-keypair keys/reserve.json
+ spl-stake-pool create-pool --epoch-fee-numerator 3 --epoch-fee-denominator 1000 --withdrawal-fee-numerator 3 --withdrawal-fee-denominator 1000 --deposit-fee-numerator 3 --deposit-fee-denominator 1000 --referral-fee 50 --max-validators 3825 --pool-keypair keys/stake-pool.json --validator-list-keypair keys/validator-list.json --mint-keypair keys/mint.json --reserve-keypair keys/reserve.json
Creating reserve stake 4tvTkLB4X7ahUYZ2NaTohkG3mud4UBBvu9ZEGD4Wk9mt
Creating mint BoNneHKDrX9BHjjvSpPfnQyRjsnc9WFH71v8wrgCd7LB
Creating associated token account DgyZrAq88bnG1TNRxpgDQzWXpzEurCvfY2ukKFWBvADQ to receive stake pool tokens of mint BoNneHKDrX9BHjjvSpPfnQyRjsnc9WFH71v8wrgCd7LB, owned by 4SnSuUtJGKvk2GYpBwmEsWG53zTurVM8yXGsoiZQyMJn

View File

@ -25,7 +25,7 @@ command_args+=( --deposit-fee-denominator 0 )
command_args+=( --referral-fee 0 ) # Percentage of deposit fee that goes towards the referrer (a number between 0 and 100, inclusive)
command_args+=( --max-validators 3950 ) # Maximum number of validators in the stake pool, 3950 is the current maximum possible
command_args+=( --max-validators 3825 ) # Maximum number of validators in the stake pool, 3825 is the current maximum possible
# (Optional) Deposit authority, required to sign all deposits into the pool.
# Setting this variable makes the pool "private" or "restricted".

View File

@ -30,7 +30,7 @@ use {
spl_token::state::{Account as SplAccount, AccountState as SplAccountState, Mint},
};
const HUGE_POOL_SIZE: u32 = 3_950;
const HUGE_POOL_SIZE: u32 = 3_825;
const ACCOUNT_RENT_EXEMPTION: u64 = 1_000_000_000; // go with something big to be safe
const STAKE_AMOUNT: u64 = 200_000_000_000;
const STAKE_ACCOUNT_RENT_EXEMPTION: u64 = 2_282_880;

View File

@ -45,7 +45,7 @@ async def create(client: AsyncClient, manager: Keypair,
)
)
)
max_validators = 3950 # current supported max by the program, go big!
max_validators = 3825 # current supported max by the program, go big!
validator_list_size = ValidatorList.calculate_validator_list_size(max_validators)
resp = await client.get_minimum_balance_for_rent_exemption(validator_list_size)
validator_list_balance = resp['result']