fix: create vote should use create_account_with_seed if applicable#2819
fix: create vote should use create_account_with_seed if applicable#2819Managarmrr wants to merge 1 commit intoanza-xyz:masterfrom
Conversation
When creating a vote account using the cli system_instruction::create_account has been used in any case regardless of whether a seed has been provided or not. This works if the base the vote account is derived from is the included in the transaction for any other reason (such as being the fee payer), but not if it is solely included as the base account. By using system_instruction::create_account_with_seed this issue has been mitigated.
|
The Firedancer team maintains a line-for-line reimplementation of the |
buffalojoec
left a comment
There was a problem hiding this comment.
Nice find. It looks like CreateVoteAccountConfig is used in a bunch of tests all over the repo, but they only use the space field, never with_seed.
Any chance you'd mind adding a test to programs/vote/src/vote_processor.rs for actually using the with_seed arg?
This is only a change to the instruction-builder helper, not the program itself. As per my review comment, tests may also be added. Program processor, state, and instructions are unchanged. |
|
This PR contains changes to the solana sdk, which will be moved to a new repo within the next week, when v2.2 is branched from master. Please merge or close this PR as soon as possible, or re-create the sdk changes when the new repository is ready at https://github.com/anza-xyz/solana-sdk |
Problem
When creating a vote account using the cli
system_instruction::create_accounthas been used in any case regardless of whether a seed has been provided or not.This works if the base the vote account is derived from is the included in the transaction for any other reason (such as being the fee payer), but not if it is solely included as the base account.
By using `system_instruction::create_account_with_seed this issue has been mitigated.
Summary of Changes
Use
system_instruction::create_account_with_seedinstead ofsystem_instruction::create_accountif derived from a seed.