Open joncinque opened 4 months ago
great
great
@joncinque
increase_additional_validator_stake_with_vote
uses &stake_pool.validator_list without having the validator list as an argument.
IncreaseValidatorStake
instruction requires a transient_stake_seed
.
so need to add another instruction that doesn't require a transient_stake_seed
. I don't think it's your intent.
Or that instruction can consume lists of transient_stake_seeds?
Then, How can I get a transient_stake_seed from validators lists?
I'm not sure I totally understand the comment, but the concept is that ValidatorList
contains the validator stake seed and the transient stake seed for the given vote account address:
So increase_additional_validator_stake_with_list
can just read those values for the given validator and pass them into increase_additional_validator_stake_with_vote
Problem
The
IncreaseAdditionalValidatorStake
andDecreaseAdditionalValidatorStake
instruction creators helpers that take the vote account require that you pass in thetransient_stake_seed
:https://github.com/solana-labs/solana-program-library/blob/c9eb289de8bc52930c109e0fba128d08e4948352/stake-pool/program/src/instruction.rs#L1325-L1334
And
https://github.com/solana-labs/solana-program-library/blob/c9eb289de8bc52930c109e0fba128d08e4948352/stake-pool/program/src/instruction.rs#L1240-L1249
Since these instructions are usually meant to reuse an existing transient stake account, these instruction creators can be confusing.
Solution
Create a new variant of these creators,
decrease_additional_validator_stake_with_list
andincrease_additional_validator_stake_with_list
, which takes in the pool'sValidatorList
, ie:From the validator list, it can figure out the seeds and be much easier to use.