Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions program-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,7 @@ impl ProgramTest {
rent.clone(),
ClusterType::Development,
std::mem::take(&mut self.genesis_accounts),
false,
);

// Remove features tagged to deactivate
Expand Down
1 change: 1 addition & 0 deletions programs/sbf/tests/programs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1437,6 +1437,7 @@ fn get_stable_genesis_config() -> GenesisConfigInfo {
Rent::free(), // most tests don't expect rent
ClusterType::Development,
vec![],
false,
);
genesis_config.creation_time = Duration::ZERO.as_secs() as UnixTimestamp;

Expand Down
27 changes: 21 additions & 6 deletions runtime/src/genesis_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ pub fn create_genesis_config_with_vote_accounts_and_cluster_type(
Rent::free(), // most tests don't expect rent
cluster_type,
vec![],
is_alpenglow,
);

let mut genesis_config_info = GenesisConfigInfo {
Expand Down Expand Up @@ -237,6 +238,7 @@ pub fn create_genesis_config_with_leader_with_mint_keypair(
Rent::free(), // most tests don't expect rent
ClusterType::Development,
vec![],
false,
);

GenesisConfigInfo {
Expand Down Expand Up @@ -299,13 +301,24 @@ pub fn create_genesis_config_with_leader_ex_no_features(
rent: Rent,
cluster_type: ClusterType,
mut initial_accounts: Vec<(Pubkey, AccountSharedData)>,
is_alpenglow: bool,
) -> GenesisConfig {
let validator_vote_account = vote_state::create_account(
validator_vote_account_pubkey,
validator_pubkey,
0,
validator_stake_lamports,
);
let validator_vote_account = if is_alpenglow {
AlpenglowVoteState::create_account_with_authorized(
validator_pubkey,
validator_vote_account_pubkey,
validator_vote_account_pubkey,
0,
validator_stake_lamports,
)
} else {
vote_state::create_account(
validator_vote_account_pubkey,
validator_pubkey,
0,
validator_stake_lamports,
)
};

let validator_stake_account = stake_state::create_account(
validator_stake_account_pubkey,
Expand Down Expand Up @@ -368,6 +381,7 @@ pub fn create_genesis_config_with_leader_ex(
rent: Rent,
cluster_type: ClusterType,
initial_accounts: Vec<(Pubkey, AccountSharedData)>,
is_alpenglow: bool,
) -> GenesisConfig {
let mut genesis_config = create_genesis_config_with_leader_ex_no_features(
mint_lamports,
Expand All @@ -381,6 +395,7 @@ pub fn create_genesis_config_with_leader_ex(
rent,
cluster_type,
initial_accounts,
is_alpenglow,
);

if genesis_config.cluster_type == ClusterType::Development {
Expand Down
1 change: 1 addition & 0 deletions test-validator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,7 @@ impl TestValidator {
config.rent.clone(),
solana_sdk::genesis_config::ClusterType::Development,
accounts.into_iter().collect(),
false,
);
genesis_config.epoch_schedule = config
.epoch_schedule
Expand Down