Skip to content

Commit

Permalink
chore: upgrade rust toolchain to 1.80.0 (#4614)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanabi1224 authored Aug 5, 2024
1 parent 6067514 commit 54d48ca
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 39 deletions.
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.79.0"
channel = "1.80.0"
components = ["clippy", "llvm-tools-preview", "rustfmt"]
12 changes: 6 additions & 6 deletions src/db/gc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
//!
//! ## GC Workflow
//! 1. Mark: traverse all the blocks, generating integer hash representations for each identifier
//! and storing those in a set.
//! and storing those in a set.
//! 2. Wait at least `chain finality` blocks.
//! 3. Traverse reachable blocks starting at the current heaviest tipset and remove those from the
//! marked set, leaving only unreachable entries that are older than `chain finality`.
//! marked set, leaving only unreachable entries that are older than `chain finality`.
//! 4. Sweep, removing all the remaining marked entries from the database.
//!
//! ## Correctness
Expand All @@ -46,9 +46,9 @@
//! The expected disk usage is slightly greater than the size of live data for three reasons:
//! 1. Unreachable data is not removed until it is at least 7.5 hours old (see `chain finality`).
//! 2. The garbage collector is conservative and is expected to leave a small (less than 1%) amount
//! of unreachable data behind.
//! of unreachable data behind.
//! 3. The blockstore back-end may be fragmented, therefore not relinquishing the disk space back to
//! the OS.
//! the OS.
//!
//! ## Memory usage
//! During the `mark` and up to the `sweep` stage, the algorithm requires `4 bytes` of memory for
Expand All @@ -58,9 +58,9 @@
//!
//! ## Scheduling
//! 1. GC is triggered automatically and there have to be at least `chain finality` epochs stored
//! for the `mark` step.
//! for the `mark` step.
//! 2. The `filter` step is triggered after at least `chain finality` has passed since the `mark`
//! step.
//! step.
//! 3. Then, the `sweep` step happens.
//! 4. Finally, the algorithm waits for a configured amount of time to initiate the next run.
//!
Expand Down
8 changes: 4 additions & 4 deletions src/ipld/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ impl<DB, T> ChainStream<DB, T> {
/// * `db` - A database that implements [`Blockstore`] interface.
/// * `tipset_iter` - An iterator of [`Tipset`], descending order `$child -> $parent`.
/// * `stateroot_limit` - An epoch that signifies how far back we need to inspect tipsets,
/// in-depth. This has to be pre-calculated using this formula: `$cur_epoch - $depth`, where `$depth`
/// is the number of `[`Tipset`]` that needs inspection.
/// in-depth. This has to be pre-calculated using this formula: `$cur_epoch - $depth`, where `$depth`
/// is the number of `[`Tipset`]` that needs inspection.
pub fn stream_chain<DB: Blockstore, T: Iterator<Item = Tipset> + Unpin>(
db: DB,
tipset_iter: T,
Expand Down Expand Up @@ -314,8 +314,8 @@ impl<DB, T> UnorderedChainStream<DB, T> {
/// * `db` - A database that implements [`Blockstore`] interface.
/// * `tipset_iter` - An iterator of [`Tipset`], descending order `$child -> $parent`.
/// * `stateroot_limit` - An epoch that signifies how far back we need to inspect tipsets, in-depth.
/// This has to be pre-calculated using this formula: `$cur_epoch - $depth`, where `$depth` is the
/// number of `[`Tipset`]` that needs inspection.
/// This has to be pre-calculated using this formula: `$cur_epoch - $depth`, where `$depth` is the
/// number of `[`Tipset`]` that needs inspection.
#[allow(dead_code)]
pub fn unordered_stream_chain<
DB: Blockstore + Sync + Send + 'static,
Expand Down
10 changes: 6 additions & 4 deletions src/key_management/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@

use std::{convert::TryFrom, str::FromStr};

use super::{errors::Error, wallet_helpers, KeyInfo, KeyStore};
use crate::shim::{address::Address, crypto::SignatureType};
use ahash::HashMap;
use serde::{Deserialize, Serialize};

#[cfg(test)]
use {crate::shim::crypto::Signature, ahash::HashMapExt as _};

use super::{errors::Error, wallet_helpers, KeyInfo, KeyStore};
use {
crate::shim::crypto::Signature,
ahash::{HashMap, HashMapExt as _},
};

/// A key, this contains a `KeyInfo`, an address, and a public key.
#[derive(Clone, PartialEq, Debug, Eq, Serialize, Deserialize)]
Expand Down Expand Up @@ -40,6 +41,7 @@ impl TryFrom<KeyInfo> for Key {
// - keystore which is a HashMap of KeyInfos resolved by their Address
/// A wallet is a collection of private keys with optional persistence and
/// optional encryption.
#[cfg(test)]
#[derive(Clone, PartialEq, Debug, Eq)]
pub struct Wallet {
keys: HashMap<Address, Key>,
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,7 @@ mod tests {
// `cargo test --lib -- --exact 'rpc::tests::openrpc'`
// `cargo insta review`
#[test]
#[ignore = "https://github.com/ChainSafe/forest/issues/4032"]
fn openrpc() {
for path in [ApiPath::V0, ApiPath::V1] {
let _spec = super::openrpc(path, None);
Expand All @@ -575,7 +576,6 @@ mod tests {
// more stable.
// (We still run this test to make sure we're not
// violating other invariants)
#[cfg(never)]
insta::assert_yaml_snapshot!(_spec);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/utils/db/car_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ impl CarBlock {
pub fn write(&self, mut writer: &mut impl io::Write) -> io::Result<()> {
let frame_length = self.cid.encoded_len() + self.data.len();
writer.write_all(&frame_length.encode_var_vec())?;
#[allow(clippy::needless_borrows_for_generic_args)]
self.cid
.write_bytes(&mut writer)
.map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?;
Expand Down
1 change: 0 additions & 1 deletion src/utils/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

mod mmap;
pub mod progress_log;
mod tempfile;
mod writer_checksum;

use std::{
Expand Down
1 change: 1 addition & 0 deletions src/utils/io/progress_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//! - They behaved poorly together with regular logging
//! - They were too verbose and printed even for very small tasks (less than 5 seconds)
//! - They were only used when connected to a TTY and not written in log files
//!
//! This lead us to develop our own logging code.
//! This module provides two new types for logging progress that are [`WithProgress`] and [`WithProgressRaw`].
//! The main goal of [`WithProgressRaw`] is to maintain a similar API to the previous one from progress bar so we could remove the [`indicatif`](https://crates.io/crates/indicatif) dependency,
Expand Down
22 changes: 0 additions & 22 deletions src/utils/io/tempfile.rs

This file was deleted.

0 comments on commit 54d48ca

Please sign in to comment.