RedeemVoteCredits has a number of problems:
MAX_EPOCH_CREDITS_HISTORY epochs for each stake/vote account or rewards evaporate.The first two points highlight the unintentional game that will be played around RedeemVoteCredits: if you see observe stake decreasing in the cluster than you're better off delaying RedeemVoteCredits if possible to capitalize on the increasing credit point value. But don't delay too long or you'll lost it all. Worse, RedeemVoteCredits can be run by anybody so others can inflict less desirable credit point values on you.
The alternative is to dispense of RedeemVoteCredits entirely, and have banks automatically redeem vote credits at the end of each epoch for all parties.
Any gaming implies a bug in the implementation. If I had to guess, credits probably need to be converted to lamports as soon as they are earned.
Anybody remember why RedeemVoteCredits was added in the first place instead of auto redemption by the runtime?
Yep, I wrote it. The goal was simply to minimize the size of the bank (aka, the kernel).
No objection to moving that functionality to the runtime.
Cool yeah these days the bank knows a ton about vote and stake so bank/vote/stake are already tightly coupled
removing the instruction pays big dividends in vote and stake state size, too
@rob-solana, can you take a stab at this?
yeap, will do
Most helpful comment
Cool yeah these days the bank knows a ton about vote and stake so bank/vote/stake are already tightly coupled