Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Bump rust to 1.47.0 #12739

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 110 additions & 3 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion account-decoder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ solana-config-program = { path = "../programs/config", version = "1.5.0" }
solana-sdk = { path = "../sdk", version = "1.5.0" }
solana-stake-program = { path = "../programs/stake", version = "1.5.0" }
solana-vote-program = { path = "../programs/vote", version = "1.5.0" }
spl-token-v2-0 = { package = "spl-token", version = "=2.0.6", features = ["skip-no-mangle"] }
spl-token-v2-0 = { path = "../../solana-program-library/token/program", package = "spl-token", version = "=2.0.7" }
thiserror = "1.0"

[package.metadata.docs.rs]
Expand Down
2 changes: 1 addition & 1 deletion account-decoder/src/parse_account_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pub fn parse_account_data(
) -> Result<ParsedAccount, ParseAccountError> {
let program_name = PARSABLE_PROGRAM_IDS
.get(program_id)
.ok_or_else(|| ParseAccountError::ProgramNotParsable)?;
.ok_or(ParseAccountError::ProgramNotParsable)?;
let additional_data = additional_data.unwrap_or_default();
let parsed_json = match program_name {
ParsableAccount::Config => serde_json::to_value(parse_config(data, pubkey)?)?,
Expand Down
7 changes: 6 additions & 1 deletion ci/docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ if [[ -n $CI ]]; then
else
# Avoid sharing ~/.cargo when building locally to avoid a mixed macOS/Linux
# ~/.cargo
ARGS+=(--volume "$PWD:/home")
ARGS+=(
--volume "$PWD:/home"
--volume "/home/trent/code/solana/solana-2:/solana-2"
--volume "/home/trent/code/solana/solana-program-library:/solana-program-library"
)

fi
ARGS+=(--env "HOME=/home" --env "CARGO_HOME=/home/.cargo")

Expand Down
2 changes: 1 addition & 1 deletion ci/docker-rust-nightly/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM solanalabs/rust:1.46.0
FROM solanalabs/rust:1.47.0
ARG date

RUN set -x \
Expand Down
2 changes: 1 addition & 1 deletion ci/docker-rust/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Note: when the rust version is changed also modify
# ci/rust-version.sh to pick up the new image tag
FROM rust:1.46.0
FROM rust:1.47.0

# Add Google Protocol Buffers for Libra's metrics library.
ENV PROTOC_VERSION 3.8.0
Expand Down
4 changes: 2 additions & 2 deletions ci/rust-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
if [[ -n $RUST_STABLE_VERSION ]]; then
stable_version="$RUST_STABLE_VERSION"
else
stable_version=1.46.0
stable_version=1.47.0
fi

if [[ -n $RUST_NIGHTLY_VERSION ]]; then
nightly_version="$RUST_NIGHTLY_VERSION"
else
nightly_version=2020-08-17
nightly_version=2020-10-08
fi


Expand Down
3 changes: 1 addition & 2 deletions ci/test-checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ _ cargo +"$rust_stable" fmt --all -- --check
# -Z... is needed because of clippy bug: https://github.com/rust-lang/rust-clippy/issues/4612
# run nightly clippy for `sdk/` as there's a moderate amount of nightly-only code there
_ cargo +"$rust_nightly" clippy \
-Zunstable-options --workspace --all-targets \
-- --deny=warnings --allow=clippy::stable_sort_primitive
-Zunstable-options --workspace --all-targets -- --deny=warnings
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went ahead and popped --allow=clippy::stable_sort_primitive out here, since stable enforces it now


cargo_audit_ignores=(
# failure is officially deprecated/unmaintained
Expand Down
2 changes: 1 addition & 1 deletion core/benches/cluster_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fn broadcast_shreds_bench(bencher: &mut Bencher) {
let stakes = Arc::new(stakes);
let cluster_info = Arc::new(cluster_info);
let (peers, peers_and_stakes) = get_broadcast_peers(&cluster_info, Some(stakes));
let shreds = Arc::new(shreds);
let shreds: Arc<[Shred]> = shreds.into();
let last_datapoint = Arc::new(AtomicU64::new(0));
bencher.iter(move || {
let shreds = shreds.clone();
Expand Down
4 changes: 2 additions & 2 deletions core/benches/retransmit_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fn bench_retransmitter(bencher: &mut Bencher) {
let (packet_sender, packet_receiver) = channel();
let packet_receiver = Arc::new(Mutex::new(packet_receiver));
const NUM_THREADS: usize = 2;
let sockets = (0..NUM_THREADS)
let sockets: Vec<_> = (0..NUM_THREADS)
.map(|_| UdpSocket::bind("0.0.0.0:0").unwrap())
.collect();

Expand All @@ -73,7 +73,7 @@ fn bench_retransmitter(bencher: &mut Bencher) {
info!("batches: {}", batches.len());

let retransmitter_handles = retransmitter(
Arc::new(sockets),
sockets.into(),
bank_forks,
&leader_schedule_cache,
cluster_info,
Expand Down
2 changes: 1 addition & 1 deletion core/src/banking_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1961,7 +1961,7 @@ mod tests {

assert_eq!(processed_transactions_count, 0,);

retryable_txs.sort();
retryable_txs.sort_unstable();
let expected: Vec<usize> = (0..transactions.len()).collect();
assert_eq!(retryable_txs, expected);
}
Expand Down
32 changes: 15 additions & 17 deletions core/src/broadcast_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ mod standard_broadcast_run;
pub(crate) const NUM_INSERT_THREADS: usize = 2;
pub(crate) type RetransmitSlotsSender = CrossbeamSender<HashMap<Slot, Arc<Bank>>>;
pub(crate) type RetransmitSlotsReceiver = CrossbeamReceiver<HashMap<Slot, Arc<Bank>>>;
pub(crate) type RecordReceiver = Receiver<(Arc<Vec<Shred>>, Option<BroadcastShredBatchInfo>)>;
pub(crate) type RecordReceiver = Receiver<(Arc<[Shred]>, Option<BroadcastShredBatchInfo>)>;
pub(crate) type TransmitReceiver = Receiver<(TransmitShreds, Option<BroadcastShredBatchInfo>)>;

#[derive(Debug, PartialEq, Eq, Clone)]
Expand Down Expand Up @@ -104,14 +104,14 @@ impl BroadcastStageType {
}
}

pub type TransmitShreds = (Option<Arc<HashMap<Pubkey, u64>>>, Arc<Vec<Shred>>);
pub type TransmitShreds = (Option<Arc<HashMap<Pubkey, u64>>>, Arc<[Shred]>);
trait BroadcastRun {
fn run(
&mut self,
blockstore: &Arc<Blockstore>,
receiver: &Receiver<WorkingBankEntry>,
socket_sender: &Sender<(TransmitShreds, Option<BroadcastShredBatchInfo>)>,
blockstore_sender: &Sender<(Arc<Vec<Shred>>, Option<BroadcastShredBatchInfo>)>,
blockstore_sender: &Sender<(Arc<[Shred]>, Option<BroadcastShredBatchInfo>)>,
) -> Result<()>;
fn transmit(
&mut self,
Expand Down Expand Up @@ -154,7 +154,7 @@ impl BroadcastStage {
blockstore: &Arc<Blockstore>,
receiver: &Receiver<WorkingBankEntry>,
socket_sender: &Sender<(TransmitShreds, Option<BroadcastShredBatchInfo>)>,
blockstore_sender: &Sender<(Arc<Vec<Shred>>, Option<BroadcastShredBatchInfo>)>,
blockstore_sender: &Sender<(Arc<[Shred]>, Option<BroadcastShredBatchInfo>)>,
mut broadcast_stage_run: impl BroadcastRun,
) -> BroadcastStageReturnType {
loop {
Expand Down Expand Up @@ -307,21 +307,19 @@ impl BroadcastStage {
let bank_epoch = bank.get_leader_schedule_epoch(bank.slot());
let stakes = staking_utils::staked_nodes_at_epoch(&bank, bank_epoch);
let stakes = stakes.map(Arc::new);
let data_shreds = Arc::new(
blockstore
.get_data_shreds_for_slot(bank.slot(), 0)
.expect("My own shreds must be reconstructable"),
);
let data_shreds: Arc<[Shred]> = blockstore
.get_data_shreds_for_slot(bank.slot(), 0)
.expect("My own shreds must be reconstructable")
.into();

if !data_shreds.is_empty() {
socket_sender.send(((stakes.clone(), data_shreds), None))?;
}

let coding_shreds = Arc::new(
blockstore
.get_coding_shreds_for_slot(bank.slot(), 0)
.expect("My own shreds must be reconstructable"),
);
let coding_shreds: Arc<[Shred]> = blockstore
.get_coding_shreds_for_slot(bank.slot(), 0)
.expect("My own shreds must be reconstructable")
.into();

if !coding_shreds.is_empty() {
socket_sender.send(((stakes.clone(), coding_shreds), None))?;
Expand Down Expand Up @@ -371,7 +369,7 @@ pub fn get_broadcast_peers<S: std::hash::BuildHasher>(
/// # Remarks
pub fn broadcast_shreds(
s: &UdpSocket,
shreds: &Arc<Vec<Shred>>,
shreds: &Arc<[Shred]>,
peers_and_stakes: &[(u64, usize)],
peers: &[ContactInfo],
last_datapoint_submit: &Arc<AtomicU64>,
Expand Down Expand Up @@ -480,11 +478,11 @@ pub mod test {
coding_shreds.clone(),
data_shreds
.into_iter()
.map(|s| (stakes.clone(), Arc::new(vec![s])))
.map(|s| (stakes.clone(), vec![s].into()))
.collect(),
coding_shreds
.into_iter()
.map(|s| (stakes.clone(), Arc::new(vec![s])))
.map(|s| (stakes.clone(), vec![s].into()))
.collect(),
)
}
Expand Down
Loading