parent
db18611c86
commit
75a92d58cb
|
@ -20,16 +20,19 @@ solana-core = { path = "../core", version = "0.20.0" }
|
|||
solana-genesis = { path = "../genesis", version = "0.20.0" }
|
||||
solana-client = { path = "../client", version = "0.20.0" }
|
||||
solana-drone = { path = "../drone", version = "0.20.0" }
|
||||
solana-librapay-api = { path = "../programs/librapay_api", version = "0.20.0" }
|
||||
solana-librapay-api = { path = "../programs/librapay_api", version = "0.20.0", optional = true }
|
||||
solana-logger = { path = "../logger", version = "0.20.0" }
|
||||
solana-metrics = { path = "../metrics", version = "0.20.0" }
|
||||
solana-measure = { path = "../measure", version = "0.20.0" }
|
||||
solana-netutil = { path = "../netutil", version = "0.20.0" }
|
||||
solana-runtime = { path = "../runtime", version = "0.20.0" }
|
||||
solana-sdk = { path = "../sdk", version = "0.20.0" }
|
||||
solana-move-loader-program = { path = "../programs/move_loader_program", version = "0.20.0" }
|
||||
solana-move-loader-api = { path = "../programs/move_loader_api", version = "0.20.0" }
|
||||
solana-move-loader-program = { path = "../programs/move_loader_program", version = "0.20.0", optional = true }
|
||||
solana-move-loader-api = { path = "../programs/move_loader_api", version = "0.20.0", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
serial_test = "0.2.0"
|
||||
serial_test_derive = "0.2.0"
|
||||
|
||||
[features]
|
||||
move = ["solana-core/move", "solana-librapay-api", "solana-move-loader-program", "solana-move-loader-api"]
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
use solana_metrics;
|
||||
|
||||
use crate::cli::Config;
|
||||
use bincode;
|
||||
use log::*;
|
||||
use rayon::prelude::*;
|
||||
use solana_client::perf_utils::{sample_txs, SampleStats};
|
||||
use solana_core::gen_keys::GenKeys;
|
||||
use solana_drone::drone::request_airdrop_transaction;
|
||||
#[cfg(feature = "move")]
|
||||
use solana_librapay_api::{create_genesis, upload_mint_program, upload_payment_program};
|
||||
#[cfg(feature = "move")]
|
||||
use solana_measure::measure::Measure;
|
||||
use solana_metrics::datapoint_info;
|
||||
use solana_sdk::client::Client;
|
||||
|
@ -30,6 +31,7 @@ use std::thread::Builder;
|
|||
use std::time::Duration;
|
||||
use std::time::Instant;
|
||||
|
||||
#[cfg(feature = "move")]
|
||||
use solana_librapay_api::librapay_transaction;
|
||||
|
||||
pub const MAX_SPENDS_PER_TX: u64 = 4;
|
||||
|
@ -232,6 +234,7 @@ fn metrics_submit_lamport_balance(lamport_balance: u64) {
|
|||
);
|
||||
}
|
||||
|
||||
#[cfg(feature = "move")]
|
||||
fn generate_move_txs(
|
||||
source: &[Keypair],
|
||||
dest: &[Keypair],
|
||||
|
@ -314,21 +317,29 @@ fn generate_txs(
|
|||
let signing_start = Instant::now();
|
||||
|
||||
let transactions = if let Some((
|
||||
libra_genesis_keypair,
|
||||
libra_pay_program_id,
|
||||
_libra_genesis_keypair,
|
||||
_libra_pay_program_id,
|
||||
_libra_mint_program_id,
|
||||
libra_keys,
|
||||
_libra_keys,
|
||||
)) = libra_args
|
||||
{
|
||||
#[cfg(not(feature = "move"))]
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
#[cfg(feature = "move")]
|
||||
{
|
||||
generate_move_txs(
|
||||
source,
|
||||
dest,
|
||||
reclaim,
|
||||
&libra_keys,
|
||||
libra_pay_program_id,
|
||||
&libra_genesis_keypair.pubkey(),
|
||||
&_libra_keys,
|
||||
_libra_pay_program_id,
|
||||
&_libra_genesis_keypair.pubkey(),
|
||||
blockhash,
|
||||
)
|
||||
}
|
||||
} else {
|
||||
generate_system_txs(source, dest, reclaim, blockhash)
|
||||
};
|
||||
|
@ -689,6 +700,7 @@ pub fn generate_keypairs(seed_keypair: &Keypair, count: u64) -> (Vec<Keypair>, u
|
|||
(rnd.gen_n_keypairs(total_keys), extra)
|
||||
}
|
||||
|
||||
#[cfg(feature = "move")]
|
||||
fn fund_move_keys<T: Client>(
|
||||
client: &T,
|
||||
funding_key: &Keypair,
|
||||
|
@ -862,8 +874,12 @@ pub fn generate_and_fund_keypairs<T: Client>(
|
|||
.get_balance(&keypairs[tx_count * 2 - 1].pubkey())
|
||||
.unwrap_or(0);
|
||||
|
||||
#[cfg(feature = "move")]
|
||||
let mut move_keypairs_ret = None;
|
||||
|
||||
#[cfg(not(feature = "move"))]
|
||||
let move_keypairs_ret = None;
|
||||
|
||||
if lamports_per_account > last_keypair_balance {
|
||||
let (_blockhash, fee_calculator) = get_recent_blockhash(client);
|
||||
let account_desired_balance =
|
||||
|
@ -883,6 +899,8 @@ pub fn generate_and_fund_keypairs<T: Client>(
|
|||
airdrop_lamports(client, &drone_addr.unwrap(), funding_key, total)?;
|
||||
}
|
||||
|
||||
#[cfg(feature = "move")]
|
||||
{
|
||||
if use_move {
|
||||
let libra_genesis_keypair = create_genesis(&funding_key, client, 10_000_000);
|
||||
let libra_mint_program_id = upload_mint_program(&funding_key, client);
|
||||
|
@ -912,6 +930,7 @@ pub fn generate_and_fund_keypairs<T: Client>(
|
|||
// Give solana keys 1/3 and move keys 1/3 the lamports. Keep 1/3 for fees.
|
||||
total /= 3;
|
||||
}
|
||||
}
|
||||
|
||||
fund_keys(
|
||||
client,
|
||||
|
|
|
@ -34,6 +34,7 @@ test-stable)
|
|||
|
||||
_ cargo +"$rust_stable" build --tests --bins ${V:+--verbose}
|
||||
_ cargo +"$rust_stable" test --all --exclude solana-local-cluster ${V:+--verbose} -- --nocapture
|
||||
_ cargo +"$rust_stable" test --manifest-path local_cluster/Cargo.toml --features=move ${V:+--verbose} test_bench_tps_local_cluster_move -- --nocapture
|
||||
;;
|
||||
test-stable-perf)
|
||||
echo "Executing $testName"
|
||||
|
|
|
@ -15,6 +15,7 @@ codecov = { repository = "solana-labs/solana", branch = "master", service = "git
|
|||
|
||||
[features]
|
||||
pin_gpu_memory = []
|
||||
move = []
|
||||
|
||||
[dependencies]
|
||||
bincode = "1.2.0"
|
||||
|
|
|
@ -17,8 +17,8 @@ solana-config-api = { path = "../programs/config_api", version = "0.20.0" }
|
|||
solana-config-program = { path = "../programs/config_program", version = "0.20.0" }
|
||||
solana-exchange-api = { path = "../programs/exchange_api", version = "0.20.0" }
|
||||
solana-exchange-program = { path = "../programs/exchange_program", version = "0.20.0" }
|
||||
solana-move-loader-program = { path = "../programs/move_loader_program", version = "0.20.0" }
|
||||
solana-move-loader-api = { path = "../programs/move_loader_api", version = "0.20.0" }
|
||||
solana-move-loader-program = { path = "../programs/move_loader_program", version = "0.20.0", optional = true }
|
||||
solana-move-loader-api = { path = "../programs/move_loader_api", version = "0.20.0", optional = true }
|
||||
solana-sdk = { path = "../sdk", version = "0.20.0" }
|
||||
solana-stake-api = { path = "../programs/stake_api", version = "0.20.0" }
|
||||
solana-stake-program = { path = "../programs/stake_program", version = "0.20.0" }
|
||||
|
@ -32,3 +32,6 @@ solana-vote-program = { path = "../programs/vote_program", version = "0.20.0" }
|
|||
[lib]
|
||||
crate-type = ["lib"]
|
||||
name = "solana_genesis_programs"
|
||||
|
||||
[features]
|
||||
move = ["solana-move-loader-program", "solana-move-loader-api"]
|
||||
|
|
|
@ -9,6 +9,7 @@ extern crate solana_budget_program;
|
|||
extern crate solana_config_program;
|
||||
#[macro_use]
|
||||
extern crate solana_exchange_program;
|
||||
#[cfg(feature = "move")]
|
||||
#[macro_use]
|
||||
extern crate solana_move_loader_program;
|
||||
#[macro_use]
|
||||
|
@ -27,6 +28,7 @@ pub fn get() -> Vec<(String, Pubkey)> {
|
|||
solana_budget_program!(),
|
||||
solana_config_program!(),
|
||||
solana_exchange_program!(),
|
||||
#[cfg(feature = "move")]
|
||||
solana_move_loader_program!(),
|
||||
solana_stake_program!(),
|
||||
solana_storage_program!(),
|
||||
|
@ -46,6 +48,7 @@ mod tests {
|
|||
solana_budget_api::id(),
|
||||
solana_config_api::id(),
|
||||
solana_exchange_api::id(),
|
||||
#[cfg(feature = "move")]
|
||||
solana_move_loader_api::id(),
|
||||
solana_sdk::bpf_loader::id(),
|
||||
solana_sdk::native_loader::id(),
|
||||
|
|
|
@ -19,8 +19,8 @@ solana-drone = { path = "../drone", version = "0.20.0" }
|
|||
solana-exchange-api = { path = "../programs/exchange_api", version = "0.20.0" }
|
||||
solana-exchange-program = { path = "../programs/exchange_program", version = "0.20.0" }
|
||||
solana-logger = { path = "../logger", version = "0.20.0" }
|
||||
solana-move-loader-api = { path = "../programs/move_loader_api", version = "0.20.0" }
|
||||
solana-move-loader-program = { path = "../programs/move_loader_program", version = "0.20.0" }
|
||||
solana-move-loader-api = { path = "../programs/move_loader_api", version = "0.20.0", optional = true }
|
||||
solana-move-loader-program = { path = "../programs/move_loader_program", version = "0.20.0", optional = true }
|
||||
solana-runtime = { path = "../runtime", version = "0.20.0" }
|
||||
solana-sdk = { path = "../sdk", version = "0.20.0" }
|
||||
solana-stake-api = { path = "../programs/stake_api", version = "0.20.0" }
|
||||
|
@ -34,3 +34,6 @@ solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "0.20.0" }
|
|||
[dev-dependencies]
|
||||
serial_test = "0.2.0"
|
||||
serial_test_derive = "0.2.0"
|
||||
|
||||
[features]
|
||||
move = ["solana-move-loader-api", "solana-move-loader-program"]
|
||||
|
|
|
@ -28,6 +28,7 @@ extern crate solana_drone;
|
|||
#[cfg(test)]
|
||||
extern crate solana_exchange_program;
|
||||
|
||||
#[cfg(feature = "move")]
|
||||
#[macro_use]
|
||||
#[cfg(test)]
|
||||
extern crate solana_move_loader_program;
|
||||
|
|
|
@ -6,19 +6,26 @@ use solana_client::thin_client::create_client;
|
|||
use solana_core::cluster_info::FULLNODE_PORT_RANGE;
|
||||
use solana_core::validator::ValidatorConfig;
|
||||
use solana_drone::drone::run_local_drone;
|
||||
#[cfg(feature = "move")]
|
||||
use solana_move_loader_program;
|
||||
use solana_sdk::signature::{Keypair, KeypairUtil};
|
||||
use std::sync::mpsc::channel;
|
||||
use std::time::Duration;
|
||||
|
||||
fn test_bench_tps_local_cluster(config: Config) {
|
||||
#[cfg(feature = "move")]
|
||||
let native_instruction_processors = vec![solana_move_loader_program!()];
|
||||
|
||||
#[cfg(not(feature = "move"))]
|
||||
let native_instruction_processors = vec![];
|
||||
|
||||
solana_logger::setup();
|
||||
const NUM_NODES: usize = 1;
|
||||
let cluster = LocalCluster::new(&ClusterConfig {
|
||||
node_stakes: vec![999_990; NUM_NODES],
|
||||
cluster_lamports: 200_000_000,
|
||||
validator_configs: vec![ValidatorConfig::default(); NUM_NODES],
|
||||
native_instruction_processors: vec![solana_move_loader_program!()],
|
||||
native_instruction_processors,
|
||||
..ClusterConfig::default()
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue