Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade rust to 1.75.0 #3961

Closed
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
3 changes: 1 addition & 2 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/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[dependencies]
anyhow = { workspace = true }
async-trait = { workspace = true }
bcs-ext = { package = "bcs-ext", workspace = true }
bcs-ext = { workspace = true }
futures = { workspace = true }
parking_lot = { workspace = true }
rand = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions account/api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[dependencies]
anyhow = { workspace = true }
async-trait = { workspace = true }
bcs-ext = { package = "bcs-ext", workspace = true }
bcs-ext = { workspace = true }
futures = { workspace = true }
hex = { workspace = true }
rand = { workspace = true }
rand_core = { default-features = false, workspace = true }
schemars = { workspace = true }
serde = { default-features = false, workspace = true }
serde = { features = ["derive"], workspace = true }
serde_bytes = { workspace = true }
serde_json = { workspace = true }
starcoin-crypto = { workspace = true }
Expand Down
8 changes: 2 additions & 6 deletions account/api/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@ use starcoin_types::account_config::token_code::TokenCode;
use starcoin_types::sign_message::{SignedMessage, SigningMessage};
use starcoin_types::transaction::{RawUserTransaction, SignedUserTransaction};

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Default)]
pub enum AccountProviderStrategy {
#[default]
RPC,
Local,
PrivateKey,
}

impl Default for AccountProviderStrategy {
fn default() -> Self {
AccountProviderStrategy::RPC
}
}
pub trait AccountProvider {
fn create_account(&self, password: String) -> Result<AccountInfo>;

Expand Down
2 changes: 1 addition & 1 deletion account/service/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[dependencies]
anyhow = { workspace = true }
async-trait = { workspace = true }
bcs-ext = { package = "bcs-ext", workspace = true }
bcs-ext = { workspace = true }
futures = { workspace = true }
starcoin-account = { workspace = true }
starcoin-account-api = { features = ["mock"], workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion account/src/account_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ pub fn test_wallet_account() -> Result<()> {
let hash_value = HashValue::sha3_256_of(&public_key.to_bytes());
let key = AuthenticationKey::new(*HashValue::sha3_256_of(&public_key.to_bytes()).as_ref());

let sign = vec![
let sign = [
227, 94, 250, 168, 43, 200, 137, 74, 61, 254, 197, 71, 245, 135, 201, 43, 222, 190, 56,
235, 247, 254, 56, 247, 108, 36, 250, 192, 143, 236, 101, 153, 61, 241, 129, 47, 38, 146,
213, 9, 79, 56, 90, 210, 179, 53, 73, 208, 248, 231, 22, 9, 55, 177, 154, 212, 248, 2, 66,
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ rust-version = { workspace = true }
[dependencies]
anyhow = { workspace = true }
criterion = { workspace = true }
starcoin-crypto = { package = "starcoin-crypto", workspace = true }
starcoin-crypto = { workspace = true }
forkable-jellyfish-merkle = { workspace = true }
futures = { workspace = true }
futures-timer = { workspace = true }
starcoin-logger = { package = "starcoin-logger", workspace = true }
starcoin-logger = { workspace = true }
parking_lot = { workspace = true }
proptest = { workspace = true }
rand = { workspace = true }
rand_core = { default-features = false, workspace = true }
starcoin-account-api = { workspace = true }
starcoin-accumulator = { package = "starcoin-accumulator", workspace = true }
starcoin-accumulator = { workspace = true }
starcoin-chain = { workspace = true }
starcoin-config = { workspace = true }
starcoin-consensus = { workspace = true }
starcoin-executor = { package = "starcoin-executor", workspace = true }
starcoin-executor = { workspace = true }
starcoin-genesis = { workspace = true }
network-api = { workspace = true }
starcoin-service-registry = { workspace = true }
Expand Down
14 changes: 7 additions & 7 deletions block-relayer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
[dependencies]
anyhow = { workspace = true }
async-trait = { workspace = true }
bcs-ext = { package = "bcs-ext", workspace = true }
starcoin-crypto = { package = "starcoin-crypto", workspace = true }
bcs-ext = { workspace = true }
starcoin-crypto = { workspace = true }
futures = { workspace = true }
starcoin-logger = { package = "starcoin-logger", workspace = true }
network-api = { package = "network-api", workspace = true }
starcoin-logger = { workspace = true }
network-api = { workspace = true }
starcoin-chain = { workspace = true }
starcoin-chain-api = { workspace = true }
starcoin-metrics = { workspace = true }
starcoin-network = { workspace = true }
starcoin-network-rpc-api = { workspace = true }
starcoin-service-registry = { workspace = true }
starcoin-sync = { package = "starcoin-sync", workspace = true }
starcoin-sync-api = { package = "starcoin-sync-api", workspace = true }
starcoin-sync = { workspace = true }
starcoin-sync-api = { workspace = true }
starcoin-time-service = { workspace = true }
starcoin-txpool = { workspace = true }
starcoin-txpool-api = { workspace = true }
starcoin-types = { package = "starcoin-types", workspace = true }
starcoin-types = { workspace = true }
starcoin-config = { workspace = true }

[dev-dependencies]
Expand Down
20 changes: 9 additions & 11 deletions chain/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
[dependencies]
anyhow = { workspace = true }
bcs-ext = { package = "bcs-ext", workspace = true }
bcs-ext = { workspace = true }
clap = { features = ["derive"], workspace = true }
starcoin-crypto = { package = "starcoin-crypto", workspace = true }
starcoin-logger = { package = "starcoin-logger", workspace = true }
proptest = { default-features = false, optional = true, workspace = true }
proptest-derive = { default-features = false, optional = true, workspace = true }
starcoin-crypto = { workspace = true }
starcoin-logger = { workspace = true }
proptest = { features = ["std"], optional = true, workspace = true }
proptest-derive = { optional = true, workspace = true }
rand = { workspace = true }
rand_core = { default-features = false, workspace = true }
sp-utils = { workspace = true }
starcoin-accumulator = { package = "starcoin-accumulator", workspace = true }
starcoin-accumulator = { workspace = true }
starcoin-consensus = { workspace = true }
starcoin-chain-api = { workspace = true }
starcoin-config = { workspace = true }
starcoin-executor = { package = "starcoin-executor", workspace = true }
starcoin-executor = { workspace = true }
starcoin-open-block = { workspace = true }
starcoin-service-registry = { workspace = true }
starcoin-state-api = { workspace = true }
starcoin-statedb = { workspace = true }
starcoin-time-service = { workspace = true }
starcoin-types = { package = "starcoin-types", workspace = true }
starcoin-types = { workspace = true }
starcoin-vm-types = { workspace = true }
starcoin-vm-runtime = { workspace = true }
starcoin-force-upgrade = { workspace = true }
Expand All @@ -36,9 +36,7 @@ starcoin-chain-mock = { workspace = true }
starcoin-genesis = { workspace = true }
starcoin-resource-viewer = { workspace = true }
starcoin-transaction-builder = { workspace = true }
starcoin-types = { package = "starcoin-types", features = [
"fuzzing",
], workspace = true }
starcoin-types = { features = [ "fuzzing" ], workspace = true }
stdlib = { workspace = true }
stest = { workspace = true }
test-helper = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions chain/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
anyhow = { workspace = true }
async-trait = { workspace = true }
futures = { workspace = true }
network-api = { package = "network-api", workspace = true }
network-api = { workspace = true }
rand = { workspace = true }
rand_core = { default-features = false, workspace = true }
serde = { default-features = false, workspace = true }
serde = { features = ["derive"], workspace = true }
starcoin-accumulator = { workspace = true }
starcoin-crypto = { workspace = true }
starcoin-service-registry = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion chain/api/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) The Starcoin Core Contributors
// SPDX-License-Identifier: Apache-2
#![deny(clippy::integer_arithmetic)]
#![deny(clippy::arithmetic_side_effects)]

use anyhow::{bail, format_err, Result};
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion chain/force-upgrade/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ rust-version = { workspace = true }
[dependencies]
anyhow = { workspace = true }
async-trait = { workspace = true }
bcs-ext = { package = "bcs-ext", workspace = true }
bcs-ext = { workspace = true }
starcoin-crypto = { workspace = true }
futures = { workspace = true }
starcoin-logger = { workspace = true }
Expand Down
16 changes: 8 additions & 8 deletions chain/mock/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
[dependencies]
anyhow = { workspace = true }
async-trait = { workspace = true }
bcs-ext = { package = "bcs-ext", workspace = true }
starcoin-crypto = { package = "starcoin-crypto", workspace = true }
bcs-ext = { workspace = true }
starcoin-crypto = { workspace = true }
futures = { workspace = true }
futures-timer = { workspace = true }
starcoin-logger = { package = "starcoin-logger", workspace = true }
starcoin-logger = { workspace = true }
parking_lot = { workspace = true }
proptest = { default-features = false, optional = true, workspace = true }
proptest-derive = { default-features = false, optional = true, workspace = true }
proptest = { features = ["std"], optional = true, workspace = true }
proptest-derive = { optional = true, workspace = true }
starcoin-account-api = { workspace = true }
starcoin-accumulator = { package = "starcoin-accumulator", workspace = true }
starcoin-accumulator = { workspace = true }
starcoin-chain = { workspace = true }
starcoin-config = { workspace = true }
starcoin-consensus = { workspace = true }
starcoin-executor = { package = "starcoin-executor", workspace = true }
starcoin-executor = { workspace = true }
starcoin-genesis = { workspace = true }
starcoin-open-block = { workspace = true }
starcoin-state-api = { workspace = true }
starcoin-statedb = { workspace = true }
starcoin-storage = { workspace = true }
starcoin-types = { package = "starcoin-types", workspace = true }
starcoin-types = { workspace = true }
starcoin-vm-types = { workspace = true }
thiserror = { workspace = true }

Expand Down
10 changes: 5 additions & 5 deletions chain/open-block/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[dependencies]
anyhow = { workspace = true }
async-trait = { workspace = true }
bcs-ext = { package = "bcs-ext", workspace = true }
starcoin-crypto = { package = "starcoin-crypto", workspace = true }
bcs-ext = { workspace = true }
starcoin-crypto = { workspace = true }
futures = { workspace = true }
starcoin-logger = { package = "starcoin-logger", workspace = true }
starcoin-logger = { workspace = true }
parking_lot = { workspace = true }
starcoin-accumulator = { package = "starcoin-accumulator", workspace = true }
starcoin-accumulator = { workspace = true }
starcoin-chain-api = { workspace = true }
starcoin-executor = { package = "starcoin-executor", workspace = true }
starcoin-executor = { workspace = true }
starcoin-state-api = { workspace = true }
starcoin-statedb = { workspace = true }
starcoin-storage = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion chain/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ async-trait = { workspace = true }
futures = { workspace = true }
rand = { workspace = true }
rand_core = { default-features = false, workspace = true }
serde = { default-features = false, workspace = true }
serde = { features = ["derive"], workspace = true }
starcoin-chain = { workspace = true }
starcoin-chain-api = { workspace = true }
starcoin-config = { workspace = true }
Expand Down
8 changes: 6 additions & 2 deletions chain/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,9 @@ impl BlockChain {
.map(|status| status.total_difficulty())
.unwrap_or_default();

let total_difficulty = pre_total_difficulty + header.difficulty();
let total_difficulty = pre_total_difficulty
.checked_add(header.difficulty())
.ok_or(format_err!("failed to calculate total difficulty"))?;

block_accumulator.append(&[block_id])?;
block_accumulator.flush()?;
Expand Down Expand Up @@ -1292,7 +1294,9 @@ impl BlockChain {
let pre_total_difficulty = parent_status
.map(|status| status.total_difficulty())
.unwrap_or_default();
let total_difficulty = pre_total_difficulty + header.difficulty();
let total_difficulty = pre_total_difficulty
.checked_add(header.difficulty())
.ok_or(format_err!("failed to calculate total difficulty"))?;
block_accumulator.append(&[block_id])?;

let txn_accumulator_info: AccumulatorInfo = txn_accumulator.get_info();
Expand Down
2 changes: 1 addition & 1 deletion chain/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) The Starcoin Core Contributors
// SPDX-License-Identifier: Apache-2.0
#![deny(clippy::integer_arithmetic)]
#![deny(clippy::arithmetic_side_effects)]
mod chain;
pub mod verifier;
pub use chain::BlockChain;
Expand Down
2 changes: 1 addition & 1 deletion chain/tests/test_txn_info_and_proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fn test_transaction_info_and_proof() -> Result<()> {
//put the genesis txn, the genesis block metadata txn do not generate txn info

all_txns.push(Transaction::UserTransaction(
genesis_block.body.transactions.get(0).cloned().unwrap(),
genesis_block.body.transactions.first().cloned().unwrap(),
));

(0..block_count).for_each(|_block_idx| {
Expand Down
2 changes: 1 addition & 1 deletion cmd/airdrop/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ async fn main() -> Result<()> {
.map(|r| r.sequence_number())
.unwrap_or_default()
};
for (i, airdrops) in airdrop_infos.chunks(batch_size).into_iter().enumerate() {
for (i, airdrops) in airdrop_infos.chunks(batch_size).enumerate() {
let addresses = MoveValue::Vector(
airdrops
.iter()
Expand Down
6 changes: 3 additions & 3 deletions cmd/db-exporter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ path = "src/main.rs"
[dependencies]
anyhow = { workspace = true }
atomic-counter = { workspace = true }
bcs-ext = { package = "bcs-ext", workspace = true }
bcs-ext = { workspace = true }
clap = { features = ["derive"], workspace = true }
csv = { workspace = true }
hex = { workspace = true }
indicatif = { workspace = true }
starcoin-logger = { package = "starcoin-logger", workspace = true }
starcoin-logger = { workspace = true }
serde = { workspace = true }
serde_json = { features = ["arbitrary_precision"], workspace = true }
tokio = { features = ["full"], workspace = true }
move-binary-format = { workspace = true }
move-bytecode-verifier = { workspace = true }
starcoin-account = { workspace = true }
starcoin-account-api = { workspace = true }
starcoin-accumulator = { package = "starcoin-accumulator", workspace = true }
starcoin-accumulator = { workspace = true }
starcoin-chain = { workspace = true }
starcoin-cmd = { workspace = true }
starcoin-config = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions cmd/db-exporter/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ pub fn apply_block(
}

if let Some(last_block) = blocks.last() {
let start = blocks.get(0).unwrap().header().number();
let start = blocks.first().unwrap().header().number();
let end = last_block.header().number();
println!(
"current number {}, import [{},{}] block number",
Expand Down Expand Up @@ -2148,7 +2148,7 @@ pub fn apply_turbo_stm_block(
}

if let Some(last_block) = blocks.last() {
let start = blocks.get(0).unwrap().header().number();
let start = blocks.first().unwrap().header().number();
let end = last_block.header().number();
println!(
"current number {}, import [{},{}] block number",
Expand Down
2 changes: 1 addition & 1 deletion cmd/faucet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ascii = { workspace = true }
clap = { features = ["derive"], workspace = true }
futures = { workspace = true }
futures-timer = { workspace = true }
hex = { default-features = false, workspace = true }
hex = { features = ["serde"], workspace = true }
once_cell = { workspace = true }
rust-embed = { workspace = true }
serde = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion cmd/generator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ anyhow = { workspace = true }
clap = { features = ["derive"], workspace = true }
futures = { workspace = true }
futures-timer = { workspace = true }
hex = { default-features = false, workspace = true }
hex = { features = ["serde"], workspace = true }
scmd = { workspace = true }
serde = { workspace = true }
serde_json = { features = ["arbitrary_precision"], workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion cmd/merkle-generator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[dependencies]
anyhow = { workspace = true }
bcs-ext = { package = "bcs-ext", workspace = true }
bcs-ext = { workspace = true }
clap = { features = ["derive"], workspace = true }
csv = { workspace = true }
hex = { workspace = true }
Expand Down
Loading
Loading