Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Moving to rust version 1.76.0 ([#2687](https://github.com/anoma/anoma/pull/2687))
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-20]
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-20]
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-20]
mold_version: [2.4.0]
make:
- name: ABCI
Expand Down Expand Up @@ -291,7 +291,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
nightly_version: [nightly-2023-06-01]
nightly_version: [nightly-2024-02-20]
mold_version: [2.4.0]
make:
- name: ABCI
Expand Down Expand Up @@ -380,7 +380,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
nightly_version: [nightly-2023-06-01]
nightly_version: [nightly-2024-02-20]
mold_version: [2.4.0]
make:
- name: ABCI
Expand Down Expand Up @@ -568,7 +568,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
nightly_version: [nightly-2023-06-01]
nightly_version: [nightly-2024-02-20]
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-20]
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-20]
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-20]
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-20]
mold_version: [2.4.0]
comet_bft: [0.37.2]
name: ["Run chain sync test"]
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

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

3 changes: 0 additions & 3 deletions crates/account/src/storage.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
//! Cryptographic signature keys storage API

use namada_core::types::address::Address;
use namada_core::types::key::common;
use namada_core::types::storage;
use namada_storage::{Result, StorageRead, StorageWrite};

Expand Down
1 change: 0 additions & 1 deletion crates/apps/src/lib/bench_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ use namada::ledger::queries::{
Client, EncodedResponseQuery, RequestCtx, RequestQuery, Router, RPC,
};
use namada::state::StorageRead;
use namada::tendermint_rpc::{self};
use namada::tx::data::pos::Bond;
use namada::tx::data::{TxResult, VpsResult};
use namada::tx::{Code, Data, Section, Signature, Tx};
Expand Down
3 changes: 1 addition & 2 deletions crates/apps/src/lib/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2926,7 +2926,6 @@ pub mod cmds {

pub mod args {
use std::collections::HashMap;
use std::convert::TryFrom;
use std::env;
use std::net::SocketAddr;
use std::path::PathBuf;
Expand Down Expand Up @@ -6336,7 +6335,7 @@ pub mod args {

let find_viewing_key = |w: &mut Wallet<CliWalletUtils>| {
w.find_viewing_key(&self.viewing_key.raw)
.map(Clone::clone)
.copied()
.unwrap_or_else(|_| {
eprintln!(
"Unknown viewing key {}",
Expand Down
2 changes: 1 addition & 1 deletion crates/apps/src/lib/cli/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ impl ArgFromMutContext for ExtendedViewingKey {
// Or it is a stored alias of one
ctx.wallet
.find_viewing_key(raw)
.map(Clone::clone)
.copied()
.map_err(|_find_err| format!("Unknown viewing key {}", raw))
})
}
Expand Down
1 change: 1 addition & 0 deletions crates/apps/src/lib/cli/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ pub trait AppExt {
/// Extensions for finding matching commands and arguments.
/// The functions match commands and arguments defined in [`AppExt`].
pub trait ArgMatchesExt {
#[allow(dead_code)]
fn args_parse<T: Args>(&self) -> T;
}

Expand Down
7 changes: 2 additions & 5 deletions crates/apps/src/lib/client/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use std::cmp::Ordering;
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
use std::fs::{self, read_dir};
use std::io;
use std::iter::Iterator;
use std::str::FromStr;

use borsh::BorshDeserialize;
Expand Down Expand Up @@ -1330,8 +1329,8 @@ pub async fn query_proposal_result(
false,
);

if proposal.is_ok() {
proposal.unwrap()
if let Ok(proposal) = proposal {
proposal
} else {
edisplay_line!(
context.io(),
Expand Down Expand Up @@ -1946,7 +1945,6 @@ pub async fn query_bonded_stake<N: Namada>(

match args.validator {
Some(validator) => {
let validator = validator;
// Find bonded stake for the given validator
let stake =
get_validator_stake(context.client(), epoch, &validator).await;
Expand Down Expand Up @@ -2248,7 +2246,6 @@ pub async fn query_and_print_metadata(
pub async fn query_slashes<N: Namada>(context: &N, args: args::QuerySlashes) {
match args.validator {
Some(validator) => {
let validator = validator;
// Find slashes for the given validator
let slashes: Vec<Slash> = unwrap_client_response::<N::Client, _>(
RPC.vp()
Expand Down
5 changes: 3 additions & 2 deletions crates/apps/src/lib/config/genesis.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::non_canonical_partial_ord_impl)]
//! The parameters used for the chain's genesis

pub mod chain;
Expand Down Expand Up @@ -400,15 +401,15 @@ pub fn make_dev_genesis(
.validator_account
.as_ref()
.unwrap()
.get(0)
.first()
.unwrap();
let genesis_addr =
GenesisAddress::EstablishedAddress(tx.tx.data.address.raw.clone());

let balance = *nam_balances.0.get(&genesis_addr).unwrap();
let bonded = {
let bond =
genesis.transactions.bond.as_mut().unwrap().get(0).unwrap();
genesis.transactions.bond.as_mut().unwrap().first().unwrap();
bond.amount
};

Expand Down
1 change: 0 additions & 1 deletion crates/apps/src/lib/config/genesis/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,6 @@ pub struct Metadata<ID> {
#[cfg(test)]
mod test {
use std::path::PathBuf;
use std::str::FromStr;

use super::*;

Expand Down
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
2 changes: 2 additions & 0 deletions crates/apps/src/lib/node/ledger/ethereum_oracle/events.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pub mod eth_events {
#![allow(dead_code)]
use std::fmt::Debug;
use std::str::FromStr;

Expand Down Expand Up @@ -119,6 +120,7 @@ pub mod eth_events {
}
}

#[allow(unused_macros)]
macro_rules! parse_method {
($name:ident -> $type:ty) => {
fn $name(self) -> Result<$type> {
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
35 changes: 12 additions & 23 deletions crates/apps/src/lib/node/ledger/shell/finalize_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,24 @@ use masp_primitives::merkle_tree::CommitmentTree;
use masp_primitives::sapling::Node;
use namada::governance::pgf::inflation as pgf_inflation;
use namada::ledger::events::EventType;
use namada::ledger::gas::{GasMetering, TxGasMeter};
use namada::ledger::gas::GasMetering;
use namada::ledger::pos::namada_proof_of_stake;
use namada::ledger::protocol::{self, WrapperArgs};
use namada::ledger::protocol::WrapperArgs;
use namada::proof_of_stake::storage::{
find_validator_by_raw_hash, read_last_block_proposer_address,
write_last_block_proposer_address,
};
use namada::state::wl_storage::WriteLogAndStorage;
use namada::state::write_log::StorageModification;
use namada::state::{
ResultExt, StorageRead, StorageWrite, EPOCH_SWITCH_BLOCKS_DELAY,
};
use namada::state::{ResultExt, StorageWrite, EPOCH_SWITCH_BLOCKS_DELAY};
use namada::token::conversion::update_allowed_conversions;
use namada::tx::data::protocol::ProtocolTxType;
use namada::types::key::tm_raw_hash_to_string;
use namada::types::storage::{BlockHash, BlockResults, Epoch, Header};
use namada::vote_ext::ethereum_events::MultiSignedEthEvent;
use namada::vote_ext::ethereum_tx_data_variants;

use super::governance::execute_governance_proposals;
use super::*;
use crate::facade::tendermint::abci::types::{Misbehavior, VoteInfo};
use crate::facade::tendermint::abci::types::VoteInfo;
use crate::node::ledger::shell::stats::InternalStats;

impl<D, H> Shell<D, H>
Expand Down Expand Up @@ -835,9 +831,7 @@ fn pos_votes_from_abci(
);

// Try to convert voting power to u64
let validator_vp = u64::try_from(*power).expect(
"Must be able to convert voting power from i64 to u64",
);
let validator_vp = u64::from(*power);

Some(namada_proof_of_stake::types::VoteInfo {
validator_address,
Expand All @@ -858,11 +852,10 @@ fn pos_votes_from_abci(
/// are covered by the e2e tests.
#[cfg(test)]
mod test_finalize_block {
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
use std::collections::{BTreeMap, HashMap, HashSet};
use std::num::NonZeroU64;
use std::str::FromStr;

use data_encoding::HEXUPPER;
use namada::core::ledger::replay_protection;
use namada::eth_bridge::storage::bridge_pool::{
self, get_key_from_hash, get_nonce_key, get_signed_root_key,
Expand Down Expand Up @@ -890,20 +883,18 @@ mod test_finalize_block {
BondId, SlashType, ValidatorState, WeightedValidator,
};
use namada::proof_of_stake::{unjail_validator, ADDRESS as pos_address};
use namada::state::StorageWrite;
use namada::token::{Amount, DenominatedAmount, NATIVE_MAX_DECIMAL_PLACES};
use namada::tx::data::{Fee, WrapperTx};
use namada::tx::{Code, Data, Section, Signature};
use namada::tx::data::Fee;
use namada::tx::{Code, Data, Signature};
use namada::types::dec::{Dec, POS_DECIMAL_PRECISION};
use namada::types::ethereum_events::{EthAddress, Uint as ethUint};
use namada::types::hash::Hash;
use namada::types::keccak::KeccakHash;
use namada::types::key::testing::common_sk_from_simple_seed;
use namada::types::key::tm_consensus_key_raw_hash;
use namada::types::storage::{Epoch, KeySeg};
use namada::types::time::{DateTimeUtc, DurationSecs};
use namada::types::storage::KeySeg;
use namada::types::time::DurationSecs;
use namada::types::uint::Uint;
use namada::vote_ext::{ethereum_events, EthereumTxData};
use namada::vote_ext::ethereum_events;
use namada_sdk::eth_bridge::MinimumConfirmations;
use namada_sdk::governance::ProposalVote;
use namada_sdk::proof_of_stake::storage::{
Expand All @@ -915,9 +906,7 @@ mod test_finalize_block {
use test_log::test;

use super::*;
use crate::facade::tendermint::abci::types::{
Misbehavior, Validator, VoteInfo,
};
use crate::facade::tendermint::abci::types::Validator;
use crate::node::ledger::oracle::control::Command;
use crate::node::ledger::shell::test_utils::*;
use crate::node::ledger::shims::abcipp_shim_types::shim::request::{
Expand Down
6 changes: 2 additions & 4 deletions crates/apps/src/lib/node/ledger/shell/governance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,16 @@ use namada::governance::utils::{
VotePower,
};
use namada::governance::{storage as gov_api, ADDRESS as gov_address};
use namada::ibc;
use namada::ledger::governance::utils::ProposalEvent;
use namada::ledger::pos::BondId;
use namada::ledger::protocol;
use namada::proof_of_stake::bond_amount;
use namada::proof_of_stake::parameters::PosParams;
use namada::proof_of_stake::storage::read_total_stake;
use namada::state::{DBIter, StorageHasher, StorageWrite, DB};
use namada::state::StorageWrite;
use namada::tx::{Code, Data};
use namada::types::address::Address;
use namada::types::encode;
use namada::types::storage::Epoch;
use namada::{ibc, token};
use namada_sdk::proof_of_stake::storage::read_validator_stake;

use super::utils::force_read;
Expand Down
Loading