Skip to content
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
12 changes: 6 additions & 6 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
matrix:
os: [ubuntu-latest]
wasm_cache_version: ["v2"]
nightly_version: [nightly-2023-06-01]
nightly_version: [nightly-2024-02-08]
mold_version: [2.4.0]

steps:
Expand Down Expand Up @@ -164,7 +164,7 @@ jobs:
matrix:
os: [ubuntu-latest]
wasm_cache_version: ["v2"]
nightly_version: [nightly-2023-06-01]
nightly_version: [nightly-2024-02-08]
mold_version: [2.4.0]

steps:
Expand Down Expand Up @@ -194,7 +194,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
nightly_version: [nightly-2023-06-01]
nightly_version: [nightly-2024-02-08]
mold_version: [2.4.0]
make:
- name: ABCI
Expand Down Expand Up @@ -292,7 +292,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
nightly_version: [nightly-2023-06-01]
nightly_version: [nightly-2024-02-08]
mold_version: [2.4.0]
make:
- name: ABCI
Expand Down Expand Up @@ -381,7 +381,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
nightly_version: [nightly-2023-06-01]
nightly_version: [nightly-2024-02-08]
mold_version: [2.4.0]
make:
- name: ABCI
Expand Down Expand Up @@ -569,7 +569,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
nightly_version: [nightly-2023-06-01]
nightly_version: [nightly-2024-02-08]
mold_version: [2.4.0]
comet_bft: [0.37.2]
hermes: [1.7.4-namada-beta7]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
nightly_version: [nightly-2023-06-01]
nightly_version: [nightly-2024-02-08]
make:
- name: Clippy
command: clippy
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
nightly_version: [nightly-2023-06-01]
nightly_version: [nightly-2024-02-08]
make:
- name: Audit
command: audit
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
nightly_version: [nightly-2023-06-01]
nightly_version: [nightly-2024-02-08]
mdbook_version: [rust-lang/mdbook@v0.4.18]
mdbook_mermaid: [badboy/mdbook-mermaid@v0.11.1]
mdbook_linkcheck: [Michael-F-Bryan/mdbook-linkcheck@v0.7.6]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/triggerable_sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
nightly_version: [nightly-2023-06-01]
nightly_version: [nightly-2024-02-08]
mold_version: [2.4.0]
comet_bft: [0.37.2]
name: ["Run chain sync test"]
Expand Down
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.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,8 @@ lto = true
opt-level = 3
panic = "unwind"
overflow-checks = true

[patch.crates-io]
# TEMP: ahash v0.7.7 is not compatible with Rust 1.76.
# Update once backport https://github.com/tkaitchuck/aHash/pull/202 is released
ahash = { git = "https://github.com/Manishearth/aHash.git", branch = "build-time-rm" }
4 changes: 2 additions & 2 deletions crates/apps/src/lib/node/ledger/abortable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ impl AbortableSpawner {
/// This future will resolve when:
///
/// 1. A user sends a shutdown signal (e.g. SIGINT), or...
/// 2. One of the child processes of the ledger terminates,
/// which generates a notification upon dropping an [`Aborter`].
/// 2. One of the child processes of the ledger terminates, which
/// generates a notification upon dropping an [`Aborter`].
///
/// These two scenarios are represented by the [`AborterStatus`] enum.
pub async fn wait_for_abort(mut self) -> AborterStatus {
Expand Down
15 changes: 7 additions & 8 deletions crates/apps/src/lib/node/ledger/shell/block_alloc/states.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@
//!
//! The state machine moves through the following state DAG:
//!
//! 1. [`BuildingEncryptedTxBatch`] - the initial state. In
//! this state, we populate a block with DKG encrypted txs.
//! This state supports two modes of operation, which you can
//! think of as two sub-states:
//! 1. [`BuildingEncryptedTxBatch`] - the initial state. In this state, we
//! populate a block with DKG encrypted txs. This state supports two modes of
//! operation, which you can think of as two sub-states:
//! * [`WithoutEncryptedTxs`] - When this mode is active, no encrypted txs are
//! included in a block proposal.
//! * [`WithEncryptedTxs`] - When this mode is active, we are able to include
//! encrypted txs in a block proposal.
//! 2. [`BuildingDecryptedTxBatch`] - the second state. In
//! this state, we populate a block with DKG decrypted txs.
//! 3. [`BuildingProtocolTxBatch`] - the third state. In
//! this state, we populate a block with protocol txs.
//! 2. [`BuildingDecryptedTxBatch`] - the second state. In this state, we
//! populate a block with DKG decrypted txs.
//! 3. [`BuildingProtocolTxBatch`] - the third state. In this state, we populate
//! a block with protocol txs.

mod decrypted_txs;
mod encrypted_txs;
Expand Down
75 changes: 41 additions & 34 deletions crates/apps/src/lib/node/ledger/shell/init_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,17 +282,19 @@ where
vp_cache: &mut HashMap<String, Vec<u8>>,
) -> ControlFlow<(), Vec<u8>> {
use std::collections::hash_map::Entry;
let Some(vp_filename) =
self.validate(
let Some(vp_filename) = self
.validate(
genesis
.vps
.wasm
.get(name)
.map(|conf| conf.filename.clone())
.ok_or_else(|| {
Panic::MissingVpWasmConfig(name.to_string())
}))
.or_placeholder(None)? else {
}),
)
.or_placeholder(None)?
else {
return self.proceed_with(vec![]);
};
let code = match vp_cache.entry(vp_filename.clone()) {
Expand Down Expand Up @@ -322,10 +324,13 @@ where
} = params;
let mut is_implicit_vp_stored = false;

let Some(checksums) = self.validate(
wasm_loader::Checksums::read_checksums(&self.wasm_dir)
.map_err(|_| Panic::ChecksumsFile)
).or_placeholder(None)? else {
let Some(checksums) = self
.validate(
wasm_loader::Checksums::read_checksums(&self.wasm_dir)
.map_err(|_| Panic::ChecksumsFile),
)
.or_placeholder(None)?
else {
return self.proceed_with(());
};

Expand Down Expand Up @@ -459,15 +464,20 @@ where
for (token_alias, TokenBalances(balances)) in &genesis.balances.token {
tracing::debug!("Initializing token balances {token_alias}");

let Some(token_address) = self.validate(genesis
.tokens
.token
.get(token_alias)
.ok_or_else(|| Panic::MissingTokenConfig(token_alias.to_string()))
.map(|conf| &conf.address)
)
.or_placeholder(None)? else {
continue
let Some(token_address) = self
.validate(
genesis
.tokens
.token
.get(token_alias)
.ok_or_else(|| {
Panic::MissingTokenConfig(token_alias.to_string())
})
.map(|conf| &conf.address),
)
.or_placeholder(None)?
else {
continue;
};

let mut total_token_balance = token::Amount::zero();
Expand Down Expand Up @@ -998,21 +1008,19 @@ mod test {
*vp_cache.get("vp_user.wasm").expect("Test failed"),
Vec::<u8>::new()
);
let [Panic::ReadingWasm(_, _)]: [Panic; 1] = initializer.panics
.clone()
.try_into()
.expect("Test failed") else {
let [Panic::ReadingWasm(_, _)]: [Panic; 1] =
initializer.panics.clone().try_into().expect("Test failed")
else {
panic!("Test failed")
};

initializer.panics.clear();
genesis.vps.wasm.remove("vp_user").expect("Test failed");
let code = initializer.lookup_vp("vp_user", &genesis, &mut vp_cache);
assert_eq!(code, ControlFlow::Continue(vec![]));
let [Panic::MissingVpWasmConfig(_)]: [Panic; 1] = initializer.panics
.clone()
.try_into()
.expect("Test failed") else {
let [Panic::MissingVpWasmConfig(_)]: [Panic; 1] =
initializer.panics.clone().try_into().expect("Test failed")
else {
panic!("Test failed")
};
}
Expand Down Expand Up @@ -1053,10 +1061,9 @@ mod test {
.store_wasms(&genesis.get_chain_parameters(test_dir.path()));
assert_eq!(res, ControlFlow::Continue(()));
let errors = initializer.errors.iter().collect::<Vec<_>>();
let [
Error::ReadingWasm(_),
Error::LoadingWasm(_),
]: [&Error; 2] = errors.try_into().expect("Test failed") else {
let [Error::ReadingWasm(_), Error::LoadingWasm(_)]: [&Error; 2] =
errors.try_into().expect("Test failed")
else {
panic!("Test failed");
};
let expected_panics = vec![
Expand All @@ -1083,7 +1090,8 @@ mod test {
Error::ReadingWasm(_),
Error::LoadingWasm(_),
Error::LoadingWasm(_),
]: [&Error; 3] = errors.try_into().expect("Test failed") else {
]: [&Error; 3] = errors.try_into().expect("Test failed")
else {
panic!("Test failed");
};
let expected_panics = vec![Panic::MissingImplicitVP("None".into())];
Expand All @@ -1107,10 +1115,9 @@ mod test {
.expect("Test failed");
let res = initializer.init_token_balances(&genesis);
assert_eq!(res, ControlFlow::Continue(()));
let [Panic::MissingTokenConfig(_)]: [Panic; 1] = initializer.panics
.clone()
.try_into()
.expect("Test failed") else {
let [Panic::MissingTokenConfig(_)]: [Panic; 1] =
initializer.panics.clone().try_into().expect("Test failed")
else {
panic!("Test failed")
};
}
Expand Down
8 changes: 6 additions & 2 deletions crates/apps/src/lib/node/ledger/shell/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -932,8 +932,12 @@ where
);
return;
}
let Some(config) = EthereumOracleConfig::read(&self.wl_storage) else {
tracing::info!("Not starting oracle as the Ethereum bridge config couldn't be found in storage");
let Some(config) = EthereumOracleConfig::read(&self.wl_storage)
else {
tracing::info!(
"Not starting oracle as the Ethereum bridge config \
couldn't be found in storage"
);
return;
};
let active =
Expand Down
3 changes: 2 additions & 1 deletion crates/core/src/types/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ impl<'addr> From<&'addr Address> for raw::Address<'addr, raw::Validated> {
// We're using the string format of addresses (bech32m) for ordering to ensure
// that addresses as strings, storage keys and storage keys as strings preserve
// the order.
#[allow(clippy::non_canonical_partial_ord_impl)]
impl PartialOrd for Address {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
self.encode().partial_cmp(&other.encode())
Expand Down Expand Up @@ -725,7 +726,7 @@ pub fn gen_established_address(seed: impl AsRef<str>) -> Address {
let mut key_gen = EstablishedAddressGen::new(seed);

let mut rng: ThreadRng = thread_rng();
let mut rng_bytes = vec![0u8; 32];
let mut rng_bytes = [0u8; 32];
rng.fill_bytes(&mut rng_bytes[..]);
let rng_source = rng_bytes
.iter()
Expand Down
1 change: 1 addition & 0 deletions crates/core/src/types/eth_abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ impl<T> ::std::cmp::PartialEq for EncodeCell<T> {
}
}

#[allow(clippy::non_canonical_partial_ord_impl)]
impl<T> ::std::cmp::PartialOrd for EncodeCell<T> {
fn partial_cmp(&self, other: &Self) -> Option<::std::cmp::Ordering> {
self.encoded_data.partial_cmp(&other.encoded_data)
Expand Down
1 change: 1 addition & 0 deletions crates/core/src/types/ethereum_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ use crate::types::token::Amount;
)]
pub struct Uint(pub [u64; 4]);

#[allow(clippy::non_canonical_partial_ord_impl)]
impl PartialOrd for Uint {
#[inline]
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Expand Down
1 change: 1 addition & 0 deletions crates/core/src/types/ibc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ pub struct IbcEvent {
pub attributes: HashMap<String, String>,
}

#[allow(clippy::non_canonical_partial_ord_impl)]
impl std::cmp::PartialOrd for IbcEvent {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
self.event_type.partial_cmp(&other.event_type)
Expand Down
2 changes: 2 additions & 0 deletions crates/core/src/types/key/ed25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ impl Hash for PublicKey {
}
}

#[allow(clippy::non_canonical_partial_ord_impl)]
impl PartialOrd for PublicKey {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
self.0.to_bytes().partial_cmp(&other.0.to_bytes())
Expand Down Expand Up @@ -314,6 +315,7 @@ impl Hash for Signature {
}
}

#[allow(clippy::non_canonical_partial_ord_impl)]
impl PartialOrd for Signature {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
self.0.to_bytes().partial_cmp(&other.0.to_bytes())
Expand Down
2 changes: 2 additions & 0 deletions crates/core/src/types/key/secp256k1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ impl Hash for PublicKey {
}
}

#[allow(clippy::non_canonical_partial_ord_impl)]
impl PartialOrd for PublicKey {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
self.0.to_sec1_bytes().partial_cmp(&other.0.to_sec1_bytes())
Expand Down Expand Up @@ -488,6 +489,7 @@ impl Hash for Signature {
}
}

#[allow(clippy::non_canonical_partial_ord_impl)]
impl PartialOrd for Signature {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
match self.0.to_bytes().partial_cmp(&other.0.to_bytes()) {
Expand Down
1 change: 1 addition & 0 deletions crates/core/src/types/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ impl FromStr for DenominatedAmount {
}
}

#[allow(clippy::non_canonical_partial_ord_impl)]
impl PartialOrd for DenominatedAmount {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
if self.denom < other.denom {
Expand Down
1 change: 1 addition & 0 deletions crates/core/src/types/uint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ impl Neg for I256 {
}
}

#[allow(clippy::non_canonical_partial_ord_impl)]
impl PartialOrd for I256 {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
match (self.non_negative(), other.non_negative()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ where
};
let valset_upd_keys = vote_tallies::Keys::from(&next_epoch);
let maybe_proof = 'check_storage: {
let Some(seen) = votes::storage::maybe_read_seen(wl_storage, &valset_upd_keys)? else {
let Some(seen) =
votes::storage::maybe_read_seen(wl_storage, &valset_upd_keys)?
else {
break 'check_storage None;
};
if seen {
Expand Down
Loading