Skip to content

Commit

Permalink
Merge branch 'solana-labs:master' into refactor-execute-timings
Browse files Browse the repository at this point in the history
  • Loading branch information
Gavin Chan committed Feb 17, 2022
2 parents 6b607a6 + a102453 commit 75d31e5
Show file tree
Hide file tree
Showing 113 changed files with 8,123 additions and 1,580 deletions.
85 changes: 58 additions & 27 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ members = [
"program-test",
"programs/address-lookup-table",
"programs/address-lookup-table-tests",
"programs/ed25519-tests",
"programs/bpf_loader",
"programs/bpf_loader/gen-syscall-list",
"programs/compute-budget",
Expand Down
2 changes: 1 addition & 1 deletion account-decoder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ solana-sdk = { path = "../sdk", version = "=1.10.0" }
solana-vote-program = { path = "../programs/vote", version = "=1.10.0" }
spl-token = { version = "=3.2.0", features = ["no-entrypoint"] }
thiserror = "1.0"
zstd = "0.9.2"
zstd = "0.10.0"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
13 changes: 12 additions & 1 deletion accountsdb-plugin-manager/src/accountsdb_plugin_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,24 @@ impl AccountsDbPluginService {
let libpath = result["libpath"]
.as_str()
.ok_or(AccountsdbPluginServiceError::LibPathNotSet)?;
let mut libpath = PathBuf::from(libpath);
if libpath.is_relative() {
let config_dir = accountsdb_plugin_config_file.parent().ok_or_else(|| {
AccountsdbPluginServiceError::CannotOpenConfigFile(format!(
"Failed to resolve parent of {:?}",
accountsdb_plugin_config_file,
))
})?;
libpath = config_dir.join(libpath);
}

let config_file = accountsdb_plugin_config_file
.as_os_str()
.to_str()
.ok_or(AccountsdbPluginServiceError::InvalidPluginPath)?;

unsafe {
let result = plugin_manager.load_plugin(libpath, config_file);
let result = plugin_manager.load_plugin(libpath.to_str().unwrap(), config_file);
if let Err(err) = result {
let msg = format!(
"Failed to load the plugin library: {:?}, error: {:?}",
Expand Down
2 changes: 1 addition & 1 deletion bench-tps/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub const NUM_SIGNATURES_FOR_TXS: u64 = 100_000 * 60 * 60 * 24 * 7;

fn main() {
solana_logger::setup_with_default("solana=info");
solana_metrics::set_panic_hook("bench-tps");
solana_metrics::set_panic_hook("bench-tps", /*version:*/ None);

let matches = cli::build_args(solana_version::version!()).get_matches();
let cli_config = cli::extract_args(&matches);
Expand Down
2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ humantime = "2.0.1"
num-traits = "0.2"
pretty-hex = "0.2.1"
reqwest = { version = "0.11.6", default-features = false, features = ["blocking", "rustls-tls", "json"] }
semver = "1.0.4"
semver = "1.0.5"
serde = "1.0.136"
serde_derive = "1.0.103"
serde_json = "1.0.78"
Expand Down
8 changes: 7 additions & 1 deletion cli/src/stake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,13 @@ pub fn process_stake_authorize(
if let Some(authorized) = authorized {
match authorization_type {
StakeAuthorize::Staker => {
check_current_authority(&authorized.staker, &authority.pubkey())?;
// first check authorized withdrawer
check_current_authority(&authorized.withdrawer, &authority.pubkey())
.or_else(|_| {
// ...then check authorized staker. If neither matches, error will
// print the stake key as `expected`
check_current_authority(&authorized.staker, &authority.pubkey())
})?;
}
StakeAuthorize::Withdrawer => {
check_current_authority(&authorized.withdrawer, &authority.pubkey())?;
Expand Down
7 changes: 4 additions & 3 deletions cli/tests/nonce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ fn full_battery_tests(
#[test]
#[allow(clippy::redundant_closure)]
fn test_create_account_with_seed() {
const ONE_SIG_FEE: f64 = 0.000005;
solana_logger::setup();
let mint_keypair = Keypair::new();
let mint_pubkey = mint_keypair.pubkey();
Expand Down Expand Up @@ -310,7 +311,7 @@ fn test_create_account_with_seed() {
&offline_nonce_authority_signer.pubkey(),
);
check_balance!(
sol_to_lamports(4000.999999999),
sol_to_lamports(4001.0 - ONE_SIG_FEE),
&rpc_client,
&online_nonce_creator_signer.pubkey(),
);
Expand Down Expand Up @@ -381,12 +382,12 @@ fn test_create_account_with_seed() {
process_command(&submit_config).unwrap();
check_balance!(sol_to_lamports(241.0), &rpc_client, &nonce_address);
check_balance!(
sol_to_lamports(31.999999999),
sol_to_lamports(32.0 - ONE_SIG_FEE),
&rpc_client,
&offline_nonce_authority_signer.pubkey(),
);
check_balance!(
sol_to_lamports(4000.999999999),
sol_to_lamports(4001.0 - ONE_SIG_FEE),
&rpc_client,
&online_nonce_creator_signer.pubkey(),
);
Expand Down

0 comments on commit 75d31e5

Please sign in to comment.