Upgrade to Rust v1.49.0
This commit is contained in:
@ -3908,6 +3908,8 @@ impl AccountsDB {
|
||||
fn report_store_timings(&self) {
|
||||
let last = self.stats.last_store_report.load(Ordering::Relaxed);
|
||||
let now = solana_sdk::timing::timestamp();
|
||||
|
||||
#[allow(deprecated)]
|
||||
if now.saturating_sub(last) > 1000
|
||||
&& self
|
||||
.stats
|
||||
|
@ -196,14 +196,18 @@ impl<T: BloomHashIndex> AtomicBloom<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: BloomHashIndex> Into<Bloom<T>> for AtomicBloom<T> {
|
||||
fn into(self) -> Bloom<T> {
|
||||
let bits: Vec<_> = self.bits.into_iter().map(AtomicU64::into_inner).collect();
|
||||
impl<T: BloomHashIndex> From<AtomicBloom<T>> for Bloom<T> {
|
||||
fn from(atomic_bloom: AtomicBloom<T>) -> Self {
|
||||
let bits: Vec<_> = atomic_bloom
|
||||
.bits
|
||||
.into_iter()
|
||||
.map(AtomicU64::into_inner)
|
||||
.collect();
|
||||
let num_bits_set = bits.iter().map(|x| x.count_ones() as u64).sum();
|
||||
let mut bits: BitVec<u64> = bits.into();
|
||||
bits.truncate(self.num_bits);
|
||||
bits.truncate(atomic_bloom.num_bits);
|
||||
Bloom {
|
||||
keys: self.keys,
|
||||
keys: atomic_bloom.keys,
|
||||
bits,
|
||||
num_bits_set,
|
||||
_phantom: PhantomData::default(),
|
||||
|
@ -30,9 +30,9 @@ impl LogCollector {
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<Vec<String>> for LogCollector {
|
||||
fn into(self) -> Vec<String> {
|
||||
self.inner.into_inner().messages
|
||||
impl From<LogCollector> for Vec<String> {
|
||||
fn from(log_collector: LogCollector) -> Self {
|
||||
log_collector.inner.into_inner().messages
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,13 @@ use solana_sdk::{
|
||||
process_instruction::{InvokeContext, LoaderEntrypoint},
|
||||
pubkey::Pubkey,
|
||||
};
|
||||
use std::{collections::HashMap, env, path::PathBuf, str, sync::RwLock};
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
env,
|
||||
path::{Path, PathBuf},
|
||||
str,
|
||||
sync::RwLock,
|
||||
};
|
||||
use thiserror::Error;
|
||||
|
||||
#[derive(Error, Debug, Serialize, Clone, PartialEq, FromPrimitive, ToPrimitive)]
|
||||
@ -85,12 +91,12 @@ impl NativeLoader {
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
fn library_open(path: &PathBuf) -> Result<Library, libloading::Error> {
|
||||
fn library_open(path: &Path) -> Result<Library, libloading::Error> {
|
||||
Library::new(path)
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
fn library_open(path: &PathBuf) -> Result<Library, libloading::Error> {
|
||||
fn library_open(path: &Path) -> Result<Library, libloading::Error> {
|
||||
// Linux tls bug can cause crash on dlclose(), workaround by never unloading
|
||||
Library::open(Some(path), libc::RTLD_NODELETE | libc::RTLD_NOW)
|
||||
}
|
||||
|
@ -24,9 +24,9 @@ impl From<&AccountStorageEntry> for SerializableAccountStorageEntry {
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<AccountStorageEntry> for SerializableAccountStorageEntry {
|
||||
fn into(self) -> AccountStorageEntry {
|
||||
AccountStorageEntry::new_empty_map(self.id, self.accounts_current_len)
|
||||
impl From<SerializableAccountStorageEntry> for AccountStorageEntry {
|
||||
fn from(s: SerializableAccountStorageEntry) -> Self {
|
||||
AccountStorageEntry::new_empty_map(s.id, s.accounts_current_len)
|
||||
}
|
||||
}
|
||||
|
||||
@ -71,43 +71,44 @@ pub(crate) struct DeserializableVersionedBank {
|
||||
pub(crate) message_processor: MessageProcessor,
|
||||
}
|
||||
|
||||
impl Into<BankFieldsToDeserialize> for DeserializableVersionedBank {
|
||||
fn into(self) -> BankFieldsToDeserialize {
|
||||
impl From<DeserializableVersionedBank> for BankFieldsToDeserialize {
|
||||
fn from(dvb: DeserializableVersionedBank) -> Self {
|
||||
BankFieldsToDeserialize {
|
||||
blockhash_queue: self.blockhash_queue,
|
||||
ancestors: self.ancestors,
|
||||
hash: self.hash,
|
||||
parent_hash: self.parent_hash,
|
||||
parent_slot: self.parent_slot,
|
||||
hard_forks: self.hard_forks,
|
||||
transaction_count: self.transaction_count,
|
||||
tick_height: self.tick_height,
|
||||
signature_count: self.signature_count,
|
||||
capitalization: self.capitalization,
|
||||
max_tick_height: self.max_tick_height,
|
||||
hashes_per_tick: self.hashes_per_tick,
|
||||
ticks_per_slot: self.ticks_per_slot,
|
||||
ns_per_slot: self.ns_per_slot,
|
||||
genesis_creation_time: self.genesis_creation_time,
|
||||
slots_per_year: self.slots_per_year,
|
||||
unused: self.unused,
|
||||
slot: self.slot,
|
||||
epoch: self.epoch,
|
||||
block_height: self.block_height,
|
||||
collector_id: self.collector_id,
|
||||
collector_fees: self.collector_fees,
|
||||
fee_calculator: self.fee_calculator,
|
||||
fee_rate_governor: self.fee_rate_governor,
|
||||
collected_rent: self.collected_rent,
|
||||
rent_collector: self.rent_collector,
|
||||
epoch_schedule: self.epoch_schedule,
|
||||
inflation: self.inflation,
|
||||
stakes: self.stakes,
|
||||
epoch_stakes: self.epoch_stakes,
|
||||
is_delta: self.is_delta,
|
||||
blockhash_queue: dvb.blockhash_queue,
|
||||
ancestors: dvb.ancestors,
|
||||
hash: dvb.hash,
|
||||
parent_hash: dvb.parent_hash,
|
||||
parent_slot: dvb.parent_slot,
|
||||
hard_forks: dvb.hard_forks,
|
||||
transaction_count: dvb.transaction_count,
|
||||
tick_height: dvb.tick_height,
|
||||
signature_count: dvb.signature_count,
|
||||
capitalization: dvb.capitalization,
|
||||
max_tick_height: dvb.max_tick_height,
|
||||
hashes_per_tick: dvb.hashes_per_tick,
|
||||
ticks_per_slot: dvb.ticks_per_slot,
|
||||
ns_per_slot: dvb.ns_per_slot,
|
||||
genesis_creation_time: dvb.genesis_creation_time,
|
||||
slots_per_year: dvb.slots_per_year,
|
||||
unused: dvb.unused,
|
||||
slot: dvb.slot,
|
||||
epoch: dvb.epoch,
|
||||
block_height: dvb.block_height,
|
||||
collector_id: dvb.collector_id,
|
||||
collector_fees: dvb.collector_fees,
|
||||
fee_calculator: dvb.fee_calculator,
|
||||
fee_rate_governor: dvb.fee_rate_governor,
|
||||
collected_rent: dvb.collected_rent,
|
||||
rent_collector: dvb.rent_collector,
|
||||
epoch_schedule: dvb.epoch_schedule,
|
||||
inflation: dvb.inflation,
|
||||
stakes: dvb.stakes,
|
||||
epoch_stakes: dvb.epoch_stakes,
|
||||
is_delta: dvb.is_delta,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Serializable version of Bank, not Deserializable to avoid cloning by using refs.
|
||||
// Sync fields with DeserializableVersionedBank!
|
||||
#[derive(Serialize)]
|
||||
|
@ -585,7 +585,7 @@ pub fn remove_snapshot<P: AsRef<Path>>(slot: Slot, snapshot_path: P) -> Result<(
|
||||
pub fn bank_from_archive<P: AsRef<Path>>(
|
||||
account_paths: &[PathBuf],
|
||||
frozen_account_pubkeys: &[Pubkey],
|
||||
snapshot_path: &PathBuf,
|
||||
snapshot_path: &Path,
|
||||
snapshot_tar: P,
|
||||
archive_format: ArchiveFormat,
|
||||
genesis_config: &GenesisConfig,
|
||||
@ -760,7 +760,7 @@ fn rebuild_bank_from_snapshots<P>(
|
||||
snapshot_version: &str,
|
||||
account_paths: &[PathBuf],
|
||||
frozen_account_pubkeys: &[Pubkey],
|
||||
unpacked_snapshots_dir: &PathBuf,
|
||||
unpacked_snapshots_dir: &Path,
|
||||
append_vecs_path: P,
|
||||
genesis_config: &GenesisConfig,
|
||||
debug_keys: Option<Arc<HashSet<Pubkey>>>,
|
||||
|
Reference in New Issue
Block a user