Skip to content

Commit

Permalink
Sync with 0.13.2
Browse files Browse the repository at this point in the history
* tag 'v0.13.2':
  Namada 0.13.2
  changelog: add #1057
  ledger: append version to moniker
  changelog: add #1062
  changelog: add #1045
  fix: unit/e2e test
  changelog: add #1019
  Fixes wrapper fee check
  fix: ci e2e scheduler script
  • Loading branch information
juped committed Jan 23, 2023
2 parents 1829357 + 74a50ea commit 3b57e84
Show file tree
Hide file tree
Showing 46 changed files with 142 additions and 91 deletions.
2 changes: 2 additions & 0 deletions .changelog/v0.13.2/bug-fixes/1019-testnet-fee-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Fixes testnet wrapper fee checks
([#1019](https://github.com/anoma/namada/pull/1019))
2 changes: 2 additions & 0 deletions .changelog/v0.13.2/ci/1045-fix-e2e-scheduler-ci.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Correctly report e2e test failures in CI.
([#1045](https://github.com/anoma/namada/pull/1045))
2 changes: 2 additions & 0 deletions .changelog/v0.13.2/improvements/1057-moniker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Append Namada version number to tendermint moniker.
([#1057](https://github.com/anoma/namada/pull/1057))
2 changes: 2 additions & 0 deletions .changelog/v0.13.2/summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Namada 0.13.2 is a bugfix release addressing issues with the 0.13
release series.
2 changes: 2 additions & 0 deletions .changelog/v0.13.2/testing/1062-fix-e2e-test-failures.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Address failing e2e tests which were not caught earlier.
([#1062](https://github.com/anoma/namada/pull/1062))
5 changes: 5 additions & 0 deletions .github/workflows/scripts/schedule-e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def find_freer_machine():
tasks = MACHINES[CURRENT_MACHINE_INDEX]['tasks']

test_results = {}
has_failures = False

for test_name in tasks:
try:
Expand All @@ -51,6 +52,7 @@ def find_freer_machine():
'status': 'fail',
'command': command
}
has_failures = True
continue

print("\nTest run:")
Expand All @@ -61,3 +63,6 @@ def find_freer_machine():
if test_results[test_name]['status'] != 'ok':
test_command = test_results[test_name]['command']
print(" Run locally with: {}".format(test_command))

if has_failures:
exit(1)
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
# CHANGELOG

## v0.13.2

Namada 0.13.2 is a bugfix release addressing issues with the 0.13
release series.

### BUG FIXES

- Fixes testnet wrapper fee checks
([#1019](https://github.com/anoma/namada/pull/1019))

### CI

- Correctly report e2e test failures in CI.
([#1045](https://github.com/anoma/namada/pull/1045))

### IMPROVEMENTS

- Append Namada version number to tendermint moniker.
([#1057](https://github.com/anoma/namada/pull/1057))

### TESTING

- Correct the whitelist test in vp_implicit to use case-insensitive whitelist
hashes. ([#1037](https://github.com/anoma/namada/pull/1037))
- Address failing e2e tests which were not caught earlier.
([#1062](https://github.com/anoma/namada/pull/1062))

## v0.13.1

Namada 0.13.1 is a maintenance release fixing an error in the tx and vp
Expand Down
20 changes: 10 additions & 10 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 apps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ license = "GPL-3.0"
name = "namada_apps"
readme = "../README.md"
resolver = "2"
version = "0.13.1"
version = "0.13.2"
default-run = "namada"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion apps/src/lib/client/signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ pub async fn sign_wrapper(
let client = HttpClient::new(args.ledger_address.clone()).unwrap();

let fee_amount = if cfg!(feature = "mainnet") {
Amount::from(MIN_FEE)
Amount::whole(MIN_FEE)
} else {
let wrapper_tx_fees_key = parameter_storage::get_wrapper_tx_fees_key();
rpc::query_storage_value::<token::Amount>(&client, &wrapper_tx_fees_key)
Expand Down
7 changes: 4 additions & 3 deletions apps/src/lib/node/ledger/shell/finalize_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,10 @@ where
Amount::from(0).try_to_vec().unwrap(),
)
.unwrap();
tx_event["log"] =
tx_event["info"] =
"Insufficient balance for fee".into();
tx_event["code"] = ErrorCodes::InvalidTx.into();
tx_event["gas_used"] = "0".to_string();

response.events.push(tx_event);
continue;
Expand Down Expand Up @@ -473,7 +474,7 @@ mod test_finalize_block {
);
shell
.storage
.write(&balance_key, Amount::from(1000).try_to_vec().unwrap())
.write(&balance_key, Amount::whole(1000).try_to_vec().unwrap())
.unwrap();

// create some wrapper txs
Expand Down Expand Up @@ -674,7 +675,7 @@ mod test_finalize_block {
);
shell
.storage
.write(&balance_key, Amount::from(1000).try_to_vec().unwrap())
.write(&balance_key, Amount::whole(1000).try_to_vec().unwrap())
.unwrap();

// create two decrypted txs
Expand Down
6 changes: 3 additions & 3 deletions apps/src/lib/node/ledger/shell/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ use namada::types::internal::WrapperTxInQueue;
use namada::types::key::*;
use namada::types::storage::{BlockHeight, Key, TxIndex};
use namada::types::time::{DateTimeUtc, TimeZone, Utc};
use namada::types::token::{self, Amount};
use namada::types::token::{self};
use namada::types::transaction::{
hash_tx, process_tx, verify_decrypted_correctly, AffineCurve, DecryptedTx,
EllipticCurve, PairingEngine, TxType, MIN_FEE,
Expand Down Expand Up @@ -597,7 +597,7 @@ where
#[cfg(feature = "mainnet")]
let has_valid_pow = false;

if !has_valid_pow && Amount::from(MIN_FEE) > balance {
if !has_valid_pow && self.get_wrapper_tx_fees() > balance {
response.code = 1;
response.log = String::from(
"The address given does not have sufficient \
Expand Down Expand Up @@ -728,7 +728,7 @@ where
&self.storage,
)
.expect("Must be able to read wrapper tx fees parameter");
fees.unwrap_or_default()
fees.unwrap_or(token::Amount::whole(MIN_FEE))
}

#[cfg(not(feature = "mainnet"))]
Expand Down
16 changes: 5 additions & 11 deletions apps/src/lib/node/ledger/shell/process_proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ where
#[cfg(feature = "mainnet")]
let has_valid_pow = false;

if has_valid_pow || Amount::from(MIN_FEE) <= balance {
if has_valid_pow
|| self.get_wrapper_tx_fees() <= balance
{
TxResult {
code: ErrorCodes::Ok.into(),
info: "Process proposal accepted this \
Expand Down Expand Up @@ -408,14 +410,6 @@ mod test_process_proposal {
#[test]
fn test_wrapper_insufficient_balance_address() {
let (mut shell, _) = TestShell::new();
shell.init_chain(RequestInitChain {
time: Some(Timestamp {
seconds: 0,
nanos: 0,
}),
chain_id: ChainId::default().to_string(),
..Default::default()
});
let keypair = crate::wallet::defaults::daewon_keypair();
// reduce address balance to match the 100 token fee
let balance_key = token::balance_key(
Expand All @@ -424,7 +418,7 @@ mod test_process_proposal {
);
shell
.storage
.write(&balance_key, Amount::from(99).try_to_vec().unwrap())
.write(&balance_key, Amount::whole(99).try_to_vec().unwrap())
.unwrap();

let tx = Tx::new(
Expand All @@ -433,7 +427,7 @@ mod test_process_proposal {
);
let wrapper = WrapperTx::new(
Fee {
amount: Amount::whole(1_000_100),
amount: Amount::whole(100),
token: shell.storage.native_token.clone(),
},
&keypair,
Expand Down
9 changes: 9 additions & 0 deletions apps/src/lib/node/ledger/tendermint_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ use namada::types::chain::ChainId;
use namada::types::key::*;
use namada::types::time::DateTimeUtc;
use serde_json::json;
#[cfg(feature = "abciplus")]
use tendermint::Moniker;
#[cfg(feature = "abcipp")]
use tendermint_abcipp::Moniker;
use thiserror::Error;
use tokio::fs::{self, File, OpenOptions};
use tokio::io::{AsyncReadExt, AsyncWriteExt};
use tokio::process::Command;

use crate::cli::namada_version;
use crate::config;
use crate::facade::tendermint::{block, Genesis};
use crate::facade::tendermint_config::net::Address as TendermintAddress;
Expand Down Expand Up @@ -305,6 +310,10 @@ async fn update_tendermint_config(
let mut config =
TendermintConfig::load_toml_file(&path).map_err(Error::LoadConfig)?;

config.moniker =
Moniker::from_str(&format!("{}-{}", config.moniker, namada_version()))
.expect("Invalid moniker");

config.p2p.laddr =
TendermintAddress::from_str(&tendermint_config.p2p_address.to_string())
.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ edition = "2021"
license = "GPL-3.0"
name = "namada_core"
resolver = "2"
version = "0.13.1"
version = "0.13.2"

[features]
default = []
Expand Down
4 changes: 2 additions & 2 deletions core/src/ledger/parameters/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,10 +478,10 @@ where
let (value, gas_wrapper_tx_fees) = storage
.read(&wrapper_tx_fees_key)
.map_err(ReadError::StorageError)?;
let address: Option<token::Amount> = value
let fee: Option<token::Amount> = value
.map(|value| decode(value).map_err(ReadError::StorageTypeError))
.transpose()?;
Ok((address, gas_wrapper_tx_fees))
Ok((fee, gas_wrapper_tx_fees))
}

// Read the all the parameters from storage. Returns the parameters and gas
Expand Down
2 changes: 1 addition & 1 deletion encoding_spec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ license = "GPL-3.0"
name = "namada_encoding_spec"
readme = "../README.md"
resolver = "2"
version = "0.13.1"
version = "0.13.2"

[features]
default = ["abciplus"]
Expand Down
2 changes: 1 addition & 1 deletion genesis/e2e-tests-single-node.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ vp = "vp_token"
Albert = 1000000
"Albert.public_key" = 100
Bertha = 1000000
"Bertha.public_key" = 100
"Bertha.public_key" = 2000
Christel = 1000000
"Christel.public_key" = 100
Daewon = 1000000
Expand Down
2 changes: 1 addition & 1 deletion macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ edition = "2021"
license = "GPL-3.0"
name = "namada_macros"
resolver = "2"
version = "0.13.1"
version = "0.13.2"

[lib]
proc-macro = true
Expand Down
2 changes: 1 addition & 1 deletion proof_of_stake/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ license = "GPL-3.0"
name = "namada_proof_of_stake"
readme = "../README.md"
resolver = "2"
version = "0.13.1"
version = "0.13.2"

[features]
default = ["abciplus"]
Expand Down
2 changes: 1 addition & 1 deletion shared/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ edition = "2021"
license = "GPL-3.0"
name = "namada"
resolver = "2"
version = "0.13.1"
version = "0.13.2"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
2 changes: 1 addition & 1 deletion tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"
license = "GPL-3.0"
name = "namada_tests"
resolver = "2"
version = "0.13.1"
version = "0.13.2"

[features]
default = ["abciplus", "wasm-runtime"]
Expand Down
Loading

0 comments on commit 3b57e84

Please sign in to comment.