-
Notifications
You must be signed in to change notification settings - Fork 42
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
feat(vote-program): Update commission instruction #615
base: dade/vote-program-update-identity
Are you sure you want to change the base?
feat(vote-program): Update commission instruction #615
Conversation
Codecov ReportAttention: Patch coverage is
... and 3 files with indirect coverage changes 🚀 New features to boost your workflow:
|
…am-update-commission
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
few nits otherwise lgtm
/// Agave https://github.com/anza-xyz/solana-sdk/blob/69edb584ac17df2f5d8b5e817d7afede7877eded/vote-interface/src/instruction.rs#L415 | ||
fn updateCommission( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont think this permalink makes sense - it should be this right? https://github.com/anza-xyz/agave/blob/24e62248d7a91c090790e7b812e23321fa1f53b1/programs/vote/src/vote_state/mod.rs#L743
pub const allow_commission_decrease_at_any_time = | ||
Pubkey.parseBase58String("5x3825XS7M2A3Ekbn5VGGkvFoAg5qrRWkTrY4bARP1GL") catch unreachable; | ||
|
||
pub const commission_updates_only_allowed_in_first_half_of_epoch = | ||
Pubkey.parseBase58String("noRuG2kzACwgaY7TVmLRnUNPLKNVQE1fb7X55YWBehp") catch unreachable; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we declare constants these at the top of the struct
pub fn getSysvar( | ||
self: *const InstructionContext, | ||
comptime T: type, | ||
) InstructionError!T { | ||
return self.tc.sysvar_cache.get(T) orelse InstructionError.UnsupportedSysvar; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we use this anywhere?
The commission is the percentage that represents what part of a rewards payout should be given to a VoteAccoun, while the rest would be distributed to the delegates.
This PR implements the instruction for updating a vote account's commission. It also adds feature sets which are needed for this instruction.