|
@@ -108,7 +108,7 @@ impl TestHarness {
|
|
fn trust_promotion(&mut self, cred: &cred::Lox) -> (PerfStat, cred::Migration) {
|
|
fn trust_promotion(&mut self, cred: &cred::Lox) -> (PerfStat, cred::Migration) {
|
|
let req_start = Instant::now();
|
|
let req_start = Instant::now();
|
|
let (promreq, promstate) =
|
|
let (promreq, promstate) =
|
|
- trust_promotion::request(&cred, &self.ba.lox_pub, self.ba.today()).unwrap();
|
|
|
|
|
|
+ trust_promotion::request(cred, &self.ba.lox_pub, self.ba.today()).unwrap();
|
|
let encoded: Vec<u8> = bincode::serialize(&promreq).unwrap();
|
|
let encoded: Vec<u8> = bincode::serialize(&promreq).unwrap();
|
|
let req_t = req_start.elapsed();
|
|
let req_t = req_start.elapsed();
|
|
let req_len = encoded.len();
|
|
let req_len = encoded.len();
|
|
@@ -187,7 +187,7 @@ impl TestHarness {
|
|
// level
|
|
// level
|
|
let req_start = Instant::now();
|
|
let req_start = Instant::now();
|
|
let (req, state) = level_up::request(
|
|
let (req, state) = level_up::request(
|
|
- &cred,
|
|
|
|
|
|
+ cred,
|
|
&reachcred,
|
|
&reachcred,
|
|
&self.ba.lox_pub,
|
|
&self.ba.lox_pub,
|
|
&self.ba.reachability_pub,
|
|
&self.ba.reachability_pub,
|
|
@@ -233,7 +233,7 @@ impl TestHarness {
|
|
|
|
|
|
let req_start = Instant::now();
|
|
let req_start = Instant::now();
|
|
let (req, state) = issue_invite::request(
|
|
let (req, state) = issue_invite::request(
|
|
- &cred,
|
|
|
|
|
|
+ cred,
|
|
&reachcred,
|
|
&reachcred,
|
|
&self.ba.lox_pub,
|
|
&self.ba.lox_pub,
|
|
&self.ba.reachability_pub,
|
|
&self.ba.reachability_pub,
|
|
@@ -277,7 +277,7 @@ impl TestHarness {
|
|
fn redeem_invite(&mut self, inv: &cred::Invitation) -> (PerfStat, cred::Lox) {
|
|
fn redeem_invite(&mut self, inv: &cred::Invitation) -> (PerfStat, cred::Lox) {
|
|
let req_start = Instant::now();
|
|
let req_start = Instant::now();
|
|
let (req, state) =
|
|
let (req, state) =
|
|
- redeem_invite::request(&inv, &self.ba.invitation_pub, self.ba.today()).unwrap();
|
|
|
|
|
|
+ redeem_invite::request(inv, &self.ba.invitation_pub, self.ba.today()).unwrap();
|
|
let encoded: Vec<u8> = bincode::serialize(&req).unwrap();
|
|
let encoded: Vec<u8> = bincode::serialize(&req).unwrap();
|
|
let req_t = req_start.elapsed();
|
|
let req_t = req_start.elapsed();
|
|
let req_len = encoded.len();
|
|
let req_len = encoded.len();
|
|
@@ -308,7 +308,7 @@ impl TestHarness {
|
|
|
|
|
|
fn check_blockage(&mut self, cred: &cred::Lox) -> (PerfStat, cred::Migration) {
|
|
fn check_blockage(&mut self, cred: &cred::Lox) -> (PerfStat, cred::Migration) {
|
|
let req_start = Instant::now();
|
|
let req_start = Instant::now();
|
|
- let (req, state) = check_blockage::request(&cred, &self.ba.lox_pub).unwrap();
|
|
|
|
|
|
+ let (req, state) = check_blockage::request(cred, &self.ba.lox_pub).unwrap();
|
|
let encoded: Vec<u8> = bincode::serialize(&req).unwrap();
|
|
let encoded: Vec<u8> = bincode::serialize(&req).unwrap();
|
|
let req_t = req_start.elapsed();
|
|
let req_t = req_start.elapsed();
|
|
let req_len = encoded.len();
|
|
let req_len = encoded.len();
|
|
@@ -344,7 +344,7 @@ impl TestHarness {
|
|
) -> (PerfStat, cred::Lox) {
|
|
) -> (PerfStat, cred::Lox) {
|
|
let req_start = Instant::now();
|
|
let req_start = Instant::now();
|
|
let (req, state) =
|
|
let (req, state) =
|
|
- blockage_migration::request(&cred, &mig, &self.ba.lox_pub, &self.ba.migration_pub)
|
|
|
|
|
|
+ blockage_migration::request(cred, mig, &self.ba.lox_pub, &self.ba.migration_pub)
|
|
.unwrap();
|
|
.unwrap();
|
|
let encoded: Vec<u8> = bincode::serialize(&req).unwrap();
|
|
let encoded: Vec<u8> = bincode::serialize(&req).unwrap();
|
|
let req_t = req_start.elapsed();
|
|
let req_t = req_start.elapsed();
|
|
@@ -1592,11 +1592,11 @@ fn block_bridges(th: &mut TestHarness, percentage: usize, credentials: Vec<cred:
|
|
- th.ba.bridge_table.spares.len()
|
|
- th.ba.bridge_table.spares.len()
|
|
- th.bdb.openinv_buckets.len();
|
|
- th.bdb.openinv_buckets.len();
|
|
let blockable_range = th.ba.bridge_table.buckets.len() - th.ba.bridge_table.spares.len();
|
|
let blockable_range = th.ba.bridge_table.buckets.len() - th.ba.bridge_table.spares.len();
|
|
- let to_block: usize = (blockable_num * percentage / 100).into();
|
|
|
|
|
|
+ let to_block: usize = (blockable_num * percentage / 100);
|
|
let mut block_index: HashSet<usize> = HashSet::new();
|
|
let mut block_index: HashSet<usize> = HashSet::new();
|
|
let mut rng = rand::thread_rng();
|
|
let mut rng = rand::thread_rng();
|
|
|
|
|
|
- while block_index.len() <= to_block - 1 {
|
|
|
|
|
|
+ while block_index.len() < to_block {
|
|
let rand_num = rng.gen_range(0, blockable_range);
|
|
let rand_num = rng.gen_range(0, blockable_range);
|
|
if !th.bdb.openinv_buckets.contains(&(rand_num as u32)) {
|
|
if !th.bdb.openinv_buckets.contains(&(rand_num as u32)) {
|
|
block_index.insert(rand_num);
|
|
block_index.insert(rand_num);
|
|
@@ -1631,7 +1631,7 @@ fn block_bridges(th: &mut TestHarness, percentage: usize, credentials: Vec<cred:
|
|
let mut count = 0;
|
|
let mut count = 0;
|
|
for bridge_line in &bucket.0 {
|
|
for bridge_line in &bucket.0 {
|
|
if th.ba.bridge_table.reachable.contains_key(bridge_line) {
|
|
if th.ba.bridge_table.reachable.contains_key(bridge_line) {
|
|
- count = count + 1;
|
|
|
|
|
|
+ count += 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|