Revert "Revert "Reformat imports to a consistent style for imports""
This reverts commit d7377d4794
.
This commit is contained in:
committed by
Tyera Eulberg
parent
9fff4aa8b8
commit
9f53f3455a
@@ -1,12 +1,11 @@
|
||||
use solana_client::thin_client::ThinClient;
|
||||
use solana_core::validator::Validator;
|
||||
use solana_core::validator::ValidatorConfig;
|
||||
use solana_gossip::{cluster_info::Node, contact_info::ContactInfo};
|
||||
use solana_sdk::pubkey::Pubkey;
|
||||
use solana_sdk::signature::Keypair;
|
||||
use solana_streamer::socket::SocketAddrSpace;
|
||||
use std::path::PathBuf;
|
||||
use std::sync::Arc;
|
||||
use {
|
||||
solana_client::thin_client::ThinClient,
|
||||
solana_core::validator::{Validator, ValidatorConfig},
|
||||
solana_gossip::{cluster_info::Node, contact_info::ContactInfo},
|
||||
solana_sdk::{pubkey::Pubkey, signature::Keypair},
|
||||
solana_streamer::socket::SocketAddrSpace,
|
||||
std::{path::PathBuf, sync::Arc},
|
||||
};
|
||||
|
||||
pub struct ValidatorInfo {
|
||||
pub keypair: Arc<Keypair>,
|
||||
|
@@ -3,38 +3,41 @@
|
||||
/// All tests must start from an entry point and a funding keypair and
|
||||
/// discover the rest of the network.
|
||||
use log::*;
|
||||
use rand::{thread_rng, Rng};
|
||||
use rayon::prelude::*;
|
||||
use solana_client::thin_client::create_client;
|
||||
use solana_core::consensus::VOTE_THRESHOLD_DEPTH;
|
||||
use solana_gossip::{
|
||||
cluster_info::VALIDATOR_PORT_RANGE, contact_info::ContactInfo, gossip_service::discover_cluster,
|
||||
};
|
||||
use solana_ledger::{
|
||||
blockstore::Blockstore,
|
||||
entry::{Entry, EntrySlice},
|
||||
};
|
||||
use solana_sdk::{
|
||||
client::SyncClient,
|
||||
clock::{self, Slot, NUM_CONSECUTIVE_LEADER_SLOTS},
|
||||
commitment_config::CommitmentConfig,
|
||||
epoch_schedule::MINIMUM_SLOTS_PER_EPOCH,
|
||||
exit::Exit,
|
||||
hash::Hash,
|
||||
poh_config::PohConfig,
|
||||
pubkey::Pubkey,
|
||||
signature::{Keypair, Signature, Signer},
|
||||
system_transaction,
|
||||
timing::duration_as_ms,
|
||||
transport::TransportError,
|
||||
};
|
||||
use solana_streamer::socket::SocketAddrSpace;
|
||||
use std::{
|
||||
collections::{HashMap, HashSet},
|
||||
path::Path,
|
||||
sync::{Arc, RwLock},
|
||||
thread::sleep,
|
||||
time::{Duration, Instant},
|
||||
use {
|
||||
rand::{thread_rng, Rng},
|
||||
rayon::prelude::*,
|
||||
solana_client::thin_client::create_client,
|
||||
solana_core::consensus::VOTE_THRESHOLD_DEPTH,
|
||||
solana_gossip::{
|
||||
cluster_info::VALIDATOR_PORT_RANGE, contact_info::ContactInfo,
|
||||
gossip_service::discover_cluster,
|
||||
},
|
||||
solana_ledger::{
|
||||
blockstore::Blockstore,
|
||||
entry::{Entry, EntrySlice},
|
||||
},
|
||||
solana_sdk::{
|
||||
client::SyncClient,
|
||||
clock::{self, Slot, NUM_CONSECUTIVE_LEADER_SLOTS},
|
||||
commitment_config::CommitmentConfig,
|
||||
epoch_schedule::MINIMUM_SLOTS_PER_EPOCH,
|
||||
exit::Exit,
|
||||
hash::Hash,
|
||||
poh_config::PohConfig,
|
||||
pubkey::Pubkey,
|
||||
signature::{Keypair, Signature, Signer},
|
||||
system_transaction,
|
||||
timing::duration_as_ms,
|
||||
transport::TransportError,
|
||||
},
|
||||
solana_streamer::socket::SocketAddrSpace,
|
||||
std::{
|
||||
collections::{HashMap, HashSet},
|
||||
path::Path,
|
||||
sync::{Arc, RwLock},
|
||||
thread::sleep,
|
||||
time::{Duration, Instant},
|
||||
},
|
||||
};
|
||||
|
||||
/// Spend and verify from every node in the network
|
||||
|
@@ -1,52 +1,53 @@
|
||||
use crate::{
|
||||
cluster::{Cluster, ClusterValidatorInfo, ValidatorInfo},
|
||||
cluster_tests,
|
||||
validator_configs::*,
|
||||
};
|
||||
use itertools::izip;
|
||||
use log::*;
|
||||
use solana_client::thin_client::{create_client, ThinClient};
|
||||
use solana_core::validator::{Validator, ValidatorConfig, ValidatorStartProgress};
|
||||
use solana_gossip::{
|
||||
cluster_info::{Node, VALIDATOR_PORT_RANGE},
|
||||
contact_info::ContactInfo,
|
||||
gossip_service::discover_cluster,
|
||||
};
|
||||
use solana_ledger::create_new_tmp_ledger;
|
||||
use solana_runtime::genesis_utils::{
|
||||
create_genesis_config_with_vote_accounts_and_cluster_type, GenesisConfigInfo,
|
||||
ValidatorVoteKeypairs,
|
||||
};
|
||||
use solana_sdk::{
|
||||
account::Account,
|
||||
account::AccountSharedData,
|
||||
client::SyncClient,
|
||||
clock::{DEFAULT_DEV_SLOTS_PER_EPOCH, DEFAULT_TICKS_PER_SLOT},
|
||||
commitment_config::CommitmentConfig,
|
||||
epoch_schedule::EpochSchedule,
|
||||
genesis_config::{ClusterType, GenesisConfig},
|
||||
message::Message,
|
||||
poh_config::PohConfig,
|
||||
pubkey::Pubkey,
|
||||
signature::{Keypair, Signer},
|
||||
stake::{
|
||||
config as stake_config, instruction as stake_instruction,
|
||||
state::{Authorized, Lockup},
|
||||
use {
|
||||
crate::{
|
||||
cluster::{Cluster, ClusterValidatorInfo, ValidatorInfo},
|
||||
cluster_tests,
|
||||
validator_configs::*,
|
||||
},
|
||||
itertools::izip,
|
||||
log::*,
|
||||
solana_client::thin_client::{create_client, ThinClient},
|
||||
solana_core::validator::{Validator, ValidatorConfig, ValidatorStartProgress},
|
||||
solana_gossip::{
|
||||
cluster_info::{Node, VALIDATOR_PORT_RANGE},
|
||||
contact_info::ContactInfo,
|
||||
gossip_service::discover_cluster,
|
||||
},
|
||||
solana_ledger::create_new_tmp_ledger,
|
||||
solana_runtime::genesis_utils::{
|
||||
create_genesis_config_with_vote_accounts_and_cluster_type, GenesisConfigInfo,
|
||||
ValidatorVoteKeypairs,
|
||||
},
|
||||
solana_sdk::{
|
||||
account::{Account, AccountSharedData},
|
||||
client::SyncClient,
|
||||
clock::{DEFAULT_DEV_SLOTS_PER_EPOCH, DEFAULT_TICKS_PER_SLOT},
|
||||
commitment_config::CommitmentConfig,
|
||||
epoch_schedule::EpochSchedule,
|
||||
genesis_config::{ClusterType, GenesisConfig},
|
||||
message::Message,
|
||||
poh_config::PohConfig,
|
||||
pubkey::Pubkey,
|
||||
signature::{Keypair, Signer},
|
||||
stake::{
|
||||
config as stake_config, instruction as stake_instruction,
|
||||
state::{Authorized, Lockup},
|
||||
},
|
||||
system_transaction,
|
||||
transaction::Transaction,
|
||||
},
|
||||
solana_stake_program::{config::create_account as create_stake_config_account, stake_state},
|
||||
solana_streamer::socket::SocketAddrSpace,
|
||||
solana_vote_program::{
|
||||
vote_instruction,
|
||||
vote_state::{VoteInit, VoteState},
|
||||
},
|
||||
std::{
|
||||
collections::HashMap,
|
||||
io::{Error, ErrorKind, Result},
|
||||
iter,
|
||||
sync::{Arc, RwLock},
|
||||
},
|
||||
system_transaction,
|
||||
transaction::Transaction,
|
||||
};
|
||||
use solana_stake_program::{config::create_account as create_stake_config_account, stake_state};
|
||||
use solana_streamer::socket::SocketAddrSpace;
|
||||
use solana_vote_program::{
|
||||
vote_instruction,
|
||||
vote_state::{VoteInit, VoteState},
|
||||
};
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
io::{Error, ErrorKind, Result},
|
||||
iter,
|
||||
sync::{Arc, RwLock},
|
||||
};
|
||||
|
||||
#[derive(Debug)]
|
||||
@@ -746,8 +747,7 @@ impl Drop for LocalCluster {
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
use solana_sdk::epoch_schedule::MINIMUM_SLOTS_PER_EPOCH;
|
||||
use {super::*, solana_sdk::epoch_schedule::MINIMUM_SLOTS_PER_EPOCH};
|
||||
|
||||
#[test]
|
||||
fn test_local_cluster_start_and_exit() {
|
||||
|
@@ -1,6 +1,8 @@
|
||||
use solana_core::validator::ValidatorConfig;
|
||||
use solana_sdk::exit::Exit;
|
||||
use std::sync::{Arc, RwLock};
|
||||
use {
|
||||
solana_core::validator::ValidatorConfig,
|
||||
solana_sdk::exit::Exit,
|
||||
std::sync::{Arc, RwLock},
|
||||
};
|
||||
|
||||
pub fn safe_clone_config(config: &ValidatorConfig) -> ValidatorConfig {
|
||||
ValidatorConfig {
|
||||
|
@@ -1,77 +1,80 @@
|
||||
#![allow(clippy::integer_arithmetic)]
|
||||
use assert_matches::assert_matches;
|
||||
use crossbeam_channel::{unbounded, Receiver};
|
||||
use gag::BufferRedirect;
|
||||
use log::*;
|
||||
use serial_test::serial;
|
||||
use solana_client::{
|
||||
pubsub_client::PubsubClient,
|
||||
rpc_client::RpcClient,
|
||||
rpc_config::{RpcProgramAccountsConfig, RpcSignatureSubscribeConfig},
|
||||
rpc_response::RpcSignatureResult,
|
||||
thin_client::{create_client, ThinClient},
|
||||
use {
|
||||
assert_matches::assert_matches,
|
||||
crossbeam_channel::{unbounded, Receiver},
|
||||
gag::BufferRedirect,
|
||||
log::*,
|
||||
serial_test::serial,
|
||||
solana_client::{
|
||||
pubsub_client::PubsubClient,
|
||||
rpc_client::RpcClient,
|
||||
rpc_config::{RpcProgramAccountsConfig, RpcSignatureSubscribeConfig},
|
||||
rpc_response::RpcSignatureResult,
|
||||
thin_client::{create_client, ThinClient},
|
||||
},
|
||||
solana_core::{
|
||||
broadcast_stage::{BroadcastDuplicatesConfig, BroadcastStageType},
|
||||
consensus::{Tower, SWITCH_FORK_THRESHOLD, VOTE_THRESHOLD_DEPTH},
|
||||
optimistic_confirmation_verifier::OptimisticConfirmationVerifier,
|
||||
validator::ValidatorConfig,
|
||||
},
|
||||
solana_download_utils::download_snapshot,
|
||||
solana_gossip::{
|
||||
cluster_info::{self, VALIDATOR_PORT_RANGE},
|
||||
crds_value::{self, CrdsData, CrdsValue},
|
||||
gossip_service::discover_cluster,
|
||||
},
|
||||
solana_ledger::{
|
||||
ancestor_iterator::AncestorIterator,
|
||||
blockstore::{Blockstore, PurgeType},
|
||||
blockstore_db::AccessType,
|
||||
leader_schedule::{FixedSchedule, LeaderSchedule},
|
||||
},
|
||||
solana_local_cluster::{
|
||||
cluster::{Cluster, ClusterValidatorInfo},
|
||||
cluster_tests,
|
||||
local_cluster::{ClusterConfig, LocalCluster},
|
||||
validator_configs::*,
|
||||
},
|
||||
solana_runtime::{
|
||||
bank_forks::{ArchiveFormat, SnapshotConfig},
|
||||
snapshot_utils,
|
||||
},
|
||||
solana_sdk::{
|
||||
account::AccountSharedData,
|
||||
client::{AsyncClient, SyncClient},
|
||||
clock::{self, Slot, DEFAULT_MS_PER_SLOT, DEFAULT_TICKS_PER_SLOT, MAX_RECENT_BLOCKHASHES},
|
||||
commitment_config::CommitmentConfig,
|
||||
epoch_schedule::MINIMUM_SLOTS_PER_EPOCH,
|
||||
genesis_config::ClusterType,
|
||||
hash::Hash,
|
||||
poh_config::PohConfig,
|
||||
pubkey::Pubkey,
|
||||
signature::{Keypair, Signer},
|
||||
system_program, system_transaction,
|
||||
timing::timestamp,
|
||||
transaction::Transaction,
|
||||
},
|
||||
solana_streamer::socket::SocketAddrSpace,
|
||||
solana_vote_program::{
|
||||
vote_instruction,
|
||||
vote_state::{Vote, MAX_LOCKOUT_HISTORY},
|
||||
},
|
||||
std::{
|
||||
collections::{BTreeSet, HashMap, HashSet},
|
||||
fs,
|
||||
io::Read,
|
||||
iter,
|
||||
path::{Path, PathBuf},
|
||||
sync::{
|
||||
atomic::{AtomicBool, Ordering},
|
||||
Arc,
|
||||
},
|
||||
thread::{sleep, Builder, JoinHandle},
|
||||
time::{Duration, Instant},
|
||||
},
|
||||
tempfile::TempDir,
|
||||
};
|
||||
use solana_core::{
|
||||
broadcast_stage::{BroadcastDuplicatesConfig, BroadcastStageType},
|
||||
consensus::{Tower, SWITCH_FORK_THRESHOLD, VOTE_THRESHOLD_DEPTH},
|
||||
optimistic_confirmation_verifier::OptimisticConfirmationVerifier,
|
||||
validator::ValidatorConfig,
|
||||
};
|
||||
use solana_download_utils::download_snapshot;
|
||||
use solana_gossip::{
|
||||
cluster_info::{self, VALIDATOR_PORT_RANGE},
|
||||
crds_value::{self, CrdsData, CrdsValue},
|
||||
gossip_service::discover_cluster,
|
||||
};
|
||||
use solana_ledger::{
|
||||
ancestor_iterator::AncestorIterator,
|
||||
blockstore::{Blockstore, PurgeType},
|
||||
blockstore_db::AccessType,
|
||||
leader_schedule::FixedSchedule,
|
||||
leader_schedule::LeaderSchedule,
|
||||
};
|
||||
use solana_local_cluster::{
|
||||
cluster::{Cluster, ClusterValidatorInfo},
|
||||
cluster_tests,
|
||||
local_cluster::{ClusterConfig, LocalCluster},
|
||||
validator_configs::*,
|
||||
};
|
||||
use solana_runtime::{
|
||||
bank_forks::{ArchiveFormat, SnapshotConfig},
|
||||
snapshot_utils,
|
||||
};
|
||||
use solana_sdk::{
|
||||
account::AccountSharedData,
|
||||
client::{AsyncClient, SyncClient},
|
||||
clock::{self, Slot, DEFAULT_MS_PER_SLOT, DEFAULT_TICKS_PER_SLOT, MAX_RECENT_BLOCKHASHES},
|
||||
commitment_config::CommitmentConfig,
|
||||
epoch_schedule::MINIMUM_SLOTS_PER_EPOCH,
|
||||
genesis_config::ClusterType,
|
||||
hash::Hash,
|
||||
poh_config::PohConfig,
|
||||
pubkey::Pubkey,
|
||||
signature::{Keypair, Signer},
|
||||
system_program, system_transaction,
|
||||
timing::timestamp,
|
||||
transaction::Transaction,
|
||||
};
|
||||
use solana_streamer::socket::SocketAddrSpace;
|
||||
use solana_vote_program::{
|
||||
vote_instruction,
|
||||
vote_state::{Vote, MAX_LOCKOUT_HISTORY},
|
||||
};
|
||||
use std::{
|
||||
collections::{BTreeSet, HashMap, HashSet},
|
||||
fs,
|
||||
io::Read,
|
||||
iter,
|
||||
path::{Path, PathBuf},
|
||||
sync::atomic::{AtomicBool, Ordering},
|
||||
sync::Arc,
|
||||
thread::{sleep, Builder, JoinHandle},
|
||||
time::{Duration, Instant},
|
||||
};
|
||||
use tempfile::TempDir;
|
||||
|
||||
const RUST_LOG_FILTER: &str =
|
||||
"error,solana_core::replay_stage=warn,solana_local_cluster=info,local_cluster=info";
|
||||
|
Reference in New Issue
Block a user