From d2b21c09ffe496f24d23995d6a78f17ed6c5543e Mon Sep 17 00:00:00 2001 From: Illia Bobyr Date: Tue, 14 Feb 2023 19:01:23 -0800 Subject: [PATCH 1/4] SamplePerformanceService: Refactor stats snapshot logic (#30297) Snapshot construction and interaction code was a bit more manual than necessary, even causing a bug to slip past a review. Separated snapshot construction from the diffing of two snapshots. This should make the logic clearer. --- core/src/sample_performance_service.rs | 79 +++++++++++++------------- 1 file changed, 38 insertions(+), 41 deletions(-) diff --git a/core/src/sample_performance_service.rs b/core/src/sample_performance_service.rs index 5f5b9b66550027..df3b43d5d84da7 100644 --- a/core/src/sample_performance_service.rs +++ b/core/src/sample_performance_service.rs @@ -14,12 +14,6 @@ use { const SAMPLE_INTERVAL: u64 = 60; const SLEEP_INTERVAL: u64 = 500; -pub struct SamplePerformanceSnapshot { - pub num_transactions: u64, - pub num_non_vote_transactions: u64, - pub highest_slot: u64, -} - pub struct SamplePerformanceService { thread_hdl: JoinHandle<()>, } @@ -39,7 +33,7 @@ impl SamplePerformanceService { let thread_hdl = Builder::new() .name("sample-performance".to_string()) .spawn(move || { - Self::run(bank_forks, &blockstore, exit); + Self::run(bank_forks, blockstore, exit); }) .unwrap(); @@ -48,23 +42,10 @@ impl SamplePerformanceService { pub fn run( bank_forks: Arc>, - blockstore: &Arc, + blockstore: Arc, exit: Arc, ) { - let mut snapshot = { - let forks = bank_forks.read().unwrap(); - let bank = forks.root_bank(); - let highest_slot = forks.highest_slot(); - - // Store the absolute transaction counts to that we can compute the - // difference between these values at points in time to figure out - // how many transactions occurred in that timespan. - SamplePerformanceSnapshot { - num_transactions: bank.transaction_count(), - num_non_vote_transactions: bank.non_vote_transaction_count_since_restart(), - highest_slot, - } - }; + let mut snapshot = StatsSnapshot::from_forks(&bank_forks); let mut now = Instant::now(); loop { @@ -76,18 +57,13 @@ impl SamplePerformanceService { if elapsed.as_secs() >= SAMPLE_INTERVAL { now = Instant::now(); - let (bank, highest_slot) = { - let bank_forks = bank_forks.read().unwrap(); - (bank_forks.root_bank(), bank_forks.highest_slot()) - }; + let new_snapshot = StatsSnapshot::from_forks(&bank_forks); + + let (num_transactions, num_non_vote_transactions, num_slots) = + new_snapshot.diff_since(&snapshot); - let num_slots = highest_slot.saturating_sub(snapshot.highest_slot); - let num_transactions = bank - .transaction_count() - .saturating_sub(snapshot.num_transactions); - let num_non_vote_transactions = bank - .non_vote_transaction_count_since_restart() - .saturating_sub(snapshot.num_non_vote_transactions); + // Store the new snapshot to compare against in the next iteration of the loop. + snapshot = new_snapshot; let perf_sample = PerfSampleV2 { num_slots, @@ -96,17 +72,10 @@ impl SamplePerformanceService { sample_period_secs: elapsed.as_secs() as u16, }; + let highest_slot = snapshot.highest_slot; if let Err(e) = blockstore.write_perf_sample(highest_slot, &perf_sample) { error!("write_perf_sample failed: slot {:?} {:?}", highest_slot, e); } - - // Same as above, store the absolute transaction counts to use - // as comparison for the next iteration of this loop. - snapshot = SamplePerformanceSnapshot { - num_transactions: bank.transaction_count(), - num_non_vote_transactions: bank.non_vote_transaction_count_since_restart(), - highest_slot, - }; } sleep(Duration::from_millis(SLEEP_INTERVAL)); @@ -117,3 +86,31 @@ impl SamplePerformanceService { self.thread_hdl.join() } } + +struct StatsSnapshot { + pub num_transactions: u64, + pub num_non_vote_transactions: u64, + pub highest_slot: u64, +} + +impl StatsSnapshot { + fn from_forks(forks: &RwLock) -> Self { + let forks = forks.read().unwrap(); + let bank = forks.root_bank(); + Self { + num_transactions: bank.transaction_count(), + num_non_vote_transactions: bank.non_vote_transaction_count_since_restart(), + highest_slot: forks.highest_slot(), + } + } + + fn diff_since(&self, predecessor: &Self) -> (u64, u64, u64) { + ( + self.num_transactions + .saturating_sub(predecessor.num_transactions), + self.num_non_vote_transactions + .saturating_sub(predecessor.num_non_vote_transactions), + self.highest_slot.saturating_sub(predecessor.highest_slot), + ) + } +} From 57337058d3104922849c2fa3e07865b429d4532b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Feb 2023 20:40:23 -0700 Subject: [PATCH 2/4] Bump quote from 1.0.18 to 1.0.23 (#30239) * Bump quote from 1.0.18 to 1.0.23 Bumps [quote](https://github.com/dtolnay/quote) from 1.0.18 to 1.0.23. - [Release notes](https://github.com/dtolnay/quote/releases) - [Commits](https://github.com/dtolnay/quote/compare/1.0.18...1.0.23) --- updated-dependencies: - dependency-name: quote dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * [auto-commit] Update all Cargo lock files --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot-buildkite --- Cargo.lock | 116 ++++++++++++++++++++-------------------- programs/sbf/Cargo.lock | 108 ++++++++++++++++++------------------- 2 files changed, 112 insertions(+), 112 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 18ba8b6a6778cf..f1d41aea49e818 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -174,7 +174,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" dependencies = [ - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -186,7 +186,7 @@ checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" dependencies = [ "num-bigint 0.4.3", "num-traits", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -257,7 +257,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", "synstructure", ] @@ -269,7 +269,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -333,7 +333,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "648ed8c8d2ce5409ccd57453d9d1b214b342a0d69376a6feda1fd6cae3299308" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -344,7 +344,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -474,7 +474,7 @@ dependencies = [ "lazycell", "peeking_take_while", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "regex", "rustc-hash", "shlex", @@ -600,7 +600,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -611,7 +611,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -707,7 +707,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "562e382481975bc61d11275ac5e62a19abd00b0547d99516a415336f183dcd0e" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -926,7 +926,7 @@ dependencies = [ "heck 0.4.0", "proc-macro-error", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -1000,7 +1000,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef196d5d972878a48da7decb7686eded338b4858fbabeed513d63a7c98b2b82d" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "unicode-xid 0.2.2", ] @@ -1218,7 +1218,7 @@ dependencies = [ "fnv", "ident_case", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "strsim 0.10.0", "syn 1.0.107", ] @@ -1230,7 +1230,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" dependencies = [ "darling_core", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -1298,7 +1298,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -1310,7 +1310,7 @@ checksum = "40eebddd2156ce1bb37b20bbe5151340a31828b1f2d22ba4141f3531710e38df" dependencies = [ "convert_case", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "rustc_version 0.3.3", "syn 1.0.107", ] @@ -1398,7 +1398,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bf95dc3f046b9da4f2d51833c0d3547d8564ef6910f5c1ed130306a75b92886" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -1480,7 +1480,7 @@ checksum = "f86b50932a01e7ec5c06160492ab660fb19b6bb2a7878030dd6cd68d21df9d4d" dependencies = [ "enum-ordinalize", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -1521,7 +1521,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "828de45d0ca18782232dfb8f3ea9cc428e8ced380eb26a520baaacfc70de39ce" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -1534,7 +1534,7 @@ dependencies = [ "num-bigint 0.4.3", "num-traits", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -1546,7 +1546,7 @@ checksum = "0eb359f1476bf611266ac1f5355bc14aeca37b299d0ebccc038ee7058891c9cb" dependencies = [ "once_cell", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -1799,7 +1799,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -2475,7 +2475,7 @@ checksum = "5b939a78fa820cdfcb7ee7484466746a7377760970f6f9c6fe19f9edcc8a38d2" dependencies = [ "proc-macro-crate 0.1.5", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -2860,7 +2860,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a7d5f7076603ebc68de2dc6a650ec331a062a13abaa346975be747bbfa4b789" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -2992,7 +2992,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -3065,7 +3065,7 @@ checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" dependencies = [ "proc-macro-crate 1.1.0", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -3133,7 +3133,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -3214,7 +3214,7 @@ dependencies = [ "Inflector", "proc-macro-error", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -3368,7 +3368,7 @@ dependencies = [ "pest", "pest_meta", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -3419,7 +3419,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -3549,7 +3549,7 @@ checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", "version_check", ] @@ -3561,7 +3561,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "version_check", ] @@ -3674,7 +3674,7 @@ dependencies = [ "anyhow", "itertools", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -3687,7 +3687,7 @@ dependencies = [ "anyhow", "itertools", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -3810,9 +3810,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.18" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" +checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" dependencies = [ "proc-macro2 1.0.50", ] @@ -4326,7 +4326,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdbda6ac5cd1321e724fa9cee216f3a61885889b896f073b8f82322789c5250e" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -4425,7 +4425,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -4470,7 +4470,7 @@ checksum = "a1966009f3c05f095697c537312f5415d1e3ed31ce0a56942bac4c771c5c335e" dependencies = [ "darling", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -4521,7 +4521,7 @@ checksum = "4b6f5d1c3087fb119617cff2966fe3808a80e5eb59a8c1601d5994d66f4346a5" dependencies = [ "proc-macro-error", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -5516,7 +5516,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6fae474ab37e2ccc4dfd33edd36a05d7df02b8531fa9870cb244f9491b64fe3" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "rustc_version 0.4.0", "syn 1.0.107", ] @@ -5526,7 +5526,7 @@ name = "solana-frozen-abi-macro" version = "1.16.0" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "rustc_version 0.4.0", "syn 1.0.107", ] @@ -6589,7 +6589,7 @@ checksum = "768f16d1a7315fc66ba835eebf9e95a83365ac94222551bc5cdcc6a74cb4a137" dependencies = [ "bs58", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "rustversion", "syn 1.0.107", ] @@ -6600,7 +6600,7 @@ version = "1.16.0" dependencies = [ "bs58", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "rustversion", "syn 1.0.107", ] @@ -7278,7 +7278,7 @@ checksum = "6878079b17446e4d3eba6192bb0a2950d5b14f0ed8424b852310e5a94345d0ef" dependencies = [ "heck 0.4.0", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "rustversion", "syn 1.0.107", ] @@ -7313,7 +7313,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "unicode-ident", ] @@ -7330,7 +7330,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", "unicode-xid 0.2.2", ] @@ -7414,7 +7414,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee42b4e559f17bce0385ebf511a7beb67d5cc33c12c96b7f4e9789919d9c10f" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -7475,7 +7475,7 @@ dependencies = [ "cfg-if 1.0.0", "proc-macro-error", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -7510,7 +7510,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -7649,7 +7649,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -7841,7 +7841,7 @@ checksum = "9403f1bafde247186684b230dc6f38b5cd514584e8bec1dd32514be4745fa757" dependencies = [ "proc-macro2 1.0.50", "prost-build 0.9.0", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -7854,7 +7854,7 @@ dependencies = [ "prettyplease", "proc-macro2 1.0.50", "prost-build 0.11.4", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -7929,7 +7929,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -8256,7 +8256,7 @@ dependencies = [ "log", "once_cell", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", "wasm-bindgen-shared", ] @@ -8279,7 +8279,7 @@ version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602" dependencies = [ - "quote 1.0.18", + "quote 1.0.23", "wasm-bindgen-macro-support", ] @@ -8290,7 +8290,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", "wasm-bindgen-backend", "wasm-bindgen-shared", @@ -8608,7 +8608,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdff2024a851a322b08f179173ae2ba620445aef1e838f0c196820eade4ae0c7" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", "synstructure", ] diff --git a/programs/sbf/Cargo.lock b/programs/sbf/Cargo.lock index 1fa51e8a3a86a8..ced6b203751dbe 100644 --- a/programs/sbf/Cargo.lock +++ b/programs/sbf/Cargo.lock @@ -174,7 +174,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" dependencies = [ - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -186,7 +186,7 @@ checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" dependencies = [ "num-bigint 0.4.3", "num-traits", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -257,7 +257,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", "synstructure", ] @@ -269,7 +269,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -319,7 +319,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -330,7 +330,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -460,7 +460,7 @@ dependencies = [ "lazycell", "peeking_take_while", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "regex", "rustc-hash", "shlex", @@ -571,7 +571,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -582,7 +582,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -660,7 +660,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "562e382481975bc61d11275ac5e62a19abd00b0547d99516a415336f183dcd0e" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -1053,7 +1053,7 @@ dependencies = [ "fnv", "ident_case", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "strsim 0.10.0", "syn 1.0.107", ] @@ -1065,7 +1065,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" dependencies = [ "darling_core", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -1122,7 +1122,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -1134,7 +1134,7 @@ checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "convert_case", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "rustc_version 0.4.0", "syn 1.0.107", ] @@ -1216,7 +1216,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bf95dc3f046b9da4f2d51833c0d3547d8564ef6910f5c1ed130306a75b92886" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -1292,7 +1292,7 @@ checksum = "f86b50932a01e7ec5c06160492ab660fb19b6bb2a7878030dd6cd68d21df9d4d" dependencies = [ "enum-ordinalize", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -1342,7 +1342,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "828de45d0ca18782232dfb8f3ea9cc428e8ced380eb26a520baaacfc70de39ce" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -1355,7 +1355,7 @@ dependencies = [ "num-bigint 0.4.3", "num-traits", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -1367,7 +1367,7 @@ checksum = "0eb359f1476bf611266ac1f5355bc14aeca37b299d0ebccc038ee7058891c9cb" dependencies = [ "once_cell", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -1594,7 +1594,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -2207,7 +2207,7 @@ checksum = "5b939a78fa820cdfcb7ee7484466746a7377760970f6f9c6fe19f9edcc8a38d2" dependencies = [ "proc-macro-crate 0.1.5", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -2625,7 +2625,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a7d5f7076603ebc68de2dc6a650ec331a062a13abaa346975be747bbfa4b789" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -2750,7 +2750,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c8b15b261814f992e33760b1fca9fe8b693d8a65299f20c9901688636cfb746" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -2823,7 +2823,7 @@ checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -2891,7 +2891,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -2972,7 +2972,7 @@ dependencies = [ "Inflector", "proc-macro-error", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -3126,7 +3126,7 @@ dependencies = [ "pest", "pest_meta", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -3167,7 +3167,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -3267,7 +3267,7 @@ checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", "version_check", ] @@ -3279,7 +3279,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "version_check", ] @@ -3372,7 +3372,7 @@ dependencies = [ "anyhow", "itertools", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -3385,7 +3385,7 @@ dependencies = [ "anyhow", "itertools", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -3488,9 +3488,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.18" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" +checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" dependencies = [ "proc-macro2 1.0.50", ] @@ -3926,7 +3926,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdbda6ac5cd1321e724fa9cee216f3a61885889b896f073b8f82322789c5250e" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -4022,7 +4022,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -4067,7 +4067,7 @@ checksum = "a1966009f3c05f095697c537312f5415d1e3ed31ce0a56942bac4c771c5c335e" dependencies = [ "darling", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -4742,7 +4742,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6fae474ab37e2ccc4dfd33edd36a05d7df02b8531fa9870cb244f9491b64fe3" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "rustc_version 0.4.0", "syn 1.0.107", ] @@ -4752,7 +4752,7 @@ name = "solana-frozen-abi-macro" version = "1.16.0" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "rustc_version 0.4.0", "syn 1.0.107", ] @@ -5902,7 +5902,7 @@ checksum = "768f16d1a7315fc66ba835eebf9e95a83365ac94222551bc5cdcc6a74cb4a137" dependencies = [ "bs58", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "rustversion", "syn 1.0.107", ] @@ -5913,7 +5913,7 @@ version = "1.16.0" dependencies = [ "bs58", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "rustversion", "syn 1.0.107", ] @@ -6452,7 +6452,7 @@ checksum = "6878079b17446e4d3eba6192bb0a2950d5b14f0ed8424b852310e5a94345d0ef" dependencies = [ "heck 0.4.0", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "rustversion", "syn 1.0.107", ] @@ -6487,7 +6487,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "unicode-ident", ] @@ -6504,7 +6504,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", "unicode-xid 0.2.3", ] @@ -6574,7 +6574,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee42b4e559f17bce0385ebf511a7beb67d5cc33c12c96b7f4e9789919d9c10f" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -6642,7 +6642,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -6775,7 +6775,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -6967,7 +6967,7 @@ checksum = "9403f1bafde247186684b230dc6f38b5cd514584e8bec1dd32514be4745fa757" dependencies = [ "proc-macro2 1.0.50", "prost-build 0.9.0", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -6980,7 +6980,7 @@ dependencies = [ "prettyplease", "proc-macro2 1.0.50", "prost-build 0.11.4", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -7055,7 +7055,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", ] @@ -7377,7 +7377,7 @@ dependencies = [ "log", "once_cell", "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", "wasm-bindgen-shared", ] @@ -7400,7 +7400,7 @@ version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602" dependencies = [ - "quote 1.0.18", + "quote 1.0.23", "wasm-bindgen-macro-support", ] @@ -7411,7 +7411,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", "wasm-bindgen-backend", "wasm-bindgen-shared", @@ -7720,7 +7720,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdff2024a851a322b08f179173ae2ba620445aef1e838f0c196820eade4ae0c7" dependencies = [ "proc-macro2 1.0.50", - "quote 1.0.18", + "quote 1.0.23", "syn 1.0.107", "synstructure", ] From 0d96d1db33b44b5ecddd329472a0ebd0adbcdb95 Mon Sep 17 00:00:00 2001 From: Yihau Chen Date: Wed, 15 Feb 2023 13:03:17 +0800 Subject: [PATCH 3/4] ci: group check steps into an individual queue (#30309) * ci: group check steps into an individual queue * lint: add quote --- ci/buildkite-pipeline.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/buildkite-pipeline.sh b/ci/buildkite-pipeline.sh index 2daa1f02b5f796..3d1d35a15588ac 100755 --- a/ci/buildkite-pipeline.sh +++ b/ci/buildkite-pipeline.sh @@ -114,7 +114,7 @@ command_step() { timeout_in_minutes: $3 artifact_paths: "log-*.txt" agents: - queue: "solana" + queue: "${4:-solana}" EOF } @@ -139,7 +139,7 @@ wait_step() { } all_test_steps() { - command_step checks ". ci/rust-version.sh; ci/docker-run.sh \$\$rust_nightly_docker_image ci/test-checks.sh" 20 + command_step checks ". ci/rust-version.sh; ci/docker-run.sh \$\$rust_nightly_docker_image ci/test-checks.sh" 20 check wait_step # Coverage... @@ -308,12 +308,12 @@ EOF } pull_or_push_steps() { - command_step sanity "ci/test-sanity.sh" 5 + command_step sanity "ci/test-sanity.sh" 5 check wait_step # Check for any .sh file changes if affects .sh$; then - command_step shellcheck "ci/shellcheck.sh" 5 + command_step shellcheck "ci/shellcheck.sh" 5 check wait_step fi From a36e1b211d144f3cf0f2a6f68da7600b49454c1a Mon Sep 17 00:00:00 2001 From: Kevin Ji <1146876+kevinji@users.noreply.github.com> Date: Tue, 14 Feb 2023 21:11:48 -0800 Subject: [PATCH 4/4] Simplify some comparisons using (a1, a2).cmp(&(b1, b2)) (#30321) --- cli-output/src/cli_output.rs | 6 +----- cli/src/feature.rs | 5 +---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/cli-output/src/cli_output.rs b/cli-output/src/cli_output.rs index 142816bf11954d..a53cd16af9066d 100644 --- a/cli-output/src/cli_output.rs +++ b/cli-output/src/cli_output.rs @@ -559,11 +559,7 @@ impl fmt::Display for CliValidators { } CliValidatorsSortOrder::Version => { sorted_validators.sort_by(|a, b| { - use std::cmp::Ordering; - match a.version.cmp(&b.version) { - Ordering::Equal => a.activated_stake.cmp(&b.activated_stake), - ordering => ordering, - } + (&a.version, a.activated_stake).cmp(&(&b.version, b.activated_stake)) }); } } diff --git a/cli/src/feature.rs b/cli/src/feature.rs index 82d26816fb67f3..e231396c90f371 100644 --- a/cli/src/feature.rs +++ b/cli/src/feature.rs @@ -93,10 +93,7 @@ impl PartialOrd for CliFeature { impl Ord for CliFeature { fn cmp(&self, other: &Self) -> Ordering { - match self.status.cmp(&other.status) { - Ordering::Equal => self.id.cmp(&other.id), - ordering => ordering, - } + (&self.status, &self.id).cmp(&(&other.status, &other.id)) } }