require stake, vote and executable accounts to be rent exempt (#5928)

* require vote account to be exempt

* make stake account rent exempt

* add rent exempted system instruction

* use rent exemption instruction in vote and stake api

* use rent exempted account while creating executable account

* updating chacha golden hash as instruction data has changed

* rent will be initialized for genesis bank too
This commit is contained in:
Parth
2019-09-20 16:52:17 +05:30
committed by GitHub
parent accd49f2e4
commit 11e6197a83
11 changed files with 199 additions and 18 deletions

View File

@ -110,7 +110,7 @@ pub fn create_stake_account_with_lockup(
custodian: &Pubkey,
) -> Vec<Instruction> {
vec![
system_instruction::create_account(
system_instruction::create_rent_exempted_account(
from_pubkey,
stake_pubkey,
lamports,

View File

@ -87,8 +87,13 @@ pub fn create_account(
lamports: u64,
) -> Vec<Instruction> {
let space = VoteState::size_of() as u64;
let create_ix =
system_instruction::create_account(from_pubkey, vote_pubkey, lamports, space, &id());
let create_ix = system_instruction::create_rent_exempted_account(
from_pubkey,
vote_pubkey,
lamports,
space,
&id(),
);
let init_ix = initialize_account(vote_pubkey, node_pubkey, commission);
vec![create_ix, init_ix]
}