From c38d82203fbaa39e55b1c80d06ff792cb7fdd959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Zemanovi=C4=8D?= Date: Mon, 16 Oct 2023 07:26:38 +0200 Subject: [PATCH 1/4] make: skip pos_state_machine_test in CI --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 74100d3e1b..6c45dcb02d 100644 --- a/Makefile +++ b/Makefile @@ -132,7 +132,8 @@ test-coverage: $(cargo) +$(nightly) llvm-cov --output-dir target \ --features namada/testing \ --html \ - -- --skip e2e -Z unstable-options --report-time + -- --skip e2e --skip pos_state_machine_test \ + -Z unstable-options --report-time # NOTE: `TEST_FILTER` is prepended with `e2e::`. Since filters in `cargo test` # work with a substring search, TEST_FILTER only works if it contains a string From efeebfd9d79001374e763f59d3b6a7bbcfd9ea9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Zemanovi=C4=8D?= Date: Mon, 16 Oct 2023 09:06:17 +0200 Subject: [PATCH 2/4] bench/vps: credit source before bond tx --- benches/vps.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benches/vps.rs b/benches/vps.rs index 6efaf78e4c..ee81b13d08 100644 --- a/benches/vps.rs +++ b/benches/vps.rs @@ -277,7 +277,7 @@ fn vp_implicit(c: &mut Criterion) { shell.commit(); } - if bench_name == "transfer" { + if bench_name == "transfer" || bench_name == "pos" { // Transfer some tokens to the implicit address shell.execute_tx(&received_transfer); shell.wl_storage.commit_tx(); From 2075e8e4162a17c3d19109c1a275869aead97bd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Zemanovi=C4=8D?= Date: Mon, 16 Oct 2023 12:58:12 +0200 Subject: [PATCH 3/4] test/e2e/slashing: fix flakiness --- tests/src/e2e/ledger_tests.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/src/e2e/ledger_tests.rs b/tests/src/e2e/ledger_tests.rs index 98bf27bc6c..b398baec2d 100644 --- a/tests/src/e2e/ledger_tests.rs +++ b/tests/src/e2e/ledger_tests.rs @@ -3315,6 +3315,8 @@ fn double_signing_gets_slashed() -> Result<()> { .exp_regex(r"Slashing [a-z0-9]+ for Duplicate vote in epoch [0-9]+") .unwrap(); println!("\n{res}\n"); + // Wait to commit a block + validator_1.exp_regex(r"Committed block hash.*, height: [0-9]+")?; let bg_validator_1 = validator_1.background(); let exp_processing_epoch = Epoch::from_str(res.split(' ').last().unwrap()) @@ -3324,9 +3326,6 @@ fn double_signing_gets_slashed() -> Result<()> { + 1u64; // Query slashes - // let tx_args = ["slashes", "--node", &validator_one_rpc]; - // let client = run!(test, Bin::Client, tx_args, Some(40))?; - let mut client = run!( test, Bin::Client, From c8f3a7d28f645bbc236971a2689ec045fb52eb3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Zemanovi=C4=8D?= Date: Wed, 18 Oct 2023 11:12:05 +0200 Subject: [PATCH 4/4] PoS: comment out unused code --- proof_of_stake/src/lib.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/proof_of_stake/src/lib.rs b/proof_of_stake/src/lib.rs index 41ea1e70d4..35ea602aba 100644 --- a/proof_of_stake/src/lib.rs +++ b/proof_of_stake/src/lib.rs @@ -3059,14 +3059,14 @@ where // TODO: apply rewards let slashes = find_validator_slashes(storage, &bond_id.validator)?; // dbg!(&slashes); - let slash_rates = - slashes - .iter() - .fold(BTreeMap::::new(), |mut map, slash| { - let tot_rate = map.entry(slash.epoch).or_default(); - *tot_rate = cmp::min(Dec::one(), *tot_rate + slash.rate); - map - }); + // let slash_rates = + // slashes + // .iter() + // .fold(BTreeMap::::new(), |mut map, slash| { + // let tot_rate = map.entry(slash.epoch).or_default(); + // *tot_rate = cmp::min(Dec::one(), *tot_rate + slash.rate); + // map + // }); // dbg!(&slash_rates); // Accumulate incoming redelegations slashes from source validator, if any.