From f787253ad55d3cf56b5f7f9b56c16a20527d166d Mon Sep 17 00:00:00 2001 From: onyinyang Date: Tue, 1 Aug 2023 15:09:46 -0400 Subject: [PATCH 01/59] Added support for lox-context storage through sled --- Cargo.lock | 127 +++++++++++++++++++++- crates/lox-distributor/Cargo.toml | 1 + crates/lox-distributor/config.json | 3 + crates/lox-distributor/src/file_reader.rs | 10 +- crates/lox-distributor/src/lox_context.rs | 2 +- crates/lox-distributor/src/main.rs | 61 +++++++---- 6 files changed, 175 insertions(+), 29 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5d862c3..694bc44 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -366,12 +366,43 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + [[package]] name = "crc64" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2707e3afba5e19b75d582d88bc79237418f2a2a2d673d01cf9b03633b46e98f3" +[[package]] +name = "crossbeam-epoch" +version = "0.9.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +dependencies = [ + "autocfg 1.1.0", + "cfg-if", + "crossbeam-utils", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -579,6 +610,16 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fs2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "fuchsia-cprng" version = "0.1.1" @@ -674,6 +715,15 @@ dependencies = [ "slab", ] +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -911,6 +961,15 @@ dependencies = [ "serde", ] +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + [[package]] name = "ipnet" version = "2.8.0" @@ -1008,6 +1067,7 @@ dependencies = [ "serde", "serde_json", "serde_with", + "sled", "time 0.3.28", "tokio", "zkp", @@ -1070,6 +1130,15 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg 1.1.0", +] + [[package]] name = "merlin" version = "2.0.1" @@ -1288,6 +1357,17 @@ dependencies = [ "libm", ] +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core 0.8.6", +] + [[package]] name = "parking_lot" version = "0.12.1" @@ -1295,7 +1375,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core", + "parking_lot_core 0.9.8", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall 0.2.16", + "smallvec", + "winapi", ] [[package]] @@ -1306,7 +1400,7 @@ checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.3.5", "smallvec", "windows-targets", ] @@ -1575,6 +1669,15 @@ dependencies = [ "tokio-util", ] +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "redox_syscall" version = "0.3.5" @@ -1815,6 +1918,22 @@ dependencies = [ "autocfg 1.1.0", ] +[[package]] +name = "sled" +version = "0.34.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f96b4737c2ce5987354855aed3797279def4ebf734436c6aa4552cf8e169935" +dependencies = [ + "crc32fast", + "crossbeam-epoch", + "crossbeam-utils", + "fs2", + "fxhash", + "libc", + "log", + "parking_lot 0.11.2", +] + [[package]] name = "smallvec" version = "1.11.0" @@ -1878,7 +1997,7 @@ checksum = "5486094ee78b2e5038a6382ed7645bc084dc2ec433426ca4c3cb61e2007b8998" dependencies = [ "cfg-if", "fastrand", - "redox_syscall", + "redox_syscall 0.3.5", "rustix", "windows-sys", ] @@ -1969,7 +2088,7 @@ dependencies = [ "libc", "mio", "num_cpus", - "parking_lot", + "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", "socket2", diff --git a/crates/lox-distributor/Cargo.toml b/crates/lox-distributor/Cargo.toml index 52ce60a..8ff6556 100644 --- a/crates/lox-distributor/Cargo.toml +++ b/crates/lox-distributor/Cargo.toml @@ -28,6 +28,7 @@ lox_utils = { path = "../lox-utils", version = "0.1.0"} rdsys_backend = { path = "../rdsys-backend-api", version = "0.2"} clap = { version = "4.4.2", features = ["derive"] } serde_json = "1.0.105" +sled = "0.34.7" [dependencies.chrono] version = "0.4.27" diff --git a/crates/lox-distributor/config.json b/crates/lox-distributor/config.json index 177e5a2..4e070bc 100644 --- a/crates/lox-distributor/config.json +++ b/crates/lox-distributor/config.json @@ -1,4 +1,6 @@ { + "db_path": "lox_db", + "rtype": { "endpoint": "http://127.0.0.1:7100/resource-stream", "name": "https", "token": "HttpsApiTokenPlaceholder", @@ -6,4 +8,5 @@ "obfs2", "scramblesuit" ] +} } \ No newline at end of file diff --git a/crates/lox-distributor/src/file_reader.rs b/crates/lox-distributor/src/file_reader.rs index 3a0846f..2b98554 100644 --- a/crates/lox-distributor/src/file_reader.rs +++ b/crates/lox-distributor/src/file_reader.rs @@ -1,5 +1,6 @@ use crate::lox_context; use chrono::prelude::*; +use sled::IVec; use std::{ env, error::Error, @@ -17,6 +18,13 @@ pub fn read_context_from_file>( Ok(context) } +pub fn write_context_to_db(db: sled::Db, context: lox_context::LoxServerContext) { + let date = Local::now().format("%Y-%m-%d_%H:%M:%S").to_string(); + let json_date = serde_json::to_vec(&date).unwrap(); + let json_result = serde_json::to_vec(&context).unwrap(); + let _ = db.insert(IVec::from(json_date), IVec::from(json_result)); +} + pub fn write_context_to_file(context: lox_context::LoxServerContext) { let mut date = Local::now().format("%Y-%m-%d_%H:%M:%S").to_string(); let path = "_lox.json"; @@ -26,7 +34,7 @@ pub fn write_context_to_file(context: lox_context::LoxServerContext) { let _ = serde_json::to_writer(file, &context); } -pub fn check_db_exists() -> Option { +pub fn check_file_exists() -> Option { let current_path = env::current_dir().expect("Unable to access current dir"); std::fs::read_dir(current_path) .expect("Couldn't read local directory") diff --git a/crates/lox-distributor/src/lox_context.rs b/crates/lox-distributor/src/lox_context.rs index b732880..a777a0d 100644 --- a/crates/lox-distributor/src/lox_context.rs +++ b/crates/lox-distributor/src/lox_context.rs @@ -16,7 +16,7 @@ use std::{ }; use zkp::ProofError; -#[derive(Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct LoxServerContext { pub db: Arc>, pub ba: Arc>, diff --git a/crates/lox-distributor/src/main.rs b/crates/lox-distributor/src/main.rs index 018661c..34df0b3 100644 --- a/crates/lox-distributor/src/main.rs +++ b/crates/lox-distributor/src/main.rs @@ -24,7 +24,7 @@ use std::{ }; mod file_reader; -use file_reader::{check_db_exists, read_context_from_file, write_context_to_file}; +use file_reader::write_context_to_db; mod lox_context; mod request_handler; use request_handler::handle; @@ -58,6 +58,12 @@ struct Args { backup_context: Option, } +#[derive(Debug, Deserialize)] +struct Config { + db_path: String, + rtype: ResourceInfo, + +} #[derive(Debug, Deserialize)] struct ResourceInfo { endpoint: String, @@ -115,7 +121,7 @@ async fn parse_bridges(rdsys_tx: mpsc::Sender, mut rx: mpsc::Receiver, + backup_context_path: String, context_rx: mpsc::Receiver, mut kill: broadcast::Receiver<()>, ) { @@ -128,23 +134,33 @@ async fn create_context_manager( // Context Manager handles the Lox BridgeDB and Bridge Authority, ensuring // that the DB can be updated from the rdsys stream and client requests // can be responded to with an updated BridgeDB state -async fn context_manager(db_path: Option, mut context_rx: mpsc::Receiver) { +async fn context_manager(db_path: String, mut context_rx: mpsc::Receiver) { let context: lox_context::LoxServerContext; - if let Some(existing_db) = db_path.as_deref() { - context = read_context_from_file(existing_db).unwrap(); - } else if let Some(last_modified_file) = check_db_exists() { - println!("Reading from file {:?}", last_modified_file); - context = read_context_from_file(&last_modified_file.path()).unwrap(); - } else { - let new_db = BridgeDb::new(); - let new_ba = BridgeAuth::new(new_db.pubkey); - context = lox_context::LoxServerContext { - db: Arc::new(Mutex::new(new_db)), - ba: Arc::new(Mutex::new(new_ba)), - extra_bridges: Arc::new(Mutex::new(Vec::new())), - to_be_replaced_bridges: Arc::new(Mutex::new(Vec::new())), + let existing_db = match sled::open(db_path) { + Ok(lox_db) => { + // Check if the lox_db already exists + if lox_db.was_recovered() { + // And use the last entry to populate the Lox context if so + // TODO add functionality to specify the key or roll back to a previous time + let ivec_context = lox_db.last().unwrap().unwrap().1; + context = serde_json::from_slice(&ivec_context).unwrap(); + //Otherwise, create a new Lox context + } else { + let new_db = BridgeDb::new(); + let new_ba = BridgeAuth::new(new_db.pubkey); + context = lox_context::LoxServerContext { + db: Arc::new(Mutex::new(new_db)), + ba: Arc::new(Mutex::new(new_ba)), + extra_bridges: Arc::new(Mutex::new(Vec::new())), + to_be_replaced_bridges: Arc::new(Mutex::new(Vec::new())), + } + } + lox_db } - } + Err(e) => { + panic!("Unable to read or create lox database! {:?}", e); + } + }; while let Some(cmd) = context_rx.recv().await { use Command::*; @@ -158,7 +174,6 @@ async fn context_manager(db_path: Option, mut context_rx: mpsc::Receive if let Some(resources) = pt.1 { for resource in resources { let bridgeline = parse_resource(resource); - println!("Now it's a bridgeline: {:?}", bridgeline); if context.to_be_replaced_bridges.lock().unwrap().len() > 0 { println!("BridgeLine to be replaced: {:?}", bridgeline); let res = context.replace_with_new(bridgeline); @@ -291,7 +306,7 @@ async fn context_manager(db_path: Option, mut context_rx: mpsc::Receive */ context.allocate_leftover_bridges(); context.encrypt_table(); - write_context_to_file(context.clone()); + write_context_to_db(existing_db.clone(), context.clone()); sleep(Duration::from_millis(1)).await; } Request { req, sender } => { @@ -332,8 +347,8 @@ async fn main() { let file = File::open(&args.config).expect("Could not read config file"); let reader = BufReader::new(file); // Read the JSON contents of the file as a ResourceInfo - let rtype: ResourceInfo = - serde_json::from_reader(reader).expect("Reading ResourceInfo from JSON failed."); + let config: Config = + serde_json::from_reader(reader).expect("Reading Config from JSON failed."); let (rdsys_tx, context_rx) = mpsc::channel(32); let request_tx = rdsys_tx.clone(); @@ -361,11 +376,11 @@ async fn main() { }); let context_manager = spawn(async move { - create_context_manager(args.backup_context, context_rx, kill_context).await + create_context_manager(config.db_path, context_rx, kill_context).await }); let (tx, rx) = mpsc::channel(32); - let rdsys_stream_handler = spawn(async { rdsys_stream(rtype, tx, kill_stream).await }); + let rdsys_stream_handler = spawn(async { rdsys_stream(config.rtype, tx, kill_stream).await }); let rdsys_resource_receiver = spawn(async { rdsys_bridge_parser(rdsys_tx, rx, kill_parser).await }); From ffb05d403a1205e570b028ce566c217a28d38cb4 Mon Sep 17 00:00:00 2001 From: onyinyang Date: Thu, 3 Aug 2023 18:22:39 -0400 Subject: [PATCH 02/59] Fix up database handling --- crates/lox-distributor/config.json | 4 +- crates/lox-distributor/src/db_handler.rs | 105 ++++++++++++++++++++++ crates/lox-distributor/src/file_reader.rs | 47 ---------- crates/lox-distributor/src/main.rs | 91 ++++++++++--------- 4 files changed, 155 insertions(+), 92 deletions(-) create mode 100644 crates/lox-distributor/src/db_handler.rs delete mode 100644 crates/lox-distributor/src/file_reader.rs diff --git a/crates/lox-distributor/config.json b/crates/lox-distributor/config.json index 4e070bc..d73ecb9 100644 --- a/crates/lox-distributor/config.json +++ b/crates/lox-distributor/config.json @@ -1,5 +1,7 @@ { - "db_path": "lox_db", + "db": { + "db_path": "lox_db" + }, "rtype": { "endpoint": "http://127.0.0.1:7100/resource-stream", "name": "https", diff --git a/crates/lox-distributor/src/db_handler.rs b/crates/lox-distributor/src/db_handler.rs new file mode 100644 index 0000000..040ef29 --- /dev/null +++ b/crates/lox-distributor/src/db_handler.rs @@ -0,0 +1,105 @@ +use std::sync::{Arc, Mutex}; + +use crate::{lox_context, DbConfig}; +use chrono::prelude::*; +use lox_library::{BridgeAuth, BridgeDb}; +use sled::IVec; + +pub fn write_context_to_db(db: sled::Db, context: lox_context::LoxServerContext) { + let date = Local::now().format("%Y-%m-%d_%H:%M:%S").to_string(); + let json_date = serde_json::to_vec(&date).unwrap(); + let json_result = serde_json::to_vec(&context).unwrap(); + let _ = db.insert(IVec::from(json_date), IVec::from(json_result)); +} + +pub fn find_existing_db( + db_config: DbConfig, +) -> Result<(sled::Db, lox_context::LoxServerContext), sled::Error> { + let context: lox_context::LoxServerContext; + let (lox_db, context) = match sled::open(db_config.db_path) { + Ok(lox_db) => { + // Check if the lox_db already exists + if lox_db.was_recovered() { + // Check if there is a roll back date and try to choose the appropriate context + // to rollback to, otherwise, take the last saved context + match db_config.roll_back_date { + // If roll back date has been specified, either the exact date or range should be set + Some(roll_back_date) => { + // If the exact date is specified and it's in the database, use that to populate the context + match roll_back_date.exact_date { + Some(exact_date) => { + match lox_db.contains_key(exact_date.clone()) { + // Find exact date/time in db and use the context from that date. + Ok(_) => { + let ivec_context = lox_db.get(exact_date).unwrap().unwrap(); + context = serde_json::from_slice(&ivec_context).unwrap(); + } + // If the entered date is not found, use the last saved context + Err(_) => { + println!("UNEXPECTED DATE: Specified exact date not found in lox db! Using last saved context"); + context = use_last_context(lox_db.clone()); + } + } + } + // Otherwise check that the start of a range has been specified + None => { + match roll_back_date.date_range_start { + Some(start) => { + // If so, ensure the end of the range has also been specified + if let Some(end) = roll_back_date.date_range_end { + let start_json: Vec = + serde_json::to_vec(&start).unwrap(); + let end_json: Vec = + serde_json::to_vec(&end).unwrap(); + let r: sled::Iter = lox_db.range( + IVec::from(start_json)..IVec::from(end_json), + ); + let ivec_context = r.last().unwrap().unwrap().1; + context = + serde_json::from_slice(&ivec_context).unwrap(); + } else { + println!("UNEXPECTED DATE: Start of range was specified but End of range was not! Using last saved context"); + context = use_last_context(lox_db.clone()); + } + } + // If not, roll_back_date should not have been indicated but it was! So just use the last + // context and print that this is happening. + None => { + // If exact date and rollback range are blank, use the last saved context + println!("UNEXPECTED DATE: No date specified despite indicating rollback! Using last saved context"); + context = use_last_context(lox_db.clone()); + } + } + } + } + } + // Use the last entry to populate the Lox context if no rollback date is set (which should be most common) + None => { + context = use_last_context(lox_db.clone()); + } + } + //Otherwise, create a new Lox context + } else { + let new_db = BridgeDb::new(); + let new_ba = BridgeAuth::new(new_db.pubkey); + context = lox_context::LoxServerContext { + db: Arc::new(Mutex::new(new_db)), + ba: Arc::new(Mutex::new(new_ba)), + extra_bridges: Arc::new(Mutex::new(Vec::new())), + to_be_replaced_bridges: Arc::new(Mutex::new(Vec::new())), + } + } + (lox_db, context) + } + Err(e) => { + panic!("Unable to read or create lox database! {:?}", e); + } + }; + Ok((lox_db, context)) +} + +fn use_last_context(cloned_db: sled::Db) -> lox_context::LoxServerContext { + let ivec_context = cloned_db.last().unwrap().unwrap().1; + println!("Using db date: {:?}", ivec_context); + serde_json::from_slice(&ivec_context).unwrap() +} diff --git a/crates/lox-distributor/src/file_reader.rs b/crates/lox-distributor/src/file_reader.rs deleted file mode 100644 index 2b98554..0000000 --- a/crates/lox-distributor/src/file_reader.rs +++ /dev/null @@ -1,47 +0,0 @@ -use crate::lox_context; -use chrono::prelude::*; -use sled::IVec; -use std::{ - env, - error::Error, - fs::{DirEntry, File}, - io::BufReader, - path::Path, -}; - -pub fn read_context_from_file>( - path: P, -) -> Result> { - let file = File::open(path)?; - let reader = BufReader::new(file); - let context = serde_json::from_reader(reader)?; - Ok(context) -} - -pub fn write_context_to_db(db: sled::Db, context: lox_context::LoxServerContext) { - let date = Local::now().format("%Y-%m-%d_%H:%M:%S").to_string(); - let json_date = serde_json::to_vec(&date).unwrap(); - let json_result = serde_json::to_vec(&context).unwrap(); - let _ = db.insert(IVec::from(json_date), IVec::from(json_result)); -} - -pub fn write_context_to_file(context: lox_context::LoxServerContext) { - let mut date = Local::now().format("%Y-%m-%d_%H:%M:%S").to_string(); - let path = "_lox.json"; - date.push_str(path); - let file = File::create(&date) - .expect(format!("Unable to write to db file: {:?} !", stringify!($date)).as_str()); - let _ = serde_json::to_writer(file, &context); -} - -pub fn check_file_exists() -> Option { - let current_path = env::current_dir().expect("Unable to access current dir"); - std::fs::read_dir(current_path) - .expect("Couldn't read local directory") - .flatten() // Remove failed - .filter(|f| { - f.metadata().unwrap().is_file() - && (f.file_name().into_string().unwrap().contains("_lox.json")) - }) // Filter out directories (only consider files) - .max_by_key(|x| x.metadata().unwrap().modified().unwrap()) -} diff --git a/crates/lox-distributor/src/main.rs b/crates/lox-distributor/src/main.rs index 34df0b3..19a73ad 100644 --- a/crates/lox-distributor/src/main.rs +++ b/crates/lox-distributor/src/main.rs @@ -8,23 +8,16 @@ use hyper::{ Body, Request, Response, Server, }; use lox_library::bridge_table::{BridgeLine, MAX_BRIDGES_PER_BUCKET}; -use lox_library::{BridgeAuth, BridgeDb}; use rdsys_backend::{proto::ResourceDiff, start_stream}; use serde::Deserialize; use std::{ - convert::Infallible, - fs::File, - io::BufReader, - net::SocketAddr, - path::PathBuf, - sync::{Arc, Mutex}, - time::Duration, + convert::Infallible, fs::File, io::BufReader, net::SocketAddr, path::PathBuf, time::Duration, }; -mod file_reader; -use file_reader::write_context_to_db; +mod db_handler; +use db_handler::{find_existing_db, write_context_to_db}; mod lox_context; mod request_handler; use request_handler::handle; @@ -60,10 +53,41 @@ struct Args { #[derive(Debug, Deserialize)] struct Config { - db_path: String, + db: DbConfig, rtype: ResourceInfo, - } + +#[derive(Debug, Deserialize)] +pub struct DbConfig { + // The path for the lox_context database, default is "lox_db" + db_path: String, + // Optional Date/time to roll back to + // This should be blank for normal operation and only changed if the lox_context + // should be rolled back to a previous state + roll_back_date: Option, +} + +impl Default for DbConfig { + fn default() -> DbConfig { + DbConfig { + db_path: "lox_db".to_owned(), + roll_back_date: None, + } + } +} +#[derive(Debug, Deserialize)] +pub struct RollBackDate { + // Optional exact Date/time to roll back to as a %Y-%m-%d_%H:%M:%S string + // This should only be changed if the lox_context should be rolled back to a + // previous state and the exact roll back date/time is known + exact_date: Option, + // Since the exact time the database last saved the context may not be obvious, + // this can be presented as a range from which the most recent date in the database will be + // selected + date_range_start: Option, + date_range_end: Option, +} + #[derive(Debug, Deserialize)] struct ResourceInfo { endpoint: String, @@ -121,12 +145,12 @@ async fn parse_bridges(rdsys_tx: mpsc::Sender, mut rx: mpsc::Receiver, mut kill: broadcast::Receiver<()>, ) { tokio::select! { - create_context = context_manager(backup_context_path, context_rx) => create_context, + create_context = context_manager(db_config, context_rx) => create_context, _ = kill.recv() => {println!("Shut down context_manager");}, } } @@ -134,31 +158,11 @@ async fn create_context_manager( // Context Manager handles the Lox BridgeDB and Bridge Authority, ensuring // that the DB can be updated from the rdsys stream and client requests // can be responded to with an updated BridgeDB state -async fn context_manager(db_path: String, mut context_rx: mpsc::Receiver) { - let context: lox_context::LoxServerContext; - let existing_db = match sled::open(db_path) { - Ok(lox_db) => { - // Check if the lox_db already exists - if lox_db.was_recovered() { - // And use the last entry to populate the Lox context if so - // TODO add functionality to specify the key or roll back to a previous time - let ivec_context = lox_db.last().unwrap().unwrap().1; - context = serde_json::from_slice(&ivec_context).unwrap(); - //Otherwise, create a new Lox context - } else { - let new_db = BridgeDb::new(); - let new_ba = BridgeAuth::new(new_db.pubkey); - context = lox_context::LoxServerContext { - db: Arc::new(Mutex::new(new_db)), - ba: Arc::new(Mutex::new(new_ba)), - extra_bridges: Arc::new(Mutex::new(Vec::new())), - to_be_replaced_bridges: Arc::new(Mutex::new(Vec::new())), - } - } - lox_db - } +async fn context_manager(db_config: DbConfig, mut context_rx: mpsc::Receiver) { + let (lox_db, context) = match find_existing_db(db_config) { + Ok((lox_db, context)) => (lox_db, context), Err(e) => { - panic!("Unable to read or create lox database! {:?}", e); + panic!("Error: {:?}", e); } }; @@ -174,6 +178,7 @@ async fn context_manager(db_path: String, mut context_rx: mpsc::Receiver 0 { println!("BridgeLine to be replaced: {:?}", bridgeline); let res = context.replace_with_new(bridgeline); @@ -306,7 +311,7 @@ async fn context_manager(db_path: String, mut context_rx: mpsc::Receiver { @@ -347,8 +352,7 @@ async fn main() { let file = File::open(&args.config).expect("Could not read config file"); let reader = BufReader::new(file); // Read the JSON contents of the file as a ResourceInfo - let config: Config = - serde_json::from_reader(reader).expect("Reading Config from JSON failed."); + let config: Config = serde_json::from_reader(reader).expect("Reading Config from JSON failed."); let (rdsys_tx, context_rx) = mpsc::channel(32); let request_tx = rdsys_tx.clone(); @@ -375,9 +379,8 @@ async fn main() { } }); - let context_manager = spawn(async move { - create_context_manager(config.db_path, context_rx, kill_context).await - }); + let context_manager = + spawn(async move { create_context_manager(config.db, context_rx, kill_context).await }); let (tx, rx) = mpsc::channel(32); let rdsys_stream_handler = spawn(async { rdsys_stream(config.rtype, tx, kill_stream).await }); From e1057143fa7e5528423a25a99101c68d721d2197 Mon Sep 17 00:00:00 2001 From: onyinyang Date: Fri, 4 Aug 2023 17:41:22 -0400 Subject: [PATCH 03/59] Add better handling for roll back and exact dates --- crates/lox-distributor/config.json | 6 ++- crates/lox-distributor/src/db_handler.rs | 65 ++++++++++++++++++++---- 2 files changed, 59 insertions(+), 12 deletions(-) diff --git a/crates/lox-distributor/config.json b/crates/lox-distributor/config.json index d73ecb9..6039d37 100644 --- a/crates/lox-distributor/config.json +++ b/crates/lox-distributor/config.json @@ -1,6 +1,10 @@ { "db": { - "db_path": "lox_db" + "db_path": "lox_db", + "roll_back_date": { + "date_range_start": "2023-08-04_16:35:32", + "date_range_end": "2023-08-04_15:35:32" + } }, "rtype": { "endpoint": "http://127.0.0.1:7100/resource-stream", diff --git a/crates/lox-distributor/src/db_handler.rs b/crates/lox-distributor/src/db_handler.rs index 040ef29..7b30444 100644 --- a/crates/lox-distributor/src/db_handler.rs +++ b/crates/lox-distributor/src/db_handler.rs @@ -9,7 +9,16 @@ pub fn write_context_to_db(db: sled::Db, context: lox_context::LoxServerContext) let date = Local::now().format("%Y-%m-%d_%H:%M:%S").to_string(); let json_date = serde_json::to_vec(&date).unwrap(); let json_result = serde_json::to_vec(&context).unwrap(); - let _ = db.insert(IVec::from(json_date), IVec::from(json_result)); + println!("Date: {:?}", date); + let new_ivec = db.insert( + IVec::from(json_date.clone()), + IVec::from(json_result.clone()), + ); + assert_eq!( + db.get(IVec::from(json_date.clone())).unwrap().unwrap(), + IVec::from(json_result.clone()) + ); + println!("What is the new key? {:?}", new_ivec); } pub fn find_existing_db( @@ -31,8 +40,17 @@ pub fn find_existing_db( match lox_db.contains_key(exact_date.clone()) { // Find exact date/time in db and use the context from that date. Ok(_) => { - let ivec_context = lox_db.get(exact_date).unwrap().unwrap(); + let json_exact_date = + serde_json::to_vec(&exact_date).unwrap(); + let ivec_context = lox_db + .get(IVec::from(json_exact_date)) + .unwrap() + .unwrap(); context = serde_json::from_slice(&ivec_context).unwrap(); + println!( + "Successfully used exact key {:?}", + exact_date + ); } // If the entered date is not found, use the last saved context Err(_) => { @@ -46,19 +64,29 @@ pub fn find_existing_db( match roll_back_date.date_range_start { Some(start) => { // If so, ensure the end of the range has also been specified - if let Some(end) = roll_back_date.date_range_end { + if error_check_input_string( + start.clone(), + roll_back_date.date_range_end.clone(), + ) { let start_json: Vec = serde_json::to_vec(&start).unwrap(); let end_json: Vec = - serde_json::to_vec(&end).unwrap(); + serde_json::to_vec(&roll_back_date.date_range_end) + .unwrap(); let r: sled::Iter = lox_db.range( IVec::from(start_json)..IVec::from(end_json), ); - let ivec_context = r.last().unwrap().unwrap().1; + let ivec_context = r.last().unwrap().unwrap(); context = - serde_json::from_slice(&ivec_context).unwrap(); + serde_json::from_slice(&ivec_context.1).unwrap(); + let json_key: String = + serde_json::from_slice(&ivec_context.0).unwrap(); + println!( + "Successfully used range and key {:?}", + json_key + ); } else { - println!("UNEXPECTED DATE: Start of range was specified but End of range was not! Using last saved context"); + println!("UNEXPECTED DATE: Start of range was specified but End of range was not! Using last saved context"); context = use_last_context(lox_db.clone()); } } @@ -98,8 +126,23 @@ pub fn find_existing_db( Ok((lox_db, context)) } -fn use_last_context(cloned_db: sled::Db) -> lox_context::LoxServerContext { - let ivec_context = cloned_db.last().unwrap().unwrap().1; - println!("Using db date: {:?}", ivec_context); - serde_json::from_slice(&ivec_context).unwrap() +fn error_check_input_string(start: String, date_range_end: Option) -> bool { + if let Some(end) = date_range_end { + let parsed_start = Utc.datetime_from_str(&start, "%Y-%m-%d_%H:%M:%S").unwrap(); + let parsed_end = Utc.datetime_from_str(&end, "%Y-%m-%d_%H:%M:%S").unwrap(); + if parsed_start <= parsed_end { + return true; + } + println!("date_range_start must be <= date_range_end! Check config file"); + return false; + } + println!("date_range_start specified but no date_range_end! Check config file"); + false +} + +fn use_last_context(cloned_db: sled::Db) -> lox_context::LoxServerContext { + let ivec_context = cloned_db.last().unwrap().unwrap(); + let ivec_date: String = serde_json::from_slice(&ivec_context.0).unwrap(); + println!("Using last context with date: {:?}", ivec_date); + serde_json::from_slice(&ivec_context.1).unwrap() } From b3ddc03ba6f0d68d0407544743335a6ee1559084 Mon Sep 17 00:00:00 2001 From: onyinyang Date: Mon, 21 Aug 2023 14:17:04 -0400 Subject: [PATCH 04/59] Make roll back date an arg, reduce fn complexity --- crates/lox-distributor/config.json | 7 +- crates/lox-distributor/src/db_handler.rs | 166 ++++++++++------------- crates/lox-distributor/src/main.rs | 47 +++---- 3 files changed, 90 insertions(+), 130 deletions(-) diff --git a/crates/lox-distributor/config.json b/crates/lox-distributor/config.json index 6039d37..444b52e 100644 --- a/crates/lox-distributor/config.json +++ b/crates/lox-distributor/config.json @@ -1,10 +1,7 @@ { "db": { - "db_path": "lox_db", - "roll_back_date": { - "date_range_start": "2023-08-04_16:35:32", - "date_range_end": "2023-08-04_15:35:32" - } + "db_path": "lox_db" + }, "rtype": { "endpoint": "http://127.0.0.1:7100/resource-stream", diff --git a/crates/lox-distributor/src/db_handler.rs b/crates/lox-distributor/src/db_handler.rs index 7b30444..5f13c89 100644 --- a/crates/lox-distributor/src/db_handler.rs +++ b/crates/lox-distributor/src/db_handler.rs @@ -1,111 +1,38 @@ use std::sync::{Arc, Mutex}; use crate::{lox_context, DbConfig}; -use chrono::prelude::*; +use chrono::{naive::Days, DateTime, Local, Utc}; use lox_library::{BridgeAuth, BridgeDb}; use sled::IVec; pub fn write_context_to_db(db: sled::Db, context: lox_context::LoxServerContext) { - let date = Local::now().format("%Y-%m-%d_%H:%M:%S").to_string(); - let json_date = serde_json::to_vec(&date).unwrap(); + let date = Local::now().format("context_%Y-%m-%d_%H:%M:%S").to_string(); let json_result = serde_json::to_vec(&context).unwrap(); println!("Date: {:?}", date); let new_ivec = db.insert( - IVec::from(json_date.clone()), + IVec::from(date.as_bytes().to_vec()), IVec::from(json_result.clone()), ); assert_eq!( - db.get(IVec::from(json_date.clone())).unwrap().unwrap(), - IVec::from(json_result.clone()) + db.get(IVec::from(date.as_bytes().to_vec())) + .unwrap() + .unwrap(), + IVec::from(json_result) ); - println!("What is the new key? {:?}", new_ivec); + println!("New entry key: {:?}", new_ivec); } -pub fn find_existing_db( +pub fn open_new_or_existing_db( db_config: DbConfig, + roll_back_date: Option, ) -> Result<(sled::Db, lox_context::LoxServerContext), sled::Error> { let context: lox_context::LoxServerContext; let (lox_db, context) = match sled::open(db_config.db_path) { Ok(lox_db) => { // Check if the lox_db already exists if lox_db.was_recovered() { - // Check if there is a roll back date and try to choose the appropriate context - // to rollback to, otherwise, take the last saved context - match db_config.roll_back_date { - // If roll back date has been specified, either the exact date or range should be set - Some(roll_back_date) => { - // If the exact date is specified and it's in the database, use that to populate the context - match roll_back_date.exact_date { - Some(exact_date) => { - match lox_db.contains_key(exact_date.clone()) { - // Find exact date/time in db and use the context from that date. - Ok(_) => { - let json_exact_date = - serde_json::to_vec(&exact_date).unwrap(); - let ivec_context = lox_db - .get(IVec::from(json_exact_date)) - .unwrap() - .unwrap(); - context = serde_json::from_slice(&ivec_context).unwrap(); - println!( - "Successfully used exact key {:?}", - exact_date - ); - } - // If the entered date is not found, use the last saved context - Err(_) => { - println!("UNEXPECTED DATE: Specified exact date not found in lox db! Using last saved context"); - context = use_last_context(lox_db.clone()); - } - } - } - // Otherwise check that the start of a range has been specified - None => { - match roll_back_date.date_range_start { - Some(start) => { - // If so, ensure the end of the range has also been specified - if error_check_input_string( - start.clone(), - roll_back_date.date_range_end.clone(), - ) { - let start_json: Vec = - serde_json::to_vec(&start).unwrap(); - let end_json: Vec = - serde_json::to_vec(&roll_back_date.date_range_end) - .unwrap(); - let r: sled::Iter = lox_db.range( - IVec::from(start_json)..IVec::from(end_json), - ); - let ivec_context = r.last().unwrap().unwrap(); - context = - serde_json::from_slice(&ivec_context.1).unwrap(); - let json_key: String = - serde_json::from_slice(&ivec_context.0).unwrap(); - println!( - "Successfully used range and key {:?}", - json_key - ); - } else { - println!("UNEXPECTED DATE: Start of range was specified but End of range was not! Using last saved context"); - context = use_last_context(lox_db.clone()); - } - } - // If not, roll_back_date should not have been indicated but it was! So just use the last - // context and print that this is happening. - None => { - // If exact date and rollback range are blank, use the last saved context - println!("UNEXPECTED DATE: No date specified despite indicating rollback! Using last saved context"); - context = use_last_context(lox_db.clone()); - } - } - } - } - } - // Use the last entry to populate the Lox context if no rollback date is set (which should be most common) - None => { - context = use_last_context(lox_db.clone()); - } - } + context = read_lox_context_from_db(lox_db.clone(), roll_back_date); + //Otherwise, create a new Lox context } else { let new_db = BridgeDb::new(); @@ -115,7 +42,7 @@ pub fn find_existing_db( ba: Arc::new(Mutex::new(new_ba)), extra_bridges: Arc::new(Mutex::new(Vec::new())), to_be_replaced_bridges: Arc::new(Mutex::new(Vec::new())), - } + }; } (lox_db, context) } @@ -126,22 +53,65 @@ pub fn find_existing_db( Ok((lox_db, context)) } -fn error_check_input_string(start: String, date_range_end: Option) -> bool { - if let Some(end) = date_range_end { - let parsed_start = Utc.datetime_from_str(&start, "%Y-%m-%d_%H:%M:%S").unwrap(); - let parsed_end = Utc.datetime_from_str(&end, "%Y-%m-%d_%H:%M:%S").unwrap(); - if parsed_start <= parsed_end { - return true; +fn read_lox_context_from_db( + lox_db: sled::Db, + roll_back_date: Option, +) -> lox_context::LoxServerContext { + let context: lox_context::LoxServerContext; + // Check if there is a roll back date and try to choose the appropriate context + // to rollback to, otherwise, take the last saved context + match roll_back_date { + // If roll back date has been specified, either the exact date or range should be set + Some(roll_back_date) => { + // If the date is specified and it's in the database, use that to populate the context + if lox_db.contains_key(roll_back_date.clone()).unwrap() { + // Find date/time in db and use the context from that date. + + let json_exact_date = serde_json::to_vec(&roll_back_date).unwrap(); + let ivec_context = lox_db.get(IVec::from(json_exact_date)).unwrap().unwrap(); + context = serde_json::from_slice(&ivec_context).unwrap(); + println!("Successfully used exact key {:?}", roll_back_date); + } else { + // If the exact date is not found, compute the start of the range as 24 hours prior to the specified date + match compute_startdate_string(roll_back_date.clone()){ + Some(start_date) => { + let sd_string = format!("{}", start_date.format("%Y-%m-%d_%H:%M:%S")); + let start_json: Vec = serde_json::to_vec(&sd_string).unwrap(); + let end_json: Vec = serde_json::to_vec(&roll_back_date).unwrap(); + let r: sled::Iter = lox_db.range(IVec::from(start_json)..IVec::from(end_json), ); + match r.last(){ + Some(entry) => { + let ivec_context = entry.unwrap(); + let json_key: String = serde_json::from_slice(&ivec_context.0).unwrap(); + println!("Successfully used range and key {:?}", json_key); + context = serde_json::from_slice(&ivec_context.1).unwrap() + }, + //If no entries are found within the 24 hours prior to the specified date, Exit + None => panic!("UNEXPECTED DATE: No entries found in the 24 hours prior to the input roll_back_date"), + } + } + None => panic!("UNEXPECTED DATE: Tried to use input date to calculate 24 hour range but failed. Exiting."), + } + } + } + // Use the last entry to populate the Lox context if no rollback date is set (which should be most common) + None => { + context = use_last_context(lox_db); } - println!("date_range_start must be <= date_range_end! Check config file"); - return false; } - println!("date_range_start specified but no date_range_end! Check config file"); - false + context } -fn use_last_context(cloned_db: sled::Db) -> lox_context::LoxServerContext { - let ivec_context = cloned_db.last().unwrap().unwrap(); +fn compute_startdate_string(date_range_end: String) -> Option> { + let parsed_end = + DateTime::parse_from_str(&date_range_end, "context_%Y-%m-%d_%H:%M:%S").unwrap(); + parsed_end + .with_timezone(&Utc) + .checked_sub_days(Days::new(1)) +} + +fn use_last_context(db: sled::Db) -> lox_context::LoxServerContext { + let ivec_context = db.last().unwrap().unwrap(); let ivec_date: String = serde_json::from_slice(&ivec_context.0).unwrap(); println!("Using last context with date: {:?}", ivec_date); serde_json::from_slice(&ivec_context.1).unwrap() diff --git a/crates/lox-distributor/src/main.rs b/crates/lox-distributor/src/main.rs index 19a73ad..2ef222f 100644 --- a/crates/lox-distributor/src/main.rs +++ b/crates/lox-distributor/src/main.rs @@ -17,7 +17,7 @@ use std::{ }; mod db_handler; -use db_handler::{find_existing_db, write_context_to_db}; +use db_handler::{open_new_or_existing_db, write_context_to_db}; mod lox_context; mod request_handler; use request_handler::handle; @@ -44,16 +44,20 @@ struct Args { #[arg(short, long, default_value = "config.json")] config: PathBuf, - /// Optional name/path of the lox context json backup file - /// Used to populate the Lox context. If none is provided, an empty - /// Lox context will be created + // Optional Date/time to roll back to as a %Y-%m-%d_%H:%M:%S string + // This argument should be passed if the lox_context should be rolled back to a + // previous state due to, for example, a mass blocking event that is likely not + // due to Lox user behaviour. If the exact roll back date/time is not known, the + // last db entry within 24 hours from the passed roll_back_date will be used or else + // the program will fail gracefully. #[arg(short, long, verbatim_doc_comment)] - backup_context: Option, + roll_back_date: Option, } #[derive(Debug, Deserialize)] struct Config { db: DbConfig, + rtype: ResourceInfo, } @@ -61,32 +65,15 @@ struct Config { pub struct DbConfig { // The path for the lox_context database, default is "lox_db" db_path: String, - // Optional Date/time to roll back to - // This should be blank for normal operation and only changed if the lox_context - // should be rolled back to a previous state - roll_back_date: Option, } impl Default for DbConfig { fn default() -> DbConfig { DbConfig { db_path: "lox_db".to_owned(), - roll_back_date: None, } } } -#[derive(Debug, Deserialize)] -pub struct RollBackDate { - // Optional exact Date/time to roll back to as a %Y-%m-%d_%H:%M:%S string - // This should only be changed if the lox_context should be rolled back to a - // previous state and the exact roll back date/time is known - exact_date: Option, - // Since the exact time the database last saved the context may not be obvious, - // this can be presented as a range from which the most recent date in the database will be - // selected - date_range_start: Option, - date_range_end: Option, -} #[derive(Debug, Deserialize)] struct ResourceInfo { @@ -146,11 +133,12 @@ async fn parse_bridges(rdsys_tx: mpsc::Sender, mut rx: mpsc::Receiver, context_rx: mpsc::Receiver, mut kill: broadcast::Receiver<()>, ) { tokio::select! { - create_context = context_manager(db_config, context_rx) => create_context, + create_context = context_manager(db_config, roll_back_date, context_rx) => create_context, _ = kill.recv() => {println!("Shut down context_manager");}, } } @@ -158,8 +146,12 @@ async fn create_context_manager( // Context Manager handles the Lox BridgeDB and Bridge Authority, ensuring // that the DB can be updated from the rdsys stream and client requests // can be responded to with an updated BridgeDB state -async fn context_manager(db_config: DbConfig, mut context_rx: mpsc::Receiver) { - let (lox_db, context) = match find_existing_db(db_config) { +async fn context_manager( + db_config: DbConfig, + roll_back_date: Option, + mut context_rx: mpsc::Receiver, +) { + let (lox_db, context) = match open_new_or_existing_db(db_config, roll_back_date) { Ok((lox_db, context)) => (lox_db, context), Err(e) => { panic!("Error: {:?}", e); @@ -379,8 +371,9 @@ async fn main() { } }); - let context_manager = - spawn(async move { create_context_manager(config.db, context_rx, kill_context).await }); + let context_manager = spawn(async move { + create_context_manager(config.db, args.roll_back_date, context_rx, kill_context).await + }); let (tx, rx) = mpsc::channel(32); let rdsys_stream_handler = spawn(async { rdsys_stream(config.rtype, tx, kill_stream).await }); From 5dc2ed2a9038450fc66d9abddb599c2dded4ce59 Mon Sep 17 00:00:00 2001 From: onyinyang Date: Tue, 22 Aug 2023 15:19:33 -0400 Subject: [PATCH 05/59] Added minor fixes required for actual input --- crates/lox-distributor/src/db_handler.rs | 57 +++++++++++++----------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/crates/lox-distributor/src/db_handler.rs b/crates/lox-distributor/src/db_handler.rs index 5f13c89..c83c084 100644 --- a/crates/lox-distributor/src/db_handler.rs +++ b/crates/lox-distributor/src/db_handler.rs @@ -1,7 +1,7 @@ use std::sync::{Arc, Mutex}; use crate::{lox_context, DbConfig}; -use chrono::{naive::Days, DateTime, Local, Utc}; +use chrono::{naive::Days, DateTime, Local, NaiveDateTime, Utc}; use lox_library::{BridgeAuth, BridgeDb}; use sled::IVec; @@ -32,7 +32,6 @@ pub fn open_new_or_existing_db( // Check if the lox_db already exists if lox_db.was_recovered() { context = read_lox_context_from_db(lox_db.clone(), roll_back_date); - //Otherwise, create a new Lox context } else { let new_db = BridgeDb::new(); @@ -66,32 +65,31 @@ fn read_lox_context_from_db( // If the date is specified and it's in the database, use that to populate the context if lox_db.contains_key(roll_back_date.clone()).unwrap() { // Find date/time in db and use the context from that date. - - let json_exact_date = serde_json::to_vec(&roll_back_date).unwrap(); - let ivec_context = lox_db.get(IVec::from(json_exact_date)).unwrap().unwrap(); + let ivec_context = lox_db + .get(IVec::from(roll_back_date.as_bytes().to_vec())) + .unwrap() + .unwrap(); context = serde_json::from_slice(&ivec_context).unwrap(); println!("Successfully used exact key {:?}", roll_back_date); } else { // If the exact date is not found, compute the start of the range as 24 hours prior to the specified date match compute_startdate_string(roll_back_date.clone()){ - Some(start_date) => { - let sd_string = format!("{}", start_date.format("%Y-%m-%d_%H:%M:%S")); - let start_json: Vec = serde_json::to_vec(&sd_string).unwrap(); - let end_json: Vec = serde_json::to_vec(&roll_back_date).unwrap(); - let r: sled::Iter = lox_db.range(IVec::from(start_json)..IVec::from(end_json), ); - match r.last(){ - Some(entry) => { - let ivec_context = entry.unwrap(); - let json_key: String = serde_json::from_slice(&ivec_context.0).unwrap(); - println!("Successfully used range and key {:?}", json_key); - context = serde_json::from_slice(&ivec_context.1).unwrap() - }, - //If no entries are found within the 24 hours prior to the specified date, Exit - None => panic!("UNEXPECTED DATE: No entries found in the 24 hours prior to the input roll_back_date"), - } - } - None => panic!("UNEXPECTED DATE: Tried to use input date to calculate 24 hour range but failed. Exiting."), - } + Some(start_date) => { + let start_date = start_date.format("context_%Y-%m-%d_%H:%M:%S").to_string(); + let r: sled::Iter = lox_db.range(IVec::from(start_date.as_bytes().to_vec())..IVec::from(roll_back_date.as_bytes().to_vec()), ); + match r.last(){ + Some(entry) => { + let ivec_context = entry.unwrap(); + let key: String = String::from_utf8(ivec_context.0.to_vec()).unwrap(); + println!("Successfully used range and key {:?}", key); + context = serde_json::from_slice(&ivec_context.1).unwrap(); + }, + //If no entries are found within the 24 hours prior to the specified date, Exit + None => panic!("UNEXPECTED DATE: No entries found in the 24 hours prior to the input roll_back_date"), + } + } + None => panic!("UNEXPECTED DATE: Tried to use input date to calculate 24 hour range but failed. Exiting."), + } } } // Use the last entry to populate the Lox context if no rollback date is set (which should be most common) @@ -104,10 +102,15 @@ fn read_lox_context_from_db( fn compute_startdate_string(date_range_end: String) -> Option> { let parsed_end = - DateTime::parse_from_str(&date_range_end, "context_%Y-%m-%d_%H:%M:%S").unwrap(); - parsed_end - .with_timezone(&Utc) - .checked_sub_days(Days::new(1)) + NaiveDateTime::parse_from_str(&date_range_end, "context_%Y-%m-%d_%H:%M:%S").unwrap(); + let dt = DateTime::::from_utc(parsed_end, Utc); + println!("WHat is datetime here: {:?}", dt); + println!( + "WHat is datetime - 1 subday here: {:?}", + dt.with_timezone(&Utc).checked_sub_days(Days::new(1)) + ); + + dt.with_timezone(&Utc).checked_sub_days(Days::new(1)) } fn use_last_context(db: sled::Db) -> lox_context::LoxServerContext { From 84fa10cbe15b67798751beaae03914bed268680e Mon Sep 17 00:00:00 2001 From: onyinyang Date: Thu, 7 Sep 2023 16:22:06 -0400 Subject: [PATCH 06/59] Adds DB struct and impl to db_handler --- crates/lox-distributor/src/db_handler.rs | 102 +++++++++++------------ crates/lox-distributor/src/main.rs | 6 +- 2 files changed, 54 insertions(+), 54 deletions(-) diff --git a/crates/lox-distributor/src/db_handler.rs b/crates/lox-distributor/src/db_handler.rs index c83c084..e732da6 100644 --- a/crates/lox-distributor/src/db_handler.rs +++ b/crates/lox-distributor/src/db_handler.rs @@ -5,51 +5,57 @@ use chrono::{naive::Days, DateTime, Local, NaiveDateTime, Utc}; use lox_library::{BridgeAuth, BridgeDb}; use sled::IVec; -pub fn write_context_to_db(db: sled::Db, context: lox_context::LoxServerContext) { - let date = Local::now().format("context_%Y-%m-%d_%H:%M:%S").to_string(); - let json_result = serde_json::to_vec(&context).unwrap(); - println!("Date: {:?}", date); - let new_ivec = db.insert( - IVec::from(date.as_bytes().to_vec()), - IVec::from(json_result.clone()), - ); - assert_eq!( - db.get(IVec::from(date.as_bytes().to_vec())) - .unwrap() - .unwrap(), - IVec::from(json_result) - ); - println!("New entry key: {:?}", new_ivec); +pub struct DB { + db: sled::Db, } -pub fn open_new_or_existing_db( - db_config: DbConfig, - roll_back_date: Option, -) -> Result<(sled::Db, lox_context::LoxServerContext), sled::Error> { - let context: lox_context::LoxServerContext; - let (lox_db, context) = match sled::open(db_config.db_path) { - Ok(lox_db) => { - // Check if the lox_db already exists - if lox_db.was_recovered() { - context = read_lox_context_from_db(lox_db.clone(), roll_back_date); - //Otherwise, create a new Lox context - } else { - let new_db = BridgeDb::new(); - let new_ba = BridgeAuth::new(new_db.pubkey); - context = lox_context::LoxServerContext { - db: Arc::new(Mutex::new(new_db)), - ba: Arc::new(Mutex::new(new_ba)), - extra_bridges: Arc::new(Mutex::new(Vec::new())), - to_be_replaced_bridges: Arc::new(Mutex::new(Vec::new())), - }; +impl DB { + pub fn write_context(&mut self, context: lox_context::LoxServerContext) { + let date = Local::now().format("context_%Y-%m-%d_%H:%M:%S").to_string(); + let json_result = serde_json::to_vec(&context).unwrap(); + println!("Writing context to the db with key: {:?}", date); + let _new_ivec = self.db.insert( + IVec::from(date.as_bytes().to_vec()), + IVec::from(json_result.clone()), + ); + assert_eq!( + self.db + .get(IVec::from(date.as_bytes().to_vec())) + .unwrap() + .unwrap(), + IVec::from(json_result) + ); + } + + pub fn open_new_or_existing_db( + db_config: DbConfig, + roll_back_date: Option, + ) -> Result<(DB, lox_context::LoxServerContext), sled::Error> { + let context: lox_context::LoxServerContext; + let (lox_db, context) = match sled::open(db_config.db_path) { + Ok(lox_db) => { + // Check if the lox_db already exists + if lox_db.was_recovered() { + context = read_lox_context_from_db(lox_db.clone(), roll_back_date); + //Otherwise, create a new Lox context + } else { + let new_db = BridgeDb::new(); + let new_ba = BridgeAuth::new(new_db.pubkey); + context = lox_context::LoxServerContext { + db: Arc::new(Mutex::new(new_db)), + ba: Arc::new(Mutex::new(new_ba)), + extra_bridges: Arc::new(Mutex::new(Vec::new())), + to_be_replaced_bridges: Arc::new(Mutex::new(Vec::new())), + }; + } + (DB { db: lox_db }, context) } - (lox_db, context) - } - Err(e) => { - panic!("Unable to read or create lox database! {:?}", e); - } - }; - Ok((lox_db, context)) + Err(e) => { + panic!("Unable to read or create lox database! {:?}", e); + } + }; + Ok((lox_db, context)) + } } fn read_lox_context_from_db( @@ -103,18 +109,12 @@ fn read_lox_context_from_db( fn compute_startdate_string(date_range_end: String) -> Option> { let parsed_end = NaiveDateTime::parse_from_str(&date_range_end, "context_%Y-%m-%d_%H:%M:%S").unwrap(); - let dt = DateTime::::from_utc(parsed_end, Utc); - println!("WHat is datetime here: {:?}", dt); - println!( - "WHat is datetime - 1 subday here: {:?}", - dt.with_timezone(&Utc).checked_sub_days(Days::new(1)) - ); - + let dt = DateTime::::from_naive_utc_and_offset(parsed_end, Utc); dt.with_timezone(&Utc).checked_sub_days(Days::new(1)) } -fn use_last_context(db: sled::Db) -> lox_context::LoxServerContext { - let ivec_context = db.last().unwrap().unwrap(); +fn use_last_context(lox_db: sled::Db) -> lox_context::LoxServerContext { + let ivec_context = lox_db.last().unwrap().unwrap(); let ivec_date: String = serde_json::from_slice(&ivec_context.0).unwrap(); println!("Using last context with date: {:?}", ivec_date); serde_json::from_slice(&ivec_context.1).unwrap() diff --git a/crates/lox-distributor/src/main.rs b/crates/lox-distributor/src/main.rs index 2ef222f..47bcd6a 100644 --- a/crates/lox-distributor/src/main.rs +++ b/crates/lox-distributor/src/main.rs @@ -17,7 +17,7 @@ use std::{ }; mod db_handler; -use db_handler::{open_new_or_existing_db, write_context_to_db}; +use db_handler::DB; mod lox_context; mod request_handler; use request_handler::handle; @@ -151,7 +151,7 @@ async fn context_manager( roll_back_date: Option, mut context_rx: mpsc::Receiver, ) { - let (lox_db, context) = match open_new_or_existing_db(db_config, roll_back_date) { + let (mut lox_db, context) = match DB::open_new_or_existing_db(db_config, roll_back_date) { Ok((lox_db, context)) => (lox_db, context), Err(e) => { panic!("Error: {:?}", e); @@ -303,7 +303,7 @@ async fn context_manager( */ context.allocate_leftover_bridges(); context.encrypt_table(); - write_context_to_db(lox_db.clone(), context.clone()); + lox_db.write_context(context.clone()); sleep(Duration::from_millis(1)).await; } Request { req, sender } => { From 56632e9dec0215eb959f679197343456250c49ed Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 11 Sep 2023 15:34:49 +0000 Subject: [PATCH 07/59] Update Rust crate chrono to 0.4.30 --- Cargo.lock | 30 ++++++----------------------- crates/lox-distributor/Cargo.toml | 2 +- crates/lox-wasm/Cargo.toml | 2 +- crates/rdsys-backend-api/Cargo.toml | 2 +- 4 files changed, 9 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 694bc44..1c057ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -247,16 +247,15 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.27" +version = "0.4.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f56b4c72906975ca04becb8a30e102dfecddd0c06181e3e95ddc444be28881f8" +checksum = "defd4e7873dbddba6c7c91e199c7fcb946abc4a6a4ac3195400bcfb01b5de877" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "serde", - "time 0.1.45", "wasm-bindgen", "windows-targets", ] @@ -1068,7 +1067,7 @@ dependencies = [ "serde_json", "serde_with", "sled", - "time 0.3.28", + "time", "tokio", "zkp", ] @@ -1092,7 +1091,7 @@ dependencies = [ "statistical", "subtle", "thiserror", - "time 0.3.28", + "time", "zkp", ] @@ -1109,7 +1108,7 @@ dependencies = [ "lox_utils", "rand 0.7.3", "serde_json", - "time 0.3.28", + "time", "wasm-bindgen", "zkp", ] @@ -1855,7 +1854,7 @@ dependencies = [ "serde", "serde_json", "serde_with_macros", - "time 0.3.28", + "time", ] [[package]] @@ -2022,17 +2021,6 @@ dependencies = [ "syn", ] -[[package]] -name = "time" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - [[package]] name = "time" version = "0.3.28" @@ -2255,12 +2243,6 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" diff --git a/crates/lox-distributor/Cargo.toml b/crates/lox-distributor/Cargo.toml index 8ff6556..3decbcf 100644 --- a/crates/lox-distributor/Cargo.toml +++ b/crates/lox-distributor/Cargo.toml @@ -31,5 +31,5 @@ serde_json = "1.0.105" sled = "0.34.7" [dependencies.chrono] -version = "0.4.27" +version = "0.4.30" features = ["serde"] diff --git a/crates/lox-wasm/Cargo.toml b/crates/lox-wasm/Cargo.toml index 01c14c7..304ecb8 100644 --- a/crates/lox-wasm/Cargo.toml +++ b/crates/lox-wasm/Cargo.toml @@ -24,5 +24,5 @@ rand = { version = "0.7", features = ["wasm-bindgen"] } zkp = "0.8.0" [dependencies.chrono] -version = "0.4.27" +version = "0.4.30" features = ["serde", "wasmbind"] diff --git a/crates/rdsys-backend-api/Cargo.toml b/crates/rdsys-backend-api/Cargo.toml index 853ff15..387376e 100644 --- a/crates/rdsys-backend-api/Cargo.toml +++ b/crates/rdsys-backend-api/Cargo.toml @@ -19,4 +19,4 @@ reqwest = { version = "0.11", features = ["stream"]} tokio-stream = "0.1.14" futures = "0.3.28" tokio-util = "0.7.8" -chrono = { version = "0.4.27", features = ["serde", "clock"] } +chrono = { version = "0.4.30", features = ["serde", "clock"] } From aade6e4913849719862469af6e17c47708ef0d87 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 11 Sep 2023 17:04:02 +0000 Subject: [PATCH 08/59] Update Rust crate serde_json to 1.0.106 --- Cargo.lock | 4 ++-- crates/lox-distributor/Cargo.toml | 2 +- crates/lox-utils/Cargo.toml | 2 +- crates/lox-wasm/Cargo.toml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1c057ff..3a55d79 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1819,9 +1819,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.105" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360" +checksum = "2cc66a619ed80bf7a0f6b17dd063a84b88f6dea1813737cf469aef1d081142c2" dependencies = [ "itoa", "ryu", diff --git a/crates/lox-distributor/Cargo.toml b/crates/lox-distributor/Cargo.toml index 3decbcf..bdcd38f 100644 --- a/crates/lox-distributor/Cargo.toml +++ b/crates/lox-distributor/Cargo.toml @@ -27,7 +27,7 @@ lox-library = { path = "../lox-library", version = "0.1.0"} lox_utils = { path = "../lox-utils", version = "0.1.0"} rdsys_backend = { path = "../rdsys-backend-api", version = "0.2"} clap = { version = "4.4.2", features = ["derive"] } -serde_json = "1.0.105" +serde_json = "1.0.106" sled = "0.34.7" [dependencies.chrono] diff --git a/crates/lox-utils/Cargo.toml b/crates/lox-utils/Cargo.toml index 0ba29b8..7691137 100644 --- a/crates/lox-utils/Cargo.toml +++ b/crates/lox-utils/Cargo.toml @@ -14,7 +14,7 @@ repository = "https://gitlab.torproject.org/tpo/anti-censorship/lox.git/" [dependencies] lox-library = {path = "../lox-library", version = "0.1.0"} serde = "1" -serde_json = "1.0.105" +serde_json = "1.0.106" serde_with = "3.3.0" diff --git a/crates/lox-wasm/Cargo.toml b/crates/lox-wasm/Cargo.toml index 304ecb8..c2a88da 100644 --- a/crates/lox-wasm/Cargo.toml +++ b/crates/lox-wasm/Cargo.toml @@ -16,7 +16,7 @@ lox-library = { path = "../lox-library", version = "0.1.0" } lox_utils = { path = "../lox-utils", version = "0.1.0" } wasm-bindgen = "0.2" time = "0.3.28" -serde_json = "1.0.105" +serde_json = "1.0.106" console_error_panic_hook = "0.1.7" js-sys = "0.3.64" From 8ec1f6237dabe68bae4e65921bc362afa794c35d Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 11 Sep 2023 17:35:00 +0000 Subject: [PATCH 09/59] Update Rust crate subtle to 2.5 --- Cargo.lock | 8 ++++---- crates/lox-library/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3a55d79..478d053 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1967,9 +1967,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "subtle-ng" @@ -2191,9 +2191,9 @@ dependencies = [ [[package]] name = "universal-hash" -version = "0.4.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" +checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402" dependencies = [ "generic-array", "subtle", diff --git a/crates/lox-library/Cargo.toml b/crates/lox-library/Cargo.toml index 30c6cda..dcfa9a0 100644 --- a/crates/lox-library/Cargo.toml +++ b/crates/lox-library/Cargo.toml @@ -25,7 +25,7 @@ hex_fmt = "0.3" aes-gcm = "0.8" base64 = "0.13" time = "0.3.28" -subtle = "2.4" +subtle = "2.5" thiserror = "1.0.48" [features] From 58372854550d26a5dc138866d16e76bbdfd0727f Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 12 Sep 2023 18:33:51 +0000 Subject: [PATCH 10/59] Update Rust crate clap to 4.4.3 --- Cargo.lock | 4 ++-- crates/lox-distributor/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 478d053..1689bd2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -271,9 +271,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.2" +version = "4.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a13b88d2c62ff462f88e4a121f17a82c1af05693a2f192b5c38d14de73c19f6" +checksum = "84ed82781cea27b43c9b106a979fe450a13a31aab0500595fb3fc06616de08e6" dependencies = [ "clap_builder", "clap_derive", diff --git a/crates/lox-distributor/Cargo.toml b/crates/lox-distributor/Cargo.toml index bdcd38f..c886517 100644 --- a/crates/lox-distributor/Cargo.toml +++ b/crates/lox-distributor/Cargo.toml @@ -26,7 +26,7 @@ zkp = "0.8.0" lox-library = { path = "../lox-library", version = "0.1.0"} lox_utils = { path = "../lox-utils", version = "0.1.0"} rdsys_backend = { path = "../rdsys-backend-api", version = "0.2"} -clap = { version = "4.4.2", features = ["derive"] } +clap = { version = "4.4.3", features = ["derive"] } serde_json = "1.0.106" sled = "0.34.7" From 67ae3ce5e269a7372e0f055c4d3bba186b579c86 Mon Sep 17 00:00:00 2001 From: onyinyang Date: Wed, 13 Sep 2023 14:21:15 -0400 Subject: [PATCH 11/59] Add documentation for db setup and more frequent save --- crates/lox-distributor/README.md | 12 +++++++++--- crates/lox-distributor/src/main.rs | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/crates/lox-distributor/README.md b/crates/lox-distributor/README.md index cbfe60f..329e769 100644 --- a/crates/lox-distributor/README.md +++ b/crates/lox-distributor/README.md @@ -1,12 +1,11 @@ # Lox Distributor The Lox distributor receives resources from [rdsys](https://gitlab.torproject.org/tpo/anti-censorship/rdsys) and writes them to [Lox -BridgeLines](https://git-crysp.uwaterloo.ca/iang/lox/src/master/src/bridge_table.rs#L42). Concurrently, it receives and responds to requests from [Lox clients](https://gitlab.torproject.org/tpo/anti-censorship/lox/lox-wasm). - +BridgeLines](https://git-crysp.uwaterloo.ca/iang/lox/src/master/src/bridge_table.rs#L42). Concurrently, it receives and responds to requests from [Lox clients](https://gitlab.torproject.org/tpo/anti-censorship/lox/lox-wasm). It saves the [LoxContext](https://gitlab.torproject.org/tpo/anti-censorship/lox-rs/-/blob/main/crates/lox-distributor/src/lox_context.rs) to a database every time the Lox bridgetable is updated and before the distributor is shutdown. ## Configure rdsys stream A test `config.json` is included for testing on a local instance of rdsys. This -can be edited to correspond to the desired types of resources and endpoints. +can be edited to correspond to the desired types of resources, endpoints and database configuration. ## Test Run @@ -26,6 +25,13 @@ Finally run rdsys: ./backend --config config.json ``` +## Database Config + +The database has a few configuration options. The path for where the database +should be read/written can be specified in the `config.json`. Rolling back to a +previous version of the database is also possible by passing the +`roll_back_date` flag at runtime and providing the date/time as a `%Y-%m-%d_%H:%M:%S` string. This argument should be passed if the `LoxContext` should be rolled back to a previous state due to, for example, a mass blocking event that is likely not due to Lox user behaviour. If the exact roll back date/time is not known, the last db entry within 24 hours from the passed `roll_back_date` will be used or else the program will fail gracefully. + ### Run Lox Distributor locally Simply run `cargo run -- config.json` :) diff --git a/crates/lox-distributor/src/main.rs b/crates/lox-distributor/src/main.rs index 47bcd6a..416184b 100644 --- a/crates/lox-distributor/src/main.rs +++ b/crates/lox-distributor/src/main.rs @@ -311,9 +311,11 @@ async fn context_manager( if let Err(e) = sender.send(response) { eprintln!("Server Response Error: {:?}", e); }; + lox_db.write_context(context.clone()); sleep(Duration::from_millis(1)).await; } Shutdown { shutdown_sig } => { + lox_db.write_context(context.clone()); println!("Sending Shutdown Signal, all threads should shutdown."); drop(shutdown_sig); println!("Shutdown Sent."); From 19b30f6a1f5431f7eb7e0270b954f5c6e18887ee Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 13 Sep 2023 23:03:48 +0000 Subject: [PATCH 12/59] Update Rust crate serde_json to 1.0.107 --- Cargo.lock | 4 ++-- crates/lox-distributor/Cargo.toml | 2 +- crates/lox-utils/Cargo.toml | 2 +- crates/lox-wasm/Cargo.toml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1689bd2..7d296b2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1819,9 +1819,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.106" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc66a619ed80bf7a0f6b17dd063a84b88f6dea1813737cf469aef1d081142c2" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ "itoa", "ryu", diff --git a/crates/lox-distributor/Cargo.toml b/crates/lox-distributor/Cargo.toml index c886517..c9389bd 100644 --- a/crates/lox-distributor/Cargo.toml +++ b/crates/lox-distributor/Cargo.toml @@ -27,7 +27,7 @@ lox-library = { path = "../lox-library", version = "0.1.0"} lox_utils = { path = "../lox-utils", version = "0.1.0"} rdsys_backend = { path = "../rdsys-backend-api", version = "0.2"} clap = { version = "4.4.3", features = ["derive"] } -serde_json = "1.0.106" +serde_json = "1.0.107" sled = "0.34.7" [dependencies.chrono] diff --git a/crates/lox-utils/Cargo.toml b/crates/lox-utils/Cargo.toml index 7691137..dabfbdb 100644 --- a/crates/lox-utils/Cargo.toml +++ b/crates/lox-utils/Cargo.toml @@ -14,7 +14,7 @@ repository = "https://gitlab.torproject.org/tpo/anti-censorship/lox.git/" [dependencies] lox-library = {path = "../lox-library", version = "0.1.0"} serde = "1" -serde_json = "1.0.106" +serde_json = "1.0.107" serde_with = "3.3.0" diff --git a/crates/lox-wasm/Cargo.toml b/crates/lox-wasm/Cargo.toml index c2a88da..5a2fc8a 100644 --- a/crates/lox-wasm/Cargo.toml +++ b/crates/lox-wasm/Cargo.toml @@ -16,7 +16,7 @@ lox-library = { path = "../lox-library", version = "0.1.0" } lox_utils = { path = "../lox-utils", version = "0.1.0" } wasm-bindgen = "0.2" time = "0.3.28" -serde_json = "1.0.106" +serde_json = "1.0.107" console_error_panic_hook = "0.1.7" js-sys = "0.3.64" From 212105ca4d99481a52945a9e06d90b146f2b3744 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 11 Sep 2023 17:34:39 +0000 Subject: [PATCH 13/59] Update Rust crate base64 to v0.21.4 --- Cargo.lock | 18 ++++++------------ crates/lox-distributor/Cargo.toml | 2 +- crates/lox-library/Cargo.toml | 2 +- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7d296b2..9698e09 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -166,15 +166,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.13.1" +version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - -[[package]] -name = "base64" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" [[package]] name = "bincode" @@ -1052,7 +1046,7 @@ checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" name = "lox-distributor" version = "0.1.0" dependencies = [ - "base64 0.13.1", + "base64", "chrono", "clap", "futures", @@ -1077,7 +1071,7 @@ name = "lox-library" version = "0.1.0" dependencies = [ "aes-gcm", - "base64 0.13.1", + "base64", "bincode", "chrono", "curve25519-dalek-ng", @@ -1692,7 +1686,7 @@ version = "0.11.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" dependencies = [ - "base64 0.21.2", + "base64", "bytes", "encoding_rs", "futures-core", @@ -1846,7 +1840,7 @@ version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ca3b16a3d82c4088f343b7480a93550b3eabe1a358569c2dfe38bbcead07237" dependencies = [ - "base64 0.21.2", + "base64", "chrono", "hex", "indexmap 1.9.3", diff --git a/crates/lox-distributor/Cargo.toml b/crates/lox-distributor/Cargo.toml index c9389bd..2af77df 100644 --- a/crates/lox-distributor/Cargo.toml +++ b/crates/lox-distributor/Cargo.toml @@ -12,7 +12,7 @@ keywords = ["tor", "lox", "bridges"] [dependencies] julianday = "1.2.0" -base64 = "0.13.1" +base64 = "0.21.4" hyper = { version = "0.14.27", features = ["server"] } hex_fmt = "0.3" futures = "0.3.28" diff --git a/crates/lox-library/Cargo.toml b/crates/lox-library/Cargo.toml index dcfa9a0..4f58682 100644 --- a/crates/lox-library/Cargo.toml +++ b/crates/lox-library/Cargo.toml @@ -23,7 +23,7 @@ statistical = "1.0.0" lazy_static = "1" hex_fmt = "0.3" aes-gcm = "0.8" -base64 = "0.13" +base64 = "0.21" time = "0.3.28" subtle = "2.5" thiserror = "1.0.48" From f85878c89af95395e5e8b2101dc11df2a50290c6 Mon Sep 17 00:00:00 2001 From: onyinyang Date: Tue, 12 Sep 2023 18:24:48 -0400 Subject: [PATCH 14/59] Change base64 generator to match updates --- crates/lox-distributor/src/request_handler.rs | 3 ++- crates/lox-library/src/bridge_table.rs | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/lox-distributor/src/request_handler.rs b/crates/lox-distributor/src/request_handler.rs index c236a52..260923a 100644 --- a/crates/lox-distributor/src/request_handler.rs +++ b/crates/lox-distributor/src/request_handler.rs @@ -71,6 +71,7 @@ mod tests { use super::*; + use base64::{engine::general_purpose, Engine as _}; use chrono::{Duration, Utc}; use julianday::JulianDay; use lox_library::{ @@ -292,7 +293,7 @@ mod tests { rng.fill_bytes(&mut cert); let infostr: String = format!( "obfs4 cert={}, iat-mode=0", - base64::encode_config(cert, base64::STANDARD_NO_PAD) + general_purpose::STANDARD_NO_PAD.encode(cert) ); res.info[..infostr.len()].copy_from_slice(infostr.as_bytes()); res diff --git a/crates/lox-library/src/bridge_table.rs b/crates/lox-library/src/bridge_table.rs index d820bd0..434d2f5 100644 --- a/crates/lox-library/src/bridge_table.rs +++ b/crates/lox-library/src/bridge_table.rs @@ -13,6 +13,7 @@ use super::CMZ_B_TABLE; use aes_gcm::aead; use aes_gcm::aead::{generic_array::GenericArray, Aead, NewAead}; use aes_gcm::Aes128Gcm; +use base64::{engine::general_purpose, Engine as _}; use curve25519_dalek::ristretto::CompressedRistretto; use curve25519_dalek::ristretto::RistrettoBasepointTable; use curve25519_dalek::scalar::Scalar; @@ -170,6 +171,7 @@ impl BridgeLine { (bridges, None) } } + /// Create a random BridgeLine for testing #[cfg(test)] pub fn random() -> Self { @@ -197,7 +199,7 @@ impl BridgeLine { rng.fill_bytes(&mut cert); let infostr: String = format!( "obfs4 cert={}, iat-mode=0", - base64::encode_config(cert, base64::STANDARD_NO_PAD) + general_purpose::STANDARD_NO_PAD.encode(cert) ); res.info[..infostr.len()].copy_from_slice(infostr.as_bytes()); res From c5bc0ee40816782d004d558adf84a39c29a6d6d0 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 15 Sep 2023 15:03:48 +0000 Subject: [PATCH 15/59] Update Rust crate chrono to 0.4.31 --- Cargo.lock | 4 ++-- crates/lox-distributor/Cargo.toml | 2 +- crates/lox-wasm/Cargo.toml | 2 +- crates/rdsys-backend-api/Cargo.toml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9698e09..8e24bdb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -241,9 +241,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.30" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defd4e7873dbddba6c7c91e199c7fcb946abc4a6a4ac3195400bcfb01b5de877" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", diff --git a/crates/lox-distributor/Cargo.toml b/crates/lox-distributor/Cargo.toml index 2af77df..c74ad1f 100644 --- a/crates/lox-distributor/Cargo.toml +++ b/crates/lox-distributor/Cargo.toml @@ -31,5 +31,5 @@ serde_json = "1.0.107" sled = "0.34.7" [dependencies.chrono] -version = "0.4.30" +version = "0.4.31" features = ["serde"] diff --git a/crates/lox-wasm/Cargo.toml b/crates/lox-wasm/Cargo.toml index 5a2fc8a..8e58492 100644 --- a/crates/lox-wasm/Cargo.toml +++ b/crates/lox-wasm/Cargo.toml @@ -24,5 +24,5 @@ rand = { version = "0.7", features = ["wasm-bindgen"] } zkp = "0.8.0" [dependencies.chrono] -version = "0.4.30" +version = "0.4.31" features = ["serde", "wasmbind"] diff --git a/crates/rdsys-backend-api/Cargo.toml b/crates/rdsys-backend-api/Cargo.toml index 387376e..a8305b3 100644 --- a/crates/rdsys-backend-api/Cargo.toml +++ b/crates/rdsys-backend-api/Cargo.toml @@ -19,4 +19,4 @@ reqwest = { version = "0.11", features = ["stream"]} tokio-stream = "0.1.14" futures = "0.3.28" tokio-util = "0.7.8" -chrono = { version = "0.4.30", features = ["serde", "clock"] } +chrono = { version = "0.4.31", features = ["serde", "clock"] } From 464faaca5a6b80c24bba90ee49d80f0e4476f656 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 11 Sep 2023 18:05:22 +0000 Subject: [PATCH 16/59] Update Rust crate aes-gcm to 0.10 --- Cargo.lock | 81 +++++++++++++++-------------------- crates/lox-library/Cargo.toml | 2 +- 2 files changed, 35 insertions(+), 48 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8e24bdb..fcaa703 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,29 +19,30 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aead" -version = "0.3.2" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" dependencies = [ + "crypto-common", "generic-array", ] [[package]] name = "aes" -version = "0.6.0" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884391ef1066acaa41e766ba8f596341b96e93ce34f9a43e7d24bf0a0eaf0561" +checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" dependencies = [ - "aes-soft", - "aesni", + "cfg-if", "cipher", + "cpufeatures", ] [[package]] name = "aes-gcm" -version = "0.8.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5278b5fabbb9bd46e24aa69b2fdea62c99088e0a950a9be40e3e0101298f88da" +checksum = "209b47e8954a928e1d72e86eca7000ebb6655fe1436d33eefc2201cad027e237" dependencies = [ "aead", "aes", @@ -51,26 +52,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "aes-soft" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" -dependencies = [ - "cipher", - "opaque-debug", -] - -[[package]] -name = "aesni" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" -dependencies = [ - "cipher", - "opaque-debug", -] - [[package]] name = "android-tzdata" version = "0.1.1" @@ -256,11 +237,12 @@ dependencies = [ [[package]] name = "cipher" -version = "0.2.5" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ - "generic-array", + "crypto-common", + "inout", ] [[package]] @@ -353,12 +335,6 @@ dependencies = [ "libc", ] -[[package]] -name = "cpuid-bool" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" - [[package]] name = "crc32fast" version = "1.3.2" @@ -403,14 +379,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", + "rand_core 0.6.4", "typenum", ] [[package]] name = "ctr" -version = "0.6.0" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb4a30d54f7443bf3d6191dcd486aca19e67cb3c49fa7a06a319966346707e7f" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" dependencies = [ "cipher", ] @@ -753,9 +730,9 @@ dependencies = [ [[package]] name = "ghash" -version = "0.3.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97304e4cd182c3846f7575ced3890c53012ce534ad9114046b0a9e00bb30a375" +checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" dependencies = [ "opaque-debug", "polyval", @@ -954,6 +931,15 @@ dependencies = [ "serde", ] +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array", +] + [[package]] name = "instant" version = "0.1.12" @@ -1424,11 +1410,12 @@ checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "polyval" -version = "0.4.5" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eebcc4aa140b9abd2bc40d9c3f7ccec842679cd79045ac3a7ac698c1a064b7cd" +checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" dependencies = [ - "cpuid-bool", + "cfg-if", + "cpufeatures", "opaque-debug", "universal-hash", ] @@ -2185,11 +2172,11 @@ dependencies = [ [[package]] name = "universal-hash" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" dependencies = [ - "generic-array", + "crypto-common", "subtle", ] diff --git a/crates/lox-library/Cargo.toml b/crates/lox-library/Cargo.toml index 4f58682..539d649 100644 --- a/crates/lox-library/Cargo.toml +++ b/crates/lox-library/Cargo.toml @@ -22,7 +22,7 @@ sha2 = "0.9" statistical = "1.0.0" lazy_static = "1" hex_fmt = "0.3" -aes-gcm = "0.8" +aes-gcm = "0.10" base64 = "0.21" time = "0.3.28" subtle = "2.5" From 7cc133236c5cd391684a0b52a8402c13b4506321 Mon Sep 17 00:00:00 2001 From: onyinyang Date: Wed, 13 Sep 2023 10:45:01 -0400 Subject: [PATCH 17/59] Add additional required changes for crate aes-gcm update to 0.1.0 --- crates/lox-library/Cargo.toml | 2 +- crates/lox-library/src/bridge_table.rs | 4 ++-- crates/lox-library/src/migration_table.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/lox-library/Cargo.toml b/crates/lox-library/Cargo.toml index 539d649..24aedd0 100644 --- a/crates/lox-library/Cargo.toml +++ b/crates/lox-library/Cargo.toml @@ -22,7 +22,7 @@ sha2 = "0.9" statistical = "1.0.0" lazy_static = "1" hex_fmt = "0.3" -aes-gcm = "0.10" +aes-gcm = { version = "0.10", features =["aes"]} base64 = "0.21" time = "0.3.28" subtle = "2.5" diff --git a/crates/lox-library/src/bridge_table.rs b/crates/lox-library/src/bridge_table.rs index 434d2f5..0353d53 100644 --- a/crates/lox-library/src/bridge_table.rs +++ b/crates/lox-library/src/bridge_table.rs @@ -11,8 +11,8 @@ use super::cred; use super::IssuerPrivKey; use super::CMZ_B_TABLE; use aes_gcm::aead; -use aes_gcm::aead::{generic_array::GenericArray, Aead, NewAead}; -use aes_gcm::Aes128Gcm; +use aes_gcm::aead::{Aead, generic_array::GenericArray}; +use aes_gcm::{Aes128Gcm, KeyInit}; use base64::{engine::general_purpose, Engine as _}; use curve25519_dalek::ristretto::CompressedRistretto; use curve25519_dalek::ristretto::RistrettoBasepointTable; diff --git a/crates/lox-library/src/migration_table.rs b/crates/lox-library/src/migration_table.rs index 5697b00..bc34ea0 100644 --- a/crates/lox-library/src/migration_table.rs +++ b/crates/lox-library/src/migration_table.rs @@ -16,8 +16,8 @@ use curve25519_dalek::scalar::Scalar; use sha2::Digest; use sha2::Sha256; -use aes_gcm::aead::{generic_array::GenericArray, Aead, NewAead}; -use aes_gcm::Aes128Gcm; +use aes_gcm::aead::{Aead, generic_array::GenericArray}; +use aes_gcm::{Aes128Gcm, KeyInit}; use rand::RngCore; use std::collections::HashMap; From 4e72f45effd960fddda691b4a99ff2c6181cef12 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 19 Sep 2023 14:04:19 +0000 Subject: [PATCH 18/59] Update Rust crate clap to 4.4.4 --- Cargo.lock | 8 ++++---- crates/lox-distributor/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fcaa703..61d2bdf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -247,9 +247,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.3" +version = "4.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84ed82781cea27b43c9b106a979fe450a13a31aab0500595fb3fc06616de08e6" +checksum = "b1d7b8d5ec32af0fadc644bf1fd509a688c2103b185644bb1e29d164e0703136" dependencies = [ "clap_builder", "clap_derive", @@ -257,9 +257,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.2" +version = "4.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08" +checksum = "5179bb514e4d7c2051749d8fcefa2ed6d06a9f4e6d69faf3805f5d80b8cf8d56" dependencies = [ "anstream", "anstyle", diff --git a/crates/lox-distributor/Cargo.toml b/crates/lox-distributor/Cargo.toml index c74ad1f..940c288 100644 --- a/crates/lox-distributor/Cargo.toml +++ b/crates/lox-distributor/Cargo.toml @@ -26,7 +26,7 @@ zkp = "0.8.0" lox-library = { path = "../lox-library", version = "0.1.0"} lox_utils = { path = "../lox-utils", version = "0.1.0"} rdsys_backend = { path = "../rdsys-backend-api", version = "0.2"} -clap = { version = "4.4.3", features = ["derive"] } +clap = { version = "4.4.4", features = ["derive"] } serde_json = "1.0.107" sled = "0.34.7" From a7feb74d6c95c23f92e702284e389282f316987f Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 20 Sep 2023 18:03:52 +0000 Subject: [PATCH 19/59] Update Rust crate tokio-util to 0.7.9 --- Cargo.lock | 8 ++++---- crates/rdsys-backend-api/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 61d2bdf..1deec3e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1392,9 +1392,9 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pin-project-lite" -version = "0.2.10" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -2099,9 +2099,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" dependencies = [ "bytes", "futures-core", diff --git a/crates/rdsys-backend-api/Cargo.toml b/crates/rdsys-backend-api/Cargo.toml index a8305b3..7b56710 100644 --- a/crates/rdsys-backend-api/Cargo.toml +++ b/crates/rdsys-backend-api/Cargo.toml @@ -18,5 +18,5 @@ tokio = { version = "1", features = ["macros"]} reqwest = { version = "0.11", features = ["stream"]} tokio-stream = "0.1.14" futures = "0.3.28" -tokio-util = "0.7.8" +tokio-util = "0.7.9" chrono = { version = "0.4.31", features = ["serde", "clock"] } From 72e2ab154a8cbf600f07e97ba529f6639beb5890 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 24 Sep 2023 06:03:54 +0000 Subject: [PATCH 20/59] Update Rust crate time to 0.3.29 --- Cargo.lock | 12 ++++++------ crates/lox-distributor/Cargo.toml | 2 +- crates/lox-library/Cargo.toml | 2 +- crates/lox-wasm/Cargo.toml | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1deec3e..8f801d3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2004,9 +2004,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" +checksum = "426f806f4089c493dcac0d24c29c01e2c38baf8e30f1b716ee37e83d200b18fe" dependencies = [ "deranged", "itoa", @@ -2017,15 +2017,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" dependencies = [ "time-core", ] diff --git a/crates/lox-distributor/Cargo.toml b/crates/lox-distributor/Cargo.toml index 940c288..8995d9b 100644 --- a/crates/lox-distributor/Cargo.toml +++ b/crates/lox-distributor/Cargo.toml @@ -16,7 +16,7 @@ base64 = "0.21.4" hyper = { version = "0.14.27", features = ["server"] } hex_fmt = "0.3" futures = "0.3.28" -time = "0.3.28" +time = "0.3.29" tokio = { version = "1", features = ["full", "macros", "signal"] } rand = "0.8.5" serde = { version = "1.0", features = ["derive", "rc"] } diff --git a/crates/lox-library/Cargo.toml b/crates/lox-library/Cargo.toml index 24aedd0..151c0b8 100644 --- a/crates/lox-library/Cargo.toml +++ b/crates/lox-library/Cargo.toml @@ -24,7 +24,7 @@ lazy_static = "1" hex_fmt = "0.3" aes-gcm = { version = "0.10", features =["aes"]} base64 = "0.21" -time = "0.3.28" +time = "0.3.29" subtle = "2.5" thiserror = "1.0.48" diff --git a/crates/lox-wasm/Cargo.toml b/crates/lox-wasm/Cargo.toml index 8e58492..34423b1 100644 --- a/crates/lox-wasm/Cargo.toml +++ b/crates/lox-wasm/Cargo.toml @@ -15,7 +15,7 @@ lazy_static = "1.4.0" lox-library = { path = "../lox-library", version = "0.1.0" } lox_utils = { path = "../lox-utils", version = "0.1.0" } wasm-bindgen = "0.2" -time = "0.3.28" +time = "0.3.29" serde_json = "1.0.107" console_error_panic_hook = "0.1.7" From 845df42573520bd76446527abd8b9d96e1f93092 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 26 Sep 2023 14:34:34 +0000 Subject: [PATCH 21/59] Update Rust crate clap to 4.4.5 --- Cargo.lock | 8 ++++---- crates/lox-distributor/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8f801d3..25ca763 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -247,9 +247,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.4" +version = "4.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d7b8d5ec32af0fadc644bf1fd509a688c2103b185644bb1e29d164e0703136" +checksum = "824956d0dca8334758a5b7f7e50518d66ea319330cbceedcf76905c2f6ab30e3" dependencies = [ "clap_builder", "clap_derive", @@ -257,9 +257,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.4" +version = "4.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5179bb514e4d7c2051749d8fcefa2ed6d06a9f4e6d69faf3805f5d80b8cf8d56" +checksum = "122ec64120a49b4563ccaedcbea7818d069ed8e9aa6d829b82d8a4128936b2ab" dependencies = [ "anstream", "anstyle", diff --git a/crates/lox-distributor/Cargo.toml b/crates/lox-distributor/Cargo.toml index 8995d9b..6ab41b3 100644 --- a/crates/lox-distributor/Cargo.toml +++ b/crates/lox-distributor/Cargo.toml @@ -26,7 +26,7 @@ zkp = "0.8.0" lox-library = { path = "../lox-library", version = "0.1.0"} lox_utils = { path = "../lox-utils", version = "0.1.0"} rdsys_backend = { path = "../rdsys-backend-api", version = "0.2"} -clap = { version = "4.4.4", features = ["derive"] } +clap = { version = "4.4.5", features = ["derive"] } serde_json = "1.0.107" sled = "0.34.7" From 1acae45188a0b44f7ce76ef734dce6575ffcd975 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 28 Sep 2023 20:05:06 +0000 Subject: [PATCH 22/59] Update Rust crate clap to 4.4.6 --- Cargo.lock | 16 ++++++++-------- crates/lox-distributor/Cargo.toml | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 25ca763..b8a6de8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -69,9 +69,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" +checksum = "bff2cf94a3dbe2d57cbd56485e1bd7436455058034d6c2d47be51d4e5e4bc6ab" dependencies = [ "anstyle", "anstyle-parse", @@ -107,9 +107,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "2.1.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" +checksum = "0238ca56c96dfa37bdf7c373c8886dd591322500aceeeccdb2216fe06dc2f796" dependencies = [ "anstyle", "windows-sys", @@ -247,9 +247,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.5" +version = "4.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824956d0dca8334758a5b7f7e50518d66ea319330cbceedcf76905c2f6ab30e3" +checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956" dependencies = [ "clap_builder", "clap_derive", @@ -257,9 +257,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.5" +version = "4.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "122ec64120a49b4563ccaedcbea7818d069ed8e9aa6d829b82d8a4128936b2ab" +checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45" dependencies = [ "anstream", "anstyle", diff --git a/crates/lox-distributor/Cargo.toml b/crates/lox-distributor/Cargo.toml index 6ab41b3..37047f2 100644 --- a/crates/lox-distributor/Cargo.toml +++ b/crates/lox-distributor/Cargo.toml @@ -26,7 +26,7 @@ zkp = "0.8.0" lox-library = { path = "../lox-library", version = "0.1.0"} lox_utils = { path = "../lox-utils", version = "0.1.0"} rdsys_backend = { path = "../rdsys-backend-api", version = "0.2"} -clap = { version = "4.4.5", features = ["derive"] } +clap = { version = "4.4.6", features = ["derive"] } serde_json = "1.0.107" sled = "0.34.7" From faa127862b1dc04e82d04f673762aafcd652f036 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 27 Sep 2023 01:34:27 +0000 Subject: [PATCH 23/59] Update Rust crate thiserror to 1.0.49 --- Cargo.lock | 8 ++++---- crates/lox-library/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b8a6de8..d0c8557 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1984,18 +1984,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.48" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.48" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", diff --git a/crates/lox-library/Cargo.toml b/crates/lox-library/Cargo.toml index 151c0b8..3c470e9 100644 --- a/crates/lox-library/Cargo.toml +++ b/crates/lox-library/Cargo.toml @@ -26,7 +26,7 @@ aes-gcm = { version = "0.10", features =["aes"]} base64 = "0.21" time = "0.3.29" subtle = "2.5" -thiserror = "1.0.48" +thiserror = "1.0.49" [features] default = ["u64_backend"] From fd9ab74f0643d2c8a164254469ced3f9a9693f99 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 26 Sep 2023 21:04:15 +0000 Subject: [PATCH 24/59] Update Rust crate sha1 to 0.10.6 --- Cargo.lock | 4 ++-- crates/rdsys-backend-api/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d0c8557..6c591bc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1852,9 +1852,9 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", diff --git a/crates/rdsys-backend-api/Cargo.toml b/crates/rdsys-backend-api/Cargo.toml index 7b56710..46b8b91 100644 --- a/crates/rdsys-backend-api/Cargo.toml +++ b/crates/rdsys-backend-api/Cargo.toml @@ -13,7 +13,7 @@ serde = { version = "1", features = ["derive"]} bytes = "1" hex = "0.4.3" crc64 = "2.0.0" -sha1 = "0.10.5" +sha1 = "0.10.6" tokio = { version = "1", features = ["macros"]} reqwest = { version = "0.11", features = ["stream"]} tokio-stream = "0.1.14" From f0e97504ca584ed20a234e19cf325c9324d21fed Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 13 Oct 2023 03:04:23 +0000 Subject: [PATCH 25/59] Update Rust crate serde to 1.0.189 --- Cargo.lock | 8 ++++---- crates/lox-library/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6c591bc..9298866 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1771,9 +1771,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.188" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" dependencies = [ "serde_derive", ] @@ -1789,9 +1789,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" dependencies = [ "proc-macro2", "quote", diff --git a/crates/lox-library/Cargo.toml b/crates/lox-library/Cargo.toml index 3c470e9..8043f92 100644 --- a/crates/lox-library/Cargo.toml +++ b/crates/lox-library/Cargo.toml @@ -16,7 +16,7 @@ zkp = "0.8" bincode = "1" chrono = "0.4" rand = "0.7" -serde = "1.0.188" +serde = "1.0.189" serde_with = {version = "3.3.0", features = ["json"]} sha2 = "0.9" statistical = "1.0.0" From ee4f53dbd48037f81fa3e4cf18ce3d0d0d125a0a Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 17 Oct 2023 17:35:10 +0000 Subject: [PATCH 26/59] Update Rust crate serde_with to 3.4.0 --- Cargo.lock | 8 ++++---- crates/lox-distributor/Cargo.toml | 2 +- crates/lox-library/Cargo.toml | 2 +- crates/lox-utils/Cargo.toml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9298866..38c8b0c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1823,9 +1823,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ca3b16a3d82c4088f343b7480a93550b3eabe1a358569c2dfe38bbcead07237" +checksum = "64cd236ccc1b7a29e7e2739f27c0b2dd199804abc4290e32f59f3b68d6405c23" dependencies = [ "base64", "chrono", @@ -1840,9 +1840,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e6be15c453eb305019bfa438b1593c731f36a289a7853f7707ee29e870b3b3c" +checksum = "93634eb5f75a2323b16de4748022ac4297f9e76b6dced2be287a099f41b5e788" dependencies = [ "darling", "proc-macro2", diff --git a/crates/lox-distributor/Cargo.toml b/crates/lox-distributor/Cargo.toml index 37047f2..5aad2a3 100644 --- a/crates/lox-distributor/Cargo.toml +++ b/crates/lox-distributor/Cargo.toml @@ -20,7 +20,7 @@ time = "0.3.29" tokio = { version = "1", features = ["full", "macros", "signal"] } rand = "0.8.5" serde = { version = "1.0", features = ["derive", "rc"] } -serde_with = "3.3.0" +serde_with = "3.4.0" zkp = "0.8.0" lox-library = { path = "../lox-library", version = "0.1.0"} diff --git a/crates/lox-library/Cargo.toml b/crates/lox-library/Cargo.toml index 8043f92..fc26df6 100644 --- a/crates/lox-library/Cargo.toml +++ b/crates/lox-library/Cargo.toml @@ -17,7 +17,7 @@ bincode = "1" chrono = "0.4" rand = "0.7" serde = "1.0.189" -serde_with = {version = "3.3.0", features = ["json"]} +serde_with = {version = "3.4.0", features = ["json"]} sha2 = "0.9" statistical = "1.0.0" lazy_static = "1" diff --git a/crates/lox-utils/Cargo.toml b/crates/lox-utils/Cargo.toml index dabfbdb..dc47a11 100644 --- a/crates/lox-utils/Cargo.toml +++ b/crates/lox-utils/Cargo.toml @@ -15,7 +15,7 @@ repository = "https://gitlab.torproject.org/tpo/anti-censorship/lox.git/" lox-library = {path = "../lox-library", version = "0.1.0"} serde = "1" serde_json = "1.0.107" -serde_with = "3.3.0" +serde_with = "3.4.0" [features] From 96cf4ab764f1fcd5694efb88e1ecc4659ec7fbd4 Mon Sep 17 00:00:00 2001 From: onyinyang Date: Wed, 23 Aug 2023 17:26:03 -0400 Subject: [PATCH 27/59] Add static request capabilities to rdsys-api-backend --- crates/lox-distributor/src/main.rs | 2 +- crates/rdsys-backend-api/Cargo.toml | 4 +-- crates/rdsys-backend-api/src/lib.rs | 54 +++++++++++++++++++++++++++-- 3 files changed, 55 insertions(+), 5 deletions(-) diff --git a/crates/lox-distributor/src/main.rs b/crates/lox-distributor/src/main.rs index 416184b..5d1d619 100644 --- a/crates/lox-distributor/src/main.rs +++ b/crates/lox-distributor/src/main.rs @@ -9,7 +9,7 @@ use hyper::{ }; use lox_library::bridge_table::{BridgeLine, MAX_BRIDGES_PER_BUCKET}; -use rdsys_backend::{proto::ResourceDiff, start_stream}; +use rdsys_backend::{proto::ResourceDiff, proto::Resource, request_resources, start_stream}; use serde::Deserialize; use std::{ diff --git a/crates/rdsys-backend-api/Cargo.toml b/crates/rdsys-backend-api/Cargo.toml index 46b8b91..b2a8dec 100644 --- a/crates/rdsys-backend-api/Cargo.toml +++ b/crates/rdsys-backend-api/Cargo.toml @@ -14,8 +14,8 @@ bytes = "1" hex = "0.4.3" crc64 = "2.0.0" sha1 = "0.10.6" -tokio = { version = "1", features = ["macros"]} -reqwest = { version = "0.11", features = ["stream"]} +tokio = { version = "1", features = ["full", "macros"] } +reqwest = { version = "0.11", features = ["json", "stream"]} tokio-stream = "0.1.14" futures = "0.3.28" tokio-util = "0.7.9" diff --git a/crates/rdsys-backend-api/src/lib.rs b/crates/rdsys-backend-api/src/lib.rs index 84b420a..8e2c8eb 100644 --- a/crates/rdsys-backend-api/src/lib.rs +++ b/crates/rdsys-backend-api/src/lib.rs @@ -6,7 +6,7 @@ use bytes::{self, Buf, Bytes}; use core::pin::Pin; use futures_util::{Stream, StreamExt}; -use reqwest::Client; +use reqwest::{Client, StatusCode}; use std::io::{self, BufRead}; use std::task::{ready, Context, Poll}; use tokio::sync::mpsc; @@ -19,6 +19,7 @@ pub enum Error { Reqwest(reqwest::Error), Io(io::Error), JSON(serde_json::Error), + String(StatusCode), } impl From for Error { @@ -39,6 +40,17 @@ impl From for Error { } } + +pub struct StaticResourceRequest {} + +impl StaticResourceRequest { + pub fn new(rx: mpsc::Receiver) -> StaticResourceRequest { + StaticResourceRequest { + + } + } +} + /// An iterable wrapper of ResourceDiff items for the streamed chunks of Bytes /// received from the connection to the rdsys backend pub struct ResourceStream { @@ -220,7 +232,7 @@ mod tests { /// } /// } /// ``` -/// + pub async fn start_stream( api_endpoint: String, name: String, @@ -260,3 +272,41 @@ pub async fn start_stream( }); Ok(ResourceStream::new(rx)) } + +pub async fn request_resources( api_endpoint: String, + name: String, + token: String, + resource_types: Vec, +) -> Result, Error> { + let fetched_resources: Result, Error>; + let req = proto::ResourceRequest { + request_origin: name, + resource_types, + }; + let json = serde_json::to_string(&req)?; + + let auth_value = format!("Bearer {}", token); + + let client = Client::new(); + + let response = client + .get(api_endpoint) + .header("Authorization", &auth_value) + .body(json) + .send() + .await.unwrap(); + println!("Success? {:?}", response); + match response.status() { + reqwest::StatusCode::OK => { + fetched_resources = match response.json::>().await { + Ok(fetched_resources) => Ok(fetched_resources), + Err(e) => Err(Error::Reqwest(e)), + }; + } + other => { + fetched_resources = Err(Error::String(other)) + } + }; + println!("Resources: {:?}", fetched_resources); + fetched_resources +} From d4c54e969c4958880f4b52079e03f1fc05fca360 Mon Sep 17 00:00:00 2001 From: onyinyang Date: Fri, 25 Aug 2023 11:21:38 -0400 Subject: [PATCH 28/59] Reconfigure distributor to handle static rdsys req --- Cargo.lock | 1 + crates/lox-distributor/Cargo.toml | 1 + crates/lox-distributor/config.json | 2 +- crates/lox-distributor/src/main.rs | 162 +++++++++++++--------------- crates/rdsys-backend-api/src/lib.rs | 2 +- 5 files changed, 80 insertions(+), 88 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 38c8b0c..7346aea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1043,6 +1043,7 @@ dependencies = [ "lox_utils", "rand 0.8.5", "rdsys_backend", + "reqwest", "serde", "serde_json", "serde_with", diff --git a/crates/lox-distributor/Cargo.toml b/crates/lox-distributor/Cargo.toml index 5aad2a3..ac48ac5 100644 --- a/crates/lox-distributor/Cargo.toml +++ b/crates/lox-distributor/Cargo.toml @@ -19,6 +19,7 @@ futures = "0.3.28" time = "0.3.29" tokio = { version = "1", features = ["full", "macros", "signal"] } rand = "0.8.5" +reqwest = { version = "0.11", features = ["json", "stream"]} serde = { version = "1.0", features = ["derive", "rc"] } serde_with = "3.4.0" zkp = "0.8.0" diff --git a/crates/lox-distributor/config.json b/crates/lox-distributor/config.json index 444b52e..04a015e 100644 --- a/crates/lox-distributor/config.json +++ b/crates/lox-distributor/config.json @@ -4,7 +4,7 @@ }, "rtype": { - "endpoint": "http://127.0.0.1:7100/resource-stream", + "endpoint": "http://127.0.0.1:7100/resources", "name": "https", "token": "HttpsApiTokenPlaceholder", "types": [ diff --git a/crates/lox-distributor/src/main.rs b/crates/lox-distributor/src/main.rs index 5d1d619..6f834c1 100644 --- a/crates/lox-distributor/src/main.rs +++ b/crates/lox-distributor/src/main.rs @@ -9,7 +9,7 @@ use hyper::{ }; use lox_library::bridge_table::{BridgeLine, MAX_BRIDGES_PER_BUCKET}; -use rdsys_backend::{proto::ResourceDiff, proto::Resource, request_resources, start_stream}; +use rdsys_backend::{proto::Resource, proto::ResourceDiff, request_resources, start_stream}; use serde::Deserialize; use std::{ @@ -27,7 +27,7 @@ use resource_parser::parse_resource; use tokio::{ signal, spawn, sync::{broadcast, mpsc, oneshot}, - time::sleep, + time::{interval, sleep}, }; async fn shutdown_signal() { @@ -89,29 +89,36 @@ struct ResourceInfo { // TODO: ensure this stream gracefully shutdowns on the ctrl_c command. async fn rdsys_stream( rtype: ResourceInfo, - tx: mpsc::Sender, + tx: mpsc::Sender>, mut kill: broadcast::Receiver<()>, ) { - let mut rstream = start_stream(rtype.endpoint, rtype.name, rtype.token, rtype.types) - .await - .expect("rdsys stream initialization failed. Start rdsys or check config.json"); - loop { - tokio::select! { - res = rstream.next() => { - match res { - Some(diff) => tx.send(diff).await.unwrap(), - None => return, - } - }, - _ = kill.recv() => {println!("Shut down rdsys stream"); return}, + tokio::select! { + start_resource_request = rdsys_request(rtype, tx) => start_resource_request, + _ = kill.recv() => {println!("Shut down rdsys request loop"); return}, - } + } +} + +async fn rdsys_request(rtype: ResourceInfo, tx: mpsc::Sender>) { + let mut interval = interval(Duration::from_secs(30)); + loop { + interval.tick().await; + let resources = request_resources( + rtype.endpoint.clone(), + rtype.name.clone(), + rtype.token.clone(), + rtype.types.clone(), + ) + .await + .unwrap(); + tx.send(resources).await.unwrap(); + sleep(Duration::from_secs(30)).await; } } async fn rdsys_bridge_parser( rdsys_tx: mpsc::Sender, - rx: mpsc::Receiver, + rx: mpsc::Receiver>, mut kill: broadcast::Receiver<()>, ) { tokio::select! { @@ -122,10 +129,10 @@ async fn rdsys_bridge_parser( // Parse Bridges receives a ResourceDiff from rdsys_sender and sends it to the // Context Manager to be parsed and added to the BridgeDB -async fn parse_bridges(rdsys_tx: mpsc::Sender, mut rx: mpsc::Receiver) { +async fn parse_bridges(rdsys_tx: mpsc::Sender, mut rx: mpsc::Receiver>) { loop { - let resourcediff = rx.recv().await.unwrap(); - let cmd = Command::Rdsys { resourcediff }; + let resources = rx.recv().await.unwrap(); + let cmd = Command::Rdsys { resources }; rdsys_tx.send(cmd).await.unwrap(); sleep(Duration::from_secs(1)).await; } @@ -161,71 +168,58 @@ async fn context_manager( while let Some(cmd) = context_rx.recv().await { use Command::*; match cmd { - Rdsys { resourcediff } => { - if let Some(new_resources) = resourcediff.new { - let mut count = 0; - let mut bucket = [BridgeLine::default(); MAX_BRIDGES_PER_BUCKET]; - for pt in new_resources { - println!("A NEW RESOURCE: {:?}", pt); - if let Some(resources) = pt.1 { - for resource in resources { - let bridgeline = parse_resource(resource); - println!("What is the bridgeline: {:?}", bridgeline); - if context.to_be_replaced_bridges.lock().unwrap().len() > 0 { - println!("BridgeLine to be replaced: {:?}", bridgeline); - let res = context.replace_with_new(bridgeline); - if res == lox_library::ReplaceSuccess::NotFound { - println!( - "BridgeLine not found in bridge_table, already updated {:?}", - bridgeline - ); - } else if res == lox_library::ReplaceSuccess::Replaced { - println!( - "BridgeLine successfully replaced: {:?}", - bridgeline - ); - } else { - assert!( - res == lox_library::ReplaceSuccess::NotReplaced, - "ReplaceSuccess incorrectly set somehow" - ); - // Add the bridge to the list of to_be_replaced bridges in the Lox context and try - // again to replace at the next update (nothing changes in the Lox Authority) - println!("'Gone' BridgeLine NOT replaced, saved for next update! : {:?}", bridgeline); - context.new_to_be_replaced_bridge(bridgeline); - } - } else if count < MAX_BRIDGES_PER_BUCKET { - bucket[count] = bridgeline; - count += 1; - } else { - // TODO: Decide the circumstances under which a bridge is allocated to an open_inv or spare bucket, - // eventually also do some more fancy grouping of new resources, i.e., by type or region - context.add_openinv_bucket(bucket); - count = 0; - bucket = [BridgeLine::default(); MAX_BRIDGES_PER_BUCKET]; - } - } + Rdsys { resources } => { + let mut count = 0; + let mut bucket = [BridgeLine::default(); MAX_BRIDGES_PER_BUCKET]; + for resource in resources { + let bridgeline = parse_resource(resource); + println!("What is the bridgeline: {:?}", bridgeline); + if context.to_be_replaced_bridges.lock().unwrap().len() > 0 { + println!("BridgeLine to be replaced: {:?}", bridgeline); + let res = context.replace_with_new(bridgeline); + if res == lox_library::ReplaceSuccess::NotFound { + println!( + "BridgeLine not found in bridge_table, already updated {:?}", + bridgeline + ); + } else if res == lox_library::ReplaceSuccess::Replaced { + println!("BridgeLine successfully replaced: {:?}", bridgeline); + } else { + assert!( + res == lox_library::ReplaceSuccess::NotReplaced, + "ReplaceSuccess incorrectly set somehow" + ); + // Add the bridge to the list of to_be_replaced bridges in the Lox context and try + // again to replace at the next update (nothing changes in the Lox Authority) + println!( + "'Gone' BridgeLine NOT replaced, saved for next update! : {:?}", + bridgeline + ); + context.new_to_be_replaced_bridge(bridgeline); } + } else if count < MAX_BRIDGES_PER_BUCKET { + bucket[count] = bridgeline; + count += 1; + } else { + // TODO: Decide the circumstances under which a bridge is allocated to an open_inv or spare bucket, + // eventually also do some more fancy grouping of new resources, i.e., by type or region + context.add_openinv_bucket(bucket); + count = 0; + bucket = [BridgeLine::default(); MAX_BRIDGES_PER_BUCKET]; } - // Handle the extra buckets that were not allocated already - if count != 0 { - for val in 0..count { - if context.extra_bridges.lock().unwrap().len() - < (MAX_BRIDGES_PER_BUCKET) - { - context.append_extra_bridges(bucket[val]); - } else { - bucket = context.remove_extra_bridges(); - context.add_spare_bucket(bucket); - } + } + // Handle the extra buckets that were not allocated already + if count != 0 { + for val in 0..count { + if context.extra_bridges.lock().unwrap().len() < (MAX_BRIDGES_PER_BUCKET) { + context.append_extra_bridges(bucket[val]); + } else { + bucket = context.remove_extra_bridges(); + context.add_spare_bucket(bucket); } } } - if let Some(changed_resources) = resourcediff.changed { - for pt in changed_resources { - println!("A NEW CHANGED RESOURCE: {:?}", pt); - if let Some(resources) = pt.1 { - for resource in resources { + /* let bridgeline = parse_resource(resource); println!("BridgeLine to be changed: {:?}", bridgeline); let res = context.update_bridge(bridgeline); @@ -250,11 +244,6 @@ async fn context_manager( // is not likely due to censorship. Therefore, we replace gone resources with new resources // TODO: create a notion of blocked resources from information collected through various means: // https://gitlab.torproject.org/tpo/anti-censorship/censorship-analysis/-/issues/40035 - if let Some(gone_resources) = resourcediff.gone { - for pt in gone_resources { - println!("A NEW GONE RESOURCE: {:?}", pt); - if let Some(resources) = pt.1 { - for resource in resources { // If resource last passed tests 3 hours ago, it should be replaced with a working // resource and be removed from the bridgetable. If it has been gone for more than 7 hours, // we should stop trying to remove it from the bridge table and assume it has successfully been @@ -285,6 +274,7 @@ async fn context_manager( } } } + */ /* Functionality for marking bridges as unreachable/blocked is currently not enabled as there is not yet a reliable way to determine that a bridge is blocked. This means that migrations to unblocked bridges do not currently work but can be easily enabled with a list of `blocked resources` from rdsys or another source with something @@ -328,7 +318,7 @@ async fn context_manager( #[derive(Debug)] enum Command { Rdsys { - resourcediff: ResourceDiff, + resources: Vec, }, Request { req: Request, diff --git a/crates/rdsys-backend-api/src/lib.rs b/crates/rdsys-backend-api/src/lib.rs index 8e2c8eb..00cc4aa 100644 --- a/crates/rdsys-backend-api/src/lib.rs +++ b/crates/rdsys-backend-api/src/lib.rs @@ -298,7 +298,7 @@ pub async fn request_resources( api_endpoint: String, println!("Success? {:?}", response); match response.status() { reqwest::StatusCode::OK => { - fetched_resources = match response.json::>().await { + fetched_resources = match dbg!(response.json::>().await) { Ok(fetched_resources) => Ok(fetched_resources), Err(e) => Err(Error::Reqwest(e)), }; From be0d026fe8fb8521c7f491cecf0b29fcdb0ba184 Mon Sep 17 00:00:00 2001 From: onyinyang Date: Wed, 13 Sep 2023 12:08:48 -0400 Subject: [PATCH 29/59] Cleanup and add syncing of resources --- crates/lox-distributor/src/lox_context.rs | 13 +++ crates/lox-distributor/src/main.rs | 100 ++++++++++-------- crates/lox-distributor/src/resource_parser.rs | 32 +++--- crates/lox-library/src/lib.rs | 5 +- crates/rdsys-backend-api/src/lib.rs | 13 --- 5 files changed, 89 insertions(+), 74 deletions(-) diff --git a/crates/lox-distributor/src/lox_context.rs b/crates/lox-distributor/src/lox_context.rs index a777a0d..4b02b6d 100644 --- a/crates/lox-distributor/src/lox_context.rs +++ b/crates/lox-distributor/src/lox_context.rs @@ -25,6 +25,19 @@ pub struct LoxServerContext { } impl LoxServerContext { + pub fn bridgetable_is_empty(&self) -> bool { + let mut ba_obj = self.ba.lock().unwrap(); + ba_obj.is_empty() + } + + // Populate an empty bridgetable for the first time + /* pub fn populate_bridgetable(&self, bridgelines: Vec, percent_spares: Option) { + if Some(percent_spares) { + let partition: usize = bridgelines.len()*percent_spares/100; + } + + } */ + pub fn append_extra_bridges(&self, bridge: BridgeLine) { let mut extra_bridges = self.extra_bridges.lock().unwrap(); extra_bridges.push(bridge); diff --git a/crates/lox-distributor/src/main.rs b/crates/lox-distributor/src/main.rs index 6f834c1..e4a29e2 100644 --- a/crates/lox-distributor/src/main.rs +++ b/crates/lox-distributor/src/main.rs @@ -1,7 +1,5 @@ -use chrono::Utc; use clap::Parser; use futures::future; -use futures::StreamExt; use hyper::{ server::conn::AddrStream, service::{make_service_fn, service_fn}, @@ -9,7 +7,7 @@ use hyper::{ }; use lox_library::bridge_table::{BridgeLine, MAX_BRIDGES_PER_BUCKET}; -use rdsys_backend::{proto::Resource, proto::ResourceDiff, request_resources, start_stream}; +use rdsys_backend::{proto::Resource, request_resources}; use serde::Deserialize; use std::{ @@ -22,7 +20,7 @@ mod lox_context; mod request_handler; use request_handler::handle; mod resource_parser; -use resource_parser::parse_resource; +use resource_parser::parse_resources; use tokio::{ signal, spawn, @@ -171,51 +169,61 @@ async fn context_manager( Rdsys { resources } => { let mut count = 0; let mut bucket = [BridgeLine::default(); MAX_BRIDGES_PER_BUCKET]; - for resource in resources { - let bridgeline = parse_resource(resource); - println!("What is the bridgeline: {:?}", bridgeline); - if context.to_be_replaced_bridges.lock().unwrap().len() > 0 { - println!("BridgeLine to be replaced: {:?}", bridgeline); - let res = context.replace_with_new(bridgeline); - if res == lox_library::ReplaceSuccess::NotFound { - println!( - "BridgeLine not found in bridge_table, already updated {:?}", - bridgeline - ); - } else if res == lox_library::ReplaceSuccess::Replaced { - println!("BridgeLine successfully replaced: {:?}", bridgeline); + if context.bridgetable_is_empty() { + // otherwise, for each resource, check if the resource fingerprint is failing tests, if it is check for how long + // check if the resource is already in the Lox bridgetable + // if it is, it's probably fine to remove or replace the existing resource with the incoming one + // to account for changes unless we want to track the number of changes on the lox side? + // that should be sufficient to keep it in sync + let bridgelines = parse_resources(resources); + for bridgeline in bridgelines { + //context.populate_bridgetable(bridgelines. None); + println!("What is the bridgeline: {:?}", bridgeline); + if context.to_be_replaced_bridges.lock().unwrap().len() > 0 { + println!("BridgeLine to be replaced: {:?}", bridgeline); + let res = context.replace_with_new(bridgeline); + if res == lox_library::ReplaceSuccess::NotFound { + println!( + "BridgeLine not found in bridge_table, already updated {:?}", + bridgeline + ); + } else if res == lox_library::ReplaceSuccess::Replaced { + println!("BridgeLine successfully replaced: {:?}", bridgeline); + } else { + assert!( + res == lox_library::ReplaceSuccess::NotReplaced, + "ReplaceSuccess incorrectly set somehow" + ); + // Add the bridge to the list of to_be_replaced bridges in the Lox context and try + // again to replace at the next update (nothing changes in the Lox Authority) + println!( + "'Gone' BridgeLine NOT replaced, saved for next update! : {:?}", + bridgeline + ); + context.new_to_be_replaced_bridge(bridgeline); + } + } else if count < MAX_BRIDGES_PER_BUCKET { + bucket[count] = bridgeline; + count += 1; } else { - assert!( - res == lox_library::ReplaceSuccess::NotReplaced, - "ReplaceSuccess incorrectly set somehow" - ); - // Add the bridge to the list of to_be_replaced bridges in the Lox context and try - // again to replace at the next update (nothing changes in the Lox Authority) - println!( - "'Gone' BridgeLine NOT replaced, saved for next update! : {:?}", - bridgeline - ); - context.new_to_be_replaced_bridge(bridgeline); + // TODO: Decide the circumstances under which a bridge is allocated to an open_inv or spare bucket, + // eventually also do some more fancy grouping of new resources, i.e., by type or region + context.add_openinv_bucket(bucket); + count = 0; + bucket = [BridgeLine::default(); MAX_BRIDGES_PER_BUCKET]; } - } else if count < MAX_BRIDGES_PER_BUCKET { - bucket[count] = bridgeline; - count += 1; - } else { - // TODO: Decide the circumstances under which a bridge is allocated to an open_inv or spare bucket, - // eventually also do some more fancy grouping of new resources, i.e., by type or region - context.add_openinv_bucket(bucket); - count = 0; - bucket = [BridgeLine::default(); MAX_BRIDGES_PER_BUCKET]; } - } - // Handle the extra buckets that were not allocated already - if count != 0 { - for val in 0..count { - if context.extra_bridges.lock().unwrap().len() < (MAX_BRIDGES_PER_BUCKET) { - context.append_extra_bridges(bucket[val]); - } else { - bucket = context.remove_extra_bridges(); - context.add_spare_bucket(bucket); + // Handle the extra buckets that were not allocated already + if count != 0 { + for val in 0..count { + if context.extra_bridges.lock().unwrap().len() + < (MAX_BRIDGES_PER_BUCKET) + { + context.append_extra_bridges(bucket[val]); + } else { + bucket = context.remove_extra_bridges(); + context.add_spare_bucket(bucket); + } } } } diff --git a/crates/lox-distributor/src/resource_parser.rs b/crates/lox-distributor/src/resource_parser.rs index 7a541b3..ae5739e 100644 --- a/crates/lox-distributor/src/resource_parser.rs +++ b/crates/lox-distributor/src/resource_parser.rs @@ -1,13 +1,15 @@ use lox_library::bridge_table::{BridgeLine, BRIDGE_BYTES}; use rdsys_backend::proto::Resource; -pub fn parse_resource(resource: Resource) -> BridgeLine { - let mut ip_bytes: [u8; 16] = [0; 16]; - ip_bytes[..resource.address.len()].copy_from_slice(resource.address.as_bytes()); - let resource_uid = resource - .get_uid() - .expect("Unable to get Fingerprint UID of resource"); - let infostr: String = format!( +pub fn parse_resources(resources: Vec) -> Vec { + let mut bridgelines: Vec = Vec::new(); + for resource in resources { + let mut ip_bytes: [u8; 16] = [0; 16]; + ip_bytes[..resource.address.len()].copy_from_slice(resource.address.as_bytes()); + let resource_uid = resource + .get_uid() + .expect("Unable to get Fingerprint UID of resource"); + let infostr: String = format!( "type={} blocked_in={:?} protocol={} fingerprint={:?} or_addresses={:?} distribution={} flags={:?} params={:?}", resource.r#type, resource.blocked_in, @@ -18,13 +20,15 @@ pub fn parse_resource(resource: Resource) -> BridgeLine { resource.flags, resource.params, ); - let mut info_bytes: [u8; BRIDGE_BYTES - 26] = [0; BRIDGE_BYTES - 26]; + let mut info_bytes: [u8; BRIDGE_BYTES - 26] = [0; BRIDGE_BYTES - 26]; - info_bytes[..infostr.len()].copy_from_slice(infostr.as_bytes()); - BridgeLine { - addr: ip_bytes, - port: resource.port, - uid_fingerprint: resource_uid, - info: info_bytes, + info_bytes[..infostr.len()].copy_from_slice(infostr.as_bytes()); + bridgelines.push(BridgeLine { + addr: ip_bytes, + port: resource.port, + uid_fingerprint: resource_uid, + info: info_bytes, + }) } + bridgelines } diff --git a/crates/lox-library/src/lib.rs b/crates/lox-library/src/lib.rs index 8a5de08..002ab9c 100644 --- a/crates/lox-library/src/lib.rs +++ b/crates/lox-library/src/lib.rs @@ -330,6 +330,10 @@ impl BridgeAuth { } } + pub fn is_empty(&mut self) -> bool { + self.bridge_table.buckets.is_empty() + } + /// Insert a set of open invitation bridges. /// /// Each of the bridges will be given its own open invitation @@ -378,7 +382,6 @@ impl BridgeAuth { // TODO Ensure synchronization of Lox bridge_table with rdsys pub fn sync_table(&mut self) { - // Create a hashtable (?) of bridges in the lox distributor from new resources // accept the hashtable and recreate the bridge table from the hash table here // using existing reachable bridges, other table checks and placements from existing bridge table diff --git a/crates/rdsys-backend-api/src/lib.rs b/crates/rdsys-backend-api/src/lib.rs index 00cc4aa..923c15a 100644 --- a/crates/rdsys-backend-api/src/lib.rs +++ b/crates/rdsys-backend-api/src/lib.rs @@ -40,17 +40,6 @@ impl From for Error { } } - -pub struct StaticResourceRequest {} - -impl StaticResourceRequest { - pub fn new(rx: mpsc::Receiver) -> StaticResourceRequest { - StaticResourceRequest { - - } - } -} - /// An iterable wrapper of ResourceDiff items for the streamed chunks of Bytes /// received from the connection to the rdsys backend pub struct ResourceStream { @@ -295,7 +284,6 @@ pub async fn request_resources( api_endpoint: String, .body(json) .send() .await.unwrap(); - println!("Success? {:?}", response); match response.status() { reqwest::StatusCode::OK => { fetched_resources = match dbg!(response.json::>().await) { @@ -307,6 +295,5 @@ pub async fn request_resources( api_endpoint: String, fetched_resources = Err(Error::String(other)) } }; - println!("Resources: {:?}", fetched_resources); fetched_resources } From 6cc8033051eb4394e962ab4043b4b3b24d370508 Mon Sep 17 00:00:00 2001 From: onyinyang Date: Mon, 28 Aug 2023 14:14:41 -0400 Subject: [PATCH 30/59] Reconfiguring lox distributor handling of rdsys resources --- crates/lox-distributor/config.json | 19 +- crates/lox-distributor/src/lox_context.rs | 20 +- crates/lox-distributor/src/main.rs | 294 ++++++++++-------- crates/lox-distributor/src/resource_parser.rs | 38 ++- crates/rdsys-backend-api/src/lib.rs | 2 +- 5 files changed, 231 insertions(+), 142 deletions(-) diff --git a/crates/lox-distributor/config.json b/crates/lox-distributor/config.json index 04a015e..6578722 100644 --- a/crates/lox-distributor/config.json +++ b/crates/lox-distributor/config.json @@ -2,14 +2,17 @@ "db": { "db_path": "lox_db" + }, + "bridge_allocation": { + "percent_spares": 50 }, "rtype": { - "endpoint": "http://127.0.0.1:7100/resources", - "name": "https", - "token": "HttpsApiTokenPlaceholder", - "types": [ - "obfs2", - "scramblesuit" - ] -} + "endpoint": "http://127.0.0.1:7100/resources", + "name": "https", + "token": "HttpsApiTokenPlaceholder", + "types": [ + "obfs2", + "scramblesuit" + ] + } } \ No newline at end of file diff --git a/crates/lox-distributor/src/lox_context.rs b/crates/lox-distributor/src/lox_context.rs index 4b02b6d..4b87166 100644 --- a/crates/lox-distributor/src/lox_context.rs +++ b/crates/lox-distributor/src/lox_context.rs @@ -31,12 +31,24 @@ impl LoxServerContext { } // Populate an empty bridgetable for the first time - /* pub fn populate_bridgetable(&self, bridgelines: Vec, percent_spares: Option) { - if Some(percent_spares) { - let partition: usize = bridgelines.len()*percent_spares/100; + pub fn populate_bridgetable( + &self, + buckets: Vec<[BridgeLine; MAX_BRIDGES_PER_BUCKET]>, + percent_spares: i32, + ) { + let mut partition: i32 = 0; + if percent_spares != 0 { + partition = buckets.len() as i32 * percent_spares / 100; + } + let (spares, open_invitations) = buckets.split_at(partition as usize); + for bucket in spares { + self.add_spare_bucket(*bucket) } - } */ + for bucket in open_invitations { + self.add_openinv_bucket(*bucket) + } + } pub fn append_extra_bridges(&self, bridge: BridgeLine) { let mut extra_bridges = self.extra_bridges.lock().unwrap(); diff --git a/crates/lox-distributor/src/main.rs b/crates/lox-distributor/src/main.rs index e4a29e2..f41c40c 100644 --- a/crates/lox-distributor/src/main.rs +++ b/crates/lox-distributor/src/main.rs @@ -20,7 +20,7 @@ mod lox_context; mod request_handler; use request_handler::handle; mod resource_parser; -use resource_parser::parse_resources; +use resource_parser::{parse_into_bridgelines, parse_into_buckets}; use tokio::{ signal, spawn, @@ -55,10 +55,11 @@ struct Args { #[derive(Debug, Deserialize)] struct Config { db: DbConfig, - + bridge_allocation: BridgeConfig, rtype: ResourceInfo, } +// Path of the lox database #[derive(Debug, Deserialize)] pub struct DbConfig { // The path for the lox_context database, default is "lox_db" @@ -73,6 +74,21 @@ impl Default for DbConfig { } } +// Config information for how bridges should be allocated to buckets +#[derive(Debug, Deserialize)] +pub struct BridgeConfig { + // The percentage of buckets (made up of MAX_BRIDGES_PER_BUCKET bridges) + // that should be allocated as spare buckets + // This will be calculated as the floor of buckets.len() * percent_spares / 100 + percent_spares: i32, +} + +impl Default for BridgeConfig { + fn default() -> BridgeConfig { + BridgeConfig { percent_spares: 0 } + } +} + #[derive(Debug, Deserialize)] struct ResourceInfo { endpoint: String, @@ -138,12 +154,13 @@ async fn parse_bridges(rdsys_tx: mpsc::Sender, mut rx: mpsc::Receiver, context_rx: mpsc::Receiver, mut kill: broadcast::Receiver<()>, ) { tokio::select! { - create_context = context_manager(db_config, roll_back_date, context_rx) => create_context, + create_context = context_manager(db_config, bridge_config, roll_back_date, context_rx) => create_context, _ = kill.recv() => {println!("Shut down context_manager");}, } } @@ -153,6 +170,7 @@ async fn create_context_manager( // can be responded to with an updated BridgeDB state async fn context_manager( db_config: DbConfig, + bridge_config: BridgeConfig, roll_back_date: Option, mut context_rx: mpsc::Receiver, ) { @@ -167,138 +185,153 @@ async fn context_manager( use Command::*; match cmd { Rdsys { resources } => { - let mut count = 0; - let mut bucket = [BridgeLine::default(); MAX_BRIDGES_PER_BUCKET]; + // If the bridgetable is not being loaded from an existing database, we will populate the + // bridgetable with all of the bridges received from rdsys if context.bridgetable_is_empty() { - // otherwise, for each resource, check if the resource fingerprint is failing tests, if it is check for how long + let bridgelines = parse_into_bridgelines(resources); + let (buckets, leftovers) = parse_into_buckets(bridgelines); + for leftover in leftovers { + context.append_extra_bridges(leftover); + } + context.populate_bridgetable(buckets, bridge_config.percent_spares); + // otherwise, we need to sync the existing bridgetable with the resources we receive from + // rdsys and ensure that all functioning bridges are correctly placed in the bridgetable + // those that have changed are updated and those that have been failing tests for an extended + // period of time are removed. + // If bridges are labelled as blocked_in, we should also handle blocking behaviour. + } else { + // for each resource, check if the resource fingerprint is failing tests, if it is check for how long // check if the resource is already in the Lox bridgetable // if it is, it's probably fine to remove or replace the existing resource with the incoming one // to account for changes unless we want to track the number of changes on the lox side? // that should be sufficient to keep it in sync - let bridgelines = parse_resources(resources); - for bridgeline in bridgelines { - //context.populate_bridgetable(bridgelines. None); - println!("What is the bridgeline: {:?}", bridgeline); - if context.to_be_replaced_bridges.lock().unwrap().len() > 0 { - println!("BridgeLine to be replaced: {:?}", bridgeline); - let res = context.replace_with_new(bridgeline); - if res == lox_library::ReplaceSuccess::NotFound { - println!( - "BridgeLine not found in bridge_table, already updated {:?}", - bridgeline - ); - } else if res == lox_library::ReplaceSuccess::Replaced { - println!("BridgeLine successfully replaced: {:?}", bridgeline); - } else { - assert!( - res == lox_library::ReplaceSuccess::NotReplaced, - "ReplaceSuccess incorrectly set somehow" - ); - // Add the bridge to the list of to_be_replaced bridges in the Lox context and try - // again to replace at the next update (nothing changes in the Lox Authority) - println!( - "'Gone' BridgeLine NOT replaced, saved for next update! : {:?}", - bridgeline - ); - context.new_to_be_replaced_bridge(bridgeline); - } - } else if count < MAX_BRIDGES_PER_BUCKET { - bucket[count] = bridgeline; - count += 1; - } else { - // TODO: Decide the circumstances under which a bridge is allocated to an open_inv or spare bucket, - // eventually also do some more fancy grouping of new resources, i.e., by type or region - context.add_openinv_bucket(bucket); - count = 0; - bucket = [BridgeLine::default(); MAX_BRIDGES_PER_BUCKET]; - } - } - // Handle the extra buckets that were not allocated already - if count != 0 { - for val in 0..count { - if context.extra_bridges.lock().unwrap().len() - < (MAX_BRIDGES_PER_BUCKET) - { - context.append_extra_bridges(bucket[val]); - } else { - bucket = context.remove_extra_bridges(); - context.add_spare_bucket(bucket); - } - } - } - } - /* - let bridgeline = parse_resource(resource); - println!("BridgeLine to be changed: {:?}", bridgeline); - let res = context.update_bridge(bridgeline); - if res { - println!("BridgeLine successfully updated: {:?}", bridgeline); + // TODO: Decide the circumstances under which a bridge is allocated to an open_inv or spare bucket, + // eventually also do some more fancy grouping of new resources, i.e., by type or region + /* for bridgeline in bridgelines { + //context.populate_bridgetable(bridgelines. None); + println!("What is the bridgeline: {:?}", bridgeline); + if context.to_be_replaced_bridges.lock().unwrap().len() > 0 { + println!("BridgeLine to be replaced: {:?}", bridgeline); + let res = context.replace_with_new(bridgeline); + if res == lox_library::ReplaceSuccess::NotFound { + println!( + "BridgeLine not found in bridge_table, already updated {:?}", + bridgeline + ); + } else if res == lox_library::ReplaceSuccess::Replaced { + println!("BridgeLine successfully replaced: {:?}", bridgeline); } else { - println!("BridgeLine: {:?} not found in Lox's Bridgetable. Save it as a new resource for now!", bridgeline); - if context.extra_bridges.lock().unwrap().len() < 2 { - context.append_extra_bridges(bridgeline); - } else { - let bucket = context.remove_extra_bridges(); - context.add_spare_bucket(bucket); - } + assert!( + res == lox_library::ReplaceSuccess::NotReplaced, + "ReplaceSuccess incorrectly set somehow" + ); + // Add the bridge to the list of to_be_replaced bridges in the Lox context and try + // again to replace at the next update (nothing changes in the Lox Authority) + println!( + "'Gone' BridgeLine NOT replaced, saved for next update! : {:?}", + bridgeline + ); + context.new_to_be_replaced_bridge(bridgeline); } - } - } - } - } - // gone resources are not the same as blocked resources. - // Instead, these are bridges which have either failed to pass tests for some period - // or have expired bridge descriptors. In both cases, the bridge is unusable, but this - // is not likely due to censorship. Therefore, we replace gone resources with new resources - // TODO: create a notion of blocked resources from information collected through various means: - // https://gitlab.torproject.org/tpo/anti-censorship/censorship-analysis/-/issues/40035 - // If resource last passed tests 3 hours ago, it should be replaced with a working - // resource and be removed from the bridgetable. If it has been gone for more than 7 hours, - // we should stop trying to remove it from the bridge table and assume it has successfully been - // removed already - if resource.last_passed < (Utc::now() - chrono::Duration::hours(3)) - || resource.last_passed - > (Utc::now() - chrono::Duration::hours(7)) - { - let bridgeline = parse_resource(resource); - println!("BridgeLine to be replaced: {:?}", bridgeline); - let res = context.replace_with_new(bridgeline); - if res == lox_library::ReplaceSuccess::Replaced { - println!( - "BridgeLine successfully replaced: {:?}", - bridgeline - ); - } else if res == lox_library::ReplaceSuccess::NotReplaced { - // Add the bridge to the list of to_be_replaced bridges in the Lox context and try - // again to replace at the next update (nothing changes in the Lox Authority) - println!( - "'Gone' BridgeLine NOT replaced, saved for next update! : {:?}", - bridgeline - ); - context.new_to_be_replaced_bridge(bridgeline); - } - } - } - } - } - } - */ - /* Functionality for marking bridges as unreachable/blocked is currently not enabled as there is not - yet a reliable way to determine that a bridge is blocked. This means that migrations to unblocked bridges do not - currently work but can be easily enabled with a list of `blocked resources` from rdsys or another source with something - like the following: - println!("BridgeLine to be removed: {:?}", bridgeline); - let res = context.add_unreachable(bridgeline); - if res { - println!( - "BridgeLine successfully marked unreachable: {:?}", - bridgeline - ); + } else if count < MAX_BRIDGES_PER_BUCKET { + bucket[count] = bridgeline; + count += 1; } else { - println!("'Gone' BridgeLine NOT REMOVED!! : {:?}", bridgeline); - //TODO probably do something else here + // TODO: Decide the circumstances under which a bridge is allocated to an open_inv or spare bucket, + // eventually also do some more fancy grouping of new resources, i.e., by type or region + context.add_openinv_bucket(bucket); + count = 0; + bucket = [BridgeLine::default(); MAX_BRIDGES_PER_BUCKET]; } - */ + } + // Handle the extra buckets that were not allocated already + if count != 0 { + for val in 0..count { + if context.extra_bridges.lock().unwrap().len() + < (MAX_BRIDGES_PER_BUCKET) + { + context.append_extra_bridges(bucket[val]); + } else { + bucket = context.remove_extra_bridges(); + context.add_spare_bucket(bucket); + } + } + } + } + + + let bridgeline = parse_resource(resource); + println!("BridgeLine to be changed: {:?}", bridgeline); + let res = context.update_bridge(bridgeline); + if res { + println!("BridgeLine successfully updated: {:?}", bridgeline); + } else { + println!("BridgeLine: {:?} not found in Lox's Bridgetable. Save it as a new resource for now!", bridgeline); + if context.extra_bridges.lock().unwrap().len() < 2 { + context.append_extra_bridges(bridgeline); + } else { + let bucket = context.remove_extra_bridges(); + context.add_spare_bucket(bucket); + } + } + } + } + } + } + // gone resources are not the same as blocked resources. + // Instead, these are bridges which have either failed to pass tests for some period + // or have expired bridge descriptors. In both cases, the bridge is unusable, but this + // is not likely due to censorship. Therefore, we replace gone resources with new resources + // TODO: create a notion of blocked resources from information collected through various means: + // https://gitlab.torproject.org/tpo/anti-censorship/censorship-analysis/-/issues/40035 + // If resource last passed tests 3 hours ago, it should be replaced with a working + // resource and be removed from the bridgetable. If it has been gone for more than 7 hours, + // we should stop trying to remove it from the bridge table and assume it has successfully been + // removed already + if resource.last_passed < (Utc::now() - chrono::Duration::hours(3)) + || resource.last_passed + > (Utc::now() - chrono::Duration::hours(7)) + { + let bridgeline = parse_resource(resource); + println!("BridgeLine to be replaced: {:?}", bridgeline); + let res = context.replace_with_new(bridgeline); + if res == lox_library::ReplaceSuccess::Replaced { + println!( + "BridgeLine successfully replaced: {:?}", + bridgeline + ); + } else if res == lox_library::ReplaceSuccess::NotReplaced { + // Add the bridge to the list of to_be_replaced bridges in the Lox context and try + // again to replace at the next update (nothing changes in the Lox Authority) + println!( + "'Gone' BridgeLine NOT replaced, saved for next update! : {:?}", + bridgeline + ); + context.new_to_be_replaced_bridge(bridgeline); + } + } + } + } + } + } + */ + /* Functionality for marking bridges as unreachable/blocked is currently not enabled as there is not + yet a reliable way to determine that a bridge is blocked. This means that migrations to unblocked bridges do not + currently work but can be easily enabled with a list of `blocked resources` from rdsys or another source with something + like the following: + println!("BridgeLine to be removed: {:?}", bridgeline); + let res = context.add_unreachable(bridgeline); + if res { + println!( + "BridgeLine successfully marked unreachable: {:?}", + bridgeline + ); + } else { + println!("'Gone' BridgeLine NOT REMOVED!! : {:?}", bridgeline); + //TODO probably do something else here + } + */ + } context.allocate_leftover_bridges(); context.encrypt_table(); lox_db.write_context(context.clone()); @@ -372,7 +405,14 @@ async fn main() { }); let context_manager = spawn(async move { - create_context_manager(config.db, args.roll_back_date, context_rx, kill_context).await + create_context_manager( + config.db, + config.bridge_allocation, + args.roll_back_date, + context_rx, + kill_context, + ) + .await }); let (tx, rx) = mpsc::channel(32); diff --git a/crates/lox-distributor/src/resource_parser.rs b/crates/lox-distributor/src/resource_parser.rs index ae5739e..bc0d95b 100644 --- a/crates/lox-distributor/src/resource_parser.rs +++ b/crates/lox-distributor/src/resource_parser.rs @@ -1,7 +1,8 @@ -use lox_library::bridge_table::{BridgeLine, BRIDGE_BYTES}; +use lox_library::bridge_table::{BridgeLine, BRIDGE_BYTES, MAX_BRIDGES_PER_BUCKET}; use rdsys_backend::proto::Resource; -pub fn parse_resources(resources: Vec) -> Vec { +// Parse each resource from rdsys into a Bridgeline as expected by the Lox Bridgetable +pub fn parse_into_bridgelines(resources: Vec) -> Vec { let mut bridgelines: Vec = Vec::new(); for resource in resources { let mut ip_bytes: [u8; 16] = [0; 16]; @@ -32,3 +33,36 @@ pub fn parse_resources(resources: Vec) -> Vec { } bridgelines } + +// Allocate each Bridgeline into a bucket that will later be allocated into spare buckets or open invitation buckets +// Any leftover buckets from total_bridgelines % MAX_BRIDGES_PER_BUCKET are returned in a separate Vec +// TODO: Improve this function to sort bridgelines into buckets in a more intentional manner. This could include +// sorting bridgelines with high bandwidth into buckets that are only distributed to more trusted users or sorting +// bridgelines by location +pub fn parse_into_buckets( + mut bridgelines: Vec, +) -> (Vec<[BridgeLine; MAX_BRIDGES_PER_BUCKET]>, Vec) { + let mut buckets: Vec<[BridgeLine; MAX_BRIDGES_PER_BUCKET]> = Vec::new(); + let mut count = 0; + let mut bucket = [BridgeLine::default(); MAX_BRIDGES_PER_BUCKET]; + let mut leftovers: Vec = Vec::new(); + for bridgeline in bridgelines.clone() { + println!("What is the bridgeline: {:?}", bridgeline); + if count < MAX_BRIDGES_PER_BUCKET { + bucket[count] = bridgeline; + count += 1; + } else { + buckets.push(bucket); + count = 0; + bucket = [BridgeLine::default(); MAX_BRIDGES_PER_BUCKET]; + } + } + // Handle the extra buckets that were not allocated already + if count != 0 { + for _ in 0..count { + // Assumes that the unallocated bridgelines will be the last x of the passed bridgelines + leftovers.push(bridgelines.pop().unwrap()); + } + } + (buckets, leftovers) +} diff --git a/crates/rdsys-backend-api/src/lib.rs b/crates/rdsys-backend-api/src/lib.rs index 923c15a..10b6087 100644 --- a/crates/rdsys-backend-api/src/lib.rs +++ b/crates/rdsys-backend-api/src/lib.rs @@ -286,7 +286,7 @@ pub async fn request_resources( api_endpoint: String, .await.unwrap(); match response.status() { reqwest::StatusCode::OK => { - fetched_resources = match dbg!(response.json::>().await) { + fetched_resources = match response.json::>().await { Ok(fetched_resources) => Ok(fetched_resources), Err(e) => Err(Error::Reqwest(e)), }; From 25add69c4d198db0eaf7744bfa74f5df53403e61 Mon Sep 17 00:00:00 2001 From: onyinyang Date: Mon, 28 Aug 2023 19:33:19 -0400 Subject: [PATCH 31/59] Add syncing functionality --- crates/lox-distributor/config.json | 2 +- crates/lox-distributor/src/db_handler.rs | 2 +- crates/lox-distributor/src/lox_context.rs | 75 +++++++++ crates/lox-distributor/src/main.rs | 151 ++---------------- crates/lox-distributor/src/resource_parser.rs | 113 +++++++++++++ crates/lox-library/src/lib.rs | 8 +- 6 files changed, 200 insertions(+), 151 deletions(-) diff --git a/crates/lox-distributor/config.json b/crates/lox-distributor/config.json index 6578722..06f6fdc 100644 --- a/crates/lox-distributor/config.json +++ b/crates/lox-distributor/config.json @@ -3,7 +3,7 @@ "db_path": "lox_db" }, - "bridge_allocation": { + "bridge_config": { "percent_spares": 50 }, "rtype": { diff --git a/crates/lox-distributor/src/db_handler.rs b/crates/lox-distributor/src/db_handler.rs index e732da6..149cb3d 100644 --- a/crates/lox-distributor/src/db_handler.rs +++ b/crates/lox-distributor/src/db_handler.rs @@ -7,7 +7,7 @@ use sled::IVec; pub struct DB { db: sled::Db, -} + } impl DB { pub fn write_context(&mut self, context: lox_context::LoxServerContext) { diff --git a/crates/lox-distributor/src/lox_context.rs b/crates/lox-distributor/src/lox_context.rs index 4b87166..adc49ca 100644 --- a/crates/lox-distributor/src/lox_context.rs +++ b/crates/lox-distributor/src/lox_context.rs @@ -50,6 +50,79 @@ impl LoxServerContext { } } + /* Functionality for marking bridges as unreachable/blocked is currently not enabled as there is not + yet a reliable way to determine that a bridge is blocked. This means that migrations to unblocked bridges do not + currently work but can be easily enabled with a list of `blocked resources` from rdsys or another source with something + like the following: + println!("BridgeLine to be removed: {:?}", bridgeline); + let res = context.add_unreachable(bridgeline); + if res { + println!( + "BridgeLine successfully marked unreachable: {:?}", + bridgeline + ); + } else { + println!("'Gone' BridgeLine NOT REMOVED!! : {:?}", bridgeline); + //TODO probably do something else here + } + */ + + // Sync resources received from rdsys with the Lox bridgetable + pub fn sync_with_bridgetable(&self, functional: Vec, failing: Vec) { + // Check if the resource is already in the Lox bridgetable. If it is, it's probably fine + // to replace the existing resource with the incoming one to account for changes, + // unless we want to track the number of changes on the lox side? + for bridge in functional { + let res = self.update_bridge(bridge); + if res { + println!( + "BridgeLine {:?} successfully updated.", + bridge.uid_fingerprint + ); + // Assume non-failing bridges that are not found in the bridge table are new bridges and save them for later + } else { + println!("BridgeLine: {:?} not found in Lox's Bridgetable. Save it as a new resource for now!", bridge.uid_fingerprint); + self.append_extra_bridges(bridge); + } + } + // Next, handle the failing bridges. If resource last passed tests 3 hours ago, it should be replaced + // with a working resource and be removed from the bridgetable. + for bridge in failing { + let res = self.replace_with_new(bridge); + if res == lox_library::ReplaceSuccess::Replaced { + println!( + "BridgeLine {:?} successfully replaced.", + bridge.uid_fingerprint + ); + } else if res == lox_library::ReplaceSuccess::NotReplaced { + // Add the bridge to the list of to_be_replaced bridges in the Lox context and try + // again to replace at the next update (nothing changes in the Lox Authority) + println!( + "BridgeLine {:?} NOT replaced, saved for next update!", + bridge.uid_fingerprint + ); + self.new_to_be_replaced_bridge(bridge); + } else { + // NotFound + assert!( + res == lox_library::ReplaceSuccess::NotFound, + "ReplaceSuccess incorrectly set" + ); + println!( + "BridgeLine {:?} no longer in bridge table.", + bridge.uid_fingerprint + ); + } + } + // Finally, assign any extra_bridges to new buckets if there are enough + while self.extra_bridges.lock().unwrap().len() >= MAX_BRIDGES_PER_BUCKET { + let bucket = self.remove_extra_bridges(); + // TODO: Decide the circumstances under which a bridge is allocated to an open_inv or spare bucket, + // eventually also do some more fancy grouping of new resources, i.e., by type or region + self.add_spare_bucket(bucket); + } + } + pub fn append_extra_bridges(&self, bridge: BridgeLine) { let mut extra_bridges = self.extra_bridges.lock().unwrap(); extra_bridges.push(bridge); @@ -112,6 +185,8 @@ impl LoxServerContext { } } + // Attempt to remove a bridge that is failing tests and replace it with a bridge from the + // available bridges or from a spare bucket pub fn replace_with_new(&self, bridgeline: BridgeLine) -> lox_library::ReplaceSuccess { let mut ba_obj = self.ba.lock().unwrap(); let eb_obj = self.extra_bridges.lock().unwrap(); diff --git a/crates/lox-distributor/src/main.rs b/crates/lox-distributor/src/main.rs index f41c40c..24c2582 100644 --- a/crates/lox-distributor/src/main.rs +++ b/crates/lox-distributor/src/main.rs @@ -5,7 +5,6 @@ use hyper::{ service::{make_service_fn, service_fn}, Body, Request, Response, Server, }; -use lox_library::bridge_table::{BridgeLine, MAX_BRIDGES_PER_BUCKET}; use rdsys_backend::{proto::Resource, request_resources}; use serde::Deserialize; @@ -28,6 +27,8 @@ use tokio::{ time::{interval, sleep}, }; +use crate::resource_parser::sort_for_parsing; + async fn shutdown_signal() { tokio::signal::ctrl_c() .await @@ -55,7 +56,7 @@ struct Args { #[derive(Debug, Deserialize)] struct Config { db: DbConfig, - bridge_allocation: BridgeConfig, + bridge_config: BridgeConfig, rtype: ResourceInfo, } @@ -75,7 +76,7 @@ impl Default for DbConfig { } // Config information for how bridges should be allocated to buckets -#[derive(Debug, Deserialize)] +#[derive(Debug, Default, Deserialize)] pub struct BridgeConfig { // The percentage of buckets (made up of MAX_BRIDGES_PER_BUCKET bridges) // that should be allocated as spare buckets @@ -83,12 +84,6 @@ pub struct BridgeConfig { percent_spares: i32, } -impl Default for BridgeConfig { - fn default() -> BridgeConfig { - BridgeConfig { percent_spares: 0 } - } -} - #[derive(Debug, Deserialize)] struct ResourceInfo { endpoint: String, @@ -108,7 +103,7 @@ async fn rdsys_stream( ) { tokio::select! { start_resource_request = rdsys_request(rtype, tx) => start_resource_request, - _ = kill.recv() => {println!("Shut down rdsys request loop"); return}, + _ = kill.recv() => {println!("Shut down rdsys request loop")}, } } @@ -200,138 +195,10 @@ async fn context_manager( // period of time are removed. // If bridges are labelled as blocked_in, we should also handle blocking behaviour. } else { - // for each resource, check if the resource fingerprint is failing tests, if it is check for how long - // check if the resource is already in the Lox bridgetable - // if it is, it's probably fine to remove or replace the existing resource with the incoming one - // to account for changes unless we want to track the number of changes on the lox side? - // that should be sufficient to keep it in sync - // TODO: Decide the circumstances under which a bridge is allocated to an open_inv or spare bucket, - // eventually also do some more fancy grouping of new resources, i.e., by type or region - /* for bridgeline in bridgelines { - //context.populate_bridgetable(bridgelines. None); - println!("What is the bridgeline: {:?}", bridgeline); - if context.to_be_replaced_bridges.lock().unwrap().len() > 0 { - println!("BridgeLine to be replaced: {:?}", bridgeline); - let res = context.replace_with_new(bridgeline); - if res == lox_library::ReplaceSuccess::NotFound { - println!( - "BridgeLine not found in bridge_table, already updated {:?}", - bridgeline - ); - } else if res == lox_library::ReplaceSuccess::Replaced { - println!("BridgeLine successfully replaced: {:?}", bridgeline); - } else { - assert!( - res == lox_library::ReplaceSuccess::NotReplaced, - "ReplaceSuccess incorrectly set somehow" - ); - // Add the bridge to the list of to_be_replaced bridges in the Lox context and try - // again to replace at the next update (nothing changes in the Lox Authority) - println!( - "'Gone' BridgeLine NOT replaced, saved for next update! : {:?}", - bridgeline - ); - context.new_to_be_replaced_bridge(bridgeline); - } - } else if count < MAX_BRIDGES_PER_BUCKET { - bucket[count] = bridgeline; - count += 1; - } else { - // TODO: Decide the circumstances under which a bridge is allocated to an open_inv or spare bucket, - // eventually also do some more fancy grouping of new resources, i.e., by type or region - context.add_openinv_bucket(bucket); - count = 0; - bucket = [BridgeLine::default(); MAX_BRIDGES_PER_BUCKET]; - } - } - // Handle the extra buckets that were not allocated already - if count != 0 { - for val in 0..count { - if context.extra_bridges.lock().unwrap().len() - < (MAX_BRIDGES_PER_BUCKET) - { - context.append_extra_bridges(bucket[val]); - } else { - bucket = context.remove_extra_bridges(); - context.add_spare_bucket(bucket); - } - } - } - } - - - let bridgeline = parse_resource(resource); - println!("BridgeLine to be changed: {:?}", bridgeline); - let res = context.update_bridge(bridgeline); - if res { - println!("BridgeLine successfully updated: {:?}", bridgeline); - } else { - println!("BridgeLine: {:?} not found in Lox's Bridgetable. Save it as a new resource for now!", bridgeline); - if context.extra_bridges.lock().unwrap().len() < 2 { - context.append_extra_bridges(bridgeline); - } else { - let bucket = context.remove_extra_bridges(); - context.add_spare_bucket(bucket); - } - } - } - } - } - } - // gone resources are not the same as blocked resources. - // Instead, these are bridges which have either failed to pass tests for some period - // or have expired bridge descriptors. In both cases, the bridge is unusable, but this - // is not likely due to censorship. Therefore, we replace gone resources with new resources - // TODO: create a notion of blocked resources from information collected through various means: - // https://gitlab.torproject.org/tpo/anti-censorship/censorship-analysis/-/issues/40035 - // If resource last passed tests 3 hours ago, it should be replaced with a working - // resource and be removed from the bridgetable. If it has been gone for more than 7 hours, - // we should stop trying to remove it from the bridge table and assume it has successfully been - // removed already - if resource.last_passed < (Utc::now() - chrono::Duration::hours(3)) - || resource.last_passed - > (Utc::now() - chrono::Duration::hours(7)) - { - let bridgeline = parse_resource(resource); - println!("BridgeLine to be replaced: {:?}", bridgeline); - let res = context.replace_with_new(bridgeline); - if res == lox_library::ReplaceSuccess::Replaced { - println!( - "BridgeLine successfully replaced: {:?}", - bridgeline - ); - } else if res == lox_library::ReplaceSuccess::NotReplaced { - // Add the bridge to the list of to_be_replaced bridges in the Lox context and try - // again to replace at the next update (nothing changes in the Lox Authority) - println!( - "'Gone' BridgeLine NOT replaced, saved for next update! : {:?}", - bridgeline - ); - context.new_to_be_replaced_bridge(bridgeline); - } - } - } - } - } - } - */ - /* Functionality for marking bridges as unreachable/blocked is currently not enabled as there is not - yet a reliable way to determine that a bridge is blocked. This means that migrations to unblocked bridges do not - currently work but can be easily enabled with a list of `blocked resources` from rdsys or another source with something - like the following: - println!("BridgeLine to be removed: {:?}", bridgeline); - let res = context.add_unreachable(bridgeline); - if res { - println!( - "BridgeLine successfully marked unreachable: {:?}", - bridgeline - ); - } else { - println!("'Gone' BridgeLine NOT REMOVED!! : {:?}", bridgeline); - //TODO probably do something else here - } - */ + let (functional, failing) = sort_for_parsing(resources); + context.sync_with_bridgetable(functional, failing); } + // Handle any bridges that are leftover in the bridge authority from the sync context.allocate_leftover_bridges(); context.encrypt_table(); lox_db.write_context(context.clone()); @@ -407,7 +274,7 @@ async fn main() { let context_manager = spawn(async move { create_context_manager( config.db, - config.bridge_allocation, + config.bridge_config, args.roll_back_date, context_rx, kill_context, diff --git a/crates/lox-distributor/src/resource_parser.rs b/crates/lox-distributor/src/resource_parser.rs index bc0d95b..e122c0a 100644 --- a/crates/lox-distributor/src/resource_parser.rs +++ b/crates/lox-distributor/src/resource_parser.rs @@ -1,6 +1,9 @@ +use chrono::{Duration, Utc}; use lox_library::bridge_table::{BridgeLine, BRIDGE_BYTES, MAX_BRIDGES_PER_BUCKET}; use rdsys_backend::proto::Resource; +pub const ACCEPTED_HOURS_OF_FAILURE: i64 = 3; + // Parse each resource from rdsys into a Bridgeline as expected by the Lox Bridgetable pub fn parse_into_bridgelines(resources: Vec) -> Vec { let mut bridgelines: Vec = Vec::new(); @@ -66,3 +69,113 @@ pub fn parse_into_buckets( } (buckets, leftovers) } + +// Sort Resources into those that are functional and those that are failing based on the last time +// they were passing tests. Before passing them back to the calling function, they are parsed into +// BridgeLines +pub fn sort_for_parsing(resources: Vec) -> (Vec, Vec) { + let mut functional: Vec = Vec::new(); + let mut failing: Vec = Vec::new(); + for resource in resources { + if resource.last_passed + Duration::hours(ACCEPTED_HOURS_OF_FAILURE) >= Utc::now() { + functional.push(resource); + } else { + failing.push(resource); + } + } + let functional_bridgelines = parse_into_bridgelines(functional); + let failing_bridgelines = parse_into_bridgelines(failing); + + (functional_bridgelines, failing_bridgelines) +} + +#[cfg(test)] +mod tests { + use rdsys_backend::proto::Resource; + use std::collections::HashMap; + + use chrono::{Duration, Utc}; + + use super::sort_for_parsing; + + pub fn make_resource( + rtype: String, + address: String, + port: u16, + fingerprint: String, + last_passed: i64, + ) -> Resource { + let mut flags = HashMap::new(); + flags.insert(String::from("fast"), true); + flags.insert(String::from("stable"), true); + let mut params = HashMap::new(); + params.insert( + String::from("password"), + String::from("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"), + ); + Resource { + r#type: String::from(rtype), + blocked_in: HashMap::new(), + last_passed: Utc::now() - Duration::hours(last_passed), + protocol: String::from("tcp"), + address: String::from(address), + port: port, + fingerprint: String::from(fingerprint), + or_addresses: None, + distribution: String::from("https"), + flags: Some(flags), + params: Some(params), + } + } + + #[test] + fn test_sort_for_parsing() { + let resource_one = make_resource( + "scramblesuit".to_owned(), + "123.456.789.100".to_owned(), + 3002, + "BE84A97D02130470A1C77839954392BA979F7EE1".to_owned(), + 2, + ); + let resource_two = make_resource( + "https".to_owned(), + "123.222.333.444".to_owned(), + 6002, + "C56B9EF202130470A1C77839954392BA979F7FF9".to_owned(), + 5, + ); + let resource_three = make_resource( + "scramblesuit".to_owned(), + "444.888.222.100".to_owned(), + 3042, + "1A4C8BD902130470A1C77839954392BA979F7B46".to_owned(), + 4, + ); + let resource_four = make_resource( + "https".to_owned(), + "555.444.212.100".to_owned(), + 8022, + "FF024DC302130470A1C77839954392BA979F7AE2".to_owned(), + 3, + ); + let resource_five = make_resource( + "https".to_owned(), + "234.111.212.100".to_owned(), + 10432, + "7B4DE14CB2130470A1C77839954392BA979F7AE2".to_owned(), + 1, + ); + let mut test_vec: Vec = Vec::new(); + test_vec.push(resource_one); + test_vec.push(resource_two); + test_vec.push(resource_three); + test_vec.push(resource_four); + test_vec.push(resource_five); + let (functional, failing) = sort_for_parsing(test_vec); + assert!( + functional.len() == 2, + "There should be 2 functional bridges" + ); + assert!(failing.len() == 3, "There should be 3 failing bridges"); + } +} diff --git a/crates/lox-library/src/lib.rs b/crates/lox-library/src/lib.rs index 002ab9c..ba6d946 100644 --- a/crates/lox-library/src/lib.rs +++ b/crates/lox-library/src/lib.rs @@ -431,16 +431,11 @@ impl BridgeAuth { let reachable_bridges = self.bridge_table.reachable.clone(); for reachable_bridge in reachable_bridges { if reachable_bridge.0.uid_fingerprint == bridge.uid_fingerprint { - println!( - "Bridge from table: {:?} has same IP and Port as bridge {:?}!", - reachable_bridge.0, bridge - ); // Now we must remove the old bridge from the table and insert the new bridge in its place // i.e., in the same bucket and with the same permissions. let positions = self.bridge_table.reachable.get(&reachable_bridge.0); if let Some(v) = positions { for (bucketnum, offset) in v.iter() { - println!("Bucket num: {:?} and offset: {:?}", bucketnum, offset); let mut bridgelines = match self.bridge_table.buckets.get(bucketnum) { Some(bridgelines) => *bridgelines, None => return res, @@ -448,11 +443,10 @@ impl BridgeAuth { assert!(bridgelines[*offset] == reachable_bridge.0); bridgelines[*offset] = *bridge; self.bridge_table.buckets.insert(*bucketnum, bridgelines); - let bridgelines = match self.bridge_table.buckets.get(bucketnum) { + match self.bridge_table.buckets.get(bucketnum) { Some(bridgelines) => *bridgelines, None => return res, }; - assert!(bridgelines[*offset] != reachable_bridge.0); } res = true; } else { From a31ed0a4e562dd18f01e513255819898c3afc3ce Mon Sep 17 00:00:00 2001 From: onyinyang Date: Wed, 30 Aug 2023 11:35:27 -0400 Subject: [PATCH 32/59] Update output msg --- crates/lox-distributor/src/resource_parser.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/lox-distributor/src/resource_parser.rs b/crates/lox-distributor/src/resource_parser.rs index e122c0a..2eeb5b2 100644 --- a/crates/lox-distributor/src/resource_parser.rs +++ b/crates/lox-distributor/src/resource_parser.rs @@ -50,7 +50,7 @@ pub fn parse_into_buckets( let mut bucket = [BridgeLine::default(); MAX_BRIDGES_PER_BUCKET]; let mut leftovers: Vec = Vec::new(); for bridgeline in bridgelines.clone() { - println!("What is the bridgeline: {:?}", bridgeline); + println!("Added bridge with fingerprint: {:?}", bridgeline.uid_fingerprint); if count < MAX_BRIDGES_PER_BUCKET { bucket[count] = bridgeline; count += 1; From 8ebc4abc195663dcba38d9dcf2c222a648ec3022 Mon Sep 17 00:00:00 2001 From: onyinyang Date: Thu, 7 Sep 2023 11:00:34 -0400 Subject: [PATCH 33/59] Minor formatting changes and last context read fix --- crates/lox-distributor/src/db_handler.rs | 4 ++-- crates/lox-distributor/src/main.rs | 7 +++---- crates/lox-distributor/src/resource_parser.rs | 5 ++++- crates/rdsys-backend-api/src/lib.rs | 10 +++++----- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/crates/lox-distributor/src/db_handler.rs b/crates/lox-distributor/src/db_handler.rs index 149cb3d..26966fa 100644 --- a/crates/lox-distributor/src/db_handler.rs +++ b/crates/lox-distributor/src/db_handler.rs @@ -7,7 +7,7 @@ use sled::IVec; pub struct DB { db: sled::Db, - } +} impl DB { pub fn write_context(&mut self, context: lox_context::LoxServerContext) { @@ -115,7 +115,7 @@ fn compute_startdate_string(date_range_end: String) -> Option> { fn use_last_context(lox_db: sled::Db) -> lox_context::LoxServerContext { let ivec_context = lox_db.last().unwrap().unwrap(); - let ivec_date: String = serde_json::from_slice(&ivec_context.0).unwrap(); + let ivec_date: String = String::from_utf8(ivec_context.0.to_vec()).unwrap(); println!("Using last context with date: {:?}", ivec_date); serde_json::from_slice(&ivec_context.1).unwrap() } diff --git a/crates/lox-distributor/src/main.rs b/crates/lox-distributor/src/main.rs index 24c2582..0387a3f 100644 --- a/crates/lox-distributor/src/main.rs +++ b/crates/lox-distributor/src/main.rs @@ -121,7 +121,6 @@ async fn rdsys_request(rtype: ResourceInfo, tx: mpsc::Sender>) { .await .unwrap(); tx.send(resources).await.unwrap(); - sleep(Duration::from_secs(30)).await; } } @@ -136,7 +135,7 @@ async fn rdsys_bridge_parser( } } -// Parse Bridges receives a ResourceDiff from rdsys_sender and sends it to the +// Parse Bridges receives a Vec from rdsys_sender and sends it to the // Context Manager to be parsed and added to the BridgeDB async fn parse_bridges(rdsys_tx: mpsc::Sender, mut rx: mpsc::Receiver>) { loop { @@ -283,7 +282,7 @@ async fn main() { }); let (tx, rx) = mpsc::channel(32); - let rdsys_stream_handler = spawn(async { rdsys_stream(config.rtype, tx, kill_stream).await }); + let rdsys_request_handler = spawn(async { rdsys_stream(config.rtype, tx, kill_stream).await }); let rdsys_resource_receiver = spawn(async { rdsys_bridge_parser(rdsys_tx, rx, kill_parser).await }); @@ -313,7 +312,7 @@ async fn main() { eprintln!("server error: {}", e); } future::join_all([ - rdsys_stream_handler, + rdsys_request_handler, rdsys_resource_receiver, context_manager, shutdown_handler, diff --git a/crates/lox-distributor/src/resource_parser.rs b/crates/lox-distributor/src/resource_parser.rs index 2eeb5b2..09863ed 100644 --- a/crates/lox-distributor/src/resource_parser.rs +++ b/crates/lox-distributor/src/resource_parser.rs @@ -50,7 +50,10 @@ pub fn parse_into_buckets( let mut bucket = [BridgeLine::default(); MAX_BRIDGES_PER_BUCKET]; let mut leftovers: Vec = Vec::new(); for bridgeline in bridgelines.clone() { - println!("Added bridge with fingerprint: {:?}", bridgeline.uid_fingerprint); + println!( + "Added bridge with fingerprint: {:?}", + bridgeline.uid_fingerprint + ); if count < MAX_BRIDGES_PER_BUCKET { bucket[count] = bridgeline; count += 1; diff --git a/crates/rdsys-backend-api/src/lib.rs b/crates/rdsys-backend-api/src/lib.rs index 10b6087..f3aa8b3 100644 --- a/crates/rdsys-backend-api/src/lib.rs +++ b/crates/rdsys-backend-api/src/lib.rs @@ -262,7 +262,8 @@ pub async fn start_stream( Ok(ResourceStream::new(rx)) } -pub async fn request_resources( api_endpoint: String, +pub async fn request_resources( + api_endpoint: String, name: String, token: String, resource_types: Vec, @@ -283,7 +284,8 @@ pub async fn request_resources( api_endpoint: String, .header("Authorization", &auth_value) .body(json) .send() - .await.unwrap(); + .await + .unwrap(); match response.status() { reqwest::StatusCode::OK => { fetched_resources = match response.json::>().await { @@ -291,9 +293,7 @@ pub async fn request_resources( api_endpoint: String, Err(e) => Err(Error::Reqwest(e)), }; } - other => { - fetched_resources = Err(Error::String(other)) - } + other => fetched_resources = Err(Error::String(other)), }; fetched_resources } From b6ff0c60e219c5ed46971dfca96ea52e5fe51469 Mon Sep 17 00:00:00 2001 From: onyinyang Date: Wed, 27 Sep 2023 18:45:40 -0400 Subject: [PATCH 34/59] Update rdsys-api-backend and lox-distributor to match rdsys --- crates/lox-distributor/src/lox_context.rs | 130 +++++++++++------- crates/lox-distributor/src/main.rs | 42 +++--- crates/lox-distributor/src/resource_parser.rs | 20 ++- crates/rdsys-backend-api/src/lib.rs | 6 +- crates/rdsys-backend-api/src/proto.rs | 35 ++++- 5 files changed, 147 insertions(+), 86 deletions(-) diff --git a/crates/lox-distributor/src/lox_context.rs b/crates/lox-distributor/src/lox_context.rs index adc49ca..b237419 100644 --- a/crates/lox-distributor/src/lox_context.rs +++ b/crates/lox-distributor/src/lox_context.rs @@ -8,6 +8,7 @@ use lox_library::{ }, BridgeAuth, BridgeDb, IssuerPubKey, }; +use rdsys_backend::proto::ResourceState; use serde::{Deserialize, Serialize}; use std::{ @@ -16,6 +17,8 @@ use std::{ }; use zkp::ProofError; +use crate::resource_parser::{parse_into_bridgelines, sort_for_parsing}; + #[derive(Clone, Debug, Serialize, Deserialize)] pub struct LoxServerContext { pub db: Arc>, @@ -68,58 +71,89 @@ impl LoxServerContext { */ // Sync resources received from rdsys with the Lox bridgetable - pub fn sync_with_bridgetable(&self, functional: Vec, failing: Vec) { + pub fn sync_with_bridgetable(&self, resources: ResourceState) { // Check if the resource is already in the Lox bridgetable. If it is, it's probably fine - // to replace the existing resource with the incoming one to account for changes, - // unless we want to track the number of changes on the lox side? - for bridge in functional { - let res = self.update_bridge(bridge); - if res { - println!( - "BridgeLine {:?} successfully updated.", - bridge.uid_fingerprint - ); - // Assume non-failing bridges that are not found in the bridge table are new bridges and save them for later - } else { - println!("BridgeLine: {:?} not found in Lox's Bridgetable. Save it as a new resource for now!", bridge.uid_fingerprint); - self.append_extra_bridges(bridge); + // to replace the existing resource with the incoming one to account for changes + let mut unaccounted_for_bridges: Vec = Vec::new(); + let mut accounted_for_bridges: Vec = Vec::new(); + if let Some(working_resources) = resources.working { + // ensure all working resources are updated and accounted for + // save a list of unaccounted for bridges and deal with them in the next block + let bridgelines = parse_into_bridgelines(working_resources); + for bridge in bridgelines { + let res = self.update_bridge(bridge); + if res { + println!( + "BridgeLine {:?} successfully updated.", + bridge.uid_fingerprint + ); + accounted_for_bridges.push(bridge.uid_fingerprint); + // Assume non-failing bridges that are not found in the bridge table are new bridges and save them for later + } else { + println!("BridgeLine: {:?} not found in Lox's Bridgetable. Save it as a new resource for now!", bridge.uid_fingerprint); + self.append_extra_bridges(bridge); + } } } - // Next, handle the failing bridges. If resource last passed tests 3 hours ago, it should be replaced - // with a working resource and be removed from the bridgetable. - for bridge in failing { - let res = self.replace_with_new(bridge); - if res == lox_library::ReplaceSuccess::Replaced { - println!( - "BridgeLine {:?} successfully replaced.", - bridge.uid_fingerprint - ); - } else if res == lox_library::ReplaceSuccess::NotReplaced { - // Add the bridge to the list of to_be_replaced bridges in the Lox context and try - // again to replace at the next update (nothing changes in the Lox Authority) - println!( - "BridgeLine {:?} NOT replaced, saved for next update!", - bridge.uid_fingerprint - ); - self.new_to_be_replaced_bridge(bridge); - } else { - // NotFound - assert!( - res == lox_library::ReplaceSuccess::NotFound, - "ReplaceSuccess incorrectly set" - ); - println!( - "BridgeLine {:?} no longer in bridge table.", - bridge.uid_fingerprint - ); + if let Some(not_working_resources) = resources.not_working { + let (grace_period, failing) = sort_for_parsing(not_working_resources); + // Update bridges in the bridge table that are failing but within the grace period + for bridge in grace_period { + let res = self.update_bridge(bridge); + if res { + println!( + "BridgeLine {:?} successfully updated.", + bridge.uid_fingerprint + ); + accounted_for_bridges.push(bridge.uid_fingerprint); + } + } + // Next, handle the failing bridges. If resource last passed tests >=ACCEPTED_HOURS_OF_FAILURE ago, + // it should be replaced with a working resource and be removed from the bridgetable. + for bridge in failing { + let res = self.replace_with_new(bridge); + if res == lox_library::ReplaceSuccess::Replaced { + println!( + "BridgeLine {:?} successfully replaced.", + bridge.uid_fingerprint + ); + accounted_for_bridges.push(bridge.uid_fingerprint); + } else if res == lox_library::ReplaceSuccess::NotReplaced { + // Add the bridge to the list of to_be_replaced bridges in the Lox context and try + // again to replace at the next update (nothing changes in the Lox Authority) + println!( + "BridgeLine {:?} NOT replaced, saved for next update!", + bridge.uid_fingerprint + ); + self.new_to_be_replaced_bridge(bridge); + accounted_for_bridges.push(bridge.uid_fingerprint); + } else { + // NotFound + assert!( + res == lox_library::ReplaceSuccess::NotFound, + "ReplaceSuccess incorrectly set" + ); + println!( + "BridgeLine {:?} no longer in bridge table.", + bridge.uid_fingerprint + ); + } + } + // Make sure that all bridges are accounted for + let ba_clone = self.ba.lock().unwrap(); + let total_reachable = ba_clone.bridge_table.reachable.len(); + if total_reachable > accounted_for_bridges.len() { + // Search for extra fingerprints, assume those bridges are gone and remove? + } else if total_reachable < accounted_for_bridges.len() { + println!("Something unexpected occurred: The number of reachable bridges should not be less than those updated from rdsys"); + } + // Finally, assign any extra_bridges to new buckets if there are enough + while self.extra_bridges.lock().unwrap().len() >= MAX_BRIDGES_PER_BUCKET { + let bucket = self.remove_extra_bridges(); + // TODO: Decide the circumstances under which a bridge is allocated to an open_inv or spare bucket, + // eventually also do some more fancy grouping of new resources, i.e., by type or region + self.add_spare_bucket(bucket); } - } - // Finally, assign any extra_bridges to new buckets if there are enough - while self.extra_bridges.lock().unwrap().len() >= MAX_BRIDGES_PER_BUCKET { - let bucket = self.remove_extra_bridges(); - // TODO: Decide the circumstances under which a bridge is allocated to an open_inv or spare bucket, - // eventually also do some more fancy grouping of new resources, i.e., by type or region - self.add_spare_bucket(bucket); } } diff --git a/crates/lox-distributor/src/main.rs b/crates/lox-distributor/src/main.rs index 0387a3f..78898e8 100644 --- a/crates/lox-distributor/src/main.rs +++ b/crates/lox-distributor/src/main.rs @@ -6,7 +6,7 @@ use hyper::{ Body, Request, Response, Server, }; -use rdsys_backend::{proto::Resource, request_resources}; +use rdsys_backend::{proto::ResourceState, request_resources}; use serde::Deserialize; use std::{ @@ -27,8 +27,6 @@ use tokio::{ time::{interval, sleep}, }; -use crate::resource_parser::sort_for_parsing; - async fn shutdown_signal() { tokio::signal::ctrl_c() .await @@ -98,7 +96,7 @@ struct ResourceInfo { // TODO: ensure this stream gracefully shutdowns on the ctrl_c command. async fn rdsys_stream( rtype: ResourceInfo, - tx: mpsc::Sender>, + tx: mpsc::Sender, mut kill: broadcast::Receiver<()>, ) { tokio::select! { @@ -108,7 +106,7 @@ async fn rdsys_stream( } } -async fn rdsys_request(rtype: ResourceInfo, tx: mpsc::Sender>) { +async fn rdsys_request(rtype: ResourceInfo, tx: mpsc::Sender) { let mut interval = interval(Duration::from_secs(30)); loop { interval.tick().await; @@ -126,7 +124,7 @@ async fn rdsys_request(rtype: ResourceInfo, tx: mpsc::Sender>) { async fn rdsys_bridge_parser( rdsys_tx: mpsc::Sender, - rx: mpsc::Receiver>, + rx: mpsc::Receiver, mut kill: broadcast::Receiver<()>, ) { tokio::select! { @@ -137,7 +135,7 @@ async fn rdsys_bridge_parser( // Parse Bridges receives a Vec from rdsys_sender and sends it to the // Context Manager to be parsed and added to the BridgeDB -async fn parse_bridges(rdsys_tx: mpsc::Sender, mut rx: mpsc::Receiver>) { +async fn parse_bridges(rdsys_tx: mpsc::Sender, mut rx: mpsc::Receiver) { loop { let resources = rx.recv().await.unwrap(); let cmd = Command::Rdsys { resources }; @@ -180,22 +178,24 @@ async fn context_manager( match cmd { Rdsys { resources } => { // If the bridgetable is not being loaded from an existing database, we will populate the - // bridgetable with all of the bridges received from rdsys + // bridgetable with all of the working bridges received from rdsys. if context.bridgetable_is_empty() { - let bridgelines = parse_into_bridgelines(resources); - let (buckets, leftovers) = parse_into_buckets(bridgelines); - for leftover in leftovers { - context.append_extra_bridges(leftover); + if let Some(working_resources) = resources.working { + let bridgelines = parse_into_bridgelines(working_resources); + let (buckets, leftovers) = parse_into_buckets(bridgelines); + for leftover in leftovers { + context.append_extra_bridges(leftover); + } + context.populate_bridgetable(buckets, bridge_config.percent_spares); + + // otherwise, we need to sync the existing bridgetable with the resources we receive from + // rdsys and ensure that all functioning bridges are correctly placed in the bridgetable + // those that have changed are updated and those that have been failing tests for an extended + // period of time are removed. + // If bridges are labelled as blocked_in, we should also handle blocking behaviour. } - context.populate_bridgetable(buckets, bridge_config.percent_spares); - // otherwise, we need to sync the existing bridgetable with the resources we receive from - // rdsys and ensure that all functioning bridges are correctly placed in the bridgetable - // those that have changed are updated and those that have been failing tests for an extended - // period of time are removed. - // If bridges are labelled as blocked_in, we should also handle blocking behaviour. } else { - let (functional, failing) = sort_for_parsing(resources); - context.sync_with_bridgetable(functional, failing); + context.sync_with_bridgetable(resources); } // Handle any bridges that are leftover in the bridge authority from the sync context.allocate_leftover_bridges(); @@ -225,7 +225,7 @@ async fn context_manager( #[derive(Debug)] enum Command { Rdsys { - resources: Vec, + resources: ResourceState, }, Request { req: Request, diff --git a/crates/lox-distributor/src/resource_parser.rs b/crates/lox-distributor/src/resource_parser.rs index 09863ed..9136450 100644 --- a/crates/lox-distributor/src/resource_parser.rs +++ b/crates/lox-distributor/src/resource_parser.rs @@ -77,24 +77,28 @@ pub fn parse_into_buckets( // they were passing tests. Before passing them back to the calling function, they are parsed into // BridgeLines pub fn sort_for_parsing(resources: Vec) -> (Vec, Vec) { - let mut functional: Vec = Vec::new(); + let mut grace_period: Vec = Vec::new(); let mut failing: Vec = Vec::new(); for resource in resources { - if resource.last_passed + Duration::hours(ACCEPTED_HOURS_OF_FAILURE) >= Utc::now() { - functional.push(resource); + // TODO: Maybe filter for untested resources first if last_passed alone would skew + // the filter in an unintended direction + if resource.test_result.last_passed + Duration::hours(ACCEPTED_HOURS_OF_FAILURE) + >= Utc::now() + { + grace_period.push(resource); } else { failing.push(resource); } } - let functional_bridgelines = parse_into_bridgelines(functional); + let grace_period_bridgelines = parse_into_bridgelines(grace_period); let failing_bridgelines = parse_into_bridgelines(failing); - (functional_bridgelines, failing_bridgelines) + (grace_period_bridgelines, failing_bridgelines) } #[cfg(test)] mod tests { - use rdsys_backend::proto::Resource; + use rdsys_backend::proto::{Resource, TestResults}; use std::collections::HashMap; use chrono::{Duration, Utc}; @@ -119,7 +123,9 @@ mod tests { Resource { r#type: String::from(rtype), blocked_in: HashMap::new(), - last_passed: Utc::now() - Duration::hours(last_passed), + test_result: TestResults { + last_passed: Utc::now() - Duration::hours(last_passed), + }, protocol: String::from("tcp"), address: String::from(address), port: port, diff --git a/crates/rdsys-backend-api/src/lib.rs b/crates/rdsys-backend-api/src/lib.rs index f3aa8b3..51e2bdc 100644 --- a/crates/rdsys-backend-api/src/lib.rs +++ b/crates/rdsys-backend-api/src/lib.rs @@ -267,8 +267,8 @@ pub async fn request_resources( name: String, token: String, resource_types: Vec, -) -> Result, Error> { - let fetched_resources: Result, Error>; +) -> Result { + let fetched_resources: Result; let req = proto::ResourceRequest { request_origin: name, resource_types, @@ -288,7 +288,7 @@ pub async fn request_resources( .unwrap(); match response.status() { reqwest::StatusCode::OK => { - fetched_resources = match response.json::>().await { + fetched_resources = match response.json::().await { Ok(fetched_resources) => Ok(fetched_resources), Err(e) => Err(Error::Reqwest(e)), }; diff --git a/crates/rdsys-backend-api/src/proto.rs b/crates/rdsys-backend-api/src/proto.rs index af0a026..ecfeee9 100644 --- a/crates/rdsys-backend-api/src/proto.rs +++ b/crates/rdsys-backend-api/src/proto.rs @@ -10,12 +10,18 @@ pub struct ResourceRequest { pub resource_types: Vec, } + +#[derive(Serialize, Deserialize, Debug, PartialEq, Eq)] +pub struct TestResults { + pub last_passed: DateTime +} + /// Representation of a bridge resource #[derive(Deserialize, PartialEq, Eq, Debug)] pub struct Resource { pub r#type: String, pub blocked_in: HashMap, - pub last_passed: DateTime, + pub test_result: TestResults, pub protocol: String, pub address: String, pub port: u16, @@ -51,6 +57,13 @@ impl Resource { } } +/// A ResourceState holds information about new, changed, or pruned resources +#[derive(Deserialize, PartialEq, Eq, Debug)] +pub struct ResourceState { + pub working: Option>, + pub not_working: Option>, +} + /// A ResourceDiff holds information about new, changed, or pruned resources #[derive(Deserialize, PartialEq, Eq, Debug)] pub struct ResourceDiff { @@ -92,7 +105,7 @@ mod tests { let bridge = Resource { r#type: String::from("scramblesuit"), blocked_in: HashMap::new(), - last_passed: "2023-05-30T14:20:28Z".parse::>().unwrap(), + test_result: TestResults { last_passed: "2023-05-30T14:20:28Z".parse::>().unwrap() }, protocol: String::from("tcp"), address: String::from("216.117.3.62"), port: 63174, @@ -107,7 +120,9 @@ mod tests { { "type": "scramblesuit", "blocked_in": {}, - "last_passed": "2023-05-30T14:20:28.000+00:00", + "test_result" : { + "last_passed": "2023-05-30T14:20:28.000+00:00" + }, "protocol": "tcp", "address": "216.117.3.62", "port": 63174, @@ -126,7 +141,7 @@ mod tests { assert_eq!(bridge, res); } - #[test] + #[test] fn deserialize_resource_diff() { let data = r#" { @@ -135,7 +150,9 @@ mod tests { { "type": "obfs2", "blocked_in": {}, - "last_passed": "2023-05-30T11:42:28.000+07:00", + "test_result" : { + "last_passed": "2023-05-30T11:42:28.000+07:00" + }, "Location": null, "protocol": "tcp", "address": "176.247.216.207", @@ -153,7 +170,9 @@ mod tests { { "type": "obfs2", "blocked_in": {}, - "last_passed": "2023-05-30T12:20:28.000+07:00", + "test_result" : { + "last_passed": "2023-05-30T12:20:28.000+07:00" + }, "protocol": "tcp", "address": "133.69.16.145", "port": 58314, @@ -172,7 +191,9 @@ mod tests { { "type": "scramblesuit", "blocked_in": {}, - "last_passed": "2023-05-30T14:20:28.000+07:00", + "test_result" : { + "last_passed": "2023-05-30T14:20:28.000+07:00" + }, "protocol": "tcp", "address": "216.117.3.62", "port": 63174, From 89fb0fbf4beaf0d0d478e5f518d60f2ac5a7aefb Mon Sep 17 00:00:00 2001 From: onyinyang Date: Mon, 2 Oct 2023 13:51:19 -0400 Subject: [PATCH 35/59] Add handling for unaccounted for bridges --- crates/lox-distributor/src/lox_context.rs | 34 +++++++++++++++++++++-- crates/lox-library/src/bridge_table.rs | 2 +- crates/lox-library/src/lib.rs | 23 ++++++++------- crates/lox-library/src/migration_table.rs | 2 +- crates/lox-library/src/tests.rs | 14 ++++++---- crates/rdsys-backend-api/src/proto.rs | 9 +++--- 6 files changed, 60 insertions(+), 24 deletions(-) diff --git a/crates/lox-distributor/src/lox_context.rs b/crates/lox-distributor/src/lox_context.rs index b237419..532eb1b 100644 --- a/crates/lox-distributor/src/lox_context.rs +++ b/crates/lox-distributor/src/lox_context.rs @@ -74,7 +74,6 @@ impl LoxServerContext { pub fn sync_with_bridgetable(&self, resources: ResourceState) { // Check if the resource is already in the Lox bridgetable. If it is, it's probably fine // to replace the existing resource with the incoming one to account for changes - let mut unaccounted_for_bridges: Vec = Vec::new(); let mut accounted_for_bridges: Vec = Vec::new(); if let Some(working_resources) = resources.working { // ensure all working resources are updated and accounted for @@ -140,10 +139,39 @@ impl LoxServerContext { } } // Make sure that all bridges are accounted for - let ba_clone = self.ba.lock().unwrap(); + let mut ba_clone = self.ba.lock().unwrap(); let total_reachable = ba_clone.bridge_table.reachable.len(); if total_reachable > accounted_for_bridges.len() { - // Search for extra fingerprints, assume those bridges are gone and remove? + let unaccounted_for = + ba_clone.find_and_remove_unaccounted_for_bridges(accounted_for_bridges); + for bridgeline in unaccounted_for { + let res = self.replace_with_new(bridgeline); + if res == lox_library::ReplaceSuccess::Replaced { + println!( + "BridgeLine {:?} not found in rdsys update was successfully replaced.", + bridgeline.uid_fingerprint + ); + } else if res == lox_library::ReplaceSuccess::NotReplaced { + // Add the bridge to the list of to_be_replaced bridges in the Lox context and try + // again to replace at the next update (nothing changes in the Lox Authority) + println!( + "BridgeLine {:?} not found in rdsys update NOT replaced, saved for next update!", + bridgeline.uid_fingerprint + ); + self.new_to_be_replaced_bridge(bridgeline); + } else { + // NotFound + assert!( + res == lox_library::ReplaceSuccess::NotFound, + "ReplaceSuccess incorrectly set" + ); + println!( + "BridgeLine {:?} no longer in reachable bridges.", + bridgeline.uid_fingerprint + ); + } + } + // Search for extra fingerprints, assume those bridges are gone and remove } else if total_reachable < accounted_for_bridges.len() { println!("Something unexpected occurred: The number of reachable bridges should not be less than those updated from rdsys"); } diff --git a/crates/lox-library/src/bridge_table.rs b/crates/lox-library/src/bridge_table.rs index 0353d53..62e43d8 100644 --- a/crates/lox-library/src/bridge_table.rs +++ b/crates/lox-library/src/bridge_table.rs @@ -11,7 +11,7 @@ use super::cred; use super::IssuerPrivKey; use super::CMZ_B_TABLE; use aes_gcm::aead; -use aes_gcm::aead::{Aead, generic_array::GenericArray}; +use aes_gcm::aead::{generic_array::GenericArray, Aead}; use aes_gcm::{Aes128Gcm, KeyInit}; use base64::{engine::general_purpose, Engine as _}; use curve25519_dalek::ristretto::CompressedRistretto; diff --git a/crates/lox-library/src/lib.rs b/crates/lox-library/src/lib.rs index ba6d946..2571893 100644 --- a/crates/lox-library/src/lib.rs +++ b/crates/lox-library/src/lib.rs @@ -381,16 +381,19 @@ impl BridgeAuth { } // TODO Ensure synchronization of Lox bridge_table with rdsys - pub fn sync_table(&mut self) { - // Create a hashtable (?) of bridges in the lox distributor from new resources - // accept the hashtable and recreate the bridge table from the hash table here - // using existing reachable bridges, other table checks and placements from existing bridge table - // If bridges are in reachable bridges, put them in the table with their Vec - // How to check for bridges that aren't there/are extra? - // After going through the update, make sure bridges in the table are the same and deal with discrepencies - // This will be the bad/annoying part - - //also use open_inv_keys and blocked_keys from bridge_table to remove expired keys from table. + pub fn find_and_remove_unaccounted_for_bridges( + &mut self, + accounted_for_bridges: Vec, + ) -> Vec { + // If there are expired blockages, separate them from the fresh blockages + let mut unaccounted_for: Vec = Vec::new(); + for (k, _v) in self.bridge_table.reachable.clone() { + if !accounted_for_bridges.contains(&k.uid_fingerprint) { + unaccounted_for.push(k); + } + } + unaccounted_for + //use open_inv_keys and blocked_keys from bridge_table to remove expired keys from table. // make sure this happens before they are removed from the structures in the bridge table } diff --git a/crates/lox-library/src/migration_table.rs b/crates/lox-library/src/migration_table.rs index bc34ea0..7b8c2bb 100644 --- a/crates/lox-library/src/migration_table.rs +++ b/crates/lox-library/src/migration_table.rs @@ -16,7 +16,7 @@ use curve25519_dalek::scalar::Scalar; use sha2::Digest; use sha2::Sha256; -use aes_gcm::aead::{Aead, generic_array::GenericArray}; +use aes_gcm::aead::{generic_array::GenericArray, Aead}; use aes_gcm::{Aes128Gcm, KeyInit}; use rand::RngCore; diff --git a/crates/lox-library/src/tests.rs b/crates/lox-library/src/tests.rs index 428fcf1..ae3a4ba 100644 --- a/crates/lox-library/src/tests.rs +++ b/crates/lox-library/src/tests.rs @@ -394,17 +394,21 @@ fn test_open_invite() { assert!(bridgeline == bucket.0[0]); } - #[test] fn test_k_invites() { let mut th = TestHarness::new(); for i in 0..25 { let _ = th.open_invite(); - if (i+1) % OPENINV_K != 0 { - assert!(th.bdb.current_k == (i+1)%OPENINV_K, "the current_k should be (i+1)%OPENINV_K"); + if (i + 1) % OPENINV_K != 0 { + assert!( + th.bdb.current_k == (i + 1) % OPENINV_K, + "the current_k should be (i+1)%OPENINV_K" + ); } else { - assert!(th.bdb.current_k == OPENINV_K, "the current_k should be OPENINV_K"); - + assert!( + th.bdb.current_k == OPENINV_K, + "the current_k should be OPENINV_K" + ); } } } diff --git a/crates/rdsys-backend-api/src/proto.rs b/crates/rdsys-backend-api/src/proto.rs index ecfeee9..7ce41e9 100644 --- a/crates/rdsys-backend-api/src/proto.rs +++ b/crates/rdsys-backend-api/src/proto.rs @@ -10,10 +10,9 @@ pub struct ResourceRequest { pub resource_types: Vec, } - #[derive(Serialize, Deserialize, Debug, PartialEq, Eq)] pub struct TestResults { - pub last_passed: DateTime + pub last_passed: DateTime, } /// Representation of a bridge resource @@ -105,7 +104,9 @@ mod tests { let bridge = Resource { r#type: String::from("scramblesuit"), blocked_in: HashMap::new(), - test_result: TestResults { last_passed: "2023-05-30T14:20:28Z".parse::>().unwrap() }, + test_result: TestResults { + last_passed: "2023-05-30T14:20:28Z".parse::>().unwrap(), + }, protocol: String::from("tcp"), address: String::from("216.117.3.62"), port: 63174, @@ -141,7 +142,7 @@ mod tests { assert_eq!(bridge, res); } - #[test] + #[test] fn deserialize_resource_diff() { let data = r#" { From 4f7b96a603dab0433ad05788471e54691b0c063c Mon Sep 17 00:00:00 2001 From: onyinyang Date: Mon, 16 Oct 2023 17:47:08 -0400 Subject: [PATCH 36/59] Fix up some minor issues + fix bug in context sync --- crates/lox-distributor/src/lox_context.rs | 248 ++++++++++++---------- crates/lox-distributor/src/main.rs | 7 +- crates/lox-library/src/lib.rs | 16 +- 3 files changed, 143 insertions(+), 128 deletions(-) diff --git a/crates/lox-distributor/src/lox_context.rs b/crates/lox-distributor/src/lox_context.rs index 532eb1b..492e17f 100644 --- a/crates/lox-distributor/src/lox_context.rs +++ b/crates/lox-distributor/src/lox_context.rs @@ -8,10 +8,11 @@ use lox_library::{ }, BridgeAuth, BridgeDb, IssuerPubKey, }; -use rdsys_backend::proto::ResourceState; +use rdsys_backend::proto::{Resource, ResourceState}; use serde::{Deserialize, Serialize}; use std::{ + cmp::Ordering, collections::HashMap, sync::{Arc, Mutex}, }; @@ -53,134 +54,149 @@ impl LoxServerContext { } } - /* Functionality for marking bridges as unreachable/blocked is currently not enabled as there is not - yet a reliable way to determine that a bridge is blocked. This means that migrations to unblocked bridges do not - currently work but can be easily enabled with a list of `blocked resources` from rdsys or another source with something - like the following: - println!("BridgeLine to be removed: {:?}", bridgeline); - let res = context.add_unreachable(bridgeline); - if res { - println!( - "BridgeLine successfully marked unreachable: {:?}", - bridgeline - ); - } else { - println!("'Gone' BridgeLine NOT REMOVED!! : {:?}", bridgeline); - //TODO probably do something else here - } - */ + pub fn handle_working_resources(&self, working_resources: Vec) -> Vec { + let mut accounted_for_bridges: Vec = Vec::new(); + let bridgelines = parse_into_bridgelines(working_resources); + for bridge in bridgelines { + /* TODO: Functionality for marking bridges as unreachable/blocked should eventually happen here. + It is currently not enabled as there is not yet a reliable way to determine that a bridge is blocked. + This means that migrations to unblocked bridges do not currently work but can be easily enabled by parsing the + list of `blocked resources` from rdsys or another source with something like the following: + let res = context.add_unreachable(bridgeline); + if res { + println!( + "BridgeLine {:?} successfully marked unreachable: {:?}", + bridgeline + ); + } else { + println!( + "BridgeLine {:?} NOT marked unreachable, saved for next update!", + bridge.uid_fingerprint + ); + } + */ + let res = self.update_bridge(bridge); + if res { + println!( + "BridgeLine {:?} successfully updated.", + bridge.uid_fingerprint + ); + accounted_for_bridges.push(bridge.uid_fingerprint); + // Assume non-failing bridges that are not found in the bridge table are new bridges and save them for later + } else { + println!("BridgeLine: {:?} not found in Lox's Bridgetable. Save it as a new resource for now!", bridge.uid_fingerprint); + self.append_extra_bridges(bridge); + } + } + accounted_for_bridges + } + + pub fn handle_not_working_resources( + &self, + not_working_resources: Vec, + mut accounted_for_bridges: Vec, + ) -> Vec { + let (grace_period, failing) = sort_for_parsing(not_working_resources); + // Update bridges in the bridge table that are failing but within the grace period + for bridge in grace_period { + let res = self.update_bridge(bridge); + if res { + println!( + "BridgeLine {:?} successfully updated.", + bridge.uid_fingerprint + ); + accounted_for_bridges.push(bridge.uid_fingerprint); + } + } + // Next, handle the failing bridges. If resource last passed tests >=ACCEPTED_HOURS_OF_FAILURE ago, + // it should be replaced with a working resource and be removed from the bridgetable. + for bridge in failing { + let res = self.replace_with_new(bridge); + if res == lox_library::ReplaceSuccess::Replaced { + println!( + "BridgeLine {:?} successfully replaced.", + bridge.uid_fingerprint + ); + accounted_for_bridges.push(bridge.uid_fingerprint); + } else if res == lox_library::ReplaceSuccess::NotReplaced { + // Add the bridge to the list of to_be_replaced bridges in the Lox context and try + // again to replace at the next update (nothing changes in the Lox Authority) + println!( + "BridgeLine {:?} NOT replaced, saved for next update!", + bridge.uid_fingerprint + ); + self.new_to_be_replaced_bridge(bridge); + accounted_for_bridges.push(bridge.uid_fingerprint); + } else { + // NotFound + assert!( + res == lox_library::ReplaceSuccess::NotFound, + "ReplaceSuccess incorrectly set" + ); + println!( + "BridgeLine {:?} no longer in bridge table.", + bridge.uid_fingerprint + ); + } + } + accounted_for_bridges + } // Sync resources received from rdsys with the Lox bridgetable pub fn sync_with_bridgetable(&self, resources: ResourceState) { - // Check if the resource is already in the Lox bridgetable. If it is, it's probably fine + // Check if each resource is already in the Lox bridgetable. If it is, it's probably fine // to replace the existing resource with the incoming one to account for changes + // save a list of accounted for bridges and deal with the unaccounted for bridges at the end let mut accounted_for_bridges: Vec = Vec::new(); + // ensure all working resources are updated and accounted for if let Some(working_resources) = resources.working { - // ensure all working resources are updated and accounted for - // save a list of unaccounted for bridges and deal with them in the next block - let bridgelines = parse_into_bridgelines(working_resources); - for bridge in bridgelines { - let res = self.update_bridge(bridge); - if res { - println!( - "BridgeLine {:?} successfully updated.", - bridge.uid_fingerprint - ); - accounted_for_bridges.push(bridge.uid_fingerprint); - // Assume non-failing bridges that are not found in the bridge table are new bridges and save them for later - } else { - println!("BridgeLine: {:?} not found in Lox's Bridgetable. Save it as a new resource for now!", bridge.uid_fingerprint); - self.append_extra_bridges(bridge); - } - } + accounted_for_bridges = self.handle_working_resources(working_resources); } if let Some(not_working_resources) = resources.not_working { - let (grace_period, failing) = sort_for_parsing(not_working_resources); - // Update bridges in the bridge table that are failing but within the grace period - for bridge in grace_period { - let res = self.update_bridge(bridge); - if res { - println!( - "BridgeLine {:?} successfully updated.", - bridge.uid_fingerprint - ); - accounted_for_bridges.push(bridge.uid_fingerprint); - } - } - // Next, handle the failing bridges. If resource last passed tests >=ACCEPTED_HOURS_OF_FAILURE ago, - // it should be replaced with a working resource and be removed from the bridgetable. - for bridge in failing { - let res = self.replace_with_new(bridge); - if res == lox_library::ReplaceSuccess::Replaced { - println!( - "BridgeLine {:?} successfully replaced.", - bridge.uid_fingerprint - ); - accounted_for_bridges.push(bridge.uid_fingerprint); - } else if res == lox_library::ReplaceSuccess::NotReplaced { - // Add the bridge to the list of to_be_replaced bridges in the Lox context and try - // again to replace at the next update (nothing changes in the Lox Authority) - println!( - "BridgeLine {:?} NOT replaced, saved for next update!", - bridge.uid_fingerprint - ); - self.new_to_be_replaced_bridge(bridge); - accounted_for_bridges.push(bridge.uid_fingerprint); - } else { - // NotFound - assert!( - res == lox_library::ReplaceSuccess::NotFound, - "ReplaceSuccess incorrectly set" - ); - println!( - "BridgeLine {:?} no longer in bridge table.", - bridge.uid_fingerprint - ); - } - } - // Make sure that all bridges are accounted for - let mut ba_clone = self.ba.lock().unwrap(); - let total_reachable = ba_clone.bridge_table.reachable.len(); - if total_reachable > accounted_for_bridges.len() { - let unaccounted_for = - ba_clone.find_and_remove_unaccounted_for_bridges(accounted_for_bridges); + accounted_for_bridges = + self.handle_not_working_resources(not_working_resources, accounted_for_bridges); + } + let mut ba_clone = self.ba.lock().unwrap(); + let total_reachable = ba_clone.bridge_table.reachable.len(); + match total_reachable.cmp(&accounted_for_bridges.len()) { + Ordering::Greater => { + let unaccounted_for = ba_clone.find_and_remove_unaccounted_for_bridges(accounted_for_bridges); for bridgeline in unaccounted_for { - let res = self.replace_with_new(bridgeline); - if res == lox_library::ReplaceSuccess::Replaced { - println!( - "BridgeLine {:?} not found in rdsys update was successfully replaced.", - bridgeline.uid_fingerprint - ); - } else if res == lox_library::ReplaceSuccess::NotReplaced { - // Add the bridge to the list of to_be_replaced bridges in the Lox context and try - // again to replace at the next update (nothing changes in the Lox Authority) - println!( - "BridgeLine {:?} not found in rdsys update NOT replaced, saved for next update!", - bridgeline.uid_fingerprint - ); - self.new_to_be_replaced_bridge(bridgeline); - } else { - // NotFound - assert!( - res == lox_library::ReplaceSuccess::NotFound, - "ReplaceSuccess incorrectly set" - ); - println!( + match self.replace_with_new(bridgeline) { + lox_library::ReplaceSuccess::Replaced => println!( + "BridgeLine {:?} not found in rdsys update was successfully replaced.", bridgeline.uid_fingerprint), + lox_library::ReplaceSuccess::NotReplaced => { + // Add the bridge to the list of to_be_replaced bridges in the Lox context and try + // again to replace at the next update (nothing changes in the Lox Authority) + println!("BridgeLine {:?} not found in rdsys update NOT replaced, saved for next update!", + bridgeline.uid_fingerprint); + self.new_to_be_replaced_bridge(bridgeline) + } + lox_library::ReplaceSuccess::NotFound => println!( "BridgeLine {:?} no longer in reachable bridges.", bridgeline.uid_fingerprint - ); + ), } } - // Search for extra fingerprints, assume those bridges are gone and remove - } else if total_reachable < accounted_for_bridges.len() { - println!("Something unexpected occurred: The number of reachable bridges should not be less than those updated from rdsys"); } - // Finally, assign any extra_bridges to new buckets if there are enough - while self.extra_bridges.lock().unwrap().len() >= MAX_BRIDGES_PER_BUCKET { - let bucket = self.remove_extra_bridges(); - // TODO: Decide the circumstances under which a bridge is allocated to an open_inv or spare bucket, - // eventually also do some more fancy grouping of new resources, i.e., by type or region - self.add_spare_bucket(bucket); + Ordering::Less => println!("Something unexpected occurred: The number of reachable bridges should not be less than those updated from rdsys"), + _ => (), + + } + // Finally, assign any extra_bridges to new buckets if there are enough + while self.extra_bridges.lock().unwrap().len() >= MAX_BRIDGES_PER_BUCKET { + let bucket = self.remove_extra_bridges(); + // TODO: Decide the circumstances under which a bridge is allocated to an open_inv or spare bucket, + // eventually also do some more fancy grouping of new resources, i.e., by type or region + let mut db_obj = self.db.lock().unwrap(); + match ba_clone.add_spare_bucket(bucket, &mut db_obj) { + Ok(_) => (), + Err(e) => { + println!("Error: {:?}", e); + for bridge in bucket { + self.append_extra_bridges(bridge); + } + } } } } @@ -262,7 +278,7 @@ impl LoxServerContext { result } - /* Uncomment when bridge blocking is finalized + /* TODO: Uncomment when bridge blocking is finalized pub fn add_unreachable(&self, bridgeline: BridgeLine) -> bool { let mut ba_obj = self.ba.lock().unwrap(); let mut db_obj = self.db.lock().unwrap(); diff --git a/crates/lox-distributor/src/main.rs b/crates/lox-distributor/src/main.rs index 78898e8..2b36e82 100644 --- a/crates/lox-distributor/src/main.rs +++ b/crates/lox-distributor/src/main.rs @@ -93,7 +93,6 @@ struct ResourceInfo { // Rdsys sender creates a ResourceStream with the api_endpoint, resource token and type specified // in the config.json file. -// TODO: ensure this stream gracefully shutdowns on the ctrl_c command. async fn rdsys_stream( rtype: ResourceInfo, tx: mpsc::Sender, @@ -107,7 +106,7 @@ async fn rdsys_stream( } async fn rdsys_request(rtype: ResourceInfo, tx: mpsc::Sender) { - let mut interval = interval(Duration::from_secs(30)); + let mut interval = interval(Duration::from_secs(5)); loop { interval.tick().await; let resources = request_resources( @@ -133,8 +132,8 @@ async fn rdsys_bridge_parser( } } -// Parse Bridges receives a Vec from rdsys_sender and sends it to the -// Context Manager to be parsed and added to the BridgeDB +// Parse Bridges receives the resources from rdsys and sends it to the +// Context Manager to be parsed and added to the Lox BridgeDB async fn parse_bridges(rdsys_tx: mpsc::Sender, mut rx: mpsc::Receiver) { loop { let resources = rx.recv().await.unwrap(); diff --git a/crates/lox-library/src/lib.rs b/crates/lox-library/src/lib.rs index 2571893..2f92ad9 100644 --- a/crates/lox-library/src/lib.rs +++ b/crates/lox-library/src/lib.rs @@ -380,12 +380,10 @@ impl BridgeAuth { Ok(()) } - // TODO Ensure synchronization of Lox bridge_table with rdsys pub fn find_and_remove_unaccounted_for_bridges( &mut self, accounted_for_bridges: Vec, ) -> Vec { - // If there are expired blockages, separate them from the fresh blockages let mut unaccounted_for: Vec = Vec::new(); for (k, _v) in self.bridge_table.reachable.clone() { if !accounted_for_bridges.contains(&k.uid_fingerprint) { @@ -393,8 +391,6 @@ impl BridgeAuth { } } unaccounted_for - //use open_inv_keys and blocked_keys from bridge_table to remove expired keys from table. - // make sure this happens before they are removed from the structures in the bridge table } pub fn allocate_bridges( @@ -446,10 +442,9 @@ impl BridgeAuth { assert!(bridgelines[*offset] == reachable_bridge.0); bridgelines[*offset] = *bridge; self.bridge_table.buckets.insert(*bucketnum, bridgelines); - match self.bridge_table.buckets.get(bucketnum) { - Some(bridgelines) => *bridgelines, - None => return res, - }; + if self.bridge_table.buckets.get(bucketnum).is_none() { + return res; + } } res = true; } else { @@ -776,6 +771,11 @@ impl BridgeAuth { .iter() .partition(|&x| x.1 + EXPIRY_DATE < self.today()); for item in expired { + // We should check that the items were actually distributed before they are removed + if !bdb.distributed_buckets.contains(&item.0) { + // TODO: Add prometheus metric for this? + println!("This bucket was not actually distributed!"); + } let new_item = item.0; bdb.remove_blocked_or_expired_buckets(&new_item); // Remove any trust upgrade migrations from this From 68b5a9c18e4f057099a28b0a528e8f07cfe2a4e9 Mon Sep 17 00:00:00 2001 From: onyinyang Date: Tue, 12 Sep 2023 14:22:32 -0400 Subject: [PATCH 37/59] Upgrading several dalek dependencies and rand --- Cargo.lock | 198 ++++++++++++------ crates/lox-distributor/Cargo.toml | 2 +- crates/lox-library/Cargo.toml | 19 +- crates/lox-library/src/bridge_table.rs | 8 +- crates/lox-library/src/lib.rs | 28 +-- crates/lox-library/src/migration_table.rs | 8 +- .../src/proto/blockage_migration.rs | 2 +- crates/lox-library/src/proto/issue_invite.rs | 4 +- crates/lox-library/src/proto/migration.rs | 14 +- crates/lox-library/src/proto/open_invite.rs | 6 +- crates/lox-library/src/proto/redeem_invite.rs | 6 +- crates/lox-library/src/tests.rs | 4 +- 12 files changed, 192 insertions(+), 107 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7346aea..8cb6ac3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -151,6 +151,12 @@ version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + [[package]] name = "bincode" version = "1.3.3" @@ -172,15 +178,6 @@ version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "generic-array", -] - [[package]] name = "block-buffer" version = "0.10.4" @@ -310,6 +307,12 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "const-oid" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" + [[package]] name = "core-foundation" version = "0.9.3" @@ -394,17 +397,34 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "3.2.1" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" +checksum = "622178105f911d937a42cdb140730ba4a3ed2becd8ae6ce39c7d28b5d75d4588" dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto", + "platforms", + "rand_core 0.6.4", + "rustc_version", + "serde", "subtle", "zeroize", ] +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "curve25519-dalek-ng" version = "3.0.3" @@ -413,7 +433,6 @@ checksum = "3b8dfd4d479156d9ad3fe6d1562f78ff31a9ba8831d3575126061541c7294e48" dependencies = [ "byteorder", "digest 0.9.0", - "packed_simd_2", "rand_core 0.5.1", "serde", "subtle-ng", @@ -455,6 +474,16 @@ dependencies = [ "syn", ] +[[package]] +name = "der" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +dependencies = [ + "const-oid", + "zeroize", +] + [[package]] name = "deranged" version = "0.3.8" @@ -479,31 +508,31 @@ version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.4", + "block-buffer", "crypto-common", ] [[package]] name = "ed25519" -version = "1.5.3" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d" dependencies = [ + "pkcs8", "serde", "signature", ] [[package]] name = "ed25519-dalek" -version = "1.0.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" dependencies = [ "curve25519-dalek", "ed25519", - "rand 0.7.3", + "rand_core 0.6.4", "serde", - "serde_bytes", "sha2", "zeroize", ] @@ -550,6 +579,12 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" +[[package]] +name = "fiat-crypto" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0870c84016d4b481be5c9f323c24f65e31e901ae618f0e80f4308fb00de1d2d" + [[package]] name = "fnv" version = "1.0.7" @@ -1000,12 +1035,6 @@ version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" -[[package]] -name = "libm" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" - [[package]] name = "linux-raw-sys" version = "0.4.3" @@ -1050,7 +1079,7 @@ dependencies = [ "sled", "time", "tokio", - "zkp", + "zkp 0.7.0", ] [[package]] @@ -1061,11 +1090,11 @@ dependencies = [ "base64", "bincode", "chrono", - "curve25519-dalek-ng", + "curve25519-dalek", "ed25519-dalek", "hex_fmt", "lazy_static", - "rand 0.7.3", + "rand 0.8.5", "serde", "serde_with", "sha2", @@ -1073,7 +1102,7 @@ dependencies = [ "subtle", "thiserror", "time", - "zkp", + "zkp 0.7.0", ] [[package]] @@ -1091,7 +1120,7 @@ dependencies = [ "serde_json", "time", "wasm-bindgen", - "zkp", + "zkp 0.8.0", ] [[package]] @@ -1131,6 +1160,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "merlin" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.6.4", + "zeroize", +] + [[package]] name = "mime" version = "0.3.17" @@ -1327,16 +1368,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "packed_simd_2" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1914cd452d8fccd6f9db48147b29fd4ae05bea9dc5d9ad578509f72415de282" -dependencies = [ - "cfg-if", - "libm", -] - [[package]] name = "parking_lot" version = "0.11.2" @@ -1403,12 +1434,28 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + [[package]] name = "pkg-config" version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +[[package]] +name = "platforms" +version = "3.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4503fa043bf02cee09a9582e9554b4c6403b2ef55e4612e96561d294419429f8" + [[package]] name = "polyval" version = "0.6.1" @@ -1713,6 +1760,15 @@ version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + [[package]] name = "rustix" version = "0.38.4" @@ -1770,6 +1826,12 @@ dependencies = [ "libc", ] +[[package]] +name = "semver" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" + [[package]] name = "serde" version = "1.0.189" @@ -1779,15 +1841,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde_bytes" -version = "0.11.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff" -dependencies = [ - "serde", -] - [[package]] name = "serde_derive" version = "1.0.189" @@ -1864,15 +1917,13 @@ dependencies = [ [[package]] name = "sha2" -version = "0.9.9" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" dependencies = [ - "block-buffer 0.9.0", "cfg-if", "cpufeatures", - "digest 0.9.0", - "opaque-debug", + "digest 0.10.7", ] [[package]] @@ -1886,9 +1937,9 @@ dependencies = [ [[package]] name = "signature" -version = "1.6.4" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" [[package]] name = "slab" @@ -1931,6 +1982,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "spki" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +dependencies = [ + "base64ct", + "der", +] + [[package]] name = "statistical" version = "1.0.0" @@ -2428,9 +2489,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.3.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" +checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" dependencies = [ "zeroize_derive", ] @@ -2446,6 +2507,19 @@ dependencies = [ "syn", ] +[[package]] +name = "zkp" +version = "0.7.0" +source = "git+ssh://git@gitlab.torproject.org/onyinyang/test-zkp.git#35a142695699bb01adef1d02860d41f3924deed8" +dependencies = [ + "curve25519-dalek", + "merlin 3.0.0", + "rand 0.8.5", + "serde", + "serde_derive", + "thiserror", +] + [[package]] name = "zkp" version = "0.8.0" @@ -2453,7 +2527,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cf6dceea8522c0ade5abe68c1ca747e80b88adce2cd6a070e95f102037f331f" dependencies = [ "curve25519-dalek-ng", - "merlin", + "merlin 2.0.1", "rand 0.7.3", "serde", "serde_derive", diff --git a/crates/lox-distributor/Cargo.toml b/crates/lox-distributor/Cargo.toml index ac48ac5..411d5b6 100644 --- a/crates/lox-distributor/Cargo.toml +++ b/crates/lox-distributor/Cargo.toml @@ -22,7 +22,7 @@ rand = "0.8.5" reqwest = { version = "0.11", features = ["json", "stream"]} serde = { version = "1.0", features = ["derive", "rc"] } serde_with = "3.4.0" -zkp = "0.8.0" +zkp = { git = "ssh://git@gitlab.torproject.org/onyinyang/test-zkp.git" } lox-library = { path = "../lox-library", version = "0.1.0"} lox_utils = { path = "../lox-utils", version = "0.1.0"} diff --git a/crates/lox-library/Cargo.toml b/crates/lox-library/Cargo.toml index fc26df6..40d6c60 100644 --- a/crates/lox-library/Cargo.toml +++ b/crates/lox-library/Cargo.toml @@ -9,16 +9,16 @@ description = "Main Lox library with protocols and functions that that make up L keywords = ["tor", "lox", "bridges"] [dependencies] -curve25519-dalek = { package = "curve25519-dalek-ng", version = "3", default-features = false, features = ["serde", "std"] } -ed25519-dalek = { version = "1", features = ["serde"] } +curve25519-dalek = { version = "4", default-features = false, features = ["serde", "rand_core", "digest"] } +ed25519-dalek = { version = "2", features = ["serde", "rand_core"] } # zkp = { version = "0.8", features = ["debug-transcript"] } -zkp = "0.8" +#zkp = "0.8" bincode = "1" chrono = "0.4" -rand = "0.7" +rand = { version = "0.8", features = ["std_rng"]} serde = "1.0.189" serde_with = {version = "3.4.0", features = ["json"]} -sha2 = "0.9" +sha2 = "0.10" statistical = "1.0.0" lazy_static = "1" hex_fmt = "0.3" @@ -27,10 +27,11 @@ base64 = "0.21" time = "0.3.29" subtle = "2.5" thiserror = "1.0.49" +zkp = { git = "ssh://git@gitlab.torproject.org/onyinyang/test-zkp.git" } [features] -default = ["u64_backend"] -u32_backend = ["curve25519-dalek/u32_backend"] -u64_backend = ["curve25519-dalek/u64_backend"] -simd_backend = ["curve25519-dalek/simd_backend"] +#default = ["u64_backend"] +#u32_backend = ["curve25519-dalek/u32_backend"] +#u64_backend = ["curve25519-dalek/u64_backend"] +#simd_backend = ["curve25519-dalek/simd_backend"] fast = [] diff --git a/crates/lox-library/src/bridge_table.rs b/crates/lox-library/src/bridge_table.rs index 62e43d8..43e248b 100644 --- a/crates/lox-library/src/bridge_table.rs +++ b/crates/lox-library/src/bridge_table.rs @@ -150,8 +150,12 @@ impl BridgeLine { let date = u32::from_le_bytes(data[pos..pos + 4].try_into().unwrap()); let (optP, optQ) = if date > 0 { ( - CompressedRistretto::from_slice(&data[pos + 4..pos + 36]).decompress(), - CompressedRistretto::from_slice(&data[pos + 36..]).decompress(), + CompressedRistretto::from_slice(&data[pos + 4..pos + 36]) + .expect("Unable to extract P from bucket") + .decompress(), + CompressedRistretto::from_slice(&data[pos + 36..]) + .expect("Unable to extract Q from bucket") + .decompress(), ) } else { (None, None) diff --git a/crates/lox-library/src/lib.rs b/crates/lox-library/src/lib.rs index 2f92ad9..c929e83 100644 --- a/crates/lox-library/src/lib.rs +++ b/crates/lox-library/src/lib.rs @@ -36,7 +36,7 @@ use rand::Rng; use std::collections::HashMap; use std::convert::{TryFrom, TryInto}; -use ed25519_dalek::{Keypair, PublicKey, Signature, SignatureError, Signer, Verifier}; +use ed25519_dalek::{Signature, SignatureError, Signer, SigningKey, Verifier, VerifyingKey}; use subtle::ConstantTimeEq; use std::collections::HashSet; @@ -57,7 +57,7 @@ lazy_static! { pub static ref CMZ_B: RistrettoPoint = dalek_constants::RISTRETTO_BASEPOINT_POINT; pub static ref CMZ_A_TABLE: RistrettoBasepointTable = RistrettoBasepointTable::create(&CMZ_A); pub static ref CMZ_B_TABLE: RistrettoBasepointTable = - dalek_constants::RISTRETTO_BASEPOINT_TABLE; + dalek_constants::RISTRETTO_BASEPOINT_TABLE.clone(); } // EXPIRY_DATE is set to EXPIRY_DATE days for open-entry and blocked buckets in order to match @@ -130,9 +130,9 @@ pub const OPENINV_K: u32 = 10; #[derive(Debug, Serialize, Deserialize)] pub struct BridgeDb { /// The keypair for signing open invitations - keypair: Keypair, + keypair: SigningKey, /// The public key for verifying open invitations - pub pubkey: PublicKey, + pub pubkey: VerifyingKey, /// The set of open-invitation buckets openinv_buckets: HashSet, distributed_buckets: Vec, @@ -152,8 +152,8 @@ impl BridgeDb { /// Create the BridgeDb. pub fn new() -> Self { let mut csprng = OsRng {}; - let keypair = Keypair::generate(&mut csprng); - let pubkey = keypair.public; + let keypair = SigningKey::generate(&mut csprng); + let pubkey = keypair.verifying_key(); Self { keypair, pubkey, @@ -203,7 +203,7 @@ impl BridgeDb { // Choose a random bucket number (from the set of open // invitation buckets) and serialize it let openinv_vec: Vec<&u32> = self.openinv_buckets.iter().collect(); - bucket_num = *openinv_vec[rng.gen_range(0, openinv_vec.len())]; + bucket_num = *openinv_vec[rng.gen_range(0..openinv_vec.len())]; self.mark_distributed(bucket_num); self.remove_openinv(&bucket_num); self.current_k = 1; @@ -221,7 +221,7 @@ impl BridgeDb { /// before. pub fn verify( invitation: [u8; OPENINV_LENGTH], - pubkey: PublicKey, + pubkey: VerifyingKey, ) -> Result<(Scalar, u32), SignatureError> { // Pull out the signature and verify it let sig = Signature::try_from(&invitation[(32 + 4)..])?; @@ -229,11 +229,13 @@ impl BridgeDb { // The signature passed. Pull out the bucket number and then // the invitation id let bucket = u32::from_le_bytes(invitation[32..(32 + 4)].try_into().unwrap()); - match Scalar::from_canonical_bytes(invitation[0..32].try_into().unwrap()) { + let s = Scalar::from_canonical_bytes(invitation[0..32].try_into().unwrap()); + if s.is_some().into() { + return Ok((s.unwrap(), bucket)); + } else { // It should never happen that there's a valid signature on // an invalid serialization of a Scalar, but check anyway. - None => Err(SignatureError::new()), - Some(s) => Ok((s, bucket)), + return Err(SignatureError::new()); } } } @@ -269,7 +271,7 @@ pub struct BridgeAuth { pub invitation_pub: IssuerPubKey, /// The public key of the BridgeDb issuing open invitations - pub bridgedb_pub: PublicKey, + pub bridgedb_pub: VerifyingKey, /// The bridge table pub bridge_table: BridgeTable, @@ -294,7 +296,7 @@ pub struct BridgeAuth { } impl BridgeAuth { - pub fn new(bridgedb_pub: PublicKey) -> Self { + pub fn new(bridgedb_pub: VerifyingKey) -> Self { // Create the private and public keys for each of the types of // credential, each with the appropriate number of attributes let lox_priv = IssuerPrivKey::new(6); diff --git a/crates/lox-library/src/migration_table.rs b/crates/lox-library/src/migration_table.rs index 7b8c2bb..612e71e 100644 --- a/crates/lox-library/src/migration_table.rs +++ b/crates/lox-library/src/migration_table.rs @@ -249,8 +249,12 @@ pub fn decrypt_cred( let mut to_bucket_bytes: [u8; 32] = [0; 32]; to_bucket_bytes.copy_from_slice(&plaintextbytes[..32]); let to_bucket = Scalar::from_bytes_mod_order(to_bucket_bytes); - let P = CompressedRistretto::from_slice(&plaintextbytes[32..64]).decompress()?; - let Q = CompressedRistretto::from_slice(&plaintextbytes[64..]).decompress()?; + let P = CompressedRistretto::from_slice(&plaintextbytes[32..64]) + .expect("Unable to extract P from bucket") + .decompress()?; + let Q = CompressedRistretto::from_slice(&plaintextbytes[64..]) + .expect("Unable to extract Q from bucket") + .decompress()?; Some(Migration { P, diff --git a/crates/lox-library/src/proto/blockage_migration.rs b/crates/lox-library/src/proto/blockage_migration.rs index f1808cd..9c6cc87 100644 --- a/crates/lox-library/src/proto/blockage_migration.rs +++ b/crates/lox-library/src/proto/blockage_migration.rs @@ -288,7 +288,7 @@ pub fn request( &migration_cred.to_bucket * Btable + ebucket * D, ); let eblockages = Scalar::random(&mut rng); - let new_blockages = lox_cred.blockages + Scalar::one(); + let new_blockages = lox_cred.blockages + Scalar::ONE; let EncBlockages = ( &eblockages * Btable, &new_blockages * Btable + eblockages * D, diff --git a/crates/lox-library/src/proto/issue_invite.rs b/crates/lox-library/src/proto/issue_invite.rs index 0dfde3b..a512270 100644 --- a/crates/lox-library/src/proto/issue_invite.rs +++ b/crates/lox-library/src/proto/issue_invite.rs @@ -269,7 +269,7 @@ pub fn request( // Ensure the credential can be correctly shown: it must be the case // that invites_remaining not be 0 - if lox_cred.invites_remaining == Scalar::zero() { + if lox_cred.invites_remaining == Scalar::ZERO { return Err(ProofError::VerificationFailure); } // The buckets in the Lox and Bucket Reachability credentials have @@ -286,7 +286,7 @@ pub fn request( return Err(ProofError::VerificationFailure); } // The new invites_remaining - let new_invites_remaining = lox_cred.invites_remaining - Scalar::one(); + let new_invites_remaining = lox_cred.invites_remaining - Scalar::ONE; // Blind showing the Lox credential diff --git a/crates/lox-library/src/proto/migration.rs b/crates/lox-library/src/proto/migration.rs index 36ab7d0..ce7bc5f 100644 --- a/crates/lox-library/src/proto/migration.rs +++ b/crates/lox-library/src/proto/migration.rs @@ -168,7 +168,7 @@ pub fn request( // This protocol only allows migrating from trust level 0 to trust // level 1 - if lox_cred.trust_level != Scalar::zero() { + if lox_cred.trust_level != Scalar::ZERO { return Err(ProofError::VerificationFailure); } @@ -323,7 +323,7 @@ impl BridgeAuth { } // We only currently support migrating from trust level 0 - if req.trust_level != Scalar::zero() { + if req.trust_level != Scalar::ZERO { return Err(ProofError::VerificationFailure); } @@ -387,7 +387,7 @@ impl BridgeAuth { // Create the trust_level attrubute (Scalar), which will be // level 1 - let trust_level: Scalar = Scalar::one(); + let trust_level: Scalar = Scalar::ONE; // Create the level_since attribute (Scalar), which is today's // Julian date @@ -513,7 +513,7 @@ pub fn handle_response( Xlevel: &lox_pub.X[3].compress(), Xsince: &lox_pub.X[4].compress(), // The new trust level is 1 - Plevel: &(Scalar::one() * resp.P).compress(), + Plevel: &(Scalar::ONE * resp.P).compress(), Psince: &(resp.level_since * resp.P).compress(), TId: &resp.TId.compress(), TBucket: &resp.TBucket.compress(), @@ -533,9 +533,9 @@ pub fn handle_response( Q, id, bucket: state.to_bucket, - trust_level: Scalar::one(), + trust_level: Scalar::ONE, level_since: resp.level_since, - invites_remaining: Scalar::zero(), - blockages: Scalar::zero(), + invites_remaining: Scalar::ZERO, + blockages: Scalar::ZERO, }) } diff --git a/crates/lox-library/src/proto/open_invite.rs b/crates/lox-library/src/proto/open_invite.rs index 69960dd..b95fc4a 100644 --- a/crates/lox-library/src/proto/open_invite.rs +++ b/crates/lox-library/src/proto/open_invite.rs @@ -324,10 +324,10 @@ pub fn handle_response( Q, id, bucket: resp.bucket, - trust_level: Scalar::zero(), + trust_level: Scalar::ZERO, level_since: resp.level_since, - invites_remaining: Scalar::zero(), - blockages: Scalar::zero(), + invites_remaining: Scalar::ZERO, + blockages: Scalar::ZERO, }, resp.bridge_line, )) diff --git a/crates/lox-library/src/proto/redeem_invite.rs b/crates/lox-library/src/proto/redeem_invite.rs index d90fb1d..9f288d6 100644 --- a/crates/lox-library/src/proto/redeem_invite.rs +++ b/crates/lox-library/src/proto/redeem_invite.rs @@ -458,7 +458,7 @@ impl BridgeAuth { let EncId = (req.EncIdClient.0, req.EncIdClient.1 + &id_server * Btable); // The trust level for invitees is always 1 - let level = Scalar::one(); + let level = Scalar::ONE; // The invites remaining for invitees is always 0 (as // appropriate for trust level 1), so we don't need to actually @@ -611,9 +611,9 @@ pub fn handle_response( Q, id, bucket: state.bucket, - trust_level: Scalar::one(), + trust_level: Scalar::ONE, level_since: resp.level_since, - invites_remaining: Scalar::zero(), + invites_remaining: Scalar::ZERO, blockages: state.blockages, }) } diff --git a/crates/lox-library/src/tests.rs b/crates/lox-library/src/tests.rs index ae3a4ba..83fd061 100644 --- a/crates/lox-library/src/tests.rs +++ b/crates/lox-library/src/tests.rs @@ -875,7 +875,7 @@ fn block_bridges(th: &mut TestHarness, to_block: usize) { let mut rng = rand::thread_rng(); while block_index.len() < to_block { - let rand_num = rng.gen_range(1, blockable_range); + let rand_num = rng.gen_range(1..blockable_range); if !th.bdb.openinv_buckets.contains(&(rand_num as u32)) && !th.bdb.distributed_buckets.contains(&(rand_num as u32)) && !block_index.contains(&rand_num) @@ -1045,7 +1045,7 @@ fn test_bridge_replace() { let table_size = th.ba.bridge_table.buckets.len(); let mut num = 100000; while !th.ba.bridge_table.buckets.contains_key(&num) { - num = rand::thread_rng().gen_range(0, th.ba.bridge_table.counter); + num = rand::thread_rng().gen_range(0..th.ba.bridge_table.counter); } let replaceable_bucket = *th.ba.bridge_table.buckets.get(&num).unwrap(); let replacement_bridge = &replaceable_bucket[0]; From 8bf938c81b40ed91bb8565438ae5156dd38d3606 Mon Sep 17 00:00:00 2001 From: onyinyang Date: Thu, 5 Oct 2023 16:13:30 -0400 Subject: [PATCH 38/59] Update Cargo to point to public github zkp for now --- Cargo.lock | 2 +- crates/lox-distributor/Cargo.toml | 2 +- crates/lox-library/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8cb6ac3..e03f56a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2510,7 +2510,7 @@ dependencies = [ [[package]] name = "zkp" version = "0.7.0" -source = "git+ssh://git@gitlab.torproject.org/onyinyang/test-zkp.git#35a142695699bb01adef1d02860d41f3924deed8" +source = "git+https://git@gitlab.torproject.org/onyinyang/test-zkp.git#17010ef440c36a31c28c832ab932911d4092ee97" dependencies = [ "curve25519-dalek", "merlin 3.0.0", diff --git a/crates/lox-distributor/Cargo.toml b/crates/lox-distributor/Cargo.toml index 411d5b6..2f356bf 100644 --- a/crates/lox-distributor/Cargo.toml +++ b/crates/lox-distributor/Cargo.toml @@ -22,7 +22,7 @@ rand = "0.8.5" reqwest = { version = "0.11", features = ["json", "stream"]} serde = { version = "1.0", features = ["derive", "rc"] } serde_with = "3.4.0" -zkp = { git = "ssh://git@gitlab.torproject.org/onyinyang/test-zkp.git" } +zkp = { git = "https://git@gitlab.torproject.org/onyinyang/test-zkp.git"} lox-library = { path = "../lox-library", version = "0.1.0"} lox_utils = { path = "../lox-utils", version = "0.1.0"} diff --git a/crates/lox-library/Cargo.toml b/crates/lox-library/Cargo.toml index 40d6c60..cc20d60 100644 --- a/crates/lox-library/Cargo.toml +++ b/crates/lox-library/Cargo.toml @@ -27,7 +27,7 @@ base64 = "0.21" time = "0.3.29" subtle = "2.5" thiserror = "1.0.49" -zkp = { git = "ssh://git@gitlab.torproject.org/onyinyang/test-zkp.git" } +zkp = { git = "https://git@gitlab.torproject.org/onyinyang/test-zkp.git"} [features] #default = ["u64_backend"] From f7f7a36812c758a8fe3d479bc319957383f3a1d9 Mon Sep 17 00:00:00 2001 From: onyinyang Date: Tue, 10 Oct 2023 17:05:24 -0400 Subject: [PATCH 39/59] Change address of zkp library --- Cargo.lock | 13 ++++++++++--- crates/lox-distributor/Cargo.toml | 2 +- crates/lox-library/Cargo.toml | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e03f56a..e10539f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -822,6 +822,12 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +[[package]] +name = "hex" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" + [[package]] name = "hex" version = "0.4.3" @@ -1167,6 +1173,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" dependencies = [ "byteorder", + "hex 0.3.2", "keccak", "rand_core 0.6.4", "zeroize", @@ -1687,7 +1694,7 @@ dependencies = [ "crc64", "futures", "futures-util", - "hex", + "hex 0.4.3", "reqwest", "serde", "serde_json", @@ -1883,7 +1890,7 @@ checksum = "64cd236ccc1b7a29e7e2739f27c0b2dd199804abc4290e32f59f3b68d6405c23" dependencies = [ "base64", "chrono", - "hex", + "hex 0.4.3", "indexmap 1.9.3", "indexmap 2.0.0", "serde", @@ -2510,7 +2517,7 @@ dependencies = [ [[package]] name = "zkp" version = "0.7.0" -source = "git+https://git@gitlab.torproject.org/onyinyang/test-zkp.git#17010ef440c36a31c28c832ab932911d4092ee97" +source = "git+https://git@gitlab.torproject.org/onyinyang/lox-zkp.git?rev=a174be65#a174be6503d09514e9102091547308e9e94648b0" dependencies = [ "curve25519-dalek", "merlin 3.0.0", diff --git a/crates/lox-distributor/Cargo.toml b/crates/lox-distributor/Cargo.toml index 2f356bf..2dcb720 100644 --- a/crates/lox-distributor/Cargo.toml +++ b/crates/lox-distributor/Cargo.toml @@ -22,7 +22,7 @@ rand = "0.8.5" reqwest = { version = "0.11", features = ["json", "stream"]} serde = { version = "1.0", features = ["derive", "rc"] } serde_with = "3.4.0" -zkp = { git = "https://git@gitlab.torproject.org/onyinyang/test-zkp.git"} +zkp = { git = "https://git@gitlab.torproject.org/onyinyang/lox-zkp.git", rev = "a174be65"} lox-library = { path = "../lox-library", version = "0.1.0"} lox_utils = { path = "../lox-utils", version = "0.1.0"} diff --git a/crates/lox-library/Cargo.toml b/crates/lox-library/Cargo.toml index cc20d60..f3ba442 100644 --- a/crates/lox-library/Cargo.toml +++ b/crates/lox-library/Cargo.toml @@ -27,7 +27,7 @@ base64 = "0.21" time = "0.3.29" subtle = "2.5" thiserror = "1.0.49" -zkp = { git = "https://git@gitlab.torproject.org/onyinyang/test-zkp.git"} +zkp = { git = "https://git@gitlab.torproject.org/onyinyang/lox-zkp.git", rev = "a174be65", features = ["debug-transcript"]} [features] #default = ["u64_backend"] From 4e436e006b15e7bdd3f6350b15599f178a5f8817 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 19 Oct 2023 15:35:04 +0000 Subject: [PATCH 40/59] Update Rust crate time to 0.3.30 --- Cargo.lock | 16 ++++++++++++---- crates/lox-distributor/Cargo.toml | 2 +- crates/lox-library/Cargo.toml | 2 +- crates/lox-wasm/Cargo.toml | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e10539f..32ce3f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -486,10 +486,11 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" +checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" dependencies = [ + "powerfmt", "serde", ] @@ -1475,6 +1476,12 @@ dependencies = [ "universal-hash", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -2073,12 +2080,13 @@ dependencies = [ [[package]] name = "time" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "426f806f4089c493dcac0d24c29c01e2c38baf8e30f1b716ee37e83d200b18fe" +checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" dependencies = [ "deranged", "itoa", + "powerfmt", "serde", "time-core", "time-macros", diff --git a/crates/lox-distributor/Cargo.toml b/crates/lox-distributor/Cargo.toml index 2dcb720..0d48138 100644 --- a/crates/lox-distributor/Cargo.toml +++ b/crates/lox-distributor/Cargo.toml @@ -16,7 +16,7 @@ base64 = "0.21.4" hyper = { version = "0.14.27", features = ["server"] } hex_fmt = "0.3" futures = "0.3.28" -time = "0.3.29" +time = "0.3.30" tokio = { version = "1", features = ["full", "macros", "signal"] } rand = "0.8.5" reqwest = { version = "0.11", features = ["json", "stream"]} diff --git a/crates/lox-library/Cargo.toml b/crates/lox-library/Cargo.toml index f3ba442..f9a7191 100644 --- a/crates/lox-library/Cargo.toml +++ b/crates/lox-library/Cargo.toml @@ -24,7 +24,7 @@ lazy_static = "1" hex_fmt = "0.3" aes-gcm = { version = "0.10", features =["aes"]} base64 = "0.21" -time = "0.3.29" +time = "0.3.30" subtle = "2.5" thiserror = "1.0.49" zkp = { git = "https://git@gitlab.torproject.org/onyinyang/lox-zkp.git", rev = "a174be65", features = ["debug-transcript"]} diff --git a/crates/lox-wasm/Cargo.toml b/crates/lox-wasm/Cargo.toml index 34423b1..9a3c3b5 100644 --- a/crates/lox-wasm/Cargo.toml +++ b/crates/lox-wasm/Cargo.toml @@ -15,7 +15,7 @@ lazy_static = "1.4.0" lox-library = { path = "../lox-library", version = "0.1.0" } lox_utils = { path = "../lox-utils", version = "0.1.0" } wasm-bindgen = "0.2" -time = "0.3.29" +time = "0.3.30" serde_json = "1.0.107" console_error_panic_hook = "0.1.7" From 2d9febaf14a125c35648f732841922d133136545 Mon Sep 17 00:00:00 2001 From: onyinyang Date: Mon, 23 Oct 2023 13:39:50 -0400 Subject: [PATCH 41/59] Update zkp crate dependency address --- Cargo.lock | 82 ++++--------------------------- crates/lox-distributor/Cargo.toml | 3 +- crates/lox-library/Cargo.toml | 4 +- crates/lox-wasm/Cargo.toml | 2 +- 4 files changed, 13 insertions(+), 78 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 32ce3f3..af142ae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -404,7 +404,7 @@ dependencies = [ "cfg-if", "cpufeatures", "curve25519-dalek-derive", - "digest 0.10.7", + "digest", "fiat-crypto", "platforms", "rand_core 0.6.4", @@ -425,20 +425,6 @@ dependencies = [ "syn", ] -[[package]] -name = "curve25519-dalek-ng" -version = "3.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b8dfd4d479156d9ad3fe6d1562f78ff31a9ba8831d3575126061541c7294e48" -dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", - "serde", - "subtle-ng", - "zeroize", -] - [[package]] name = "darling" version = "0.20.3" @@ -494,15 +480,6 @@ dependencies = [ "serde", ] -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array", -] - [[package]] name = "digest" version = "0.10.7" @@ -823,12 +800,6 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" -[[package]] -name = "hex" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" - [[package]] name = "hex" version = "0.4.3" @@ -1086,7 +1057,7 @@ dependencies = [ "sled", "time", "tokio", - "zkp 0.7.0", + "zkp", ] [[package]] @@ -1109,7 +1080,7 @@ dependencies = [ "subtle", "thiserror", "time", - "zkp 0.7.0", + "zkp", ] [[package]] @@ -1127,7 +1098,7 @@ dependencies = [ "serde_json", "time", "wasm-bindgen", - "zkp 0.8.0", + "zkp", ] [[package]] @@ -1155,18 +1126,6 @@ dependencies = [ "autocfg 1.1.0", ] -[[package]] -name = "merlin" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e261cf0f8b3c42ded9f7d2bb59dea03aa52bc8a1cbc7482f9fc3fd1229d3b42" -dependencies = [ - "byteorder", - "keccak", - "rand_core 0.5.1", - "zeroize", -] - [[package]] name = "merlin" version = "3.0.0" @@ -1174,7 +1133,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" dependencies = [ "byteorder", - "hex 0.3.2", "keccak", "rand_core 0.6.4", "zeroize", @@ -1701,7 +1659,7 @@ dependencies = [ "crc64", "futures", "futures-util", - "hex 0.4.3", + "hex", "reqwest", "serde", "serde_json", @@ -1897,7 +1855,7 @@ checksum = "64cd236ccc1b7a29e7e2739f27c0b2dd199804abc4290e32f59f3b68d6405c23" dependencies = [ "base64", "chrono", - "hex 0.4.3", + "hex", "indexmap 1.9.3", "indexmap 2.0.0", "serde", @@ -1926,7 +1884,7 @@ checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.7", + "digest", ] [[package]] @@ -1937,7 +1895,7 @@ checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.7", + "digest", ] [[package]] @@ -2028,12 +1986,6 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" -[[package]] -name = "subtle-ng" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" - [[package]] name = "syn" version = "2.0.29" @@ -2525,26 +2477,12 @@ dependencies = [ [[package]] name = "zkp" version = "0.7.0" -source = "git+https://git@gitlab.torproject.org/onyinyang/lox-zkp.git?rev=a174be65#a174be6503d09514e9102091547308e9e94648b0" +source = "git+https://gitlab.torproject.org/onyinyang/lox-zkp#0210f272211bd9a4000e3ee9dd9358316b0a8d0c" dependencies = [ "curve25519-dalek", - "merlin 3.0.0", + "merlin", "rand 0.8.5", "serde", "serde_derive", "thiserror", ] - -[[package]] -name = "zkp" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cf6dceea8522c0ade5abe68c1ca747e80b88adce2cd6a070e95f102037f331f" -dependencies = [ - "curve25519-dalek-ng", - "merlin 2.0.1", - "rand 0.7.3", - "serde", - "serde_derive", - "thiserror", -] diff --git a/crates/lox-distributor/Cargo.toml b/crates/lox-distributor/Cargo.toml index 0d48138..ce30113 100644 --- a/crates/lox-distributor/Cargo.toml +++ b/crates/lox-distributor/Cargo.toml @@ -22,8 +22,7 @@ rand = "0.8.5" reqwest = { version = "0.11", features = ["json", "stream"]} serde = { version = "1.0", features = ["derive", "rc"] } serde_with = "3.4.0" -zkp = { git = "https://git@gitlab.torproject.org/onyinyang/lox-zkp.git", rev = "a174be65"} - +zkp = { git = "https://gitlab.torproject.org/onyinyang/lox-zkp" } lox-library = { path = "../lox-library", version = "0.1.0"} lox_utils = { path = "../lox-utils", version = "0.1.0"} rdsys_backend = { path = "../rdsys-backend-api", version = "0.2"} diff --git a/crates/lox-library/Cargo.toml b/crates/lox-library/Cargo.toml index f9a7191..217377a 100644 --- a/crates/lox-library/Cargo.toml +++ b/crates/lox-library/Cargo.toml @@ -11,8 +11,6 @@ keywords = ["tor", "lox", "bridges"] [dependencies] curve25519-dalek = { version = "4", default-features = false, features = ["serde", "rand_core", "digest"] } ed25519-dalek = { version = "2", features = ["serde", "rand_core"] } -# zkp = { version = "0.8", features = ["debug-transcript"] } -#zkp = "0.8" bincode = "1" chrono = "0.4" rand = { version = "0.8", features = ["std_rng"]} @@ -27,7 +25,7 @@ base64 = "0.21" time = "0.3.30" subtle = "2.5" thiserror = "1.0.49" -zkp = { git = "https://git@gitlab.torproject.org/onyinyang/lox-zkp.git", rev = "a174be65", features = ["debug-transcript"]} +zkp = { git = "https://gitlab.torproject.org/onyinyang/lox-zkp" } [features] #default = ["u64_backend"] diff --git a/crates/lox-wasm/Cargo.toml b/crates/lox-wasm/Cargo.toml index 9a3c3b5..e1c8c60 100644 --- a/crates/lox-wasm/Cargo.toml +++ b/crates/lox-wasm/Cargo.toml @@ -21,7 +21,7 @@ serde_json = "1.0.107" console_error_panic_hook = "0.1.7" js-sys = "0.3.64" rand = { version = "0.7", features = ["wasm-bindgen"] } -zkp = "0.8.0" +zkp = { git = "https://gitlab.torproject.org/onyinyang/lox-zkp" } [dependencies.chrono] version = "0.4.31" From 794f80ab111a92dbadc4c7698c6bd14c9bd55c85 Mon Sep 17 00:00:00 2001 From: onyinyang Date: Thu, 7 Sep 2023 11:12:40 -0400 Subject: [PATCH 42/59] Fix bug in DupFilter that breaks serialize/deserialize --- crates/lox-distributor/src/db_handler.rs | 23 +++++++++++++++++++++++ crates/lox-library/src/dup_filter.rs | 13 ++++++------- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/crates/lox-distributor/src/db_handler.rs b/crates/lox-distributor/src/db_handler.rs index 26966fa..94630f3 100644 --- a/crates/lox-distributor/src/db_handler.rs +++ b/crates/lox-distributor/src/db_handler.rs @@ -119,3 +119,26 @@ fn use_last_context(lox_db: sled::Db) -> lox_context::LoxServerContext { println!("Using last context with date: {:?}", ivec_date); serde_json::from_slice(&ivec_context.1).unwrap() } + +#[cfg(test)] +mod tests { + use super::lox_context::LoxServerContext; + use super::DB; + use super::DbConfig; + + #[test] + fn test_write_context() { + let (mut lox_db, _context) = DB::open_new_or_existing_db(DbConfig::default(), None).unwrap(); + assert!( + lox_db.db.is_empty(), + "db read from context that shouldn't exist" + ); + let test_string = "{\"db\":{\"keypair\":[201,84,79,188,183,80,124,38,24,57,74,101,168,234,97,113,45,2,27,227,236,170,128,86,236,16,167,242,10,166,252,90,4,176,236,14,247,73,94,98,246,65,69,32,32,82,12,127,18,85,244,194,243,248,95,15,35,105,203,156,11,111,19,29],\"pubkey\":[4,176,236,14,247,73,94,98,246,65,69,32,32,82,12,127,18,85,244,194,243,248,95,15,35,105,203,156,11,111,19,29],\"openinv_buckets\":[4,5,9,7,8],\"distributed_buckets\":[3],\"current_k\":1},\"ba\":{\"lox_priv\":{\"x0tilde\":[85,41,72,109,86,46,81,9,210,97,10,49,74,248,36,92,65,58,213,176,216,158,218,104,12,74,2,195,125,21,181,2],\"x\":[[123,196,110,59,160,128,12,49,184,235,21,191,5,211,238,241,140,17,45,124,43,0,132,200,245,60,39,231,171,103,1,1],[128,1,189,179,132,58,53,239,39,140,129,8,248,214,198,30,108,62,192,126,180,213,186,2,122,251,125,209,115,123,62,15],[23,138,233,141,142,126,154,226,142,12,251,164,251,235,56,66,235,183,113,251,33,16,26,201,119,40,206,152,127,72,25,11],[61,94,54,105,111,7,90,98,138,16,180,84,221,166,224,139,241,221,247,49,103,91,79,78,3,241,79,175,62,181,179,7],[120,251,196,223,77,58,205,154,26,78,186,178,178,26,70,203,123,55,136,128,106,95,213,141,119,124,16,40,24,66,193,10],[107,64,82,11,205,92,33,21,141,85,186,19,166,69,198,15,69,18,244,229,212,214,243,124,239,128,153,97,174,221,195,1],[89,185,222,176,72,23,67,104,75,194,113,15,48,236,71,181,122,80,144,167,218,253,41,59,59,248,243,4,191,74,203,9]]},\"lox_pub\":{\"X\":[[124,86,226,73,90,65,51,142,228,106,134,73,243,140,30,66,95,245,111,108,13,103,241,221,222,231,4,202,168,86,75,120],[38,178,246,142,27,106,61,213,8,212,201,114,158,48,91,31,213,139,0,152,157,165,45,220,75,77,34,177,15,158,84,84],[152,36,2,34,71,93,87,173,89,7,250,213,65,242,146,194,137,188,157,123,228,102,85,130,78,34,117,55,113,100,200,101],[182,145,71,159,110,42,203,61,239,214,178,8,120,9,203,90,222,118,207,135,239,125,55,173,99,157,41,246,87,178,198,29],[134,145,250,125,207,137,246,47,213,61,137,28,254,57,36,198,112,81,117,8,126,177,35,72,5,2,175,116,117,7,246,0],[210,51,80,8,26,219,12,108,164,137,122,142,190,146,151,136,8,129,78,2,170,79,174,177,249,235,235,203,94,118,155,53],[12,214,157,115,201,64,215,118,158,108,77,219,253,222,33,248,17,233,225,150,231,193,160,51,21,1,21,109,157,36,28,54]]},\"migration_priv\":{\"x0tilde\":[181,29,215,96,118,231,180,229,98,80,101,106,72,144,19,165,214,253,0,50,245,213,91,27,185,48,159,234,38,205,147,14],\"x\":[[77,128,28,95,123,122,78,104,230,37,172,252,211,32,27,30,215,3,168,49,219,142,72,86,20,108,175,30,155,183,89,15],[131,213,100,130,177,195,196,157,155,94,160,42,146,56,244,21,21,225,217,124,223,129,208,238,72,179,222,1,22,197,80,10],[66,103,172,113,175,41,44,227,83,37,146,206,86,235,5,140,106,166,38,211,84,53,106,135,147,230,251,52,21,251,65,13],[108,44,131,107,94,121,95,238,253,225,133,200,239,190,181,29,95,141,65,201,188,140,162,41,20,49,240,249,160,188,86,8],[42,223,124,126,107,165,159,133,60,253,47,144,95,206,172,211,23,79,188,46,59,236,39,82,217,226,210,0,111,250,79,7]]},\"migration_pub\":{\"X\":[[118,3,198,185,75,234,119,161,104,244,73,220,137,14,215,106,71,172,9,105,43,196,212,8,175,36,231,13,244,150,99,5],[246,175,188,123,108,192,70,27,203,226,226,125,186,253,150,191,86,185,16,217,227,134,197,187,32,181,56,49,59,82,223,85],[106,236,9,177,125,238,13,89,118,20,190,146,180,51,246,198,153,111,55,73,233,53,16,171,145,122,200,97,173,95,49,0],[112,81,204,172,90,70,92,192,153,105,192,40,224,188,26,58,153,9,246,255,76,80,28,245,127,66,123,84,20,150,82,92],[4,67,164,55,135,180,11,122,35,219,138,108,243,185,19,6,147,165,191,82,17,143,254,177,218,101,126,58,80,116,16,54]]},\"migrationkey_priv\":{\"x0tilde\":[241,119,133,223,169,255,180,151,120,139,119,244,42,225,75,147,157,144,176,193,154,66,205,167,190,151,245,25,111,100,175,4],\"x\":[[13,164,109,8,131,170,158,121,184,95,70,236,244,54,248,30,190,152,40,147,143,174,215,76,62,125,59,140,56,46,191,11],[136,13,238,110,70,92,169,61,90,145,38,115,60,100,174,89,25,241,40,155,39,27,25,191,255,101,128,202,54,173,112,3],[138,178,205,1,214,251,19,220,100,169,146,87,169,247,92,135,238,214,176,115,68,248,98,151,249,223,250,127,86,126,12,5]]},\"migrationkey_pub\":{\"X\":[[124,62,91,180,173,88,176,18,50,126,217,90,115,135,56,148,1,192,49,122,145,106,15,41,102,132,104,250,58,171,246,54],[78,125,118,143,92,135,62,105,183,113,216,111,149,180,171,255,34,227,159,7,71,250,55,46,133,49,118,185,118,197,25,89],[78,35,14,23,16,87,161,203,241,129,68,15,113,149,188,78,43,44,6,124,8,241,37,72,206,77,203,95,107,240,212,51]]},\"reachability_priv\":{\"x0tilde\":[117,96,143,255,115,69,103,65,180,11,222,138,12,211,129,70,196,165,32,132,111,234,226,190,115,135,172,116,93,35,139,10],\"x\":[[119,97,187,188,31,54,247,119,178,12,12,107,184,112,163,180,127,41,50,115,88,36,46,241,178,98,38,147,91,139,215,13],[19,243,10,139,50,81,42,247,170,1,180,163,40,123,99,24,97,185,214,254,229,122,92,193,84,125,54,74,203,205,0,4],[215,156,31,28,179,18,140,114,93,90,92,126,47,206,62,79,144,124,215,63,234,118,172,38,75,255,55,215,176,106,108,1]]},\"reachability_pub\":{\"X\":[[84,50,132,41,247,148,208,142,47,191,111,107,107,249,22,184,183,97,242,239,209,107,161,248,237,242,25,247,38,231,65,85],[246,109,19,64,148,150,196,224,215,0,169,198,188,68,79,69,166,189,220,30,64,12,104,115,111,120,17,187,83,238,104,34],[4,55,132,2,213,114,25,101,140,205,249,190,133,60,136,18,151,227,59,104,193,186,158,45,212,128,216,235,165,104,1,50]]},\"invitation_priv\":{\"x0tilde\":[160,223,222,49,99,175,219,242,84,138,200,147,114,241,238,45,206,37,227,94,73,97,31,221,74,53,236,104,106,237,249,11],\"x\":[[115,220,229,104,149,88,90,188,19,134,95,138,124,14,20,46,21,40,29,180,189,230,161,121,167,96,239,154,76,148,155,1],[207,22,84,95,153,117,163,241,162,91,164,42,236,44,66,121,2,163,243,86,232,215,16,190,254,27,131,222,3,118,34,5],[2,3,80,235,190,114,154,191,83,34,55,51,94,31,28,101,96,93,148,91,132,48,166,229,9,186,121,221,141,199,173,15],[90,81,26,185,179,92,173,21,138,226,130,46,25,161,159,107,116,163,5,223,207,248,15,153,236,197,217,160,4,41,68,6],[207,133,200,240,250,195,202,205,125,76,69,62,14,233,171,22,218,147,203,41,114,236,218,149,75,104,115,48,236,233,72,6]]},\"invitation_pub\":{\"X\":[[174,173,72,99,191,209,97,186,7,72,159,230,209,29,82,215,129,206,27,244,114,36,115,14,60,160,193,189,241,115,113,23],[120,197,70,151,188,223,242,200,66,48,54,22,208,252,60,32,233,221,244,35,123,58,58,32,141,17,201,227,120,211,15,44],[52,96,210,153,126,87,72,56,210,157,108,14,237,179,235,160,81,195,92,147,244,54,190,176,55,84,203,238,53,145,248,19],[202,104,118,179,60,207,203,201,191,108,167,127,51,240,120,63,140,191,231,171,93,50,30,24,182,168,213,116,39,239,255,87],[158,22,194,92,254,206,129,69,181,161,240,206,129,234,144,103,229,172,53,28,109,114,24,97,168,64,143,179,70,14,42,69]]},\"bridgedb_pub\":[4,176,236,14,247,73,94,98,246,65,69,32,32,82,12,127,18,85,244,194,243,248,95,15,35,105,203,156,11,111,19,29],\"bridge_table\":{\"counter\":9,\"keys\":{\"2\":[234,125,15,48,43,93,107,32,129,111,101,99,74,171,94,115],\"8\":[37,31,162,20,37,170,152,183,229,227,188,141,11,190,93,81],\"9\":[142,198,20,243,148,87,181,35,76,215,162,102,149,194,20,47],\"5\":[94,127,85,8,145,157,65,81,60,193,214,239,212,222,208,192],\"7\":[253,41,25,218,229,23,96,223,162,65,198,161,93,255,41,204],\"1\":[4,216,218,48,7,174,74,108,19,195,193,104,111,225,227,24],\"3\":[253,81,46,66,147,94,161,254,83,218,184,56,240,178,129,153],\"6\":[28,114,248,173,187,78,104,166,243,182,17,110,24,91,123,97],\"4\":[139,137,67,18,169,40,232,253,97,72,129,245,96,13,102,168]},\"buckets\":{\"8\":[{\"addr\":[50,49,54,46,49,49,55,46,51,46,54,50,0,0,0,0],\"port\":63174,\"uid_fingerprint\":922068108643293997,\"info\":[116,121,112,101,61,115,99,114,97,109,98,108,101,115,117,105,116,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,70,68,56,68,67,55,69,70,57,50,70,49,70,49,52,68,48,48,67,70,57,68,54,70,54,50,57,55,65,51,52,54,56,66,53,57,69,55,48,55,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,83,111,109,101,40,123,34,112,97,115,115,119,111,114,100,34,58,32,34,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,50,51,52,53,54,55,34,125,41,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],\"3\":[{\"addr\":[49,57,53,46,55,50,46,55,52,46,49,49,55,0,0,0],\"port\":28746,\"uid_fingerprint\":8013544061081454931,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,50,57,49,49,48,66,55,68,57,69,57,54,48,65,53,67,52,50,56,52,56,55,55,50,65,70,54,50,52,65,51,66,50,55,65,50,68,69,52,69,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,32,102,108,97,103,115,61,83,111,109,101,40,123,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],\"7\":[{\"addr\":[49,57,49,46,49,56,48,46,49,48,51,46,50,51,54,0],\"port\":50309,\"uid_fingerprint\":17576062521251310994,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,70,68,56,68,67,55,69,70,57,50,70,49,70,49,52,68,48,48,67,70,57,68,54,70,54,50,57,55,65,51,52,54,56,66,53,57,69,55,48,55,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],\"2\":[{\"addr\":[49,57,53,46,55,50,46,55,52,46,49,49,55,0,0,0],\"port\":28746,\"uid_fingerprint\":8013544061081454931,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,50,57,49,49,48,66,55,68,57,69,57,54,48,65,53,67,52,50,56,52,56,55,55,50,65,70,54,50,52,65,51,66,50,55,65,50,68,69,52,69,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,32,102,108,97,103,115,61,83,111,109,101,40,123,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[49,50,56,46,49,51,57,46,52,52,46,49,53,55,0,0],\"port\":10839,\"uid_fingerprint\":16072135124933872676,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,55,67,53,65,51,68,67,53,51,49,48,55,53,53,48,54,65,50,52,52,65,51,67,70,49,57,66,53,55,70,52,68,69,52,55,55,67,65,54,51,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[49,51,52,46,50,48,55,46,50,51,53,46,49,48,53,0],\"port\":9042,\"uid_fingerprint\":5838789323103363859,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,56,48,55,56,70,57,55,66,50,50,49,53,55,69,66,55,49,54,65,69,66,68,53,54,65,57,52,55,54,67,51,55,56,57,57,65,68,70,54,65,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],\"4\":[{\"addr\":[49,50,56,46,49,51,57,46,52,52,46,49,53,55,0,0],\"port\":10839,\"uid_fingerprint\":16072135124933872676,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,55,67,53,65,51,68,67,53,51,49,48,55,53,53,48,54,65,50,52,52,65,51,67,70,49,57,66,53,55,70,52,68,69,52,55,55,67,65,54,51,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],\"9\":[{\"addr\":[50,49,54,46,49,49,55,46,51,46,54,50,0,0,0,0],\"port\":63174,\"uid_fingerprint\":9189545078772697644,\"info\":[116,121,112,101,61,115,99,114,97,109,98,108,101,115,117,105,116,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,69,68,67,51,65,65,48,51,70,69,54,69,53,50,66,69,55,55,56,68,68,52,54,70,50,55,68,51,53,56,57,57,51,66,55,65,49,48,65,52,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,83,111,109,101,40,123,34,112,97,115,115,119,111,114,100,34,58,32,34,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,50,51,52,53,54,55,34,125,41,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],\"5\":[{\"addr\":[49,51,52,46,50,48,55,46,50,51,53,46,49,48,53,0],\"port\":9042,\"uid_fingerprint\":5838789323103363859,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,56,48,55,56,70,57,55,66,50,50,49,53,55,69,66,55,49,54,65,69,66,68,53,54,65,57,52,55,54,67,51,55,56,57,57,65,68,70,54,65,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],\"1\":[{\"addr\":[50,49,50,46,49,54,54,46,49,54,54,46,54,55,0,0],\"port\":32414,\"uid_fingerprint\":3643046579853129326,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,66,48,56,49,49,56,65,56,48,68,55,54,54,66,65,57,65,56,70,57,65,55,50,50,67,50,54,54,49,52,69,48,54,66,56,54,69,52,67,65,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[49,51,50,46,49,56,49,46,49,53,53,46,55,54,0,0],\"port\":55241,\"uid_fingerprint\":4215620865531854407,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,67,66,70,56,51,51,51,49,54,53,70,49,67,51,53,65,68,70,48,54,66,70,52,50,53,49,48,52,69,56,51,51,65,68,68,65,49,54,53,66,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,32,102,108,97,103,115,61,83,111,109,101,40,123,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[49,53,54,46,55,50,46,50,49,57,46,52,57,0,0,0],\"port\":56030,\"uid_fingerprint\":8564141605929456761,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,68,56,66,67,67,48,69,67,70,69,50,67,57,54,53,65,66,67,50,57,67,54,50,55,70,68,67,69,67,48,66,48,54,67,53,65,68,66,49,54,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],\"6\":[{\"addr\":[49,57,49,46,49,56,48,46,49,48,51,46,50,51,54,0],\"port\":50309,\"uid_fingerprint\":17576062521251310994,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,70,68,56,68,67,55,69,70,57,50,70,49,70,49,52,68,48,48,67,70,57,68,54,70,54,50,57,55,65,51,52,54,56,66,53,57,69,55,48,55,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[50,49,54,46,49,49,55,46,51,46,54,50,0,0,0,0],\"port\":63174,\"uid_fingerprint\":922068108643293997,\"info\":[116,121,112,101,61,115,99,114,97,109,98,108,101,115,117,105,116,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,70,68,56,68,67,55,69,70,57,50,70,49,70,49,52,68,48,48,67,70,57,68,54,70,54,50,57,55,65,51,52,54,56,66,53,57,69,55,48,55,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,83,111,109,101,40,123,34,112,97,115,115,119,111,114,100,34,58,32,34,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,50,51,52,53,54,55,34,125,41,0]},{\"addr\":[50,49,54,46,49,49,55,46,51,46,54,50,0,0,0,0],\"port\":63174,\"uid_fingerprint\":9189545078772697644,\"info\":[116,121,112,101,61,115,99,114,97,109,98,108,101,115,117,105,116,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,69,68,67,51,65,65,48,51,70,69,54,69,53,50,66,69,55,55,56,68,68,52,54,70,50,55,68,51,53,56,57,57,51,66,55,65,49,48,65,52,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,83,111,109,101,40,123,34,112,97,115,115,119,111,114,100,34,58,32,34,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,50,51,52,53,54,55,34,125,41,0]}]},\"encbuckets\":{\"4\":[243,219,179,57,84,182,40,215,251,37,203,204,99,245,55,82,26,47,170,128,85,194,171,108,79,73,178,160,48,41,178,118,20,198,82,162,99,91,229,66,254,152,22,109,194,79,223,116,188,96,129,98,218,76,209,69,21,11,137,109,125,187,195,203,229,202,93,69,16,167,98,206,228,205,41,169,234,20,253,164,110,3,127,84,162,112,204,99,7,27,64,225,42,137,155,12,141,140,129,8,47,83,47,91,116,110,211,171,108,247,100,73,11,203,200,49,110,219,197,36,220,210,84,167,104,229,209,178,223,243,106,195,242,156,224,120,206,105,113,74,113,114,75,58,29,155,27,159,226,201,113,12,187,246,246,55,81,137,41,81,114,255,230,159,77,14,143,152,255,63,186,59,42,243,189,136,127,186,125,95,116,2,20,80,185,56,192,97,30,32,252,114,158,112,77,212,76,77,138,124,249,201,104,22,66,124,199,75,96,40,9,241,79,152,69,211,155,203,84,101,251,94,120,212,64,41,144,111,127,76,32,233,225,196,182,57,178,39,234,185,41,137,111,135,36,40,3,200,107,72,63,198,102,206,22,147,114,116,77,165,221,176,126,202,77,228,186,2,153,58,115,187,35,128,99,251,209,27,52,70,58,185,196,39,29,228,232,137,107,165,239,185,63,190,194,62,58,233,224,161,247,181,110,148,166,167,31,107,198,227,199,248,221,135,150,80,128,253,53,239,65,15,244,184,108,155,8,135,220,182,140,130,240,200,206,109,218,134,69,15,55,18,43,164,137,9,19,69,21,73,121,164,160,119,98,188,128,95,76,177,215,135,80,0,208,97,74,173,194,147,175,145,200,239,47,236,148,10,145,152,20,13,99,48,1,168,227,115,175,10,160,86,139,21,63,115,147,16,72,181,16,17,103,184,18,182,177,28,13,210,221,163,31,36,181,108,163,73,60,7,11,219,35,195,136,51,168,65,99,193,226,108,76,20,178,211,138,12,50,67,24,23,118,34,251,38,142,4,47,140,177,158,115,17,99,112,33,165,182,49,17,27,200,56,83,18,84,159,248,128,103,28,87,222,167,184,61,54,44,24,7,78,60,254,60,133,139,45,4,189,100,240,236,9,27,209,235,193,123,51,1,224,192,43,171,119,31,147,134,222,75,222,175,158,97,84,151,252,94,234,111,234,174,58,34,155,97,224,118,119,107,56,174,248,235,20,25,74,180,167,235,59,70,134,181,52,169,123,84,12,244,139,44,127,227,16,66,32,101,246,219,146,162,220,91,142,100,196,25,106,235,16,121,82,44,179,15,137,136,203,172,221,245,15,9,48,225,0,63,73,198,205,35,129,244,222,131,168,136,90,133,216,77,180,110,125,77,78,205,116,60,120,181,62,170,75,17,159,203,233,83,0,180,20,148,222,236,232,142,143,59,106,56,183,133,106,240,132,247,70,71,208,96,0,127,76,141,139,15,143,231,95,224,171,112,168,141,85,9,76,50,234,3,179,76,155,188,52,56,158,80,103,191,226,204,134,83,110,1,173,105,52,213,233,226,26,92,21,186,154,47,43,62,220,89,19,74,254,191,42,205,121,146,171,171,226,110,50,225,199,200,148,13,49,80,31,209,159,242,83,44,207,7,6,140,222,82,164,91,116,155,1,72,179,82,133,214,6,110,20,110,52,102,102,183,171,179,227,244,111,80,161,50,66,61,122,51,7,82,77,185,156,53,136,173,132,200,156,137,227,31,71,231,143,88,220,216,200,96,37,94,36,100,150,136,22,90,223,130,36,91,69,210,241,141,146,78,52,180,87,3,66,110,34,67,203,2,122,148,237,219,210,83,190,41,230,112,157,206,53,173,131,81,147,99,172,139,232,106,200,46,39,88,63,155,187,214,183,33,63,109,180,157,56,53,32,166,217,45,88,155,112,116,58,36,195,57,5,47,212,72,25,204,148,99,212,192,20,164,68,250,17,14,86,204,58,142,33,178,217,37,153,76,94,215,84,176,180,237,132,44,89,121,192,233,209,179,226,242,239,54,229,0,80,78,93,209,162,143,169,144,189,153,236,17,196,120,91,169,143,120,186,105,246,170,67,151,22,105,91,53,202,84,220,67,78,172,26,189,198,63,134,196,236,106,251,220,151,96,86,23,98,79,115,3,73,152,115,184,116,66,223,109,175,217,253,194,180,166,148,36,246,60,3,174,193,139,86,208,169,194,105,215,106,105,172,83,147,12,185,249,151,241,107,182,164],\"7\":[121,116,166,201,156,46,185,47,24,40,165,223,229,251,190,116,128,130,33,81,2,157,253,153,154,74,232,248,187,174,231,135,184,149,226,227,156,41,28,164,243,190,172,24,41,215,93,207,173,52,151,5,10,176,166,217,37,136,199,3,20,4,175,115,184,48,222,208,198,87,221,183,16,136,98,187,176,248,38,192,127,187,241,110,131,41,27,7,142,121,88,226,177,134,18,55,185,212,220,3,97,4,109,200,0,74,234,152,102,131,204,54,56,66,112,157,152,93,136,51,230,214,213,25,30,152,20,132,80,98,74,184,48,218,62,169,99,81,41,150,127,145,38,199,159,117,9,30,111,156,249,48,136,112,190,158,237,242,135,131,144,45,164,249,224,132,4,61,156,237,51,247,214,114,217,91,241,65,253,197,12,174,59,248,2,178,149,31,177,46,131,45,69,65,204,187,50,214,131,138,192,95,96,128,15,13,42,85,23,185,73,144,94,167,211,102,67,79,97,112,9,155,28,176,249,141,145,51,113,72,174,106,105,44,117,9,17,251,22,224,68,180,188,19,214,202,215,157,135,55,188,173,124,92,85,195,116,14,75,94,96,19,208,8,250,61,62,54,228,122,152,30,113,185,123,125,120,6,171,5,185,185,210,52,24,120,17,48,87,42,146,195,226,134,113,63,195,116,161,21,94,102,40,248,134,172,97,117,40,229,153,170,58,78,207,62,255,139,175,77,199,228,28,159,186,231,80,142,199,7,35,161,74,215,63,249,2,3,185,41,7,97,224,252,2,160,217,97,208,17,20,141,247,31,125,2,145,235,2,158,203,110,69,151,39,9,110,101,212,205,73,70,65,170,114,202,169,94,226,118,212,30,52,205,122,244,48,123,97,11,94,149,70,205,183,111,183,141,213,110,93,167,99,195,173,203,79,53,55,2,58,171,220,188,224,173,20,106,114,34,81,179,210,86,48,9,51,237,134,154,209,66,79,164,140,38,151,49,69,205,188,255,64,233,124,84,229,200,83,109,238,79,135,33,41,92,156,108,193,177,1,150,116,242,203,126,159,224,32,12,214,205,138,139,51,52,149,136,99,11,42,250,32,53,131,117,146,163,152,122,77,250,8,10,144,178,95,126,237,230,188,64,128,254,198,45,91,46,19,177,217,179,140,5,156,150,207,72,42,202,66,35,245,44,254,49,80,113,228,236,8,160,78,141,159,235,242,161,49,215,18,49,40,123,211,173,51,181,206,55,149,46,74,220,219,156,92,229,255,69,52,39,109,55,253,80,97,231,186,119,161,23,163,135,20,89,224,177,187,78,226,171,222,80,231,206,246,175,68,214,12,229,172,131,2,98,125,40,165,163,209,23,191,86,112,188,229,86,126,180,27,118,119,219,24,7,124,100,238,129,147,83,115,148,50,186,227,27,132,38,84,127,203,52,177,119,230,170,54,224,27,106,91,138,52,173,151,126,0,140,17,238,38,128,12,120,114,10,127,45,168,2,45,8,191,185,48,137,126,187,146,42,123,122,63,53,230,69,5,0,225,24,210,176,218,86,138,141,191,236,19,87,228,170,106,5,53,142,235,186,172,17,50,70,60,221,45,188,172,33,103,7,112,181,147,149,215,47,160,181,167,229,198,98,142,199,171,226,119,148,50,130,159,44,21,78,117,162,114,56,249,52,39,65,242,27,164,248,114,102,46,98,249,15,222,13,42,170,173,230,99,50,242,166,63,69,162,218,217,210,135,20,229,91,141,29,28,22,222,225,212,219,188,123,87,96,161,36,34,5,77,7,55,39,52,212,195,205,66,16,3,20,7,199,206,120,12,158,223,215,65,47,76,87,173,255,142,70,83,153,189,81,24,23,211,54,103,19,25,146,75,127,252,234,132,102,138,184,79,189,253,103,60,180,12,179,49,135,105,53,180,139,42,158,171,38,12,108,18,51,198,125,243,60,44,108,182,189,127,101,101,56,82,207,224,133,71,75,227,11,227,52,146,93,229,164,36,146,247,168,102,150,115,239,124,188,189,241,172,50,250,140,156,223,125,36,248,106,68,220,24,147,126,101,36,244,34,108,157,252,72,57,130,15,70,7,3,111,149,71,61,214,243,102,201,93,127,121,110,203,115,209,219,149,109,68,177,76,31,156,9,253,161,64,236,155,179,235,127,247,209,121,160,209,175,254,206,39,7,14,119,81,35,239,232,125,81,98,85,222,79,195,26,44,142,210,155,90,68,74,52,41,11,148,102,27],\"6\":[244,11,101,22,78,170,71,140,99,116,217,44,131,218,253,82,90,97,68,119,33,138,170,25,164,190,131,162,170,130,3,115,91,101,207,203,27,103,99,248,246,203,7,214,173,158,5,215,199,207,161,55,192,114,167,194,205,252,80,76,161,125,10,92,4,247,32,164,73,105,221,40,138,56,166,126,231,204,121,157,253,200,142,239,212,137,173,73,218,19,66,60,61,176,141,89,224,119,3,4,36,142,4,196,171,46,175,142,137,245,239,137,71,161,111,63,83,144,208,234,84,80,130,63,187,102,192,102,249,30,74,27,68,35,15,147,199,67,118,57,187,187,48,205,198,34,147,0,55,119,146,202,227,70,68,159,176,148,248,249,1,185,134,153,178,42,132,57,165,76,230,15,182,29,201,23,201,5,15,29,4,52,19,246,224,218,120,175,76,240,32,211,180,222,185,158,217,252,238,226,216,177,246,113,69,185,93,84,143,239,179,205,26,248,166,7,17,236,57,88,49,192,147,28,40,34,190,53,87,4,208,237,209,69,68,86,231,185,11,27,255,118,64,250,123,183,49,211,48,146,59,37,46,199,114,234,143,148,165,232,93,126,9,31,42,92,241,8,221,191,41,107,150,220,236,234,239,170,13,4,215,99,10,153,34,81,23,27,102,47,246,83,135,198,49,231,105,117,209,21,17,167,46,151,250,192,150,231,234,33,53,143,139,160,219,172,41,144,120,149,36,190,92,177,23,33,209,157,229,181,102,118,74,38,11,152,232,43,121,20,72,204,40,251,107,239,224,211,120,85,229,22,232,155,92,146,181,112,61,181,213,10,51,52,91,159,160,162,176,170,64,132,50,203,67,231,148,254,52,103,156,133,5,175,181,71,34,49,78,141,15,163,150,151,132,195,149,49,110,61,95,239,79,82,78,147,210,246,106,102,107,195,107,225,219,115,169,18,10,203,213,180,134,146,227,164,213,190,180,11,193,4,44,56,182,101,238,176,224,193,69,71,169,223,23,1,17,12,20,80,137,61,214,238,145,85,115,156,125,176,84,157,171,60,4,177,54,190,219,178,182,25,65,206,253,14,117,110,196,196,29,44,54,131,128,76,77,165,133,61,239,175,25,244,180,143,235,110,182,117,86,215,253,226,252,211,107,81,74,184,192,211,95,95,38,163,23,47,246,216,138,87,237,108,11,143,177,111,199,133,161,144,9,114,53,208,41,13,28,139,234,198,210,206,204,184,126,118,96,253,182,253,247,231,213,160,117,255,198,116,94,153,119,34,18,91,40,95,65,176,215,1,115,105,166,73,58,230,136,204,30,109,134,64,249,92,207,138,170,115,56,40,20,215,175,39,105,237,224,63,233,250,186,89,118,227,118,47,176,21,194,207,245,182,78,158,31,237,77,145,111,24,66,228,5,38,218,184,91,25,193,153,90,233,8,224,127,102,37,135,198,206,102,253,224,193,243,100,59,182,146,206,185,168,69,101,201,160,237,192,33,246,202,119,49,33,33,75,244,255,142,145,49,235,108,246,211,166,87,5,21,104,239,95,104,195,15,31,130,58,32,172,118,159,3,166,35,48,126,88,51,226,194,173,130,76,249,36,244,43,120,3,1,40,219,39,208,119,235,178,252,48,159,144,157,36,243,196,9,33,118,79,178,119,232,28,160,132,35,81,244,209,96,168,146,133,206,161,103,120,138,133,254,96,103,139,19,29,213,190,153,69,217,164,26,64,163,51,232,144,78,167,113,209,72,47,230,111,183,79,97,178,67,96,105,255,17,155,89,106,42,1,75,4,21,87,82,43,82,105,74,65,100,165,92,203,73,37,31,196,189,11,142,81,26,119,148,198,148,211,97,4,36,34,12,63,209,12,49,175,224,199,90,3,70,250,241,252,248,142,231,149,240,220,183,27,214,28,9,154,15,187,205,190,222,28,172,80,198,88,110,60,2,239,88,63,222,110,47,203,23,96,215,58,188,150,14,221,231,191,170,106,183,227,146,136,132,54,173,126,155,231,45,167,101,0,110,97,121,3,169,62,82,250,125,246,32,32,94,35,215,115,123,1,66,39,205,26,145,248,249,190,162,133,10,239,105,172,31,185,122,2,161,244,90,37,56,204,249,210,94,110,9,106,71,189,149,37,247,18,209,3,4,36,50,13,159,227,253,5,215,15,86,66,171,214,67,12,22,54,132,69,9,255,47,113,75,152,137,29,21,240,144,127,35,186,150,3,66,213,153,77,109,154,142,210],\"5\":[233,196,158,255,98,84,122,36,218,215,121,163,96,106,42,88,230,167,14,88,179,219,50,169,25,90,3,145,244,37,23,242,225,67,131,245,126,150,236,250,28,245,185,107,7,131,111,93,225,78,186,159,39,191,187,218,192,164,9,120,45,193,155,75,198,116,203,52,233,122,253,76,21,94,26,159,69,197,235,231,185,49,184,7,190,41,190,9,96,34,67,18,205,120,50,81,16,52,238,13,173,27,134,22,9,63,238,163,64,35,207,37,123,66,114,186,180,47,172,31,121,231,196,120,160,82,198,254,20,99,103,102,197,70,162,72,65,158,175,191,145,13,62,108,92,195,56,168,121,109,24,233,67,231,116,49,140,242,20,126,200,100,90,239,183,139,250,6,157,223,92,203,174,49,50,126,91,10,154,70,34,149,153,82,45,14,15,99,140,71,103,168,208,121,58,253,203,23,150,146,156,243,98,202,111,129,67,203,126,198,188,209,3,170,64,242,91,19,253,236,157,35,134,212,5,235,118,48,90,178,198,46,89,139,64,236,253,13,171,40,68,165,104,2,97,6,33,137,150,11,43,161,21,189,202,98,98,95,204,124,82,80,199,101,163,168,181,160,148,232,178,32,216,99,17,145,198,154,147,194,20,31,144,190,235,132,158,218,7,80,131,97,123,158,16,220,202,226,177,139,112,10,108,97,150,214,70,26,190,107,190,57,214,236,29,184,24,84,204,35,67,89,155,81,135,229,19,201,82,125,68,29,217,216,175,198,194,9,95,178,152,194,34,25,19,241,213,234,60,13,139,148,238,184,10,208,78,59,174,93,216,193,244,59,165,90,146,163,207,101,60,145,21,74,123,24,227,106,239,56,50,176,35,250,74,170,255,98,15,135,52,38,30,64,158,174,195,136,153,97,69,135,31,80,14,170,44,137,83,107,66,4,42,141,78,66,153,157,35,147,245,234,103,125,191,71,225,223,215,190,220,47,62,12,178,85,199,110,133,111,214,36,179,132,17,152,62,6,31,198,251,9,77,53,168,106,91,80,215,57,94,31,52,194,159,175,214,122,155,173,2,225,24,228,207,71,69,115,66,86,205,0,228,101,83,111,7,249,214,124,42,204,250,209,121,170,138,122,185,112,151,131,132,121,105,175,23,117,197,191,134,153,224,130,48,239,49,228,69,186,50,242,55,112,193,149,98,1,156,92,167,235,114,195,58,55,32,158,168,245,56,164,109,172,74,154,89,193,183,63,60,243,64,139,202,56,132,240,211,80,135,88,230,66,4,234,199,220,49,184,201,108,68,36,176,101,88,62,83,250,22,247,25,29,158,228,222,72,149,121,170,4,119,25,124,211,208,135,19,197,182,130,153,158,231,247,42,163,164,217,47,45,30,221,139,58,197,102,155,60,39,71,234,18,53,204,165,77,247,169,119,146,31,108,39,92,167,104,27,110,98,70,174,78,151,239,225,145,15,153,12,158,95,214,8,53,244,237,42,143,51,168,5,153,182,96,26,143,193,106,197,163,79,91,48,142,197,51,179,139,12,238,16,106,184,99,225,208,35,141,109,31,7,27,223,198,156,118,93,114,111,25,178,122,38,49,160,19,45,165,203,94,64,249,72,108,254,166,184,200,14,144,180,74,128,245,8,20,29,119,34,85,174,126,248,186,142,24,160,60,22,142,38,97,98,243,222,69,126,46,66,215,40,61,77,216,165,5,178,45,21,29,159,4,91,168,11,244,253,72,240,86,199,154,137,5,75,127,5,148,120,50,26,105,70,96,248,170,127,31,98,158,20,113,111,142,234,53,247,191,168,226,194,54,214,202,175,216,122,131,2,218,73,208,69,227,142,15,158,30,197,233,191,69,5,255,237,78,64,82,35,145,202,24,134,131,183,31,87,213,246,158,74,122,251,36,5,116,138,224,182,80,18,95,80,45,222,28,104,205,8,151,189,138,243,14,90,204,108,30,160,203,119,6,148,38,252,155,6,134,48,204,60,48,141,198,64,14,227,243,87,99,246,99,172,195,36,212,195,50,43,109,49,184,210,36,79,46,115,75,42,116,80,125,222,207,83,206,53,88,225,239,138,185,223,1,109,122,34,64,195,224,188,33,84,250,151,83,165,160,106,59,117,117,39,71,255,10,28,180,224,201,4,19,213,182,248,112,170,75,200,207,123,70,132,248,59,46,202,106,8,142,240,84,250,167,189,142,191,223,10,215,83,115,32,124,30,238,155,171,212,166,186,239,117,141],\"9\":[92,82,84,153,8,228,93,80,116,15,126,28,55,66,233,244,9,42,69,236,27,101,144,6,213,241,217,101,175,6,159,83,171,242,191,19,169,57,97,30,24,251,103,12,69,245,37,79,108,206,155,78,101,218,30,45,86,219,245,198,108,133,192,255,130,76,85,34,8,191,27,27,72,24,10,172,27,62,25,53,57,22,247,7,101,241,70,53,207,233,166,88,90,136,232,18,13,9,230,153,205,91,17,47,239,17,178,242,91,235,165,160,57,15,247,204,39,237,64,220,15,66,84,161,119,238,146,105,46,81,47,171,147,238,81,192,190,161,147,42,137,106,178,222,150,138,76,144,177,41,142,84,159,140,175,143,28,223,101,182,18,252,42,126,6,108,48,162,133,106,104,150,43,138,121,206,143,50,167,227,146,67,38,106,109,25,50,56,21,174,79,158,116,226,29,147,228,128,195,13,106,14,8,64,209,68,6,72,56,21,212,175,108,162,210,236,4,255,130,25,167,58,185,126,123,58,141,237,188,43,133,60,138,183,197,37,127,215,0,1,48,54,64,114,235,52,183,245,228,29,20,130,226,68,76,4,146,200,94,206,148,224,106,3,92,242,243,6,202,52,165,171,34,22,8,195,162,213,39,167,119,54,119,66,99,227,237,26,180,26,9,4,78,123,152,153,253,42,20,58,224,170,80,110,191,196,215,84,224,168,150,49,4,63,125,11,224,88,74,196,108,89,29,165,244,26,39,104,129,168,210,30,52,80,187,244,54,211,190,216,34,24,108,47,92,88,213,227,22,123,79,191,154,61,120,114,176,101,94,67,113,232,110,88,125,140,69,136,62,101,109,126,133,198,234,150,253,205,37,189,145,16,168,98,211,195,89,67,119,11,30,39,39,51,222,153,200,174,76,181,215,218,97,48,83,208,124,198,170,45,82,65,252,236,104,201,104,218,66,221,155,57,111,211,251,78,140,38,209,174,25,154,85,101,29,8,153,35,119,210,145,249,58,195,141,252,204,104,213,173,205,48,52,215,167,210,27,32,93,15,105,4,52,174,214,87,109,97,213,82,166,74,57,188,145,148,135,93,187,195,129,23,227,197,111,113,158,210,86,167,38,118,165,235,126,97,136,143,10,14,76,202,176,219,132,58,247,219,6,206,127,243,193,155,90,213,106,134,170,223,98,108,79,26,156,115,1,196,81,6,90,245,219,23,172,37,247,213,185,129,177,138,144,251,29,162,112,27,97,11,145,183,191,214,198,140,133,116,94,180,92,68,86,226,235,36,122,153,207,85,69,42,30,60,199,59,232,244,67,29,124,106,174,236,232,77,227,206,35,239,141,125,211,103,239,193,232,171,193,209,179,93,27,39,148,104,178,118,129,151,124,209,244,180,9,82,43,255,64,227,151,246,175,250,238,92,4,91,173,253,119,45,176,157,230,53,112,43,57,133,95,90,120,27,129,161,13,178,196,23,216,243,17,31,25,95,124,173,41,188,93,25,69,62,6,80,211,206,87,228,68,86,238,6,135,80,156,212,113,124,131,120,79,29,70,250,213,235,53,131,22,189,103,176,254,153,231,65,70,85,41,66,130,205,151,240,138,224,144,214,15,20,251,235,250,55,124,157,227,121,108,23,119,60,195,241,112,123,207,236,147,86,226,45,74,186,186,32,2,66,251,56,154,151,227,78,140,207,145,159,115,0,207,147,2,35,165,181,199,128,187,202,25,229,146,177,153,86,131,130,236,35,192,227,26,142,235,131,53,85,40,91,85,218,11,97,153,224,12,137,151,214,116,147,223,5,64,253,78,16,75,132,237,25,74,69,249,246,81,36,122,246,209,245,176,240,29,188,64,155,97,29,58,200,90,254,171,179,88,175,85,253,115,238,111,7,101,7,236,212,48,241,217,17,106,134,37,100,232,85,92,15,31,66,118,17,98,71,181,210,253,197,34,144,228,60,77,167,91,187,140,17,248,248,199,103,92,20,240,196,139,239,4,230,191,154,159,232,220,80,44,65,232,118,77,255,126,237,23,112,70,29,99,30,68,95,134,123,238,248,158,50,99,87,46,113,184,116,17,233,69,187,188,209,139,218,217,20,106,240,255,198,84,42,23,159,146,118,82,55,130,228,19,62,128,4,223,219,97,96,252,30,136,95,163,221,117,76,53,55,219,170,141,121,49,191,81,145,8,134,251,242,82,201,128,32,89,226,191,104,187,133,161,209,49,11,124,238,249,215,77,165,250,212,0,111],\"2\":[39,26,40,155,207,170,15,166,186,15,65,98,28,37,104,74,15,50,185,112,129,178,58,207,160,21,134,44,134,184,190,242,198,111,251,71,182,133,249,86,245,76,231,191,158,198,177,137,32,38,35,207,3,35,252,107,96,193,73,154,254,227,209,10,75,42,80,61,119,103,32,88,132,109,136,91,236,235,120,62,128,255,14,128,4,33,225,196,76,1,90,251,145,11,18,79,230,109,255,56,255,134,53,88,182,166,68,226,242,132,95,253,188,206,242,16,221,38,184,90,33,21,73,58,229,80,214,58,73,68,147,81,191,6,183,227,162,107,31,7,1,115,149,250,150,7,33,94,25,250,34,34,152,23,21,45,88,107,120,34,141,121,33,27,69,210,51,83,116,71,248,237,225,182,52,58,142,85,5,64,234,68,124,214,103,188,20,198,35,171,220,188,8,19,117,84,112,108,21,73,129,58,172,87,111,92,189,143,163,82,47,23,90,31,243,189,94,99,7,218,175,189,255,0,231,196,150,141,12,80,115,115,1,16,15,39,145,68,88,243,22,12,156,116,13,84,180,186,228,80,71,213,130,1,146,208,32,252,196,127,234,49,103,147,91,35,30,209,157,59,150,177,116,91,97,170,101,187,168,190,87,109,20,98,114,166,87,179,209,211,87,179,227,123,51,45,182,54,65,217,109,91,12,99,135,114,225,93,141,180,71,66,79,138,135,77,31,85,18,35,0,151,148,191,125,51,105,2,248,0,60,232,178,149,72,111,71,26,249,143,0,164,165,45,112,227,9,217,20,223,235,55,230,184,163,188,165,26,18,60,204,56,208,213,30,217,77,51,239,139,103,15,241,135,85,88,165,237,96,60,28,216,129,87,229,74,187,130,149,17,169,31,242,130,199,84,219,224,95,49,177,152,160,176,113,112,142,61,5,252,240,205,55,130,87,242,0,69,149,179,116,255,64,135,93,113,109,36,220,100,230,50,185,29,180,202,221,63,192,149,227,82,194,231,79,189,150,146,64,50,132,197,198,233,64,126,78,210,204,57,21,134,102,12,61,210,251,144,47,26,42,96,195,199,246,24,243,219,72,43,176,165,35,130,243,10,161,8,242,20,209,35,39,10,205,13,172,76,182,231,90,106,145,78,254,140,183,152,169,62,159,210,88,42,217,41,196,187,247,173,126,11,174,41,231,95,124,129,29,41,139,179,174,219,112,133,134,225,127,150,10,222,244,133,115,18,36,21,241,136,105,95,193,244,2,56,36,160,61,5,240,51,73,92,6,235,164,221,23,194,130,16,248,249,224,250,205,103,148,154,104,75,195,146,181,193,56,185,229,231,139,58,65,204,38,60,232,39,7,116,118,115,40,195,138,208,77,145,92,245,248,229,212,138,253,76,115,75,15,105,190,88,21,183,53,210,77,3,10,122,133,176,194,117,109,52,177,113,130,172,143,177,19,205,157,110,2,236,22,68,160,255,212,186,168,175,225,145,200,112,110,212,233,16,117,88,170,81,159,73,112,161,193,9,34,206,155,243,155,181,197,111,149,55,82,230,103,74,65,187,134,25,106,131,163,194,80,193,79,186,173,201,205,196,160,53,203,136,151,110,52,53,217,100,173,34,0,54,167,148,239,166,21,241,77,37,70,122,93,139,196,244,34,30,227,95,200,21,80,223,169,255,247,55,23,99,87,120,45,140,5,145,100,134,98,27,219,38,148,134,159,165,252,81,134,127,161,148,145,245,156,60,128,172,136,54,10,98,115,202,14,231,101,27,178,40,230,120,11,190,82,201,13,188,254,243,240,85,193,76,210,248,8,49,246,191,13,150,89,38,36,13,63,183,6,45,215,76,122,168,98,2,62,153,136,35,63,250,213,126,214,20,139,90,232,97,251,5,226,1,228,206,232,246,4,243,228,138,219,151,234,82,162,103,22,95,136,162,174,146,56,88,57,10,235,119,158,177,17,194,88,92,198,136,88,45,236,72,33,43,25,208,13,105,90,43,226,236,167,56,73,164,151,94,106,187,62,97,123,230,230,104,163,205,6,22,1,230,69,249,246,181,121,209,98,152,223,224,233,251,208,127,123,106,39,149,161,161,136,171,118,38,224,50,122,135,223,194,233,108,48,247,242,73,180,75,47,154,10,237,243,43,207,186,200,0,105,199,58,83,13,195,65,246,26,218,254,32,47,86,105,30,175,120,73,59,248,44,214,52,107,47,232,250,124,227,122,4,248,27,197,25,167,116,140,147],\"1\":[119,213,100,52,177,0,161,84,252,204,52,125,174,105,85,152,53,191,113,187,76,139,212,167,79,12,251,221,244,29,66,95,235,10,252,39,46,210,253,66,16,61,115,176,135,129,230,71,4,23,226,92,239,68,245,244,56,92,208,135,232,53,90,42,65,35,249,192,196,65,240,9,142,39,43,116,45,192,206,6,100,22,175,62,91,153,33,218,210,102,59,49,242,147,82,174,113,61,93,229,174,133,95,23,80,70,119,146,45,43,115,254,228,79,68,54,31,237,137,240,177,0,220,82,238,87,205,76,60,215,246,39,199,43,90,111,77,130,172,229,125,135,252,238,123,58,47,61,134,215,35,45,245,29,151,147,158,166,224,134,7,26,255,93,47,98,169,61,97,152,157,84,42,13,89,181,143,120,63,93,252,79,147,152,100,214,85,139,0,90,46,12,246,161,0,12,109,240,153,222,77,218,88,103,65,117,52,127,29,94,157,29,74,252,184,220,106,77,117,106,122,90,11,223,239,112,28,131,84,180,103,180,76,202,185,95,101,117,161,10,14,15,20,175,11,44,114,95,215,97,58,129,140,172,92,82,227,149,172,153,72,9,66,164,158,158,33,193,173,190,14,12,72,56,183,56,105,99,121,170,16,145,26,50,254,241,159,130,22,12,63,157,218,91,67,247,220,142,101,100,103,214,199,2,142,176,213,127,2,138,225,28,205,131,219,64,1,59,124,160,201,18,145,19,232,90,118,87,187,193,82,193,178,101,131,176,167,8,17,69,37,41,56,86,58,220,76,18,7,187,179,2,3,4,143,250,33,82,100,190,120,172,72,217,6,5,3,241,39,240,173,220,196,227,158,30,205,170,247,5,119,174,68,129,82,0,236,9,40,89,76,143,179,219,75,192,152,131,159,213,37,181,59,105,37,249,46,142,51,232,109,246,123,232,162,167,226,11,230,109,232,102,176,246,125,206,74,214,149,192,157,240,35,229,86,94,160,3,3,248,3,196,223,124,35,111,95,246,105,74,118,125,181,180,151,141,182,239,49,141,48,57,224,98,236,182,223,73,240,143,15,20,194,168,118,251,190,233,87,85,64,204,70,131,193,174,128,22,83,47,78,61,172,223,36,81,115,102,35,206,105,159,242,98,54,200,135,135,67,6,241,150,35,26,71,221,176,119,39,144,67,77,241,156,201,102,142,140,142,205,4,136,135,186,40,118,70,60,43,242,147,200,250,229,119,118,95,191,36,39,159,211,57,58,116,168,247,229,124,221,104,32,242,1,65,182,103,165,52,218,111,108,206,49,218,217,120,116,161,214,210,243,3,73,176,166,93,138,250,128,97,9,168,133,155,45,34,38,138,145,5,172,236,164,66,150,173,100,200,239,70,79,60,27,193,244,56,94,121,47,250,36,242,249,184,185,74,105,133,220,28,45,54,155,6,176,75,109,22,252,54,73,71,22,1,127,233,166,207,77,35,203,130,105,36,33,21,24,46,82,84,135,127,8,27,188,198,223,204,117,147,183,151,138,140,179,44,228,111,58,38,144,118,216,95,207,11,140,108,70,52,81,5,119,113,118,81,240,106,154,252,150,37,149,30,183,225,112,8,12,143,190,148,107,174,238,19,85,130,125,224,69,159,18,139,143,138,155,45,13,60,93,25,108,72,17,128,122,51,255,18,177,247,34,205,152,242,31,63,98,128,69,210,105,206,84,121,21,112,128,22,12,65,213,10,154,220,242,70,158,167,34,210,230,92,206,83,168,244,185,130,7,204,244,10,67,74,78,110,247,224,48,122,169,208,143,18,81,98,224,38,210,101,164,48,189,116,22,39,152,84,119,148,38,163,17,78,105,23,175,73,163,173,43,22,225,120,165,99,88,158,222,178,239,197,135,239,203,42,207,43,173,72,197,217,60,231,104,241,179,144,52,231,135,82,201,198,105,118,223,206,56,8,207,73,71,50,239,39,220,165,49,115,253,39,2,77,81,37,175,156,55,232,91,128,0,83,222,17,183,160,63,179,61,178,236,41,244,161,173,85,165,157,133,4,172,143,24,11,161,212,194,17,3,31,105,101,9,117,190,155,224,116,116,107,181,181,255,1,60,47,165,72,79,85,214,153,204,214,81,52,119,63,153,34,170,223,232,89,114,142,216,138,187,252,194,181,32,83,66,93,122,39,156,96,23,44,96,153,55,113,172,221,63,133,17,63,231,47,166,198,56,231,236,116,76,39,232,125,229,215,63,83,38,62,53],\"3\":[49,117,129,233,104,116,154,224,25,5,12,234,130,105,252,125,25,187,232,174,167,29,60,207,168,89,150,40,211,149,160,173,17,149,213,186,239,170,163,221,195,215,202,11,191,77,37,205,73,80,223,114,176,32,60,24,164,201,19,88,17,12,177,33,254,8,201,88,125,21,119,6,144,244,1,66,74,219,218,211,189,169,217,94,238,120,47,32,91,182,242,0,7,236,154,55,44,245,0,177,47,185,96,70,18,160,118,26,250,154,239,251,176,216,48,91,19,151,26,106,170,120,226,181,217,237,242,36,190,61,82,92,8,222,255,36,75,82,13,230,107,162,236,173,6,216,139,81,209,53,37,226,106,218,10,87,74,106,76,39,227,81,161,187,231,127,46,190,30,120,11,138,47,210,179,182,136,233,158,165,224,166,8,65,227,102,213,205,59,135,26,134,62,199,37,218,88,168,192,130,254,11,112,66,246,99,84,207,93,8,2,33,8,189,136,73,91,255,188,36,128,253,211,55,41,180,226,19,225,192,193,218,154,8,229,54,234,166,228,126,125,160,214,31,74,140,113,96,242,210,156,70,57,130,50,128,95,2,102,97,75,185,239,117,111,20,116,172,84,109,94,71,245,33,85,14,150,169,118,222,31,159,72,34,217,2,148,179,228,120,114,87,252,240,206,104,47,206,182,192,218,239,159,46,188,103,167,137,179,111,18,16,78,68,111,178,170,165,183,152,180,194,23,115,189,98,138,218,116,167,103,5,64,8,16,178,51,23,197,34,254,241,184,86,75,105,65,75,140,143,165,79,157,1,179,2,14,28,131,231,124,3,65,191,215,169,168,18,83,26,111,70,242,97,4,123,50,34,174,228,134,148,85,183,111,22,25,147,182,90,104,238,212,201,88,166,24,218,224,38,188,79,81,87,100,85,10,228,208,160,30,102,164,166,98,169,65,224,75,80,43,97,185,64,118,158,125,174,93,22,197,126,99,191,47,179,193,188,158,245,15,60,65,145,37,205,128,106,129,212,66,137,174,145,84,22,243,116,3,98,130,41,48,168,232,92,155,86,182,170,219,59,243,182,194,255,178,52,85,63,130,27,219,79,235,0,215,140,188,186,32,153,92,86,86,45,79,23,95,119,206,89,18,56,106,31,218,115,83,132,43,76,212,98,253,201,244,231,88,14,42,23,61,1,2,187,88,71,72,148,94,54,172,170,87,58,153,70,169,27,189,156,254,5,80,115,220,61,86,22,173,178,16,31,217,25,161,212,110,248,90,20,42,135,61,148,42,145,201,237,175,78,186,75,116,126,152,4,157,10,233,155,89,242,204,97,105,152,25,37,3,193,248,247,121,50,215,115,233,249,80,98,245,247,136,252,95,135,160,0,68,107,116,175,75,191,212,71,238,148,112,213,55,62,69,30,94,79,92,117,163,236,7,72,52,20,217,158,184,239,24,108,242,205,74,36,67,199,100,18,33,12,91,80,6,25,137,238,239,241,56,201,142,196,9,177,10,166,225,229,216,171,231,63,131,193,154,139,35,32,116,213,239,158,231,115,68,183,141,50,193,154,147,106,83,240,198,103,228,193,15,70,33,187,171,43,43,100,153,39,143,188,176,80,190,166,246,184,77,114,67,216,191,101,170,128,75,49,162,65,123,244,139,87,2,50,76,77,224,238,141,183,30,157,94,107,196,181,228,93,181,152,150,134,38,246,208,0,64,3,21,15,236,63,93,153,242,161,123,203,54,109,139,207,124,98,202,147,80,16,45,81,162,107,79,142,195,199,193,58,109,237,193,140,25,86,162,142,138,114,37,2,7,19,65,30,59,215,58,72,153,30,25,145,244,143,107,66,155,142,68,169,101,180,194,111,251,195,27,192,140,75,160,194,182,92,136,49,170,83,164,9,149,132,136,45,44,253,98,162,13,175,170,198,117,169,167,217,147,193,123,7,221,94,231,62,102,180,103,91,20,215,79,37,159,43,67,25,83,41,219,8,114,145,76,27,122,216,35,95,42,123,248,222,215,12,38,25,41,54,242,180,244,33,23,51,140,234,80,29,179,130,232,87,212,94,171,222,193,39,48,164,63,254,173,152,54,218,194,28,205,194,121,143,190,115,42,176,109,58,77,74,246,234,226,233,110,123,82,85,20,106,93,119,91,100,58,227,110,16,219,151,33,52,223,64,236,158,185,37,125,165,173,200,185,67,35,194,159,95,37,239,205,52,116,98,180,154,245,44,237,106,69,102,249,77],\"8\":[61,15,52,84,78,202,205,135,46,28,212,160,230,180,222,30,135,37,211,165,246,221,237,204,48,117,68,116,101,173,175,221,42,93,165,160,147,231,157,120,111,124,33,94,151,239,57,77,66,196,61,53,28,108,130,34,224,130,242,244,7,229,189,175,154,219,130,214,118,99,191,236,69,43,220,182,178,65,205,17,142,36,70,70,76,227,11,249,164,222,44,84,4,87,81,12,61,14,119,32,241,212,93,207,32,17,78,125,187,25,33,206,211,158,140,122,157,40,65,166,205,118,130,186,41,82,133,80,64,30,150,23,201,89,213,134,171,72,150,63,4,168,127,149,62,164,251,158,149,32,139,226,131,219,208,47,19,52,223,144,14,250,50,100,71,30,133,109,255,252,94,55,201,163,122,7,23,128,216,60,226,32,124,123,173,168,44,238,252,199,152,228,113,223,160,87,153,39,129,148,42,105,182,219,53,14,146,229,161,245,129,75,248,134,248,4,0,153,225,14,4,66,212,175,40,19,18,200,133,143,174,53,250,246,93,8,230,180,110,4,109,244,221,56,222,252,247,149,224,171,109,71,172,182,117,238,65,5,224,175,36,63,92,29,122,69,20,11,145,166,192,178,244,93,78,238,5,174,101,131,33,211,123,2,93,244,237,238,158,130,161,159,105,145,180,79,78,119,17,220,22,90,247,253,159,0,212,130,198,24,254,213,213,216,43,67,92,102,4,128,26,86,22,187,0,40,224,134,54,25,21,49,51,217,5,55,148,134,66,35,37,247,66,254,100,23,140,131,84,98,139,127,97,242,78,25,11,89,219,36,208,116,199,216,65,207,72,72,66,177,88,65,239,227,219,205,198,45,79,97,186,179,13,146,152,201,4,30,35,68,202,209,151,79,187,182,146,184,42,211,101,124,55,152,63,205,16,167,19,29,43,200,243,138,248,179,116,200,152,171,101,189,184,136,220,17,227,227,223,29,227,126,7,61,117,42,213,92,138,143,198,201,221,53,234,238,141,13,253,13,227,55,125,70,236,53,133,28,230,183,230,112,46,2,52,227,208,12,23,157,102,199,187,31,150,14,185,96,117,154,163,119,254,166,193,11,18,220,168,202,224,25,226,142,51,139,1,130,115,191,50,73,157,27,80,70,147,172,154,3,210,108,241,63,14,15,4,216,99,192,174,77,98,155,36,32,109,77,49,66,212,188,101,3,161,185,44,125,66,148,45,15,10,231,124,112,29,249,248,245,34,188,109,145,144,80,57,68,46,214,97,129,10,175,244,53,236,233,28,244,108,205,121,45,223,114,244,165,109,96,244,66,23,26,49,231,39,37,23,21,245,160,112,218,197,128,19,181,213,52,64,231,101,191,239,136,142,26,241,228,63,9,148,156,75,213,252,152,60,73,60,112,98,113,39,57,132,232,122,33,105,163,55,247,197,199,90,49,196,246,206,227,1,157,214,6,204,187,209,115,129,56,225,199,180,43,231,44,197,209,60,198,13,243,247,152,54,10,131,16,83,61,225,12,169,12,1,114,192,83,8,69,111,236,211,168,46,136,81,63,178,71,183,11,72,14,160,154,176,109,130,254,123,8,249,45,213,123,202,34,52,59,5,99,118,147,51,75,45,182,132,209,121,49,176,102,218,48,209,176,128,232,88,14,7,97,99,127,113,212,88,102,252,252,141,216,37,135,41,143,216,76,69,253,140,227,247,71,159,216,220,255,97,185,146,148,132,115,163,116,116,211,24,187,183,25,207,150,6,204,152,138,189,110,122,42,63,201,52,103,110,139,12,6,13,43,175,188,163,221,184,151,163,41,96,235,134,44,230,18,206,225,195,111,100,99,236,2,246,206,175,9,194,84,128,162,100,130,210,37,44,149,216,161,105,54,81,208,42,233,134,31,69,12,133,194,179,171,213,231,115,80,134,161,193,236,126,88,210,59,9,62,47,189,106,243,60,232,5,105,238,0,163,109,191,221,20,102,205,108,127,178,39,228,229,138,114,202,122,157,208,131,7,177,249,96,5,60,243,170,84,151,10,93,17,188,141,112,209,98,30,158,7,252,100,82,227,181,111,19,208,158,33,60,124,108,214,225,84,92,245,253,244,80,155,245,213,142,104,151,207,71,79,38,137,143,147,171,154,36,36,89,164,157,161,100,63,251,42,137,74,24,1,41,243,119,118,44,163,9,141,57,98,170,79,67,184,44,142,183,210,228,242,137,177,199,69,52,217,17,243,189,14,14,25,236]},\"reachable\":{\"{\\\"addr\\\":[50,49,54,46,49,49,55,46,51,46,54,50,0,0,0,0],\\\"port\\\":63174,\\\"uid_fingerprint\\\":922068108643293997,\\\"info\\\":[116,121,112,101,61,115,99,114,97,109,98,108,101,115,117,105,116,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,70,68,56,68,67,55,69,70,57,50,70,49,70,49,52,68,48,48,67,70,57,68,54,70,54,50,57,55,65,51,52,54,56,66,53,57,69,55,48,55,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,83,111,109,101,40,123,34,112,97,115,115,119,111,114,100,34,58,32,34,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,50,51,52,53,54,55,34,125,41,0]}\":[[6,1],[8,0]],\"{\\\"addr\\\":[49,53,54,46,55,50,46,50,49,57,46,52,57,0,0,0],\\\"port\\\":56030,\\\"uid_fingerprint\\\":8564141605929456761,\\\"info\\\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,68,56,66,67,67,48,69,67,70,69,50,67,57,54,53,65,66,67,50,57,67,54,50,55,70,68,67,69,67,48,66,48,54,67,53,65,68,66,49,54,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}\":[[1,2]],\"{\\\"addr\\\":[49,50,56,46,49,51,57,46,52,52,46,49,53,55,0,0],\\\"port\\\":10839,\\\"uid_fingerprint\\\":16072135124933872676,\\\"info\\\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,55,67,53,65,51,68,67,53,51,49,48,55,53,53,48,54,65,50,52,52,65,51,67,70,49,57,66,53,55,70,52,68,69,52,55,55,67,65,54,51,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}\":[[2,1],[4,0]],\"{\\\"addr\\\":[50,49,50,46,49,54,54,46,49,54,54,46,54,55,0,0],\\\"port\\\":32414,\\\"uid_fingerprint\\\":3643046579853129326,\\\"info\\\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,66,48,56,49,49,56,65,56,48,68,55,54,54,66,65,57,65,56,70,57,65,55,50,50,67,50,54,54,49,52,69,48,54,66,56,54,69,52,67,65,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}\":[[1,0]],\"{\\\"addr\\\":[49,51,50,46,49,56,49,46,49,53,53,46,55,54,0,0],\\\"port\\\":55241,\\\"uid_fingerprint\\\":4215620865531854407,\\\"info\\\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,67,66,70,56,51,51,51,49,54,53,70,49,67,51,53,65,68,70,48,54,66,70,52,50,53,49,48,52,69,56,51,51,65,68,68,65,49,54,53,66,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,32,102,108,97,103,115,61,83,111,109,101,40,123,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}\":[[1,1]],\"{\\\"addr\\\":[49,57,53,46,55,50,46,55,52,46,49,49,55,0,0,0],\\\"port\\\":28746,\\\"uid_fingerprint\\\":8013544061081454931,\\\"info\\\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,50,57,49,49,48,66,55,68,57,69,57,54,48,65,53,67,52,50,56,52,56,55,55,50,65,70,54,50,52,65,51,66,50,55,65,50,68,69,52,69,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,32,102,108,97,103,115,61,83,111,109,101,40,123,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}\":[[2,0],[3,0]],\"{\\\"addr\\\":[49,57,49,46,49,56,48,46,49,48,51,46,50,51,54,0],\\\"port\\\":50309,\\\"uid_fingerprint\\\":17576062521251310994,\\\"info\\\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,70,68,56,68,67,55,69,70,57,50,70,49,70,49,52,68,48,48,67,70,57,68,54,70,54,50,57,55,65,51,52,54,56,66,53,57,69,55,48,55,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}\":[[6,0],[7,0]],\"{\\\"addr\\\":[50,49,54,46,49,49,55,46,51,46,54,50,0,0,0,0],\\\"port\\\":63174,\\\"uid_fingerprint\\\":9189545078772697644,\\\"info\\\":[116,121,112,101,61,115,99,114,97,109,98,108,101,115,117,105,116,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,69,68,67,51,65,65,48,51,70,69,54,69,53,50,66,69,55,55,56,68,68,52,54,70,50,55,68,51,53,56,57,57,51,66,55,65,49,48,65,52,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,83,111,109,101,40,123,34,112,97,115,115,119,111,114,100,34,58,32,34,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,50,51,52,53,54,55,34,125,41,0]}\":[[6,2],[9,0]],\"{\\\"addr\\\":[49,51,52,46,50,48,55,46,50,51,53,46,49,48,53,0],\\\"port\\\":9042,\\\"uid_fingerprint\\\":5838789323103363859,\\\"info\\\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,56,48,55,56,70,57,55,66,50,50,49,53,55,69,66,55,49,54,65,69,66,68,53,54,65,57,52,55,54,67,51,55,56,57,57,65,68,70,54,65,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}\":[[2,2],[5,0]]},\"spares\":[1],\"unallocated_bridges\":[],\"recycleable_keys\":[],\"blocked_keys\":[],\"open_inv_keys\":[[3,2460195],[4,2460195],[5,2460195],[7,2460195],[8,2460195],[9,2460195]],\"date_last_enc\":2460195},\"trustup_migration_table\":{\"table\":{\"7\":6,\"8\":6,\"4\":2,\"9\":6,\"3\":2,\"5\":2},\"migration_type\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},\"blockage_migration_table\":{\"table\":{},\"migration_type\":[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},\"openinv_filter\":{\"seen_table\":[[34,155,156,133,153,119,92,150,172,38,54,150,219,251,139,195,56,83,13,212,134,136,136,104,166,12,221,138,41,4,223,12]]},\"id_filter\":{\"seen_table\":[]},\"inv_id_filter\":{\"seen_table\":[]},\"trust_promotion_filter\":{\"seen_table\":[]}},\"extra_bridges\":[],\"to_be_replaced_bridges\":[]}"; + let test_context: LoxServerContext = serde_json::from_str(&test_string).unwrap(); + lox_db.write_context(test_context); + assert!( + lox_db.db.len() == 1, + "db should have written only one context" + ); + } +} diff --git a/crates/lox-library/src/dup_filter.rs b/crates/lox-library/src/dup_filter.rs index 6f874ba..2bd747a 100644 --- a/crates/lox-library/src/dup_filter.rs +++ b/crates/lox-library/src/dup_filter.rs @@ -4,8 +4,7 @@ This implementation just keeps the table of seen ids in memory, but a production one would of course use a disk-backed database. */ -use std::cmp::Eq; -use std::collections::HashMap; +use std::collections::HashSet; use std::hash::Hash; use serde::{Deserialize, Serialize}; @@ -14,7 +13,7 @@ use serde::{Deserialize, Serialize}; /// seen ids. IdType will typically be Scalar. #[derive(Default, Debug, Serialize, Deserialize)] pub struct DupFilter { - seen_table: HashMap, + seen_table: HashSet, } /// A return type indicating whether the item was fresh (not previously @@ -30,7 +29,7 @@ impl DupFilter { /// to the seen table. Return Seen if it is already in the table, /// Fresh if not. pub fn check(&self, id: &IdType) -> SeenType { - if self.seen_table.contains_key(id) { + if self.seen_table.contains(id) { SeenType::Seen } else { SeenType::Fresh @@ -41,9 +40,9 @@ impl DupFilter { /// table, and add it if not. Return Fresh if it was not already /// in the table, and Seen if it was. pub fn filter(&mut self, id: &IdType) -> SeenType { - match self.seen_table.insert(*id, ()) { - None => SeenType::Fresh, - Some(()) => SeenType::Seen, + match self.seen_table.insert(*id) { + true => SeenType::Fresh, + false => SeenType::Seen, } } } From 5e1a2d8c6d1a7009b7a749873ca1854e5c1c6d2c Mon Sep 17 00:00:00 2001 From: onyinyang Date: Fri, 20 Oct 2023 14:13:21 -0400 Subject: [PATCH 43/59] Fix lox-wasm dependencies --- Cargo.lock | 3 +++ crates/lox-distributor/src/db_handler.rs | 2 +- crates/lox-wasm/Cargo.toml | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index af142ae..cfb312a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -737,8 +737,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] @@ -1089,6 +1091,7 @@ version = "0.1.0" dependencies = [ "chrono", "console_error_panic_hook", + "getrandom 0.2.10", "js-sys", "julianday", "lazy_static", diff --git a/crates/lox-distributor/src/db_handler.rs b/crates/lox-distributor/src/db_handler.rs index 94630f3..133dbd0 100644 --- a/crates/lox-distributor/src/db_handler.rs +++ b/crates/lox-distributor/src/db_handler.rs @@ -133,7 +133,7 @@ mod tests { lox_db.db.is_empty(), "db read from context that shouldn't exist" ); - let test_string = "{\"db\":{\"keypair\":[201,84,79,188,183,80,124,38,24,57,74,101,168,234,97,113,45,2,27,227,236,170,128,86,236,16,167,242,10,166,252,90,4,176,236,14,247,73,94,98,246,65,69,32,32,82,12,127,18,85,244,194,243,248,95,15,35,105,203,156,11,111,19,29],\"pubkey\":[4,176,236,14,247,73,94,98,246,65,69,32,32,82,12,127,18,85,244,194,243,248,95,15,35,105,203,156,11,111,19,29],\"openinv_buckets\":[4,5,9,7,8],\"distributed_buckets\":[3],\"current_k\":1},\"ba\":{\"lox_priv\":{\"x0tilde\":[85,41,72,109,86,46,81,9,210,97,10,49,74,248,36,92,65,58,213,176,216,158,218,104,12,74,2,195,125,21,181,2],\"x\":[[123,196,110,59,160,128,12,49,184,235,21,191,5,211,238,241,140,17,45,124,43,0,132,200,245,60,39,231,171,103,1,1],[128,1,189,179,132,58,53,239,39,140,129,8,248,214,198,30,108,62,192,126,180,213,186,2,122,251,125,209,115,123,62,15],[23,138,233,141,142,126,154,226,142,12,251,164,251,235,56,66,235,183,113,251,33,16,26,201,119,40,206,152,127,72,25,11],[61,94,54,105,111,7,90,98,138,16,180,84,221,166,224,139,241,221,247,49,103,91,79,78,3,241,79,175,62,181,179,7],[120,251,196,223,77,58,205,154,26,78,186,178,178,26,70,203,123,55,136,128,106,95,213,141,119,124,16,40,24,66,193,10],[107,64,82,11,205,92,33,21,141,85,186,19,166,69,198,15,69,18,244,229,212,214,243,124,239,128,153,97,174,221,195,1],[89,185,222,176,72,23,67,104,75,194,113,15,48,236,71,181,122,80,144,167,218,253,41,59,59,248,243,4,191,74,203,9]]},\"lox_pub\":{\"X\":[[124,86,226,73,90,65,51,142,228,106,134,73,243,140,30,66,95,245,111,108,13,103,241,221,222,231,4,202,168,86,75,120],[38,178,246,142,27,106,61,213,8,212,201,114,158,48,91,31,213,139,0,152,157,165,45,220,75,77,34,177,15,158,84,84],[152,36,2,34,71,93,87,173,89,7,250,213,65,242,146,194,137,188,157,123,228,102,85,130,78,34,117,55,113,100,200,101],[182,145,71,159,110,42,203,61,239,214,178,8,120,9,203,90,222,118,207,135,239,125,55,173,99,157,41,246,87,178,198,29],[134,145,250,125,207,137,246,47,213,61,137,28,254,57,36,198,112,81,117,8,126,177,35,72,5,2,175,116,117,7,246,0],[210,51,80,8,26,219,12,108,164,137,122,142,190,146,151,136,8,129,78,2,170,79,174,177,249,235,235,203,94,118,155,53],[12,214,157,115,201,64,215,118,158,108,77,219,253,222,33,248,17,233,225,150,231,193,160,51,21,1,21,109,157,36,28,54]]},\"migration_priv\":{\"x0tilde\":[181,29,215,96,118,231,180,229,98,80,101,106,72,144,19,165,214,253,0,50,245,213,91,27,185,48,159,234,38,205,147,14],\"x\":[[77,128,28,95,123,122,78,104,230,37,172,252,211,32,27,30,215,3,168,49,219,142,72,86,20,108,175,30,155,183,89,15],[131,213,100,130,177,195,196,157,155,94,160,42,146,56,244,21,21,225,217,124,223,129,208,238,72,179,222,1,22,197,80,10],[66,103,172,113,175,41,44,227,83,37,146,206,86,235,5,140,106,166,38,211,84,53,106,135,147,230,251,52,21,251,65,13],[108,44,131,107,94,121,95,238,253,225,133,200,239,190,181,29,95,141,65,201,188,140,162,41,20,49,240,249,160,188,86,8],[42,223,124,126,107,165,159,133,60,253,47,144,95,206,172,211,23,79,188,46,59,236,39,82,217,226,210,0,111,250,79,7]]},\"migration_pub\":{\"X\":[[118,3,198,185,75,234,119,161,104,244,73,220,137,14,215,106,71,172,9,105,43,196,212,8,175,36,231,13,244,150,99,5],[246,175,188,123,108,192,70,27,203,226,226,125,186,253,150,191,86,185,16,217,227,134,197,187,32,181,56,49,59,82,223,85],[106,236,9,177,125,238,13,89,118,20,190,146,180,51,246,198,153,111,55,73,233,53,16,171,145,122,200,97,173,95,49,0],[112,81,204,172,90,70,92,192,153,105,192,40,224,188,26,58,153,9,246,255,76,80,28,245,127,66,123,84,20,150,82,92],[4,67,164,55,135,180,11,122,35,219,138,108,243,185,19,6,147,165,191,82,17,143,254,177,218,101,126,58,80,116,16,54]]},\"migrationkey_priv\":{\"x0tilde\":[241,119,133,223,169,255,180,151,120,139,119,244,42,225,75,147,157,144,176,193,154,66,205,167,190,151,245,25,111,100,175,4],\"x\":[[13,164,109,8,131,170,158,121,184,95,70,236,244,54,248,30,190,152,40,147,143,174,215,76,62,125,59,140,56,46,191,11],[136,13,238,110,70,92,169,61,90,145,38,115,60,100,174,89,25,241,40,155,39,27,25,191,255,101,128,202,54,173,112,3],[138,178,205,1,214,251,19,220,100,169,146,87,169,247,92,135,238,214,176,115,68,248,98,151,249,223,250,127,86,126,12,5]]},\"migrationkey_pub\":{\"X\":[[124,62,91,180,173,88,176,18,50,126,217,90,115,135,56,148,1,192,49,122,145,106,15,41,102,132,104,250,58,171,246,54],[78,125,118,143,92,135,62,105,183,113,216,111,149,180,171,255,34,227,159,7,71,250,55,46,133,49,118,185,118,197,25,89],[78,35,14,23,16,87,161,203,241,129,68,15,113,149,188,78,43,44,6,124,8,241,37,72,206,77,203,95,107,240,212,51]]},\"reachability_priv\":{\"x0tilde\":[117,96,143,255,115,69,103,65,180,11,222,138,12,211,129,70,196,165,32,132,111,234,226,190,115,135,172,116,93,35,139,10],\"x\":[[119,97,187,188,31,54,247,119,178,12,12,107,184,112,163,180,127,41,50,115,88,36,46,241,178,98,38,147,91,139,215,13],[19,243,10,139,50,81,42,247,170,1,180,163,40,123,99,24,97,185,214,254,229,122,92,193,84,125,54,74,203,205,0,4],[215,156,31,28,179,18,140,114,93,90,92,126,47,206,62,79,144,124,215,63,234,118,172,38,75,255,55,215,176,106,108,1]]},\"reachability_pub\":{\"X\":[[84,50,132,41,247,148,208,142,47,191,111,107,107,249,22,184,183,97,242,239,209,107,161,248,237,242,25,247,38,231,65,85],[246,109,19,64,148,150,196,224,215,0,169,198,188,68,79,69,166,189,220,30,64,12,104,115,111,120,17,187,83,238,104,34],[4,55,132,2,213,114,25,101,140,205,249,190,133,60,136,18,151,227,59,104,193,186,158,45,212,128,216,235,165,104,1,50]]},\"invitation_priv\":{\"x0tilde\":[160,223,222,49,99,175,219,242,84,138,200,147,114,241,238,45,206,37,227,94,73,97,31,221,74,53,236,104,106,237,249,11],\"x\":[[115,220,229,104,149,88,90,188,19,134,95,138,124,14,20,46,21,40,29,180,189,230,161,121,167,96,239,154,76,148,155,1],[207,22,84,95,153,117,163,241,162,91,164,42,236,44,66,121,2,163,243,86,232,215,16,190,254,27,131,222,3,118,34,5],[2,3,80,235,190,114,154,191,83,34,55,51,94,31,28,101,96,93,148,91,132,48,166,229,9,186,121,221,141,199,173,15],[90,81,26,185,179,92,173,21,138,226,130,46,25,161,159,107,116,163,5,223,207,248,15,153,236,197,217,160,4,41,68,6],[207,133,200,240,250,195,202,205,125,76,69,62,14,233,171,22,218,147,203,41,114,236,218,149,75,104,115,48,236,233,72,6]]},\"invitation_pub\":{\"X\":[[174,173,72,99,191,209,97,186,7,72,159,230,209,29,82,215,129,206,27,244,114,36,115,14,60,160,193,189,241,115,113,23],[120,197,70,151,188,223,242,200,66,48,54,22,208,252,60,32,233,221,244,35,123,58,58,32,141,17,201,227,120,211,15,44],[52,96,210,153,126,87,72,56,210,157,108,14,237,179,235,160,81,195,92,147,244,54,190,176,55,84,203,238,53,145,248,19],[202,104,118,179,60,207,203,201,191,108,167,127,51,240,120,63,140,191,231,171,93,50,30,24,182,168,213,116,39,239,255,87],[158,22,194,92,254,206,129,69,181,161,240,206,129,234,144,103,229,172,53,28,109,114,24,97,168,64,143,179,70,14,42,69]]},\"bridgedb_pub\":[4,176,236,14,247,73,94,98,246,65,69,32,32,82,12,127,18,85,244,194,243,248,95,15,35,105,203,156,11,111,19,29],\"bridge_table\":{\"counter\":9,\"keys\":{\"2\":[234,125,15,48,43,93,107,32,129,111,101,99,74,171,94,115],\"8\":[37,31,162,20,37,170,152,183,229,227,188,141,11,190,93,81],\"9\":[142,198,20,243,148,87,181,35,76,215,162,102,149,194,20,47],\"5\":[94,127,85,8,145,157,65,81,60,193,214,239,212,222,208,192],\"7\":[253,41,25,218,229,23,96,223,162,65,198,161,93,255,41,204],\"1\":[4,216,218,48,7,174,74,108,19,195,193,104,111,225,227,24],\"3\":[253,81,46,66,147,94,161,254,83,218,184,56,240,178,129,153],\"6\":[28,114,248,173,187,78,104,166,243,182,17,110,24,91,123,97],\"4\":[139,137,67,18,169,40,232,253,97,72,129,245,96,13,102,168]},\"buckets\":{\"8\":[{\"addr\":[50,49,54,46,49,49,55,46,51,46,54,50,0,0,0,0],\"port\":63174,\"uid_fingerprint\":922068108643293997,\"info\":[116,121,112,101,61,115,99,114,97,109,98,108,101,115,117,105,116,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,70,68,56,68,67,55,69,70,57,50,70,49,70,49,52,68,48,48,67,70,57,68,54,70,54,50,57,55,65,51,52,54,56,66,53,57,69,55,48,55,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,83,111,109,101,40,123,34,112,97,115,115,119,111,114,100,34,58,32,34,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,50,51,52,53,54,55,34,125,41,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],\"3\":[{\"addr\":[49,57,53,46,55,50,46,55,52,46,49,49,55,0,0,0],\"port\":28746,\"uid_fingerprint\":8013544061081454931,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,50,57,49,49,48,66,55,68,57,69,57,54,48,65,53,67,52,50,56,52,56,55,55,50,65,70,54,50,52,65,51,66,50,55,65,50,68,69,52,69,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,32,102,108,97,103,115,61,83,111,109,101,40,123,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],\"7\":[{\"addr\":[49,57,49,46,49,56,48,46,49,48,51,46,50,51,54,0],\"port\":50309,\"uid_fingerprint\":17576062521251310994,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,70,68,56,68,67,55,69,70,57,50,70,49,70,49,52,68,48,48,67,70,57,68,54,70,54,50,57,55,65,51,52,54,56,66,53,57,69,55,48,55,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],\"2\":[{\"addr\":[49,57,53,46,55,50,46,55,52,46,49,49,55,0,0,0],\"port\":28746,\"uid_fingerprint\":8013544061081454931,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,50,57,49,49,48,66,55,68,57,69,57,54,48,65,53,67,52,50,56,52,56,55,55,50,65,70,54,50,52,65,51,66,50,55,65,50,68,69,52,69,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,32,102,108,97,103,115,61,83,111,109,101,40,123,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[49,50,56,46,49,51,57,46,52,52,46,49,53,55,0,0],\"port\":10839,\"uid_fingerprint\":16072135124933872676,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,55,67,53,65,51,68,67,53,51,49,48,55,53,53,48,54,65,50,52,52,65,51,67,70,49,57,66,53,55,70,52,68,69,52,55,55,67,65,54,51,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[49,51,52,46,50,48,55,46,50,51,53,46,49,48,53,0],\"port\":9042,\"uid_fingerprint\":5838789323103363859,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,56,48,55,56,70,57,55,66,50,50,49,53,55,69,66,55,49,54,65,69,66,68,53,54,65,57,52,55,54,67,51,55,56,57,57,65,68,70,54,65,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],\"4\":[{\"addr\":[49,50,56,46,49,51,57,46,52,52,46,49,53,55,0,0],\"port\":10839,\"uid_fingerprint\":16072135124933872676,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,55,67,53,65,51,68,67,53,51,49,48,55,53,53,48,54,65,50,52,52,65,51,67,70,49,57,66,53,55,70,52,68,69,52,55,55,67,65,54,51,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],\"9\":[{\"addr\":[50,49,54,46,49,49,55,46,51,46,54,50,0,0,0,0],\"port\":63174,\"uid_fingerprint\":9189545078772697644,\"info\":[116,121,112,101,61,115,99,114,97,109,98,108,101,115,117,105,116,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,69,68,67,51,65,65,48,51,70,69,54,69,53,50,66,69,55,55,56,68,68,52,54,70,50,55,68,51,53,56,57,57,51,66,55,65,49,48,65,52,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,83,111,109,101,40,123,34,112,97,115,115,119,111,114,100,34,58,32,34,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,50,51,52,53,54,55,34,125,41,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],\"5\":[{\"addr\":[49,51,52,46,50,48,55,46,50,51,53,46,49,48,53,0],\"port\":9042,\"uid_fingerprint\":5838789323103363859,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,56,48,55,56,70,57,55,66,50,50,49,53,55,69,66,55,49,54,65,69,66,68,53,54,65,57,52,55,54,67,51,55,56,57,57,65,68,70,54,65,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],\"1\":[{\"addr\":[50,49,50,46,49,54,54,46,49,54,54,46,54,55,0,0],\"port\":32414,\"uid_fingerprint\":3643046579853129326,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,66,48,56,49,49,56,65,56,48,68,55,54,54,66,65,57,65,56,70,57,65,55,50,50,67,50,54,54,49,52,69,48,54,66,56,54,69,52,67,65,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[49,51,50,46,49,56,49,46,49,53,53,46,55,54,0,0],\"port\":55241,\"uid_fingerprint\":4215620865531854407,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,67,66,70,56,51,51,51,49,54,53,70,49,67,51,53,65,68,70,48,54,66,70,52,50,53,49,48,52,69,56,51,51,65,68,68,65,49,54,53,66,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,32,102,108,97,103,115,61,83,111,109,101,40,123,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[49,53,54,46,55,50,46,50,49,57,46,52,57,0,0,0],\"port\":56030,\"uid_fingerprint\":8564141605929456761,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,68,56,66,67,67,48,69,67,70,69,50,67,57,54,53,65,66,67,50,57,67,54,50,55,70,68,67,69,67,48,66,48,54,67,53,65,68,66,49,54,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],\"6\":[{\"addr\":[49,57,49,46,49,56,48,46,49,48,51,46,50,51,54,0],\"port\":50309,\"uid_fingerprint\":17576062521251310994,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,70,68,56,68,67,55,69,70,57,50,70,49,70,49,52,68,48,48,67,70,57,68,54,70,54,50,57,55,65,51,52,54,56,66,53,57,69,55,48,55,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[50,49,54,46,49,49,55,46,51,46,54,50,0,0,0,0],\"port\":63174,\"uid_fingerprint\":922068108643293997,\"info\":[116,121,112,101,61,115,99,114,97,109,98,108,101,115,117,105,116,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,70,68,56,68,67,55,69,70,57,50,70,49,70,49,52,68,48,48,67,70,57,68,54,70,54,50,57,55,65,51,52,54,56,66,53,57,69,55,48,55,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,83,111,109,101,40,123,34,112,97,115,115,119,111,114,100,34,58,32,34,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,50,51,52,53,54,55,34,125,41,0]},{\"addr\":[50,49,54,46,49,49,55,46,51,46,54,50,0,0,0,0],\"port\":63174,\"uid_fingerprint\":9189545078772697644,\"info\":[116,121,112,101,61,115,99,114,97,109,98,108,101,115,117,105,116,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,69,68,67,51,65,65,48,51,70,69,54,69,53,50,66,69,55,55,56,68,68,52,54,70,50,55,68,51,53,56,57,57,51,66,55,65,49,48,65,52,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,83,111,109,101,40,123,34,112,97,115,115,119,111,114,100,34,58,32,34,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,50,51,52,53,54,55,34,125,41,0]}]},\"encbuckets\":{\"4\":[243,219,179,57,84,182,40,215,251,37,203,204,99,245,55,82,26,47,170,128,85,194,171,108,79,73,178,160,48,41,178,118,20,198,82,162,99,91,229,66,254,152,22,109,194,79,223,116,188,96,129,98,218,76,209,69,21,11,137,109,125,187,195,203,229,202,93,69,16,167,98,206,228,205,41,169,234,20,253,164,110,3,127,84,162,112,204,99,7,27,64,225,42,137,155,12,141,140,129,8,47,83,47,91,116,110,211,171,108,247,100,73,11,203,200,49,110,219,197,36,220,210,84,167,104,229,209,178,223,243,106,195,242,156,224,120,206,105,113,74,113,114,75,58,29,155,27,159,226,201,113,12,187,246,246,55,81,137,41,81,114,255,230,159,77,14,143,152,255,63,186,59,42,243,189,136,127,186,125,95,116,2,20,80,185,56,192,97,30,32,252,114,158,112,77,212,76,77,138,124,249,201,104,22,66,124,199,75,96,40,9,241,79,152,69,211,155,203,84,101,251,94,120,212,64,41,144,111,127,76,32,233,225,196,182,57,178,39,234,185,41,137,111,135,36,40,3,200,107,72,63,198,102,206,22,147,114,116,77,165,221,176,126,202,77,228,186,2,153,58,115,187,35,128,99,251,209,27,52,70,58,185,196,39,29,228,232,137,107,165,239,185,63,190,194,62,58,233,224,161,247,181,110,148,166,167,31,107,198,227,199,248,221,135,150,80,128,253,53,239,65,15,244,184,108,155,8,135,220,182,140,130,240,200,206,109,218,134,69,15,55,18,43,164,137,9,19,69,21,73,121,164,160,119,98,188,128,95,76,177,215,135,80,0,208,97,74,173,194,147,175,145,200,239,47,236,148,10,145,152,20,13,99,48,1,168,227,115,175,10,160,86,139,21,63,115,147,16,72,181,16,17,103,184,18,182,177,28,13,210,221,163,31,36,181,108,163,73,60,7,11,219,35,195,136,51,168,65,99,193,226,108,76,20,178,211,138,12,50,67,24,23,118,34,251,38,142,4,47,140,177,158,115,17,99,112,33,165,182,49,17,27,200,56,83,18,84,159,248,128,103,28,87,222,167,184,61,54,44,24,7,78,60,254,60,133,139,45,4,189,100,240,236,9,27,209,235,193,123,51,1,224,192,43,171,119,31,147,134,222,75,222,175,158,97,84,151,252,94,234,111,234,174,58,34,155,97,224,118,119,107,56,174,248,235,20,25,74,180,167,235,59,70,134,181,52,169,123,84,12,244,139,44,127,227,16,66,32,101,246,219,146,162,220,91,142,100,196,25,106,235,16,121,82,44,179,15,137,136,203,172,221,245,15,9,48,225,0,63,73,198,205,35,129,244,222,131,168,136,90,133,216,77,180,110,125,77,78,205,116,60,120,181,62,170,75,17,159,203,233,83,0,180,20,148,222,236,232,142,143,59,106,56,183,133,106,240,132,247,70,71,208,96,0,127,76,141,139,15,143,231,95,224,171,112,168,141,85,9,76,50,234,3,179,76,155,188,52,56,158,80,103,191,226,204,134,83,110,1,173,105,52,213,233,226,26,92,21,186,154,47,43,62,220,89,19,74,254,191,42,205,121,146,171,171,226,110,50,225,199,200,148,13,49,80,31,209,159,242,83,44,207,7,6,140,222,82,164,91,116,155,1,72,179,82,133,214,6,110,20,110,52,102,102,183,171,179,227,244,111,80,161,50,66,61,122,51,7,82,77,185,156,53,136,173,132,200,156,137,227,31,71,231,143,88,220,216,200,96,37,94,36,100,150,136,22,90,223,130,36,91,69,210,241,141,146,78,52,180,87,3,66,110,34,67,203,2,122,148,237,219,210,83,190,41,230,112,157,206,53,173,131,81,147,99,172,139,232,106,200,46,39,88,63,155,187,214,183,33,63,109,180,157,56,53,32,166,217,45,88,155,112,116,58,36,195,57,5,47,212,72,25,204,148,99,212,192,20,164,68,250,17,14,86,204,58,142,33,178,217,37,153,76,94,215,84,176,180,237,132,44,89,121,192,233,209,179,226,242,239,54,229,0,80,78,93,209,162,143,169,144,189,153,236,17,196,120,91,169,143,120,186,105,246,170,67,151,22,105,91,53,202,84,220,67,78,172,26,189,198,63,134,196,236,106,251,220,151,96,86,23,98,79,115,3,73,152,115,184,116,66,223,109,175,217,253,194,180,166,148,36,246,60,3,174,193,139,86,208,169,194,105,215,106,105,172,83,147,12,185,249,151,241,107,182,164],\"7\":[121,116,166,201,156,46,185,47,24,40,165,223,229,251,190,116,128,130,33,81,2,157,253,153,154,74,232,248,187,174,231,135,184,149,226,227,156,41,28,164,243,190,172,24,41,215,93,207,173,52,151,5,10,176,166,217,37,136,199,3,20,4,175,115,184,48,222,208,198,87,221,183,16,136,98,187,176,248,38,192,127,187,241,110,131,41,27,7,142,121,88,226,177,134,18,55,185,212,220,3,97,4,109,200,0,74,234,152,102,131,204,54,56,66,112,157,152,93,136,51,230,214,213,25,30,152,20,132,80,98,74,184,48,218,62,169,99,81,41,150,127,145,38,199,159,117,9,30,111,156,249,48,136,112,190,158,237,242,135,131,144,45,164,249,224,132,4,61,156,237,51,247,214,114,217,91,241,65,253,197,12,174,59,248,2,178,149,31,177,46,131,45,69,65,204,187,50,214,131,138,192,95,96,128,15,13,42,85,23,185,73,144,94,167,211,102,67,79,97,112,9,155,28,176,249,141,145,51,113,72,174,106,105,44,117,9,17,251,22,224,68,180,188,19,214,202,215,157,135,55,188,173,124,92,85,195,116,14,75,94,96,19,208,8,250,61,62,54,228,122,152,30,113,185,123,125,120,6,171,5,185,185,210,52,24,120,17,48,87,42,146,195,226,134,113,63,195,116,161,21,94,102,40,248,134,172,97,117,40,229,153,170,58,78,207,62,255,139,175,77,199,228,28,159,186,231,80,142,199,7,35,161,74,215,63,249,2,3,185,41,7,97,224,252,2,160,217,97,208,17,20,141,247,31,125,2,145,235,2,158,203,110,69,151,39,9,110,101,212,205,73,70,65,170,114,202,169,94,226,118,212,30,52,205,122,244,48,123,97,11,94,149,70,205,183,111,183,141,213,110,93,167,99,195,173,203,79,53,55,2,58,171,220,188,224,173,20,106,114,34,81,179,210,86,48,9,51,237,134,154,209,66,79,164,140,38,151,49,69,205,188,255,64,233,124,84,229,200,83,109,238,79,135,33,41,92,156,108,193,177,1,150,116,242,203,126,159,224,32,12,214,205,138,139,51,52,149,136,99,11,42,250,32,53,131,117,146,163,152,122,77,250,8,10,144,178,95,126,237,230,188,64,128,254,198,45,91,46,19,177,217,179,140,5,156,150,207,72,42,202,66,35,245,44,254,49,80,113,228,236,8,160,78,141,159,235,242,161,49,215,18,49,40,123,211,173,51,181,206,55,149,46,74,220,219,156,92,229,255,69,52,39,109,55,253,80,97,231,186,119,161,23,163,135,20,89,224,177,187,78,226,171,222,80,231,206,246,175,68,214,12,229,172,131,2,98,125,40,165,163,209,23,191,86,112,188,229,86,126,180,27,118,119,219,24,7,124,100,238,129,147,83,115,148,50,186,227,27,132,38,84,127,203,52,177,119,230,170,54,224,27,106,91,138,52,173,151,126,0,140,17,238,38,128,12,120,114,10,127,45,168,2,45,8,191,185,48,137,126,187,146,42,123,122,63,53,230,69,5,0,225,24,210,176,218,86,138,141,191,236,19,87,228,170,106,5,53,142,235,186,172,17,50,70,60,221,45,188,172,33,103,7,112,181,147,149,215,47,160,181,167,229,198,98,142,199,171,226,119,148,50,130,159,44,21,78,117,162,114,56,249,52,39,65,242,27,164,248,114,102,46,98,249,15,222,13,42,170,173,230,99,50,242,166,63,69,162,218,217,210,135,20,229,91,141,29,28,22,222,225,212,219,188,123,87,96,161,36,34,5,77,7,55,39,52,212,195,205,66,16,3,20,7,199,206,120,12,158,223,215,65,47,76,87,173,255,142,70,83,153,189,81,24,23,211,54,103,19,25,146,75,127,252,234,132,102,138,184,79,189,253,103,60,180,12,179,49,135,105,53,180,139,42,158,171,38,12,108,18,51,198,125,243,60,44,108,182,189,127,101,101,56,82,207,224,133,71,75,227,11,227,52,146,93,229,164,36,146,247,168,102,150,115,239,124,188,189,241,172,50,250,140,156,223,125,36,248,106,68,220,24,147,126,101,36,244,34,108,157,252,72,57,130,15,70,7,3,111,149,71,61,214,243,102,201,93,127,121,110,203,115,209,219,149,109,68,177,76,31,156,9,253,161,64,236,155,179,235,127,247,209,121,160,209,175,254,206,39,7,14,119,81,35,239,232,125,81,98,85,222,79,195,26,44,142,210,155,90,68,74,52,41,11,148,102,27],\"6\":[244,11,101,22,78,170,71,140,99,116,217,44,131,218,253,82,90,97,68,119,33,138,170,25,164,190,131,162,170,130,3,115,91,101,207,203,27,103,99,248,246,203,7,214,173,158,5,215,199,207,161,55,192,114,167,194,205,252,80,76,161,125,10,92,4,247,32,164,73,105,221,40,138,56,166,126,231,204,121,157,253,200,142,239,212,137,173,73,218,19,66,60,61,176,141,89,224,119,3,4,36,142,4,196,171,46,175,142,137,245,239,137,71,161,111,63,83,144,208,234,84,80,130,63,187,102,192,102,249,30,74,27,68,35,15,147,199,67,118,57,187,187,48,205,198,34,147,0,55,119,146,202,227,70,68,159,176,148,248,249,1,185,134,153,178,42,132,57,165,76,230,15,182,29,201,23,201,5,15,29,4,52,19,246,224,218,120,175,76,240,32,211,180,222,185,158,217,252,238,226,216,177,246,113,69,185,93,84,143,239,179,205,26,248,166,7,17,236,57,88,49,192,147,28,40,34,190,53,87,4,208,237,209,69,68,86,231,185,11,27,255,118,64,250,123,183,49,211,48,146,59,37,46,199,114,234,143,148,165,232,93,126,9,31,42,92,241,8,221,191,41,107,150,220,236,234,239,170,13,4,215,99,10,153,34,81,23,27,102,47,246,83,135,198,49,231,105,117,209,21,17,167,46,151,250,192,150,231,234,33,53,143,139,160,219,172,41,144,120,149,36,190,92,177,23,33,209,157,229,181,102,118,74,38,11,152,232,43,121,20,72,204,40,251,107,239,224,211,120,85,229,22,232,155,92,146,181,112,61,181,213,10,51,52,91,159,160,162,176,170,64,132,50,203,67,231,148,254,52,103,156,133,5,175,181,71,34,49,78,141,15,163,150,151,132,195,149,49,110,61,95,239,79,82,78,147,210,246,106,102,107,195,107,225,219,115,169,18,10,203,213,180,134,146,227,164,213,190,180,11,193,4,44,56,182,101,238,176,224,193,69,71,169,223,23,1,17,12,20,80,137,61,214,238,145,85,115,156,125,176,84,157,171,60,4,177,54,190,219,178,182,25,65,206,253,14,117,110,196,196,29,44,54,131,128,76,77,165,133,61,239,175,25,244,180,143,235,110,182,117,86,215,253,226,252,211,107,81,74,184,192,211,95,95,38,163,23,47,246,216,138,87,237,108,11,143,177,111,199,133,161,144,9,114,53,208,41,13,28,139,234,198,210,206,204,184,126,118,96,253,182,253,247,231,213,160,117,255,198,116,94,153,119,34,18,91,40,95,65,176,215,1,115,105,166,73,58,230,136,204,30,109,134,64,249,92,207,138,170,115,56,40,20,215,175,39,105,237,224,63,233,250,186,89,118,227,118,47,176,21,194,207,245,182,78,158,31,237,77,145,111,24,66,228,5,38,218,184,91,25,193,153,90,233,8,224,127,102,37,135,198,206,102,253,224,193,243,100,59,182,146,206,185,168,69,101,201,160,237,192,33,246,202,119,49,33,33,75,244,255,142,145,49,235,108,246,211,166,87,5,21,104,239,95,104,195,15,31,130,58,32,172,118,159,3,166,35,48,126,88,51,226,194,173,130,76,249,36,244,43,120,3,1,40,219,39,208,119,235,178,252,48,159,144,157,36,243,196,9,33,118,79,178,119,232,28,160,132,35,81,244,209,96,168,146,133,206,161,103,120,138,133,254,96,103,139,19,29,213,190,153,69,217,164,26,64,163,51,232,144,78,167,113,209,72,47,230,111,183,79,97,178,67,96,105,255,17,155,89,106,42,1,75,4,21,87,82,43,82,105,74,65,100,165,92,203,73,37,31,196,189,11,142,81,26,119,148,198,148,211,97,4,36,34,12,63,209,12,49,175,224,199,90,3,70,250,241,252,248,142,231,149,240,220,183,27,214,28,9,154,15,187,205,190,222,28,172,80,198,88,110,60,2,239,88,63,222,110,47,203,23,96,215,58,188,150,14,221,231,191,170,106,183,227,146,136,132,54,173,126,155,231,45,167,101,0,110,97,121,3,169,62,82,250,125,246,32,32,94,35,215,115,123,1,66,39,205,26,145,248,249,190,162,133,10,239,105,172,31,185,122,2,161,244,90,37,56,204,249,210,94,110,9,106,71,189,149,37,247,18,209,3,4,36,50,13,159,227,253,5,215,15,86,66,171,214,67,12,22,54,132,69,9,255,47,113,75,152,137,29,21,240,144,127,35,186,150,3,66,213,153,77,109,154,142,210],\"5\":[233,196,158,255,98,84,122,36,218,215,121,163,96,106,42,88,230,167,14,88,179,219,50,169,25,90,3,145,244,37,23,242,225,67,131,245,126,150,236,250,28,245,185,107,7,131,111,93,225,78,186,159,39,191,187,218,192,164,9,120,45,193,155,75,198,116,203,52,233,122,253,76,21,94,26,159,69,197,235,231,185,49,184,7,190,41,190,9,96,34,67,18,205,120,50,81,16,52,238,13,173,27,134,22,9,63,238,163,64,35,207,37,123,66,114,186,180,47,172,31,121,231,196,120,160,82,198,254,20,99,103,102,197,70,162,72,65,158,175,191,145,13,62,108,92,195,56,168,121,109,24,233,67,231,116,49,140,242,20,126,200,100,90,239,183,139,250,6,157,223,92,203,174,49,50,126,91,10,154,70,34,149,153,82,45,14,15,99,140,71,103,168,208,121,58,253,203,23,150,146,156,243,98,202,111,129,67,203,126,198,188,209,3,170,64,242,91,19,253,236,157,35,134,212,5,235,118,48,90,178,198,46,89,139,64,236,253,13,171,40,68,165,104,2,97,6,33,137,150,11,43,161,21,189,202,98,98,95,204,124,82,80,199,101,163,168,181,160,148,232,178,32,216,99,17,145,198,154,147,194,20,31,144,190,235,132,158,218,7,80,131,97,123,158,16,220,202,226,177,139,112,10,108,97,150,214,70,26,190,107,190,57,214,236,29,184,24,84,204,35,67,89,155,81,135,229,19,201,82,125,68,29,217,216,175,198,194,9,95,178,152,194,34,25,19,241,213,234,60,13,139,148,238,184,10,208,78,59,174,93,216,193,244,59,165,90,146,163,207,101,60,145,21,74,123,24,227,106,239,56,50,176,35,250,74,170,255,98,15,135,52,38,30,64,158,174,195,136,153,97,69,135,31,80,14,170,44,137,83,107,66,4,42,141,78,66,153,157,35,147,245,234,103,125,191,71,225,223,215,190,220,47,62,12,178,85,199,110,133,111,214,36,179,132,17,152,62,6,31,198,251,9,77,53,168,106,91,80,215,57,94,31,52,194,159,175,214,122,155,173,2,225,24,228,207,71,69,115,66,86,205,0,228,101,83,111,7,249,214,124,42,204,250,209,121,170,138,122,185,112,151,131,132,121,105,175,23,117,197,191,134,153,224,130,48,239,49,228,69,186,50,242,55,112,193,149,98,1,156,92,167,235,114,195,58,55,32,158,168,245,56,164,109,172,74,154,89,193,183,63,60,243,64,139,202,56,132,240,211,80,135,88,230,66,4,234,199,220,49,184,201,108,68,36,176,101,88,62,83,250,22,247,25,29,158,228,222,72,149,121,170,4,119,25,124,211,208,135,19,197,182,130,153,158,231,247,42,163,164,217,47,45,30,221,139,58,197,102,155,60,39,71,234,18,53,204,165,77,247,169,119,146,31,108,39,92,167,104,27,110,98,70,174,78,151,239,225,145,15,153,12,158,95,214,8,53,244,237,42,143,51,168,5,153,182,96,26,143,193,106,197,163,79,91,48,142,197,51,179,139,12,238,16,106,184,99,225,208,35,141,109,31,7,27,223,198,156,118,93,114,111,25,178,122,38,49,160,19,45,165,203,94,64,249,72,108,254,166,184,200,14,144,180,74,128,245,8,20,29,119,34,85,174,126,248,186,142,24,160,60,22,142,38,97,98,243,222,69,126,46,66,215,40,61,77,216,165,5,178,45,21,29,159,4,91,168,11,244,253,72,240,86,199,154,137,5,75,127,5,148,120,50,26,105,70,96,248,170,127,31,98,158,20,113,111,142,234,53,247,191,168,226,194,54,214,202,175,216,122,131,2,218,73,208,69,227,142,15,158,30,197,233,191,69,5,255,237,78,64,82,35,145,202,24,134,131,183,31,87,213,246,158,74,122,251,36,5,116,138,224,182,80,18,95,80,45,222,28,104,205,8,151,189,138,243,14,90,204,108,30,160,203,119,6,148,38,252,155,6,134,48,204,60,48,141,198,64,14,227,243,87,99,246,99,172,195,36,212,195,50,43,109,49,184,210,36,79,46,115,75,42,116,80,125,222,207,83,206,53,88,225,239,138,185,223,1,109,122,34,64,195,224,188,33,84,250,151,83,165,160,106,59,117,117,39,71,255,10,28,180,224,201,4,19,213,182,248,112,170,75,200,207,123,70,132,248,59,46,202,106,8,142,240,84,250,167,189,142,191,223,10,215,83,115,32,124,30,238,155,171,212,166,186,239,117,141],\"9\":[92,82,84,153,8,228,93,80,116,15,126,28,55,66,233,244,9,42,69,236,27,101,144,6,213,241,217,101,175,6,159,83,171,242,191,19,169,57,97,30,24,251,103,12,69,245,37,79,108,206,155,78,101,218,30,45,86,219,245,198,108,133,192,255,130,76,85,34,8,191,27,27,72,24,10,172,27,62,25,53,57,22,247,7,101,241,70,53,207,233,166,88,90,136,232,18,13,9,230,153,205,91,17,47,239,17,178,242,91,235,165,160,57,15,247,204,39,237,64,220,15,66,84,161,119,238,146,105,46,81,47,171,147,238,81,192,190,161,147,42,137,106,178,222,150,138,76,144,177,41,142,84,159,140,175,143,28,223,101,182,18,252,42,126,6,108,48,162,133,106,104,150,43,138,121,206,143,50,167,227,146,67,38,106,109,25,50,56,21,174,79,158,116,226,29,147,228,128,195,13,106,14,8,64,209,68,6,72,56,21,212,175,108,162,210,236,4,255,130,25,167,58,185,126,123,58,141,237,188,43,133,60,138,183,197,37,127,215,0,1,48,54,64,114,235,52,183,245,228,29,20,130,226,68,76,4,146,200,94,206,148,224,106,3,92,242,243,6,202,52,165,171,34,22,8,195,162,213,39,167,119,54,119,66,99,227,237,26,180,26,9,4,78,123,152,153,253,42,20,58,224,170,80,110,191,196,215,84,224,168,150,49,4,63,125,11,224,88,74,196,108,89,29,165,244,26,39,104,129,168,210,30,52,80,187,244,54,211,190,216,34,24,108,47,92,88,213,227,22,123,79,191,154,61,120,114,176,101,94,67,113,232,110,88,125,140,69,136,62,101,109,126,133,198,234,150,253,205,37,189,145,16,168,98,211,195,89,67,119,11,30,39,39,51,222,153,200,174,76,181,215,218,97,48,83,208,124,198,170,45,82,65,252,236,104,201,104,218,66,221,155,57,111,211,251,78,140,38,209,174,25,154,85,101,29,8,153,35,119,210,145,249,58,195,141,252,204,104,213,173,205,48,52,215,167,210,27,32,93,15,105,4,52,174,214,87,109,97,213,82,166,74,57,188,145,148,135,93,187,195,129,23,227,197,111,113,158,210,86,167,38,118,165,235,126,97,136,143,10,14,76,202,176,219,132,58,247,219,6,206,127,243,193,155,90,213,106,134,170,223,98,108,79,26,156,115,1,196,81,6,90,245,219,23,172,37,247,213,185,129,177,138,144,251,29,162,112,27,97,11,145,183,191,214,198,140,133,116,94,180,92,68,86,226,235,36,122,153,207,85,69,42,30,60,199,59,232,244,67,29,124,106,174,236,232,77,227,206,35,239,141,125,211,103,239,193,232,171,193,209,179,93,27,39,148,104,178,118,129,151,124,209,244,180,9,82,43,255,64,227,151,246,175,250,238,92,4,91,173,253,119,45,176,157,230,53,112,43,57,133,95,90,120,27,129,161,13,178,196,23,216,243,17,31,25,95,124,173,41,188,93,25,69,62,6,80,211,206,87,228,68,86,238,6,135,80,156,212,113,124,131,120,79,29,70,250,213,235,53,131,22,189,103,176,254,153,231,65,70,85,41,66,130,205,151,240,138,224,144,214,15,20,251,235,250,55,124,157,227,121,108,23,119,60,195,241,112,123,207,236,147,86,226,45,74,186,186,32,2,66,251,56,154,151,227,78,140,207,145,159,115,0,207,147,2,35,165,181,199,128,187,202,25,229,146,177,153,86,131,130,236,35,192,227,26,142,235,131,53,85,40,91,85,218,11,97,153,224,12,137,151,214,116,147,223,5,64,253,78,16,75,132,237,25,74,69,249,246,81,36,122,246,209,245,176,240,29,188,64,155,97,29,58,200,90,254,171,179,88,175,85,253,115,238,111,7,101,7,236,212,48,241,217,17,106,134,37,100,232,85,92,15,31,66,118,17,98,71,181,210,253,197,34,144,228,60,77,167,91,187,140,17,248,248,199,103,92,20,240,196,139,239,4,230,191,154,159,232,220,80,44,65,232,118,77,255,126,237,23,112,70,29,99,30,68,95,134,123,238,248,158,50,99,87,46,113,184,116,17,233,69,187,188,209,139,218,217,20,106,240,255,198,84,42,23,159,146,118,82,55,130,228,19,62,128,4,223,219,97,96,252,30,136,95,163,221,117,76,53,55,219,170,141,121,49,191,81,145,8,134,251,242,82,201,128,32,89,226,191,104,187,133,161,209,49,11,124,238,249,215,77,165,250,212,0,111],\"2\":[39,26,40,155,207,170,15,166,186,15,65,98,28,37,104,74,15,50,185,112,129,178,58,207,160,21,134,44,134,184,190,242,198,111,251,71,182,133,249,86,245,76,231,191,158,198,177,137,32,38,35,207,3,35,252,107,96,193,73,154,254,227,209,10,75,42,80,61,119,103,32,88,132,109,136,91,236,235,120,62,128,255,14,128,4,33,225,196,76,1,90,251,145,11,18,79,230,109,255,56,255,134,53,88,182,166,68,226,242,132,95,253,188,206,242,16,221,38,184,90,33,21,73,58,229,80,214,58,73,68,147,81,191,6,183,227,162,107,31,7,1,115,149,250,150,7,33,94,25,250,34,34,152,23,21,45,88,107,120,34,141,121,33,27,69,210,51,83,116,71,248,237,225,182,52,58,142,85,5,64,234,68,124,214,103,188,20,198,35,171,220,188,8,19,117,84,112,108,21,73,129,58,172,87,111,92,189,143,163,82,47,23,90,31,243,189,94,99,7,218,175,189,255,0,231,196,150,141,12,80,115,115,1,16,15,39,145,68,88,243,22,12,156,116,13,84,180,186,228,80,71,213,130,1,146,208,32,252,196,127,234,49,103,147,91,35,30,209,157,59,150,177,116,91,97,170,101,187,168,190,87,109,20,98,114,166,87,179,209,211,87,179,227,123,51,45,182,54,65,217,109,91,12,99,135,114,225,93,141,180,71,66,79,138,135,77,31,85,18,35,0,151,148,191,125,51,105,2,248,0,60,232,178,149,72,111,71,26,249,143,0,164,165,45,112,227,9,217,20,223,235,55,230,184,163,188,165,26,18,60,204,56,208,213,30,217,77,51,239,139,103,15,241,135,85,88,165,237,96,60,28,216,129,87,229,74,187,130,149,17,169,31,242,130,199,84,219,224,95,49,177,152,160,176,113,112,142,61,5,252,240,205,55,130,87,242,0,69,149,179,116,255,64,135,93,113,109,36,220,100,230,50,185,29,180,202,221,63,192,149,227,82,194,231,79,189,150,146,64,50,132,197,198,233,64,126,78,210,204,57,21,134,102,12,61,210,251,144,47,26,42,96,195,199,246,24,243,219,72,43,176,165,35,130,243,10,161,8,242,20,209,35,39,10,205,13,172,76,182,231,90,106,145,78,254,140,183,152,169,62,159,210,88,42,217,41,196,187,247,173,126,11,174,41,231,95,124,129,29,41,139,179,174,219,112,133,134,225,127,150,10,222,244,133,115,18,36,21,241,136,105,95,193,244,2,56,36,160,61,5,240,51,73,92,6,235,164,221,23,194,130,16,248,249,224,250,205,103,148,154,104,75,195,146,181,193,56,185,229,231,139,58,65,204,38,60,232,39,7,116,118,115,40,195,138,208,77,145,92,245,248,229,212,138,253,76,115,75,15,105,190,88,21,183,53,210,77,3,10,122,133,176,194,117,109,52,177,113,130,172,143,177,19,205,157,110,2,236,22,68,160,255,212,186,168,175,225,145,200,112,110,212,233,16,117,88,170,81,159,73,112,161,193,9,34,206,155,243,155,181,197,111,149,55,82,230,103,74,65,187,134,25,106,131,163,194,80,193,79,186,173,201,205,196,160,53,203,136,151,110,52,53,217,100,173,34,0,54,167,148,239,166,21,241,77,37,70,122,93,139,196,244,34,30,227,95,200,21,80,223,169,255,247,55,23,99,87,120,45,140,5,145,100,134,98,27,219,38,148,134,159,165,252,81,134,127,161,148,145,245,156,60,128,172,136,54,10,98,115,202,14,231,101,27,178,40,230,120,11,190,82,201,13,188,254,243,240,85,193,76,210,248,8,49,246,191,13,150,89,38,36,13,63,183,6,45,215,76,122,168,98,2,62,153,136,35,63,250,213,126,214,20,139,90,232,97,251,5,226,1,228,206,232,246,4,243,228,138,219,151,234,82,162,103,22,95,136,162,174,146,56,88,57,10,235,119,158,177,17,194,88,92,198,136,88,45,236,72,33,43,25,208,13,105,90,43,226,236,167,56,73,164,151,94,106,187,62,97,123,230,230,104,163,205,6,22,1,230,69,249,246,181,121,209,98,152,223,224,233,251,208,127,123,106,39,149,161,161,136,171,118,38,224,50,122,135,223,194,233,108,48,247,242,73,180,75,47,154,10,237,243,43,207,186,200,0,105,199,58,83,13,195,65,246,26,218,254,32,47,86,105,30,175,120,73,59,248,44,214,52,107,47,232,250,124,227,122,4,248,27,197,25,167,116,140,147],\"1\":[119,213,100,52,177,0,161,84,252,204,52,125,174,105,85,152,53,191,113,187,76,139,212,167,79,12,251,221,244,29,66,95,235,10,252,39,46,210,253,66,16,61,115,176,135,129,230,71,4,23,226,92,239,68,245,244,56,92,208,135,232,53,90,42,65,35,249,192,196,65,240,9,142,39,43,116,45,192,206,6,100,22,175,62,91,153,33,218,210,102,59,49,242,147,82,174,113,61,93,229,174,133,95,23,80,70,119,146,45,43,115,254,228,79,68,54,31,237,137,240,177,0,220,82,238,87,205,76,60,215,246,39,199,43,90,111,77,130,172,229,125,135,252,238,123,58,47,61,134,215,35,45,245,29,151,147,158,166,224,134,7,26,255,93,47,98,169,61,97,152,157,84,42,13,89,181,143,120,63,93,252,79,147,152,100,214,85,139,0,90,46,12,246,161,0,12,109,240,153,222,77,218,88,103,65,117,52,127,29,94,157,29,74,252,184,220,106,77,117,106,122,90,11,223,239,112,28,131,84,180,103,180,76,202,185,95,101,117,161,10,14,15,20,175,11,44,114,95,215,97,58,129,140,172,92,82,227,149,172,153,72,9,66,164,158,158,33,193,173,190,14,12,72,56,183,56,105,99,121,170,16,145,26,50,254,241,159,130,22,12,63,157,218,91,67,247,220,142,101,100,103,214,199,2,142,176,213,127,2,138,225,28,205,131,219,64,1,59,124,160,201,18,145,19,232,90,118,87,187,193,82,193,178,101,131,176,167,8,17,69,37,41,56,86,58,220,76,18,7,187,179,2,3,4,143,250,33,82,100,190,120,172,72,217,6,5,3,241,39,240,173,220,196,227,158,30,205,170,247,5,119,174,68,129,82,0,236,9,40,89,76,143,179,219,75,192,152,131,159,213,37,181,59,105,37,249,46,142,51,232,109,246,123,232,162,167,226,11,230,109,232,102,176,246,125,206,74,214,149,192,157,240,35,229,86,94,160,3,3,248,3,196,223,124,35,111,95,246,105,74,118,125,181,180,151,141,182,239,49,141,48,57,224,98,236,182,223,73,240,143,15,20,194,168,118,251,190,233,87,85,64,204,70,131,193,174,128,22,83,47,78,61,172,223,36,81,115,102,35,206,105,159,242,98,54,200,135,135,67,6,241,150,35,26,71,221,176,119,39,144,67,77,241,156,201,102,142,140,142,205,4,136,135,186,40,118,70,60,43,242,147,200,250,229,119,118,95,191,36,39,159,211,57,58,116,168,247,229,124,221,104,32,242,1,65,182,103,165,52,218,111,108,206,49,218,217,120,116,161,214,210,243,3,73,176,166,93,138,250,128,97,9,168,133,155,45,34,38,138,145,5,172,236,164,66,150,173,100,200,239,70,79,60,27,193,244,56,94,121,47,250,36,242,249,184,185,74,105,133,220,28,45,54,155,6,176,75,109,22,252,54,73,71,22,1,127,233,166,207,77,35,203,130,105,36,33,21,24,46,82,84,135,127,8,27,188,198,223,204,117,147,183,151,138,140,179,44,228,111,58,38,144,118,216,95,207,11,140,108,70,52,81,5,119,113,118,81,240,106,154,252,150,37,149,30,183,225,112,8,12,143,190,148,107,174,238,19,85,130,125,224,69,159,18,139,143,138,155,45,13,60,93,25,108,72,17,128,122,51,255,18,177,247,34,205,152,242,31,63,98,128,69,210,105,206,84,121,21,112,128,22,12,65,213,10,154,220,242,70,158,167,34,210,230,92,206,83,168,244,185,130,7,204,244,10,67,74,78,110,247,224,48,122,169,208,143,18,81,98,224,38,210,101,164,48,189,116,22,39,152,84,119,148,38,163,17,78,105,23,175,73,163,173,43,22,225,120,165,99,88,158,222,178,239,197,135,239,203,42,207,43,173,72,197,217,60,231,104,241,179,144,52,231,135,82,201,198,105,118,223,206,56,8,207,73,71,50,239,39,220,165,49,115,253,39,2,77,81,37,175,156,55,232,91,128,0,83,222,17,183,160,63,179,61,178,236,41,244,161,173,85,165,157,133,4,172,143,24,11,161,212,194,17,3,31,105,101,9,117,190,155,224,116,116,107,181,181,255,1,60,47,165,72,79,85,214,153,204,214,81,52,119,63,153,34,170,223,232,89,114,142,216,138,187,252,194,181,32,83,66,93,122,39,156,96,23,44,96,153,55,113,172,221,63,133,17,63,231,47,166,198,56,231,236,116,76,39,232,125,229,215,63,83,38,62,53],\"3\":[49,117,129,233,104,116,154,224,25,5,12,234,130,105,252,125,25,187,232,174,167,29,60,207,168,89,150,40,211,149,160,173,17,149,213,186,239,170,163,221,195,215,202,11,191,77,37,205,73,80,223,114,176,32,60,24,164,201,19,88,17,12,177,33,254,8,201,88,125,21,119,6,144,244,1,66,74,219,218,211,189,169,217,94,238,120,47,32,91,182,242,0,7,236,154,55,44,245,0,177,47,185,96,70,18,160,118,26,250,154,239,251,176,216,48,91,19,151,26,106,170,120,226,181,217,237,242,36,190,61,82,92,8,222,255,36,75,82,13,230,107,162,236,173,6,216,139,81,209,53,37,226,106,218,10,87,74,106,76,39,227,81,161,187,231,127,46,190,30,120,11,138,47,210,179,182,136,233,158,165,224,166,8,65,227,102,213,205,59,135,26,134,62,199,37,218,88,168,192,130,254,11,112,66,246,99,84,207,93,8,2,33,8,189,136,73,91,255,188,36,128,253,211,55,41,180,226,19,225,192,193,218,154,8,229,54,234,166,228,126,125,160,214,31,74,140,113,96,242,210,156,70,57,130,50,128,95,2,102,97,75,185,239,117,111,20,116,172,84,109,94,71,245,33,85,14,150,169,118,222,31,159,72,34,217,2,148,179,228,120,114,87,252,240,206,104,47,206,182,192,218,239,159,46,188,103,167,137,179,111,18,16,78,68,111,178,170,165,183,152,180,194,23,115,189,98,138,218,116,167,103,5,64,8,16,178,51,23,197,34,254,241,184,86,75,105,65,75,140,143,165,79,157,1,179,2,14,28,131,231,124,3,65,191,215,169,168,18,83,26,111,70,242,97,4,123,50,34,174,228,134,148,85,183,111,22,25,147,182,90,104,238,212,201,88,166,24,218,224,38,188,79,81,87,100,85,10,228,208,160,30,102,164,166,98,169,65,224,75,80,43,97,185,64,118,158,125,174,93,22,197,126,99,191,47,179,193,188,158,245,15,60,65,145,37,205,128,106,129,212,66,137,174,145,84,22,243,116,3,98,130,41,48,168,232,92,155,86,182,170,219,59,243,182,194,255,178,52,85,63,130,27,219,79,235,0,215,140,188,186,32,153,92,86,86,45,79,23,95,119,206,89,18,56,106,31,218,115,83,132,43,76,212,98,253,201,244,231,88,14,42,23,61,1,2,187,88,71,72,148,94,54,172,170,87,58,153,70,169,27,189,156,254,5,80,115,220,61,86,22,173,178,16,31,217,25,161,212,110,248,90,20,42,135,61,148,42,145,201,237,175,78,186,75,116,126,152,4,157,10,233,155,89,242,204,97,105,152,25,37,3,193,248,247,121,50,215,115,233,249,80,98,245,247,136,252,95,135,160,0,68,107,116,175,75,191,212,71,238,148,112,213,55,62,69,30,94,79,92,117,163,236,7,72,52,20,217,158,184,239,24,108,242,205,74,36,67,199,100,18,33,12,91,80,6,25,137,238,239,241,56,201,142,196,9,177,10,166,225,229,216,171,231,63,131,193,154,139,35,32,116,213,239,158,231,115,68,183,141,50,193,154,147,106,83,240,198,103,228,193,15,70,33,187,171,43,43,100,153,39,143,188,176,80,190,166,246,184,77,114,67,216,191,101,170,128,75,49,162,65,123,244,139,87,2,50,76,77,224,238,141,183,30,157,94,107,196,181,228,93,181,152,150,134,38,246,208,0,64,3,21,15,236,63,93,153,242,161,123,203,54,109,139,207,124,98,202,147,80,16,45,81,162,107,79,142,195,199,193,58,109,237,193,140,25,86,162,142,138,114,37,2,7,19,65,30,59,215,58,72,153,30,25,145,244,143,107,66,155,142,68,169,101,180,194,111,251,195,27,192,140,75,160,194,182,92,136,49,170,83,164,9,149,132,136,45,44,253,98,162,13,175,170,198,117,169,167,217,147,193,123,7,221,94,231,62,102,180,103,91,20,215,79,37,159,43,67,25,83,41,219,8,114,145,76,27,122,216,35,95,42,123,248,222,215,12,38,25,41,54,242,180,244,33,23,51,140,234,80,29,179,130,232,87,212,94,171,222,193,39,48,164,63,254,173,152,54,218,194,28,205,194,121,143,190,115,42,176,109,58,77,74,246,234,226,233,110,123,82,85,20,106,93,119,91,100,58,227,110,16,219,151,33,52,223,64,236,158,185,37,125,165,173,200,185,67,35,194,159,95,37,239,205,52,116,98,180,154,245,44,237,106,69,102,249,77],\"8\":[61,15,52,84,78,202,205,135,46,28,212,160,230,180,222,30,135,37,211,165,246,221,237,204,48,117,68,116,101,173,175,221,42,93,165,160,147,231,157,120,111,124,33,94,151,239,57,77,66,196,61,53,28,108,130,34,224,130,242,244,7,229,189,175,154,219,130,214,118,99,191,236,69,43,220,182,178,65,205,17,142,36,70,70,76,227,11,249,164,222,44,84,4,87,81,12,61,14,119,32,241,212,93,207,32,17,78,125,187,25,33,206,211,158,140,122,157,40,65,166,205,118,130,186,41,82,133,80,64,30,150,23,201,89,213,134,171,72,150,63,4,168,127,149,62,164,251,158,149,32,139,226,131,219,208,47,19,52,223,144,14,250,50,100,71,30,133,109,255,252,94,55,201,163,122,7,23,128,216,60,226,32,124,123,173,168,44,238,252,199,152,228,113,223,160,87,153,39,129,148,42,105,182,219,53,14,146,229,161,245,129,75,248,134,248,4,0,153,225,14,4,66,212,175,40,19,18,200,133,143,174,53,250,246,93,8,230,180,110,4,109,244,221,56,222,252,247,149,224,171,109,71,172,182,117,238,65,5,224,175,36,63,92,29,122,69,20,11,145,166,192,178,244,93,78,238,5,174,101,131,33,211,123,2,93,244,237,238,158,130,161,159,105,145,180,79,78,119,17,220,22,90,247,253,159,0,212,130,198,24,254,213,213,216,43,67,92,102,4,128,26,86,22,187,0,40,224,134,54,25,21,49,51,217,5,55,148,134,66,35,37,247,66,254,100,23,140,131,84,98,139,127,97,242,78,25,11,89,219,36,208,116,199,216,65,207,72,72,66,177,88,65,239,227,219,205,198,45,79,97,186,179,13,146,152,201,4,30,35,68,202,209,151,79,187,182,146,184,42,211,101,124,55,152,63,205,16,167,19,29,43,200,243,138,248,179,116,200,152,171,101,189,184,136,220,17,227,227,223,29,227,126,7,61,117,42,213,92,138,143,198,201,221,53,234,238,141,13,253,13,227,55,125,70,236,53,133,28,230,183,230,112,46,2,52,227,208,12,23,157,102,199,187,31,150,14,185,96,117,154,163,119,254,166,193,11,18,220,168,202,224,25,226,142,51,139,1,130,115,191,50,73,157,27,80,70,147,172,154,3,210,108,241,63,14,15,4,216,99,192,174,77,98,155,36,32,109,77,49,66,212,188,101,3,161,185,44,125,66,148,45,15,10,231,124,112,29,249,248,245,34,188,109,145,144,80,57,68,46,214,97,129,10,175,244,53,236,233,28,244,108,205,121,45,223,114,244,165,109,96,244,66,23,26,49,231,39,37,23,21,245,160,112,218,197,128,19,181,213,52,64,231,101,191,239,136,142,26,241,228,63,9,148,156,75,213,252,152,60,73,60,112,98,113,39,57,132,232,122,33,105,163,55,247,197,199,90,49,196,246,206,227,1,157,214,6,204,187,209,115,129,56,225,199,180,43,231,44,197,209,60,198,13,243,247,152,54,10,131,16,83,61,225,12,169,12,1,114,192,83,8,69,111,236,211,168,46,136,81,63,178,71,183,11,72,14,160,154,176,109,130,254,123,8,249,45,213,123,202,34,52,59,5,99,118,147,51,75,45,182,132,209,121,49,176,102,218,48,209,176,128,232,88,14,7,97,99,127,113,212,88,102,252,252,141,216,37,135,41,143,216,76,69,253,140,227,247,71,159,216,220,255,97,185,146,148,132,115,163,116,116,211,24,187,183,25,207,150,6,204,152,138,189,110,122,42,63,201,52,103,110,139,12,6,13,43,175,188,163,221,184,151,163,41,96,235,134,44,230,18,206,225,195,111,100,99,236,2,246,206,175,9,194,84,128,162,100,130,210,37,44,149,216,161,105,54,81,208,42,233,134,31,69,12,133,194,179,171,213,231,115,80,134,161,193,236,126,88,210,59,9,62,47,189,106,243,60,232,5,105,238,0,163,109,191,221,20,102,205,108,127,178,39,228,229,138,114,202,122,157,208,131,7,177,249,96,5,60,243,170,84,151,10,93,17,188,141,112,209,98,30,158,7,252,100,82,227,181,111,19,208,158,33,60,124,108,214,225,84,92,245,253,244,80,155,245,213,142,104,151,207,71,79,38,137,143,147,171,154,36,36,89,164,157,161,100,63,251,42,137,74,24,1,41,243,119,118,44,163,9,141,57,98,170,79,67,184,44,142,183,210,228,242,137,177,199,69,52,217,17,243,189,14,14,25,236]},\"reachable\":{\"{\\\"addr\\\":[50,49,54,46,49,49,55,46,51,46,54,50,0,0,0,0],\\\"port\\\":63174,\\\"uid_fingerprint\\\":922068108643293997,\\\"info\\\":[116,121,112,101,61,115,99,114,97,109,98,108,101,115,117,105,116,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,70,68,56,68,67,55,69,70,57,50,70,49,70,49,52,68,48,48,67,70,57,68,54,70,54,50,57,55,65,51,52,54,56,66,53,57,69,55,48,55,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,83,111,109,101,40,123,34,112,97,115,115,119,111,114,100,34,58,32,34,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,50,51,52,53,54,55,34,125,41,0]}\":[[6,1],[8,0]],\"{\\\"addr\\\":[49,53,54,46,55,50,46,50,49,57,46,52,57,0,0,0],\\\"port\\\":56030,\\\"uid_fingerprint\\\":8564141605929456761,\\\"info\\\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,68,56,66,67,67,48,69,67,70,69,50,67,57,54,53,65,66,67,50,57,67,54,50,55,70,68,67,69,67,48,66,48,54,67,53,65,68,66,49,54,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}\":[[1,2]],\"{\\\"addr\\\":[49,50,56,46,49,51,57,46,52,52,46,49,53,55,0,0],\\\"port\\\":10839,\\\"uid_fingerprint\\\":16072135124933872676,\\\"info\\\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,55,67,53,65,51,68,67,53,51,49,48,55,53,53,48,54,65,50,52,52,65,51,67,70,49,57,66,53,55,70,52,68,69,52,55,55,67,65,54,51,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}\":[[2,1],[4,0]],\"{\\\"addr\\\":[50,49,50,46,49,54,54,46,49,54,54,46,54,55,0,0],\\\"port\\\":32414,\\\"uid_fingerprint\\\":3643046579853129326,\\\"info\\\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,66,48,56,49,49,56,65,56,48,68,55,54,54,66,65,57,65,56,70,57,65,55,50,50,67,50,54,54,49,52,69,48,54,66,56,54,69,52,67,65,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}\":[[1,0]],\"{\\\"addr\\\":[49,51,50,46,49,56,49,46,49,53,53,46,55,54,0,0],\\\"port\\\":55241,\\\"uid_fingerprint\\\":4215620865531854407,\\\"info\\\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,67,66,70,56,51,51,51,49,54,53,70,49,67,51,53,65,68,70,48,54,66,70,52,50,53,49,48,52,69,56,51,51,65,68,68,65,49,54,53,66,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,32,102,108,97,103,115,61,83,111,109,101,40,123,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}\":[[1,1]],\"{\\\"addr\\\":[49,57,53,46,55,50,46,55,52,46,49,49,55,0,0,0],\\\"port\\\":28746,\\\"uid_fingerprint\\\":8013544061081454931,\\\"info\\\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,50,57,49,49,48,66,55,68,57,69,57,54,48,65,53,67,52,50,56,52,56,55,55,50,65,70,54,50,52,65,51,66,50,55,65,50,68,69,52,69,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,32,102,108,97,103,115,61,83,111,109,101,40,123,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}\":[[2,0],[3,0]],\"{\\\"addr\\\":[49,57,49,46,49,56,48,46,49,48,51,46,50,51,54,0],\\\"port\\\":50309,\\\"uid_fingerprint\\\":17576062521251310994,\\\"info\\\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,70,68,56,68,67,55,69,70,57,50,70,49,70,49,52,68,48,48,67,70,57,68,54,70,54,50,57,55,65,51,52,54,56,66,53,57,69,55,48,55,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}\":[[6,0],[7,0]],\"{\\\"addr\\\":[50,49,54,46,49,49,55,46,51,46,54,50,0,0,0,0],\\\"port\\\":63174,\\\"uid_fingerprint\\\":9189545078772697644,\\\"info\\\":[116,121,112,101,61,115,99,114,97,109,98,108,101,115,117,105,116,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,69,68,67,51,65,65,48,51,70,69,54,69,53,50,66,69,55,55,56,68,68,52,54,70,50,55,68,51,53,56,57,57,51,66,55,65,49,48,65,52,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,83,111,109,101,40,123,34,112,97,115,115,119,111,114,100,34,58,32,34,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,50,51,52,53,54,55,34,125,41,0]}\":[[6,2],[9,0]],\"{\\\"addr\\\":[49,51,52,46,50,48,55,46,50,51,53,46,49,48,53,0],\\\"port\\\":9042,\\\"uid_fingerprint\\\":5838789323103363859,\\\"info\\\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,56,48,55,56,70,57,55,66,50,50,49,53,55,69,66,55,49,54,65,69,66,68,53,54,65,57,52,55,54,67,51,55,56,57,57,65,68,70,54,65,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}\":[[2,2],[5,0]]},\"spares\":[1],\"unallocated_bridges\":[],\"recycleable_keys\":[],\"blocked_keys\":[],\"open_inv_keys\":[[3,2460195],[4,2460195],[5,2460195],[7,2460195],[8,2460195],[9,2460195]],\"date_last_enc\":2460195},\"trustup_migration_table\":{\"table\":{\"7\":6,\"8\":6,\"4\":2,\"9\":6,\"3\":2,\"5\":2},\"migration_type\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},\"blockage_migration_table\":{\"table\":{},\"migration_type\":[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},\"openinv_filter\":{\"seen_table\":[[34,155,156,133,153,119,92,150,172,38,54,150,219,251,139,195,56,83,13,212,134,136,136,104,166,12,221,138,41,4,223,12]]},\"id_filter\":{\"seen_table\":[]},\"inv_id_filter\":{\"seen_table\":[]},\"trust_promotion_filter\":{\"seen_table\":[]}},\"extra_bridges\":[],\"to_be_replaced_bridges\":[]}"; + let test_string = "{\"db\":{\"keypair\":[121,4,160,52,248,243,39,240,71,101,82,207,64,22,142,74,246,212,153,208,24,125,84,1,155,176,83,205,46,185,185,44],\"pubkey\":[160,195,123,233,25,157,126,89,37,85,193,202,132,49,53,205,169,199,176,14,251,234,40,100,156,84,155,125,186,244,134,220],\"openinv_buckets\":[5,4,7,3,8],\"distributed_buckets\":[9],\"current_k\":2,\"daily_bridges_distributed\":1},\"ba\":{\"lox_priv\":{\"x0tilde\":[143,9,251,99,139,233,249,99,12,151,209,199,61,9,226,112,162,129,137,136,195,3,66,179,223,161,50,85,30,157,37,0],\"x\":[[243,220,21,212,62,251,120,189,78,69,185,186,29,7,23,200,129,129,142,47,138,112,151,4,126,40,138,144,220,88,86,8],[79,133,82,56,114,75,230,209,153,126,84,177,85,238,191,235,7,187,196,196,228,60,103,178,44,88,5,143,238,120,72,12],[114,190,197,197,92,27,104,48,174,133,173,50,91,173,81,40,202,254,102,100,238,9,180,244,14,47,71,72,202,169,223,0],[109,226,189,23,245,119,6,254,111,241,15,1,66,129,65,190,153,106,160,142,102,92,76,111,147,235,77,118,198,131,78,8],[219,73,214,47,104,208,140,251,118,150,220,157,85,115,83,86,89,232,171,242,152,64,20,61,209,119,78,245,36,204,85,11],[126,164,101,171,7,207,113,121,133,92,210,120,97,92,70,89,142,29,89,58,9,83,90,126,153,202,216,250,123,157,30,5],[25,203,47,124,192,229,50,210,39,186,172,157,71,221,90,252,83,0,234,180,15,228,133,110,58,222,51,147,110,190,237,5]]},\"lox_pub\":{\"X\":[[52,135,83,91,17,4,67,24,173,18,214,24,58,154,63,119,67,136,188,179,157,120,218,195,200,188,209,141,93,24,124,94],[238,46,17,216,198,220,35,70,61,27,186,253,177,7,221,231,169,81,99,102,18,128,125,114,184,15,246,233,1,244,118,61],[202,55,212,100,56,227,184,106,93,175,150,254,8,19,166,25,194,60,224,172,26,76,98,122,17,253,72,94,54,207,109,21],[216,173,4,2,65,255,161,45,106,111,132,219,209,220,33,26,43,173,120,117,116,30,45,151,244,206,240,255,231,179,175,103],[150,200,66,157,230,92,163,117,225,136,193,109,1,35,120,151,48,182,82,35,7,93,239,212,39,67,11,15,239,235,234,13],[172,116,53,192,167,34,113,160,85,68,184,65,117,63,29,26,138,132,224,234,105,96,194,93,220,240,88,237,110,113,86,82],[18,225,205,220,116,77,165,132,231,244,189,5,159,221,110,177,187,104,168,78,255,134,92,17,109,161,77,58,72,192,205,114]]},\"migration_priv\":{\"x0tilde\":[211,143,194,8,37,8,12,55,39,248,78,75,118,168,145,205,240,248,252,53,185,227,9,219,69,45,75,103,105,146,187,7],\"x\":[[104,107,78,46,137,189,128,168,148,77,184,118,199,234,137,81,190,103,120,180,134,231,215,197,20,176,51,138,238,54,110,12],[31,250,96,78,75,51,84,243,27,66,21,169,30,15,13,96,37,74,133,201,120,159,98,129,42,239,221,169,67,134,143,8],[74,167,255,153,36,234,214,227,250,25,106,172,36,25,72,176,81,222,197,223,237,86,17,230,97,249,107,70,91,21,190,15],[23,236,100,248,42,74,41,2,155,96,226,199,117,227,182,36,96,99,177,192,222,251,105,188,196,163,43,80,49,30,22,10],[242,31,173,104,138,50,162,156,255,85,58,180,93,228,130,239,115,14,89,179,114,236,140,190,116,16,6,147,121,27,92,11]]},\"migration_pub\":{\"X\":[[66,150,237,69,9,213,22,190,254,2,95,43,154,115,131,141,71,35,197,202,154,163,159,164,64,16,248,83,214,60,227,23],[26,26,30,134,61,140,209,165,221,146,165,203,213,57,60,16,82,185,177,218,28,59,86,37,139,88,118,69,43,120,49,97],[142,238,183,118,107,13,48,154,94,204,119,104,218,179,149,208,242,151,228,117,6,125,138,65,92,160,91,166,62,75,224,127],[6,134,209,57,107,68,65,24,78,50,197,79,39,74,239,181,77,57,17,173,30,21,231,241,211,185,78,235,219,138,235,49],[88,146,145,147,186,255,230,241,145,139,149,123,247,101,222,173,86,23,22,48,230,0,148,222,205,143,17,5,5,63,199,55]]},\"migrationkey_priv\":{\"x0tilde\":[108,193,14,7,211,244,9,190,251,186,173,191,159,67,226,168,60,109,225,13,157,225,5,88,42,21,40,103,143,79,232,0],\"x\":[[208,84,202,133,58,81,191,86,34,124,80,151,105,145,135,13,250,255,151,217,162,212,204,212,244,215,202,138,14,93,6,11],[253,152,102,66,182,93,38,129,126,173,154,32,46,2,96,174,197,211,100,130,19,206,64,153,40,104,51,36,99,163,154,10],[32,158,137,175,136,206,72,252,69,225,103,80,1,175,238,240,204,210,185,1,85,206,146,234,252,201,193,19,150,76,254,9]]},\"migrationkey_pub\":{\"X\":[[158,136,224,166,235,252,254,136,145,186,93,50,217,48,51,242,90,47,99,179,211,206,102,222,15,205,61,20,178,224,11,85],[238,183,52,40,190,24,231,89,149,158,183,90,255,178,156,37,47,223,162,251,128,222,16,185,125,91,29,185,76,121,209,15],[62,76,165,228,36,162,30,208,29,173,174,40,129,38,182,84,196,210,67,125,115,64,85,197,118,114,39,52,111,82,125,13]]},\"reachability_priv\":{\"x0tilde\":[36,187,28,100,96,130,72,135,158,51,170,109,52,72,103,90,220,74,212,104,103,92,247,69,35,235,11,53,107,234,77,0],\"x\":[[199,24,219,64,123,139,129,139,190,139,114,172,254,52,193,46,65,66,87,240,7,10,139,158,232,40,99,230,210,179,71,5],[186,173,85,159,209,12,113,8,136,170,194,128,243,174,20,78,188,57,63,144,163,218,59,102,107,184,152,42,149,22,66,6],[110,162,248,148,212,200,180,133,86,76,209,152,185,64,46,128,131,95,13,130,190,151,83,24,102,96,201,96,179,133,48,3]]},\"reachability_pub\":{\"X\":[[70,56,136,60,123,40,11,124,4,170,204,160,93,221,48,117,145,66,146,206,162,54,24,98,189,115,191,102,252,51,83,110],[60,52,219,76,2,245,192,204,150,195,154,211,150,104,201,53,43,137,32,135,133,205,82,109,50,186,87,52,27,254,160,46],[168,172,24,38,194,113,8,1,124,179,17,190,244,114,228,122,53,24,62,138,27,177,89,238,167,79,64,104,39,10,216,94]]},\"invitation_priv\":{\"x0tilde\":[98,218,42,226,106,65,201,104,75,104,13,80,9,213,177,167,186,16,188,139,208,56,23,22,16,17,206,187,170,253,122,15],\"x\":[[112,9,221,148,24,75,246,241,128,87,120,9,146,203,160,238,250,10,215,116,25,138,172,150,74,244,19,67,248,116,234,5],[246,214,228,161,154,83,161,139,113,170,189,7,6,84,104,101,167,201,174,249,29,219,155,108,165,19,88,252,32,169,121,14],[115,155,88,53,123,252,230,51,173,10,205,187,83,108,129,241,144,178,210,189,22,197,204,174,164,143,125,101,82,139,18,1],[235,162,227,81,108,197,23,213,19,74,249,242,84,12,11,134,244,102,171,74,125,234,94,134,17,200,235,172,3,236,212,9],[178,57,128,236,178,248,50,5,214,239,97,153,20,55,197,220,217,98,4,118,246,131,124,90,113,121,169,129,211,175,216,1]]},\"invitation_pub\":{\"X\":[[18,91,111,4,165,234,85,12,151,195,5,213,91,191,167,191,89,60,218,90,204,99,35,166,37,73,105,134,227,169,158,27],[52,2,100,3,112,118,66,31,105,121,74,208,215,223,40,210,103,149,254,18,232,150,136,241,112,136,4,98,187,175,214,25],[156,112,201,126,204,98,91,120,114,189,170,32,238,249,248,163,196,109,205,150,163,209,49,95,193,113,191,226,255,83,0,86],[120,15,100,23,59,173,212,124,73,190,37,77,132,190,169,48,183,222,194,183,119,194,39,184,73,206,193,154,200,129,252,117],[78,246,199,66,152,244,85,179,40,77,215,77,81,206,248,236,102,112,244,74,247,180,207,195,109,70,95,242,207,58,179,109]]},\"bridgedb_pub\":[160,195,123,233,25,157,126,89,37,85,193,202,132,49,53,205,169,199,176,14,251,234,40,100,156,84,155,125,186,244,134,220],\"bridge_table\":{\"counter\":10,\"keys\":{\"4\":[98,77,88,28,245,60,12,162,231,142,175,244,134,36,108,189],\"5\":[231,37,133,52,229,253,115,13,11,167,181,65,108,249,202,39],\"8\":[104,79,30,48,46,140,65,219,127,227,243,161,132,163,136,8],\"10\":[156,165,205,136,12,139,204,191,14,8,129,174,126,95,179,80],\"3\":[151,150,241,156,53,136,84,201,6,109,247,5,174,211,73,255],\"1\":[111,79,32,173,35,142,62,131,8,17,215,22,0,36,146,65],\"6\":[40,76,205,122,89,219,86,59,189,63,21,108,107,149,34,120],\"9\":[138,27,80,18,27,19,245,215,20,19,26,158,17,7,77,194],\"7\":[158,57,44,39,78,80,130,81,160,117,234,188,89,51,62,134],\"2\":[108,105,146,211,217,191,102,209,15,44,87,22,53,35,34,243]},\"buckets\":{\"2\":[{\"addr\":[49,57,53,46,55,50,46,55,52,46,49,49,55,0,0,0],\"port\":28746,\"uid_fingerprint\":8013544061081454931,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,50,57,49,49,48,66,55,68,57,69,57,54,48,65,53,67,52,50,56,52,56,55,55,50,65,70,54,50,52,65,51,66,50,55,65,50,68,69,52,69,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,32,102,108,97,103,115,61,83,111,109,101,40,123,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[49,50,56,46,49,51,57,46,52,52,46,49,53,55,0,0],\"port\":10839,\"uid_fingerprint\":16072135124933872676,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,55,67,53,65,51,68,67,53,51,49,48,55,53,53,48,54,65,50,52,52,65,51,67,70,49,57,66,53,55,70,52,68,69,52,55,55,67,65,54,51,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[49,51,52,46,50,48,55,46,50,51,53,46,49,48,53,0],\"port\":9042,\"uid_fingerprint\":5838789323103363859,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,56,48,55,56,70,57,55,66,50,50,49,53,55,69,66,55,49,54,65,69,66,68,53,54,65,57,52,55,54,67,51,55,56,57,57,65,68,70,54,65,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],\"9\":[{\"addr\":[50,49,54,46,49,49,55,46,51,46,54,50,0,0,0,0],\"port\":63174,\"uid_fingerprint\":9189545078772697644,\"info\":[116,121,112,101,61,115,99,114,97,109,98,108,101,115,117,105,116,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,69,68,67,51,65,65,48,51,70,69,54,69,53,50,66,69,55,55,56,68,68,52,54,70,50,55,68,51,53,56,57,57,51,66,55,65,49,48,65,52,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,83,111,109,101,40,123,34,112,97,115,115,119,111,114,100,34,58,32,34,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,50,51,52,53,54,55,34,125,41,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],\"7\":[{\"addr\":[49,57,49,46,49,56,48,46,49,48,51,46,50,51,54,0],\"port\":50309,\"uid_fingerprint\":17576062521251310994,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,70,68,56,68,67,55,69,70,57,50,70,49,70,49,52,68,48,48,67,70,57,68,54,70,54,50,57,55,65,51,52,54,56,66,53,57,69,55,48,55,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],\"6\":[{\"addr\":[49,57,49,46,49,56,48,46,49,48,51,46,50,51,54,0],\"port\":50309,\"uid_fingerprint\":17576062521251310994,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,70,68,56,68,67,55,69,70,57,50,70,49,70,49,52,68,48,48,67,70,57,68,54,70,54,50,57,55,65,51,52,54,56,66,53,57,69,55,48,55,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[50,49,54,46,49,49,55,46,51,46,54,50,0,0,0,0],\"port\":63174,\"uid_fingerprint\":922068108643293997,\"info\":[116,121,112,101,61,115,99,114,97,109,98,108,101,115,117,105,116,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,70,68,56,68,67,55,69,70,57,50,70,49,70,49,52,68,48,48,67,70,57,68,54,70,54,50,57,55,65,51,52,54,56,66,53,57,69,55,48,55,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,83,111,109,101,40,123,34,112,97,115,115,119,111,114,100,34,58,32,34,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,50,51,52,53,54,55,34,125,41,0]},{\"addr\":[50,49,54,46,49,49,55,46,51,46,54,50,0,0,0,0],\"port\":63174,\"uid_fingerprint\":9189545078772697644,\"info\":[116,121,112,101,61,115,99,114,97,109,98,108,101,115,117,105,116,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,69,68,67,51,65,65,48,51,70,69,54,69,53,50,66,69,55,55,56,68,68,52,54,70,50,55,68,51,53,56,57,57,51,66,55,65,49,48,65,52,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,83,111,109,101,40,123,34,112,97,115,115,119,111,114,100,34,58,32,34,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,50,51,52,53,54,55,34,125,41,0]}],\"4\":[{\"addr\":[49,50,56,46,49,51,57,46,52,52,46,49,53,55,0,0],\"port\":10839,\"uid_fingerprint\":16072135124933872676,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,55,67,53,65,51,68,67,53,51,49,48,55,53,53,48,54,65,50,52,52,65,51,67,70,49,57,66,53,55,70,52,68,69,52,55,55,67,65,54,51,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],\"5\":[{\"addr\":[49,51,52,46,50,48,55,46,50,51,53,46,49,48,53,0],\"port\":9042,\"uid_fingerprint\":5838789323103363859,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,56,48,55,56,70,57,55,66,50,50,49,53,55,69,66,55,49,54,65,69,66,68,53,54,65,57,52,55,54,67,51,55,56,57,57,65,68,70,54,65,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],\"10\":[{\"addr\":[50,49,54,46,49,49,55,46,51,46,54,50,0,0,0,0],\"port\":63174,\"uid_fingerprint\":14821306939685929169,\"info\":[116,121,112,101,61,115,99,114,97,109,98,108,101,115,117,105,116,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,66,48,56,49,49,56,65,56,48,68,55,54,54,66,65,57,65,56,70,57,65,55,50,50,67,50,54,54,49,52,69,48,54,66,56,54,69,52,67,65,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,83,111,109,101,40,123,34,112,97,115,115,119,111,114,100,34,58,32,34,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,50,51,52,53,54,55,34,125,41,0]},{\"addr\":[57,55,46,49,55,53,46,57,49,46,55,0,0,0,0,0],\"port\":27719,\"uid_fingerprint\":9270304952963857555,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,69,68,67,51,65,65,48,51,70,69,54,69,53,50,66,69,55,55,56,68,68,52,54,70,50,55,68,51,53,56,57,57,51,66,55,65,49,48,65,52,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[50,50,46,50,52,49,46,56,49,46,54,50,0,0,0,0],\"port\":36457,\"uid_fingerprint\":14409951350199027285,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,68,68,56,56,57,53,48,56,48,48,50,70,57,50,53,67,70,55,52,69,49,51,48,68,49,48,49,67,68,70,49,67,49,51,51,65,65,65,68,49,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],\"3\":[{\"addr\":[49,57,53,46,55,50,46,55,52,46,49,49,55,0,0,0],\"port\":28746,\"uid_fingerprint\":8013544061081454931,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,50,57,49,49,48,66,55,68,57,69,57,54,48,65,53,67,52,50,56,52,56,55,55,50,65,70,54,50,52,65,51,66,50,55,65,50,68,69,52,69,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,32,102,108,97,103,115,61,83,111,109,101,40,123,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],\"8\":[{\"addr\":[50,49,54,46,49,49,55,46,51,46,54,50,0,0,0,0],\"port\":63174,\"uid_fingerprint\":922068108643293997,\"info\":[116,121,112,101,61,115,99,114,97,109,98,108,101,115,117,105,116,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,70,68,56,68,67,55,69,70,57,50,70,49,70,49,52,68,48,48,67,70,57,68,54,70,54,50,57,55,65,51,52,54,56,66,53,57,69,55,48,55,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,83,111,109,101,40,123,34,112,97,115,115,119,111,114,100,34,58,32,34,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,50,51,52,53,54,55,34,125,41,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"port\":0,\"uid_fingerprint\":0,\"info\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],\"1\":[{\"addr\":[50,49,50,46,49,54,54,46,49,54,54,46,54,55,0,0],\"port\":32414,\"uid_fingerprint\":3643046579853129326,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,66,48,56,49,49,56,65,56,48,68,55,54,54,66,65,57,65,56,70,57,65,55,50,50,67,50,54,54,49,52,69,48,54,66,56,54,69,52,67,65,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[49,51,50,46,49,56,49,46,49,53,53,46,55,54,0,0],\"port\":55241,\"uid_fingerprint\":4215620865531854407,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,67,66,70,56,51,51,51,49,54,53,70,49,67,51,53,65,68,70,48,54,66,70,52,50,53,49,48,52,69,56,51,51,65,68,68,65,49,54,53,66,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,32,102,108,97,103,115,61,83,111,109,101,40,123,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{\"addr\":[49,53,54,46,55,50,46,50,49,57,46,52,57,0,0,0],\"port\":56030,\"uid_fingerprint\":8564141605929456761,\"info\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,68,56,66,67,67,48,69,67,70,69,50,67,57,54,53,65,66,67,50,57,67,54,50,55,70,68,67,69,67,48,66,48,54,67,53,65,68,66,49,54,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}]},\"encbuckets\":{\"5\":[212,104,142,74,232,164,167,215,241,173,77,228,245,132,164,225,11,40,120,21,101,201,141,172,165,1,169,6,103,29,201,195,239,64,154,123,117,201,31,58,194,198,58,27,147,125,3,99,188,202,0,92,144,102,139,27,250,91,206,233,232,25,130,91,199,92,186,150,33,0,168,1,133,229,208,96,104,225,211,42,136,126,37,209,110,149,128,66,145,196,77,148,55,38,221,115,205,184,149,69,34,137,39,109,135,58,85,10,134,181,86,223,200,32,90,195,75,203,25,123,211,183,22,232,122,50,105,151,39,29,185,135,37,164,228,102,249,177,158,27,186,128,59,3,28,120,156,8,222,247,100,213,144,61,31,57,253,72,62,202,216,137,226,217,46,136,135,169,151,216,101,95,210,43,158,172,11,38,45,166,91,240,116,102,84,198,129,255,84,114,82,235,162,163,25,206,227,66,88,161,170,255,46,43,243,216,126,253,116,246,136,201,13,127,108,121,249,188,119,223,9,62,216,38,152,45,119,159,174,229,255,52,36,97,11,112,137,43,147,85,104,160,128,205,8,135,236,211,78,137,237,9,130,196,17,5,235,7,116,184,46,161,0,138,234,15,120,169,128,30,143,37,161,161,7,8,245,130,192,173,239,38,171,77,88,139,227,41,162,87,111,165,218,3,102,194,231,208,167,181,252,199,82,79,76,215,82,49,114,93,80,144,111,96,153,145,128,161,173,148,223,151,43,198,82,255,170,10,89,43,203,137,200,70,113,150,115,209,185,128,76,134,81,163,104,231,134,113,9,89,206,155,162,216,44,145,238,160,112,216,162,143,189,38,56,218,188,224,17,249,174,169,174,62,35,56,110,10,189,85,43,232,96,177,88,23,151,73,31,15,107,158,186,21,112,249,236,58,111,126,11,159,138,120,22,213,83,9,129,181,148,5,180,210,82,203,248,182,254,98,212,175,154,155,20,232,34,158,127,223,76,253,105,145,132,104,180,205,59,188,223,213,86,25,151,241,176,167,116,164,14,196,79,17,192,162,76,189,57,48,103,196,114,248,32,61,77,144,14,200,134,213,13,190,103,179,90,96,174,43,217,229,187,64,193,128,134,41,207,112,41,235,144,5,219,43,147,41,191,138,89,208,30,81,184,2,31,166,121,159,211,242,80,164,3,227,146,11,248,172,198,32,177,89,23,115,55,167,172,127,75,93,185,213,115,70,134,226,26,117,53,238,187,3,147,43,20,142,56,148,19,170,219,107,128,0,117,149,172,40,236,186,250,102,242,208,154,101,159,110,162,64,113,203,113,5,209,79,91,180,75,99,37,13,10,207,41,199,239,51,132,237,216,35,30,143,232,229,252,152,92,149,76,36,12,241,113,110,177,98,226,147,173,90,21,68,106,218,85,242,27,22,213,79,115,24,191,247,80,94,223,193,77,70,25,204,57,204,81,25,39,116,32,162,60,192,239,134,162,233,186,13,84,200,111,142,150,67,229,246,48,119,129,113,39,200,254,104,97,194,62,108,103,220,120,221,138,5,4,191,89,164,144,243,175,75,119,127,100,90,121,140,33,223,21,204,141,79,168,218,102,58,169,107,108,23,215,228,237,77,162,142,232,29,224,192,74,227,1,208,26,170,156,183,134,69,132,159,128,249,105,215,72,138,87,181,164,96,243,3,130,94,90,89,122,196,27,237,132,203,91,29,64,67,120,98,139,181,62,252,39,67,120,34,84,55,38,74,218,170,113,115,255,140,30,207,8,244,250,111,82,243,19,107,80,40,120,209,103,239,36,88,72,151,89,172,12,194,184,42,126,110,49,90,66,251,222,70,224,216,9,211,104,254,193,212,169,241,27,64,198,147,80,100,106,46,143,171,131,34,91,116,231,10,14,73,113,12,255,71,243,232,123,30,226,203,172,3,31,148,171,37,210,251,17,0,87,244,206,176,64,39,80,125,67,33,24,253,38,250,4,156,147,175,132,4,7,208,169,251,137,214,139,212,150,43,75,39,98,180,173,96,150,198,54,39,217,229,171,206,139,57,239,1,210,155,164,18,114,207,57,103,63,95,85,77,201,1,155,190,3,51,177,75,145,250,110,106,87,65,28,210,40,73,155,176,82,252,230,239,51,87,195,5,173,37,54,234,106,201,212,43,202,177,19,217,109,179,210,12,1,222,251,167,213,6,244,80,224,239,67,124,123,253,220,73,194,165,191,61,225,86,142,123,103,231,248,181,117,137,92,221,50,214,78,112],\"7\":[133,67,45,40,43,226,44,44,55,133,123,44,38,130,99,59,186,45,165,90,12,117,245,92,142,58,66,87,125,251,210,214,132,228,64,30,149,114,212,247,217,223,241,174,38,63,95,97,164,250,225,169,70,152,184,254,247,24,51,143,240,246,213,237,161,101,70,47,173,234,57,79,56,160,210,81,230,73,42,198,255,109,176,54,211,15,124,40,125,88,249,72,193,51,98,248,246,153,137,171,157,197,57,252,163,83,132,122,127,52,210,116,83,240,126,17,71,77,244,249,25,213,183,86,245,158,214,98,101,230,95,96,74,4,166,90,141,77,200,78,108,132,153,162,133,59,177,106,38,158,223,133,207,51,219,198,241,192,244,167,162,176,1,13,191,181,235,103,40,227,183,60,15,77,122,154,120,94,249,23,53,128,232,62,31,84,106,178,105,36,143,66,254,120,219,128,206,58,207,20,95,134,80,3,176,130,67,215,42,2,170,43,141,151,133,83,5,254,187,96,102,111,181,195,71,25,163,203,227,33,44,197,5,205,224,125,205,240,192,93,178,115,16,117,249,186,229,144,174,60,60,197,137,144,77,154,63,169,198,144,71,251,238,9,62,179,140,187,203,58,112,214,26,216,235,41,112,173,131,108,12,185,168,93,35,96,110,127,108,205,190,237,61,173,93,187,165,214,166,157,197,20,191,156,5,217,246,115,216,76,112,85,107,243,111,153,255,148,229,16,162,82,60,86,2,199,64,149,23,23,124,196,193,186,75,114,204,30,197,82,253,237,141,204,246,136,235,255,29,250,203,194,32,207,202,14,26,149,193,230,35,89,8,170,107,45,77,223,66,76,248,76,156,127,149,126,58,224,209,21,43,133,135,140,67,231,101,86,177,78,252,184,153,36,107,239,171,38,236,101,172,82,144,155,81,248,18,60,190,94,101,171,39,11,191,246,152,149,164,26,80,165,58,254,136,11,221,226,159,148,15,217,173,176,82,221,182,99,187,169,94,80,177,66,63,220,234,25,138,27,208,193,3,165,219,14,42,12,249,86,72,132,201,18,139,226,93,248,209,232,106,15,178,164,3,50,226,140,171,86,101,206,220,55,239,255,211,43,41,82,166,168,43,101,170,228,87,55,156,164,28,131,107,33,23,174,156,132,219,129,128,137,33,21,193,205,64,28,195,242,173,38,191,193,181,64,13,163,112,104,28,50,142,153,54,70,170,8,114,69,144,2,208,152,30,158,167,15,161,94,87,148,178,186,205,16,139,158,174,111,148,51,64,210,190,88,226,206,99,26,226,247,147,84,181,29,75,125,217,238,55,191,39,148,43,41,47,143,198,38,128,173,59,102,13,15,89,59,43,158,201,200,15,56,51,38,109,165,77,40,167,119,122,87,96,191,40,130,186,79,251,161,10,227,69,19,46,235,51,104,7,253,217,1,32,59,187,210,147,92,204,109,82,226,202,71,120,196,146,31,85,230,55,99,157,42,68,217,209,112,149,19,225,34,72,197,187,147,195,122,187,43,105,60,36,134,112,59,127,171,55,189,27,87,240,32,92,134,138,95,162,47,214,197,157,103,49,249,173,13,25,233,75,200,162,4,180,15,44,15,210,101,199,47,197,40,67,22,78,232,230,92,2,113,209,177,199,105,217,5,133,57,164,182,8,43,113,151,253,159,92,96,212,208,201,69,139,224,97,38,28,204,46,249,111,157,74,127,42,159,159,194,175,246,142,70,252,226,236,99,98,110,131,25,254,60,207,31,204,51,24,28,164,157,3,202,100,215,12,49,33,121,202,160,185,71,204,188,187,144,93,10,212,104,80,93,6,11,217,164,157,86,36,250,111,226,207,234,43,58,1,229,42,178,37,155,144,1,179,188,38,50,121,239,241,124,80,117,191,115,100,30,196,58,66,39,2,138,220,251,12,83,37,3,108,22,115,232,75,25,99,168,19,190,27,22,79,18,187,190,138,93,237,41,28,199,99,30,125,169,230,49,2,169,9,245,141,232,152,171,26,189,152,146,165,230,134,238,21,195,92,60,115,139,148,71,32,48,186,236,155,164,234,107,211,204,77,76,59,231,151,75,230,156,84,171,151,146,126,181,9,212,152,123,25,26,87,29,250,55,204,121,221,237,16,58,160,219,54,12,223,36,147,157,94,192,45,185,13,32,214,112,155,242,245,62,46,96,29,236,16,2,54,28,229,9,35,7,11,110,251,181,81,44,136,35,75,93,50,168,15,64,217,236,246,156],\"9\":[32,9,165,173,194,126,208,224,139,145,74,38,105,240,179,139,109,250,199,118,91,133,178,129,211,139,235,127,167,187,206,12,57,15,143,58,198,104,64,245,15,93,27,93,17,60,3,188,121,220,93,161,67,112,235,60,25,72,86,253,141,79,214,233,96,26,98,108,108,208,205,34,16,114,169,239,4,19,1,151,57,204,20,182,113,161,187,22,65,224,94,179,23,122,218,224,162,17,111,73,122,64,111,9,124,238,189,223,64,109,205,150,105,193,213,190,173,22,27,139,191,31,46,190,212,86,101,104,13,13,94,21,153,35,232,171,223,141,119,85,185,142,118,137,166,143,129,249,54,48,66,111,90,152,147,54,120,196,58,22,74,234,81,36,44,95,163,67,76,124,44,149,141,19,159,77,186,53,25,161,15,117,10,137,64,182,127,73,20,175,197,77,116,113,148,135,73,204,124,121,141,38,46,228,20,188,253,190,165,40,183,126,210,82,198,55,50,225,84,168,187,97,6,56,77,246,195,211,84,38,86,241,165,244,11,244,252,152,238,154,184,165,77,185,32,122,68,70,167,245,211,247,189,75,220,93,240,199,245,139,16,218,5,157,87,180,67,70,223,201,5,91,102,161,111,197,22,201,237,121,111,72,138,237,80,249,205,149,249,202,183,42,26,33,7,115,166,103,152,97,182,68,200,203,95,238,20,113,206,96,203,23,78,58,68,136,84,57,118,155,82,101,161,146,8,81,126,77,85,187,82,20,181,183,91,103,19,249,77,7,150,4,242,6,45,46,23,210,34,32,228,215,68,78,191,174,37,129,36,102,219,187,154,90,124,147,186,191,241,116,76,137,96,151,243,192,90,97,13,88,170,114,252,80,41,238,145,113,205,167,131,161,251,16,111,132,215,215,31,197,130,88,3,152,75,50,111,148,104,45,211,69,206,216,80,167,69,109,30,37,94,33,50,233,51,191,65,48,169,89,127,142,123,79,84,176,17,150,187,30,114,214,204,220,180,180,61,33,156,244,121,247,66,209,185,99,66,97,39,241,31,29,189,230,85,29,67,10,22,207,158,153,252,106,220,195,188,6,95,9,88,179,222,213,167,91,175,105,74,139,242,101,216,226,206,228,255,204,213,168,110,211,147,189,150,180,76,240,114,2,157,197,207,227,250,193,107,206,114,85,207,169,16,93,125,94,245,29,232,86,29,207,254,105,88,24,158,188,225,139,213,77,166,27,179,202,96,122,107,227,32,124,183,199,19,5,199,132,223,113,136,199,90,24,178,15,184,83,212,222,186,77,102,116,226,119,104,80,220,82,17,133,183,134,79,148,206,128,252,248,160,80,201,31,154,39,139,154,249,215,8,61,102,200,151,8,102,127,153,166,217,46,254,41,41,109,7,191,127,117,211,1,209,193,132,211,252,97,174,97,29,78,218,22,141,92,54,99,90,100,16,230,230,252,251,96,17,119,150,58,50,18,234,242,101,47,245,119,178,33,233,188,80,253,117,248,34,195,183,66,166,94,240,26,213,32,0,0,132,167,219,212,83,167,96,97,253,233,140,117,223,236,124,47,164,100,95,124,222,252,27,10,203,185,241,188,111,22,147,97,247,200,229,17,56,161,235,99,60,171,238,236,1,231,43,226,72,58,94,240,186,234,1,224,44,166,121,56,233,0,172,64,139,126,51,250,188,182,23,48,155,213,54,168,91,178,125,70,57,42,196,40,51,35,251,105,7,226,216,230,159,87,196,74,26,179,116,200,43,99,207,153,225,36,78,33,168,57,2,100,107,32,209,158,144,22,147,145,255,226,2,233,46,181,84,208,170,189,73,153,229,171,48,50,69,58,94,46,245,201,145,18,18,41,186,79,145,14,129,112,9,244,118,142,250,123,197,45,38,51,21,199,224,60,248,207,247,108,43,177,93,209,128,128,196,214,191,55,179,113,75,184,23,226,168,30,22,214,86,47,53,29,160,178,95,96,141,114,217,76,43,143,204,135,170,240,85,163,12,149,6,16,134,241,174,80,96,230,94,19,89,93,248,120,206,125,11,14,63,199,10,198,149,82,25,95,124,185,85,78,115,121,1,177,96,72,125,90,179,151,169,195,104,118,229,245,85,182,248,126,2,231,51,210,88,86,162,186,208,213,124,24,45,85,215,236,99,69,255,220,230,27,83,210,148,212,22,49,1,95,187,46,212,230,169,15,41,108,188,146,245,92,86,114,176,152,100,126,193,21,126,129,76,158,158,168],\"4\":[240,57,83,70,115,206,170,187,199,104,38,218,103,81,178,153,109,1,21,229,238,191,25,26,253,133,215,31,198,66,136,177,103,113,149,189,224,55,214,1,237,103,24,219,103,224,183,195,173,27,248,10,202,132,53,177,47,81,141,123,10,21,60,134,234,165,138,172,246,29,164,59,182,12,144,9,186,4,3,78,101,142,133,90,155,148,232,89,177,66,55,36,12,15,195,200,232,237,165,169,171,136,179,0,120,31,25,56,195,112,194,86,82,54,67,243,7,187,195,91,13,130,239,186,240,77,29,180,176,133,207,9,133,88,238,201,73,253,200,179,59,158,95,111,165,44,72,102,114,183,222,9,194,215,0,210,128,218,147,69,161,218,42,193,46,193,155,62,189,28,107,81,37,136,43,194,73,40,161,94,44,204,253,228,157,34,92,8,249,133,110,14,58,96,219,211,82,84,50,224,35,151,250,157,17,49,43,56,82,239,0,82,241,201,115,92,145,91,72,152,239,70,30,118,236,223,61,66,3,226,5,175,245,152,129,113,117,159,71,122,190,12,2,161,158,190,212,121,138,88,155,169,97,119,107,43,85,227,7,244,225,199,75,98,191,228,101,31,167,216,147,100,229,100,119,119,33,134,133,201,16,57,96,68,89,26,152,229,145,27,25,135,182,224,126,214,59,231,109,239,72,53,19,83,194,240,252,166,93,39,205,190,236,127,59,55,159,126,5,220,73,200,140,5,242,207,137,90,97,109,233,72,68,230,187,3,123,84,130,56,171,49,184,23,145,116,158,207,93,1,129,191,9,191,20,97,141,157,248,79,139,78,94,12,94,119,181,160,224,57,99,155,159,119,236,70,186,22,187,242,217,126,77,107,99,121,255,189,49,92,138,121,233,43,57,233,225,75,184,222,201,178,73,46,68,74,199,66,221,121,172,47,78,238,245,233,43,197,240,65,149,226,35,132,177,19,239,158,0,4,158,120,146,203,55,81,119,42,101,87,245,244,254,16,123,189,3,75,158,16,133,221,14,228,27,237,91,1,63,179,38,226,198,24,159,148,158,228,202,201,173,219,92,10,228,80,160,143,32,79,219,47,114,90,149,168,14,241,23,83,169,113,118,58,248,120,72,40,53,41,82,228,46,89,89,218,105,136,178,192,204,180,213,83,206,61,46,219,240,26,223,233,76,102,158,189,142,120,100,4,87,83,51,12,168,91,150,193,176,251,169,125,12,180,207,210,192,38,46,219,122,237,205,105,229,134,163,187,186,159,14,197,163,223,214,49,186,184,209,87,58,116,113,59,237,54,199,155,124,251,98,225,84,111,116,171,105,115,211,100,121,28,197,225,11,209,31,50,241,51,129,150,6,62,9,218,31,89,14,211,16,226,69,81,163,40,173,80,225,214,2,209,70,239,98,85,165,150,220,38,243,224,177,98,25,249,126,152,86,176,99,76,108,108,205,126,201,115,200,89,169,5,230,6,250,14,120,31,110,53,31,36,224,2,248,144,13,161,3,225,165,228,120,50,228,123,127,5,47,96,87,70,206,216,59,225,179,112,255,217,247,125,164,3,26,86,204,70,102,88,21,98,230,20,226,250,109,219,157,218,27,212,254,250,181,144,28,252,128,218,191,248,209,60,195,42,68,204,171,196,5,84,248,65,26,185,208,176,40,37,222,55,255,126,37,201,192,100,82,6,61,16,68,37,196,253,217,190,198,122,128,249,184,135,192,17,47,88,16,179,55,252,211,246,186,132,174,209,222,126,153,174,2,65,138,30,170,153,234,185,135,163,104,164,23,94,146,137,33,39,49,15,127,203,171,88,32,116,224,30,120,213,230,244,223,251,233,59,223,38,223,213,18,159,196,108,252,250,61,197,244,78,99,95,191,200,40,11,153,194,150,254,240,128,235,141,248,112,102,109,223,163,61,13,57,121,102,238,110,238,28,2,25,245,212,232,62,15,149,44,93,129,39,95,159,109,83,202,112,237,173,229,117,73,19,174,205,78,133,49,40,227,79,62,120,166,107,158,49,158,18,99,9,134,73,86,43,174,211,174,66,235,90,18,62,111,2,196,62,72,172,126,93,54,222,95,158,117,172,108,141,162,165,103,65,199,231,228,3,23,231,156,128,22,220,143,66,159,47,142,187,96,99,196,86,10,177,92,208,19,50,202,190,168,248,178,240,169,213,102,47,156,0,252,180,181,4,195,95,43,228,109,126,145,140,28,128,10,23,159,75,67,125,59,60,165],\"1\":[83,65,246,139,120,241,89,167,110,53,191,214,181,241,95,138,116,18,215,61,136,85,72,206,226,46,122,92,137,61,216,236,218,169,193,142,197,23,181,176,152,243,239,130,249,47,51,75,7,205,187,221,111,2,172,232,181,242,176,67,144,57,133,81,197,75,250,129,180,120,199,201,208,184,107,11,176,131,180,88,23,202,55,247,248,187,57,186,98,203,228,250,88,124,220,254,15,192,234,191,182,15,183,223,135,210,159,151,236,131,152,27,23,17,118,195,11,187,148,206,131,114,14,2,226,117,24,142,136,168,220,196,199,221,111,115,153,123,128,122,247,81,204,8,220,90,155,188,236,59,65,152,44,60,136,113,48,97,209,227,152,73,4,216,160,27,8,162,168,83,154,119,122,38,94,173,175,69,38,164,234,229,62,5,13,14,15,1,39,140,30,10,138,223,237,158,153,205,87,69,25,41,113,152,38,153,174,169,54,25,68,173,224,117,170,79,224,52,206,43,122,183,92,9,28,193,194,237,49,172,231,249,29,197,208,138,2,90,255,32,71,83,64,138,220,194,187,226,178,108,94,249,28,34,129,0,116,241,26,1,118,15,34,152,45,102,249,122,179,43,56,95,169,127,91,12,162,106,193,65,250,27,163,205,202,188,220,64,47,109,174,132,92,33,23,231,108,126,36,57,9,188,162,167,224,65,106,66,204,191,212,127,179,72,241,67,192,153,58,151,216,15,199,89,112,111,130,98,213,66,113,222,215,65,225,208,91,12,195,226,5,250,2,219,250,248,189,221,62,33,88,98,189,206,236,39,223,153,28,236,94,185,209,221,93,133,146,15,127,204,142,16,96,36,198,87,52,247,69,65,188,29,216,170,247,28,250,36,25,12,28,194,204,88,127,216,73,209,180,146,86,47,201,138,250,146,183,143,88,107,60,128,157,34,188,240,107,157,249,11,235,85,229,147,183,19,54,220,196,85,3,28,205,67,87,214,182,7,223,7,244,229,138,189,104,156,97,101,11,155,211,81,205,125,46,57,12,172,27,36,55,124,6,247,149,202,54,39,5,58,198,212,77,218,149,39,205,47,196,116,98,213,65,221,243,23,196,129,95,130,116,19,217,27,86,46,224,166,151,222,134,150,59,50,70,151,97,232,96,89,255,27,77,244,128,51,198,184,126,29,193,57,35,79,231,84,97,55,132,145,60,112,113,122,122,172,34,37,135,21,252,186,14,31,91,154,137,147,125,254,149,45,176,14,146,67,167,191,101,210,69,247,158,250,174,232,51,9,67,156,48,223,214,149,12,240,32,174,210,167,2,185,175,72,136,133,122,35,160,175,147,121,1,209,179,62,223,100,199,228,114,209,14,88,250,107,249,195,102,183,180,78,234,237,95,96,255,22,232,7,43,8,109,226,77,93,218,95,20,37,109,170,160,78,53,224,48,187,92,143,7,155,132,88,136,56,178,225,34,70,221,28,251,125,206,138,36,137,180,4,161,133,87,219,122,185,241,216,25,154,139,60,89,190,184,194,89,105,195,148,135,38,158,141,60,192,174,164,188,175,129,30,247,232,203,128,170,135,184,44,174,84,102,164,203,115,206,125,73,243,42,201,249,222,214,140,198,85,129,65,90,154,156,101,102,103,165,70,63,38,130,131,73,86,112,105,246,148,14,165,58,252,45,57,181,64,118,241,142,167,137,63,102,207,118,154,48,241,203,138,107,25,139,29,16,3,230,30,105,57,161,136,128,125,156,56,105,47,42,125,156,106,80,102,89,8,55,104,215,254,110,132,213,46,28,61,81,114,95,30,186,7,142,15,180,102,61,203,34,132,50,133,13,58,40,251,27,115,206,165,182,82,109,179,26,109,47,40,196,244,83,27,219,178,95,92,237,210,83,182,178,161,102,214,80,193,246,44,1,65,168,82,250,244,129,202,141,70,164,74,55,178,156,73,191,131,79,27,50,21,128,44,6,45,173,41,245,193,53,183,99,75,104,138,206,196,43,68,16,153,141,126,200,43,74,168,222,48,145,243,67,118,56,146,104,159,136,119,209,183,224,113,123,8,210,242,247,18,170,77,189,236,141,181,225,102,21,167,54,167,91,112,25,57,40,5,21,89,57,117,111,78,24,38,0,94,229,200,17,143,216,237,141,69,164,48,235,169,234,153,255,167,12,200,251,164,10,245,198,6,187,81,192,157,65,171,131,3,27,178,60,254,62,28,68,5,22,189,200,105,140,95,139,152,136,149],\"8\":[163,17,66,120,5,244,188,246,165,142,192,57,214,175,164,32,233,218,67,224,33,165,156,16,32,188,39,211,111,46,82,235,71,80,21,214,155,148,89,121,7,68,112,113,116,189,107,103,178,148,41,80,67,173,8,142,38,245,240,85,36,249,103,208,105,42,193,97,157,51,101,110,248,247,98,222,57,75,195,184,79,10,191,153,211,144,177,97,92,250,61,176,230,190,159,43,63,1,0,31,202,109,239,242,251,129,58,10,148,97,254,13,214,179,167,7,179,228,255,113,46,97,21,118,141,84,46,251,179,0,172,26,31,219,144,132,121,77,241,108,218,124,119,255,105,67,254,45,131,5,223,6,194,74,11,93,249,36,80,232,54,156,208,230,14,56,83,53,243,227,253,254,41,174,155,59,18,105,153,53,33,69,84,228,29,173,54,152,205,111,55,3,203,151,160,177,161,154,80,30,89,87,154,151,42,0,185,42,242,171,213,250,148,243,73,98,30,162,136,188,8,46,141,154,25,238,142,27,14,162,190,195,204,86,113,158,70,181,141,248,45,90,170,158,111,167,200,174,97,21,111,214,251,68,91,37,247,217,133,47,120,45,194,234,168,233,85,120,104,71,151,137,155,244,118,78,81,194,217,57,74,239,25,112,202,176,15,156,84,72,194,20,181,180,198,57,169,1,90,24,85,118,227,199,151,213,47,39,47,128,82,58,237,123,144,188,221,253,139,154,154,159,64,207,238,71,60,136,116,159,180,44,209,50,199,106,178,179,254,71,21,22,7,120,167,52,191,82,231,106,177,44,158,164,103,175,21,237,220,20,156,241,251,243,108,64,113,95,206,251,81,101,28,107,247,2,75,159,5,175,99,14,160,179,141,115,153,118,189,42,108,93,195,204,168,8,187,146,205,52,248,105,91,5,30,71,239,27,176,10,147,50,206,242,207,195,221,220,94,134,71,149,8,29,60,193,113,237,178,82,248,98,214,230,242,122,253,128,125,189,133,252,101,231,66,209,253,211,13,9,185,136,2,151,100,175,85,87,251,60,201,43,75,6,118,133,247,43,187,240,65,206,13,180,196,16,164,118,106,142,50,180,64,17,230,139,235,197,225,158,145,105,188,156,117,144,110,248,204,245,105,133,73,213,245,146,70,19,15,180,232,42,214,234,221,183,158,209,126,29,139,75,94,93,52,153,158,249,195,197,15,75,187,53,114,168,253,77,239,34,39,188,63,205,85,243,7,186,193,147,78,71,132,129,97,242,127,219,222,135,253,102,200,116,239,71,191,137,75,47,37,1,37,223,169,127,30,213,125,153,193,254,136,99,44,82,141,198,246,211,79,34,128,216,193,100,117,137,43,217,83,143,207,83,99,180,42,253,214,124,247,9,215,139,220,75,166,217,92,55,71,242,169,32,1,59,225,204,98,90,223,175,71,28,91,201,196,42,227,186,170,67,193,32,242,8,137,183,94,150,120,32,42,22,141,172,56,38,68,155,128,133,191,183,67,127,61,247,3,60,187,210,6,38,243,51,17,9,84,216,241,95,219,116,66,153,41,133,178,11,240,148,170,225,93,248,250,226,119,52,201,33,17,120,198,155,201,170,244,130,122,88,162,131,104,172,167,184,236,82,202,249,6,144,123,170,186,67,154,236,40,71,81,102,91,98,227,160,217,7,241,193,116,215,146,164,123,210,134,208,141,4,180,223,54,83,112,67,163,16,138,33,110,160,191,12,164,237,131,14,223,179,53,218,172,128,184,225,92,109,58,53,136,167,79,239,2,88,5,188,132,232,101,104,9,80,3,252,25,52,170,72,134,81,166,226,201,170,110,39,108,173,21,154,74,89,165,47,214,115,91,10,183,245,146,193,179,113,226,119,124,61,8,202,15,218,139,23,56,246,56,21,236,2,246,161,212,86,150,175,142,163,236,54,61,102,138,190,187,230,90,53,52,202,17,42,149,210,97,59,6,152,172,184,208,140,119,35,47,246,126,159,198,99,27,233,108,144,45,134,9,155,130,95,94,210,64,141,178,107,133,101,26,228,156,109,217,211,232,53,184,188,44,33,104,122,108,204,21,75,167,199,222,186,197,58,0,37,16,71,119,252,197,251,25,53,132,9,243,31,14,246,177,196,37,30,168,217,47,147,88,104,186,174,32,87,13,53,184,198,217,195,53,221,66,3,152,227,232,147,79,58,22,98,188,137,220,14,171,121,42,158,123,4,164,2,209,5,36,31,158,250,201,25,5,67],\"3\":[9,40,233,153,173,55,216,205,244,126,162,110,157,130,69,251,118,87,249,182,222,27,140,244,48,27,127,46,243,185,193,244,102,201,100,171,44,161,215,111,174,202,73,173,216,139,200,116,153,158,234,28,105,94,102,77,193,13,133,94,232,11,229,252,233,80,74,79,136,9,65,174,221,137,94,25,149,229,107,147,241,227,221,58,38,190,67,128,163,203,12,83,236,227,81,49,52,27,17,184,212,139,108,42,15,243,12,189,83,113,106,106,98,48,185,119,115,29,171,206,191,50,202,4,27,128,99,211,141,218,35,151,154,248,84,129,193,154,4,184,108,216,62,92,86,39,226,4,142,213,224,82,123,211,254,40,14,241,3,113,69,227,66,195,117,107,23,65,197,71,243,243,38,99,13,171,120,255,125,95,230,244,222,156,110,215,248,226,73,163,210,12,169,99,60,106,212,207,86,80,111,86,230,90,10,207,50,255,211,63,92,203,40,176,95,83,255,167,192,229,33,96,166,170,230,147,69,143,13,36,150,45,242,46,139,211,75,61,164,87,43,133,238,108,186,157,127,67,7,140,21,96,225,197,179,108,88,148,114,100,82,114,174,66,125,195,78,242,116,29,203,43,122,123,244,168,9,80,0,212,132,190,15,142,107,86,127,2,20,75,226,106,143,136,232,58,35,223,48,97,231,47,12,243,115,72,186,39,249,250,4,37,87,76,209,0,119,95,249,110,153,186,111,238,64,116,8,77,129,184,169,166,202,186,135,195,233,189,44,208,122,243,95,138,88,144,46,234,65,62,39,199,209,128,212,122,222,165,67,166,213,157,29,130,239,52,3,47,24,17,93,78,142,202,222,160,79,67,70,107,138,200,167,254,183,245,230,230,79,221,169,95,113,229,170,72,4,132,6,40,133,131,85,165,51,230,91,181,181,135,3,89,26,43,174,74,154,196,227,91,251,64,32,176,39,245,110,79,158,160,9,89,189,232,224,16,203,41,69,243,119,241,12,91,222,26,237,49,87,208,242,176,44,91,70,51,19,216,70,196,38,79,45,220,17,113,18,114,169,151,253,45,30,85,50,228,162,51,91,172,46,201,238,189,102,244,160,129,188,165,193,104,218,193,224,27,239,8,133,95,168,185,163,207,190,105,10,60,8,235,82,160,210,212,17,40,129,6,34,81,35,25,132,236,202,14,150,76,111,77,64,217,86,35,248,30,2,2,226,115,244,209,20,76,19,133,86,208,3,49,71,124,156,222,16,31,49,200,52,92,213,88,100,7,222,184,50,223,83,223,43,56,165,123,137,45,87,150,142,154,253,154,109,193,42,190,170,125,86,100,0,93,248,10,248,151,218,219,55,252,183,214,219,56,4,215,8,130,146,18,175,159,146,64,171,193,27,19,211,92,221,195,224,23,44,195,176,225,173,169,169,151,42,115,59,176,174,85,117,200,200,216,78,241,50,199,136,75,59,193,93,239,166,146,172,112,151,146,21,65,23,25,193,4,109,87,160,133,2,159,97,114,225,208,3,123,105,90,48,189,148,83,99,194,1,103,167,116,238,182,150,133,233,247,82,201,127,173,24,154,37,98,247,203,32,95,171,95,200,92,132,230,254,34,243,253,113,126,199,15,205,195,57,210,3,183,192,89,108,31,227,178,155,0,31,187,233,184,159,142,221,235,101,9,249,145,154,120,12,222,24,178,31,96,252,137,28,0,96,73,25,233,229,169,115,93,97,152,54,228,236,148,243,224,97,137,154,86,42,51,6,240,4,94,85,60,182,215,80,252,144,98,148,23,157,66,222,164,22,42,40,14,66,130,94,182,224,113,183,64,140,252,114,118,93,136,48,20,34,127,19,95,97,137,99,121,14,124,5,24,251,215,92,187,225,228,218,172,40,78,197,166,104,57,162,192,174,119,94,137,11,152,68,184,243,143,122,139,85,230,22,190,226,251,146,182,89,218,89,180,96,250,21,112,231,76,213,119,132,2,162,150,79,206,17,241,61,20,172,188,164,108,114,38,96,227,244,228,134,48,133,86,9,123,125,209,51,245,87,142,246,197,136,81,230,145,101,105,186,154,189,82,244,177,228,63,88,78,139,109,157,71,248,180,7,211,192,242,99,118,176,103,189,225,31,167,96,231,120,243,162,161,6,175,155,59,31,148,86,137,18,97,213,170,80,254,67,68,228,47,59,195,99,46,86,227,99,133,42,52,6,80,48,192,135,118,83,200,127,99,101,165,97,153,27,188],\"6\":[90,149,140,53,121,148,108,180,117,11,173,24,107,54,142,171,218,60,71,105,217,215,43,46,173,123,191,107,122,83,66,74,253,162,177,49,80,137,8,35,213,158,73,223,188,123,59,201,123,174,197,146,239,180,13,217,165,229,173,243,106,162,100,177,1,14,59,7,47,76,29,116,141,60,194,240,73,224,215,233,186,21,191,4,201,128,204,182,157,240,55,244,80,184,209,247,147,96,177,231,215,11,75,148,176,242,112,67,169,38,94,30,133,37,184,98,184,58,123,227,189,112,98,198,128,212,41,23,68,243,236,117,174,69,20,97,48,168,128,254,239,203,132,172,190,92,230,154,40,213,88,131,131,56,159,119,154,125,114,228,200,121,81,155,195,164,47,236,1,67,34,253,191,80,179,143,19,91,31,1,38,104,233,193,205,135,2,243,31,132,228,206,40,224,178,228,206,115,84,87,172,81,10,169,230,171,58,128,15,98,150,231,84,233,198,41,21,23,68,17,242,222,46,142,246,177,46,250,72,108,21,55,129,136,105,168,199,12,19,44,49,217,222,203,89,19,98,191,229,48,145,132,109,44,96,23,223,11,146,16,43,30,55,118,24,222,52,255,223,158,113,105,0,111,80,140,236,34,90,102,177,175,161,154,218,185,139,253,227,105,53,178,242,136,30,199,77,103,100,187,68,187,112,221,113,255,15,205,83,237,111,56,5,121,65,205,100,102,172,63,228,29,201,41,64,99,226,235,69,42,186,161,131,186,231,39,125,244,245,74,168,16,218,179,247,182,26,156,49,191,85,196,226,16,8,104,82,19,64,52,174,200,62,56,76,190,94,182,32,61,168,223,131,147,146,227,213,205,31,16,169,70,7,68,175,4,172,45,129,11,83,47,228,62,97,144,197,64,97,7,254,152,244,33,102,73,137,50,75,98,203,250,228,208,20,205,207,52,69,45,223,58,71,128,55,116,132,58,97,201,235,116,198,25,157,226,89,188,52,28,167,232,217,219,157,150,132,175,136,37,28,104,119,42,170,138,68,155,216,236,119,200,205,16,84,253,178,3,178,25,239,250,136,214,109,237,185,216,245,166,209,14,161,220,233,238,95,38,144,29,42,72,245,85,204,230,186,102,149,41,208,35,207,71,163,130,18,11,65,15,36,253,44,126,247,209,2,39,46,142,45,215,131,226,58,104,236,144,107,58,252,224,105,125,251,191,104,13,200,240,157,154,58,207,73,219,235,131,18,202,186,66,201,190,3,0,45,82,232,23,243,7,154,243,128,175,247,240,172,131,114,213,57,70,254,3,44,226,19,174,51,81,69,58,194,170,244,161,187,239,238,37,29,175,237,196,234,252,179,107,233,237,39,93,68,155,75,234,45,187,209,165,153,151,35,11,247,98,94,16,86,117,4,90,109,27,198,128,2,44,253,191,107,76,167,84,137,64,197,122,168,18,20,97,28,128,241,41,6,94,134,25,66,96,215,245,134,203,174,215,32,80,62,22,116,226,145,2,244,165,171,103,12,71,226,213,59,2,246,143,196,252,124,70,104,136,227,185,244,39,126,7,37,201,117,106,107,90,157,195,134,140,220,31,240,42,114,123,207,123,204,69,226,13,93,31,250,142,108,63,92,132,136,16,70,241,34,16,24,206,139,218,133,140,1,200,193,150,88,3,153,109,196,50,3,233,230,228,116,221,133,195,104,67,95,27,2,141,19,35,28,205,176,163,6,119,208,11,104,57,233,41,50,3,93,135,150,147,174,130,131,34,14,167,175,155,244,184,71,96,36,63,148,39,45,119,20,182,97,143,44,237,184,53,200,7,225,217,233,23,94,129,225,206,36,229,85,130,139,57,212,130,101,182,78,205,201,43,29,23,18,183,176,108,134,52,180,219,67,166,10,85,36,123,9,13,89,237,65,6,58,51,117,133,123,4,1,190,159,197,9,140,217,204,239,2,43,231,70,196,114,153,231,17,254,19,80,75,61,218,142,66,157,71,172,94,8,32,7,133,222,166,32,34,126,225,230,163,128,124,199,118,149,212,109,117,39,255,133,163,171,33,175,194,233,143,224,114,237,34,33,151,250,210,213,118,135,57,4,177,51,204,39,81,248,239,253,102,249,199,110,102,241,170,30,29,93,163,77,192,27,71,132,225,108,66,5,64,20,148,63,66,121,126,136,126,44,82,188,221,155,250,151,101,32,97,218,213,126,152,139,88,3,53,177,220,10,91,205,108,54,208,79,252,23,23],\"2\":[35,58,103,185,133,5,217,87,173,98,13,139,28,66,70,181,216,126,92,223,91,190,162,214,239,23,164,194,176,197,187,46,223,24,241,122,159,20,161,75,168,116,153,227,60,9,164,69,215,225,21,15,121,50,18,42,105,0,140,158,59,18,48,161,182,220,105,162,6,60,90,88,80,17,172,255,170,59,81,90,221,141,228,102,77,42,120,203,127,233,67,19,71,188,64,46,225,20,69,228,0,206,104,12,140,232,183,201,52,236,145,173,45,46,29,211,183,16,91,153,47,48,184,93,12,232,33,231,250,248,204,69,3,211,4,100,171,68,207,74,121,146,190,83,251,66,148,116,160,35,114,124,68,225,167,23,132,159,253,71,68,235,198,117,96,69,96,51,85,81,209,96,152,94,102,11,195,75,105,16,134,238,218,103,242,82,47,23,9,172,51,53,2,193,16,169,105,211,112,33,198,167,42,68,79,14,1,167,88,172,194,52,89,244,140,160,47,182,212,237,165,57,209,233,52,208,154,231,86,116,48,30,76,19,7,20,124,94,202,187,253,133,167,92,81,29,142,141,120,44,126,39,6,24,54,180,248,189,110,200,175,178,254,135,137,167,84,10,206,109,66,20,230,186,46,190,91,170,167,216,187,129,217,34,184,224,225,216,102,144,105,137,16,244,188,254,130,53,108,176,126,166,2,207,182,252,60,15,97,8,69,248,58,92,184,25,19,186,18,77,227,140,17,248,169,101,134,109,1,102,238,197,118,232,234,12,70,212,99,83,223,126,226,55,8,18,228,67,65,121,44,90,48,97,195,244,109,0,55,170,19,192,242,180,148,84,200,101,86,9,237,188,12,171,166,184,27,202,144,53,44,126,129,126,198,143,37,107,51,202,25,20,164,49,36,126,68,38,32,12,224,203,203,67,196,43,139,98,246,226,226,114,28,53,16,105,79,163,40,212,21,228,3,20,20,218,29,98,57,64,117,127,99,201,143,101,78,19,7,4,252,131,109,27,189,204,27,10,96,174,53,126,251,10,164,19,21,81,182,40,123,53,60,227,133,120,108,26,149,25,77,67,125,118,83,18,164,118,94,248,206,224,125,103,188,184,51,109,80,118,99,86,194,78,163,32,45,64,106,174,58,45,0,75,54,67,118,236,171,113,12,26,148,77,57,146,66,12,245,53,172,25,214,205,252,112,230,100,127,32,217,104,124,183,88,237,175,175,88,126,87,194,208,190,89,219,67,206,151,88,217,112,56,119,57,167,1,250,239,190,196,136,21,225,244,236,119,28,253,204,243,241,56,99,163,199,186,254,41,119,103,102,241,208,152,237,210,161,32,93,35,238,213,255,208,33,201,172,74,73,224,172,133,216,145,30,208,186,222,81,192,151,183,154,102,233,30,3,95,196,41,89,248,132,255,101,5,143,151,14,122,189,219,115,234,104,191,163,4,190,129,129,200,90,155,111,113,213,125,170,12,138,185,23,110,149,41,135,209,122,136,87,239,115,204,198,170,246,79,218,227,144,148,23,199,235,214,1,58,44,105,49,151,140,80,37,249,124,113,59,204,203,134,34,179,94,231,149,142,126,12,232,168,214,114,11,62,39,59,96,51,190,5,128,184,92,163,177,99,130,6,89,114,221,40,175,174,5,177,112,160,28,196,20,3,32,68,221,181,104,92,250,191,89,97,29,241,225,107,144,235,212,173,120,71,21,213,185,12,231,154,58,20,151,205,122,175,220,198,131,18,68,91,207,83,248,148,165,28,135,122,205,213,202,227,226,121,121,182,144,191,146,97,158,128,11,119,233,128,106,195,128,105,42,171,55,179,9,5,210,118,50,225,38,171,197,14,97,11,131,27,250,67,107,95,147,53,1,93,62,153,199,149,95,22,200,222,143,80,70,253,205,111,5,245,59,105,254,206,251,238,182,120,56,94,160,71,120,57,28,51,199,215,93,10,220,118,87,38,148,10,244,254,37,114,130,236,122,86,88,62,194,26,101,31,194,226,46,26,90,75,167,185,221,146,117,47,152,133,140,178,17,52,253,142,174,168,223,87,111,132,225,105,192,181,169,7,186,14,19,236,152,11,160,143,4,129,181,115,88,61,156,3,194,84,7,222,137,196,192,168,117,122,160,132,131,103,113,59,129,112,35,8,229,111,44,66,176,252,64,34,243,76,30,146,116,232,47,166,100,246,215,36,12,145,229,129,253,29,6,129,151,28,172,205,109,128,77,115,9,180,145,226,7,211,100]},\"reachable\":{\"{\\\"addr\\\":[49,57,49,46,49,56,48,46,49,48,51,46,50,51,54,0],\\\"port\\\":50309,\\\"uid_fingerprint\\\":17576062521251310994,\\\"info\\\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,70,68,56,68,67,55,69,70,57,50,70,49,70,49,52,68,48,48,67,70,57,68,54,70,54,50,57,55,65,51,52,54,56,66,53,57,69,55,48,55,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}\":[[6,0],[7,0]],\"{\\\"addr\\\":[49,51,50,46,49,56,49,46,49,53,53,46,55,54,0,0],\\\"port\\\":55241,\\\"uid_fingerprint\\\":4215620865531854407,\\\"info\\\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,67,66,70,56,51,51,51,49,54,53,70,49,67,51,53,65,68,70,48,54,66,70,52,50,53,49,48,52,69,56,51,51,65,68,68,65,49,54,53,66,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,32,102,108,97,103,115,61,83,111,109,101,40,123,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}\":[[1,1]],\"{\\\"addr\\\":[49,53,54,46,55,50,46,50,49,57,46,52,57,0,0,0],\\\"port\\\":56030,\\\"uid_fingerprint\\\":8564141605929456761,\\\"info\\\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,68,56,66,67,67,48,69,67,70,69,50,67,57,54,53,65,66,67,50,57,67,54,50,55,70,68,67,69,67,48,66,48,54,67,53,65,68,66,49,54,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}\":[[1,2]],\"{\\\"addr\\\":[50,49,54,46,49,49,55,46,51,46,54,50,0,0,0,0],\\\"port\\\":63174,\\\"uid_fingerprint\\\":922068108643293997,\\\"info\\\":[116,121,112,101,61,115,99,114,97,109,98,108,101,115,117,105,116,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,70,68,56,68,67,55,69,70,57,50,70,49,70,49,52,68,48,48,67,70,57,68,54,70,54,50,57,55,65,51,52,54,56,66,53,57,69,55,48,55,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,83,111,109,101,40,123,34,112,97,115,115,119,111,114,100,34,58,32,34,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,50,51,52,53,54,55,34,125,41,0]}\":[[6,1],[8,0]],\"{\\\"addr\\\":[50,49,54,46,49,49,55,46,51,46,54,50,0,0,0,0],\\\"port\\\":63174,\\\"uid_fingerprint\\\":9189545078772697644,\\\"info\\\":[116,121,112,101,61,115,99,114,97,109,98,108,101,115,117,105,116,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,69,68,67,51,65,65,48,51,70,69,54,69,53,50,66,69,55,55,56,68,68,52,54,70,50,55,68,51,53,56,57,57,51,66,55,65,49,48,65,52,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,83,111,109,101,40,123,34,112,97,115,115,119,111,114,100,34,58,32,34,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,50,51,52,53,54,55,34,125,41,0]}\":[[6,2],[9,0]],\"{\\\"addr\\\":[50,49,54,46,49,49,55,46,51,46,54,50,0,0,0,0],\\\"port\\\":63174,\\\"uid_fingerprint\\\":14821306939685929169,\\\"info\\\":[116,121,112,101,61,115,99,114,97,109,98,108,101,115,117,105,116,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,66,48,56,49,49,56,65,56,48,68,55,54,54,66,65,57,65,56,70,57,65,55,50,50,67,50,54,54,49,52,69,48,54,66,56,54,69,52,67,65,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,83,111,109,101,40,123,34,112,97,115,115,119,111,114,100,34,58,32,34,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,50,51,52,53,54,55,34,125,41,0]}\":[[10,0]],\"{\\\"addr\\\":[49,51,52,46,50,48,55,46,50,51,53,46,49,48,53,0],\\\"port\\\":9042,\\\"uid_fingerprint\\\":5838789323103363859,\\\"info\\\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,56,48,55,56,70,57,55,66,50,50,49,53,55,69,66,55,49,54,65,69,66,68,53,54,65,57,52,55,54,67,51,55,56,57,57,65,68,70,54,65,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}\":[[2,2],[5,0]],\"{\\\"addr\\\":[50,50,46,50,52,49,46,56,49,46,54,50,0,0,0,0],\\\"port\\\":36457,\\\"uid_fingerprint\\\":14409951350199027285,\\\"info\\\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,68,68,56,56,57,53,48,56,48,48,50,70,57,50,53,67,70,55,52,69,49,51,48,68,49,48,49,67,68,70,49,67,49,51,51,65,65,65,68,49,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}\":[[10,2]],\"{\\\"addr\\\":[49,57,53,46,55,50,46,55,52,46,49,49,55,0,0,0],\\\"port\\\":28746,\\\"uid_fingerprint\\\":8013544061081454931,\\\"info\\\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,50,57,49,49,48,66,55,68,57,69,57,54,48,65,53,67,52,50,56,52,56,55,55,50,65,70,54,50,52,65,51,66,50,55,65,50,68,69,52,69,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,32,102,108,97,103,115,61,83,111,109,101,40,123,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}\":[[2,0],[3,0]],\"{\\\"addr\\\":[49,50,56,46,49,51,57,46,52,52,46,49,53,55,0,0],\\\"port\\\":10839,\\\"uid_fingerprint\\\":16072135124933872676,\\\"info\\\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,55,67,53,65,51,68,67,53,51,49,48,55,53,53,48,54,65,50,52,52,65,51,67,70,49,57,66,53,55,70,52,68,69,52,55,55,67,65,54,51,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}\":[[2,1],[4,0]],\"{\\\"addr\\\":[50,49,50,46,49,54,54,46,49,54,54,46,54,55,0,0],\\\"port\\\":32414,\\\"uid_fingerprint\\\":3643046579853129326,\\\"info\\\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,66,48,56,49,49,56,65,56,48,68,55,54,54,66,65,57,65,56,70,57,65,55,50,50,67,50,54,54,49,52,69,48,54,66,56,54,69,52,67,65,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,102,97,115,116,34,58,32,116,114,117,101,44,32,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}\":[[1,0]],\"{\\\"addr\\\":[57,55,46,49,55,53,46,57,49,46,55,0,0,0,0,0],\\\"port\\\":27719,\\\"uid_fingerprint\\\":9270304952963857555,\\\"info\\\":[116,121,112,101,61,111,98,102,115,50,32,98,108,111,99,107,101,100,95,105,110,61,123,125,32,112,114,111,116,111,99,111,108,61,116,99,112,32,102,105,110,103,101,114,112,114,105,110,116,61,34,69,68,67,51,65,65,48,51,70,69,54,69,53,50,66,69,55,55,56,68,68,52,54,70,50,55,68,51,53,56,57,57,51,66,55,65,49,48,65,52,34,32,111,114,95,97,100,100,114,101,115,115,101,115,61,78,111,110,101,32,100,105,115,116,114,105,98,117,116,105,111,110,61,104,116,116,112,115,32,102,108,97,103,115,61,83,111,109,101,40,123,34,115,116,97,98,108,101,34,58,32,116,114,117,101,44,32,34,114,117,110,110,105,110,103,34,58,32,116,114,117,101,44,32,34,118,97,108,105,100,34,58,32,116,114,117,101,44,32,34,102,97,115,116,34,58,32,116,114,117,101,125,41,32,112,97,114,97,109,115,61,78,111,110,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}\":[[10,1]]},\"spares\":[10,1],\"unallocated_bridges\":[],\"recycleable_keys\":[],\"blocked_keys\":[],\"open_inv_keys\":[[3,2460237],[4,2460237],[5,2460237],[7,2460237],[8,2460237],[9,2460237]],\"date_last_enc\":2460237},\"trustup_migration_table\":{\"table\":{\"5\":2,\"4\":2,\"9\":6,\"7\":6,\"3\":2,\"8\":6},\"migration_type\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},\"blockage_migration_table\":{\"table\":{},\"migration_type\":[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},\"openinv_filter\":{\"seen_table\":[[167,121,14,179,249,174,210,194,223,78,92,229,191,6,227,23,111,17,206,87,132,3,0,86,116,37,13,177,246,57,9,0],[20,146,141,79,128,206,56,95,212,130,37,81,177,11,14,184,9,71,14,116,101,107,243,17,237,199,192,127,212,63,30,7]]},\"id_filter\":{\"seen_table\":[]},\"inv_id_filter\":{\"seen_table\":[]},\"trust_promotion_filter\":{\"seen_table\":[]}},\"extra_bridges\":[],\"to_be_replaced_bridges\":[]}"; let test_context: LoxServerContext = serde_json::from_str(&test_string).unwrap(); lox_db.write_context(test_context); assert!( diff --git a/crates/lox-wasm/Cargo.toml b/crates/lox-wasm/Cargo.toml index e1c8c60..20cece6 100644 --- a/crates/lox-wasm/Cargo.toml +++ b/crates/lox-wasm/Cargo.toml @@ -10,6 +10,7 @@ license = "MIT" crate-type = ["cdylib"] [dependencies] +getrandom = { version = "0.2", features = ["js"] } julianday = "1.2.0" lazy_static = "1.4.0" lox-library = { path = "../lox-library", version = "0.1.0" } From ed72b05347931d6824df5ab9aece493cdc88ce2c Mon Sep 17 00:00:00 2001 From: onyinyang Date: Thu, 21 Sep 2023 10:25:28 -0400 Subject: [PATCH 44/59] Add changes for bug fix in zkp crate --- .../src/proto/blockage_migration.rs | 55 ++++--------------- 1 file changed, 12 insertions(+), 43 deletions(-) diff --git a/crates/lox-library/src/proto/blockage_migration.rs b/crates/lox-library/src/proto/blockage_migration.rs index 9c6cc87..7b18902 100644 --- a/crates/lox-library/src/proto/blockage_migration.rs +++ b/crates/lox-library/src/proto/blockage_migration.rs @@ -26,9 +26,7 @@ and a new Lox credential to be issued: - trust_level: revealed to be 2 less than the trust_level above - level_since: today - invites_remaining: revealed to be LEVEL_INVITATIONS for the new trust - level [Actually, there's a bug in the zkp crate that's triggered when - a public value is 0 (the identity element of the Ristretto group), so - we treat this field as blinded, but the _server_ encrypts the value.] + level - blockages: blinded, but proved in ZK that it's one more than the blockages above @@ -100,15 +98,14 @@ pub struct Response { // The new attributes; the trust_level and invites_remaining are // implicit level_since: Scalar, + invremain: Scalar, // The fields for the new Lox credential P: RistrettoPoint, EncQ: (RistrettoPoint, RistrettoPoint), - EncInvRemain: (RistrettoPoint, RistrettoPoint), id_server: Scalar, TId: RistrettoPoint, TBucket: RistrettoPoint, - TInvRemain: RistrettoPoint, TBlockages: RistrettoPoint, // The ZKP @@ -155,11 +152,10 @@ define_proof! { blindissue, "Blockage Migration Blind Issuing", (x0, x0tilde, xid, xbucket, xlevel, xsince, xinvremain, xblockages, - s, b, tid, tbucket, tinvremain, tblockages), + s, b, tid, tbucket, tblockages), (P, EncQ0, EncQ1, X0, Xid, Xbucket, Xlevel, Xsince, Xinvremain, - Xblockages, Plevel, Psince, TId, TBucket, TInvRemain, TBlockages, - D, EncId0, EncId1, EncBucket0, EncBucket1, EncInvRemain0, - EncInvRemain1, EncBlockages0, EncBlockages1), + Xblockages, Plevel, Psince, Pinvremain, TId, TBucket, TBlockages, + D, EncId0, EncId1, EncBucket0, EncBucket1, EncBlockages0, EncBlockages1), (A, B): Xid = (xid*A), Xlevel = (xlevel*A), @@ -173,14 +169,12 @@ define_proof! { TId = (tid*A), TBucket = (b*Xbucket), TBucket = (tbucket*A), - TInvRemain = (b*Xinvremain), - TInvRemain = (tinvremain*A), TBlockages = (b*Xblockages), TBlockages = (tblockages*A), EncQ0 = (s*B + tid*EncId0 + tbucket*EncBucket0 - + tinvremain*EncInvRemain0 + tblockages*EncBlockages0), + + tblockages*EncBlockages0), EncQ1 = (s*D + tid*EncId1 + tbucket*EncBucket1 - + tinvremain*EncInvRemain1 + tblockages*EncBlockages1 + + tblockages*EncBlockages1 + x0*P + xlevel*Plevel + xsince*Psince) } @@ -484,14 +478,6 @@ impl BridgeAuth { // invitations for moving from level i to level i+1) let invremain: Scalar = LEVEL_INVITATIONS[(level - 3) as usize].into(); - // Because of the bug in the zkp crate, encrypt the invites - // remaining instead of sending it in the clear - let sinvremain = Scalar::random(&mut rng); - let EncInvRemain = ( - &sinvremain * Btable, - &invremain * Btable + sinvremain * req.D, - ); - // Compute the MAC on the visible attributes let b = Scalar::random(&mut rng); let P = &b * Btable; @@ -512,9 +498,6 @@ impl BridgeAuth { let tbucket = self.lox_priv.x[2] * b; let TBucket = &tbucket * Atable; let EncQBucket = (tbucket * req.EncBucket.0, tbucket * req.EncBucket.1); - let tinvremain = self.lox_priv.x[5] * b; - let TInvRemain = &tinvremain * Atable; - let EncQInvRemain = (tinvremain * EncInvRemain.0, tinvremain * EncInvRemain.1); let tblockages = self.lox_priv.x[6] * b; let TBlockages = &tblockages * Atable; let EncQBlockages = ( @@ -523,8 +506,8 @@ impl BridgeAuth { ); let EncQ = ( - EncQHc.0 + EncQId.0 + EncQBucket.0 + EncQInvRemain.0 + EncQBlockages.0, - EncQHc.1 + EncQId.1 + EncQBucket.1 + EncQInvRemain.1 + EncQBlockages.1, + EncQHc.0 + EncQId.0 + EncQBucket.0 + EncQBlockages.0, + EncQHc.1 + EncQId.1 + EncQBucket.1 + EncQBlockages.1, ); let mut transcript = Transcript::new(b"blockage migration issuing"); @@ -545,17 +528,15 @@ impl BridgeAuth { Xblockages: &self.lox_pub.X[6], Plevel: &(trust_level * P), Psince: &(level_since * P), + Pinvremain: &(invremain * P), TId: &TId, TBucket: &TBucket, - TInvRemain: &TInvRemain, TBlockages: &TBlockages, D: &req.D, EncId0: &EncId.0, EncId1: &EncId.1, EncBucket0: &req.EncBucket.0, EncBucket1: &req.EncBucket.1, - EncInvRemain0: &EncInvRemain.0, - EncInvRemain1: &EncInvRemain.1, EncBlockages0: &req.EncBlockages.0, EncBlockages1: &req.EncBlockages.1, x0: &self.lox_priv.x[0], @@ -570,7 +551,6 @@ impl BridgeAuth { b: &b, tid: &tid, tbucket: &tbucket, - tinvremain: &tinvremain, tblockages: &tblockages, }, ) @@ -578,13 +558,12 @@ impl BridgeAuth { Ok(Response { level_since, + invremain, P, EncQ, - EncInvRemain, id_server, TId, TBucket, - TInvRemain, TBlockages, piBlindIssue, }) @@ -601,7 +580,6 @@ pub fn handle_response( let A: &RistrettoPoint = &CMZ_A; let B: &RistrettoPoint = &CMZ_B; let Btable: &RistrettoBasepointTable = &CMZ_B_TABLE; - if resp.P.is_identity() { return Err(ProofError::VerificationFailure); } @@ -627,13 +605,6 @@ pub fn handle_response( // moving from level i to level i+1) let invremain: Scalar = LEVEL_INVITATIONS[(new_level - 1) as usize].into(); - // Decrypt EncInvRemain - let recv_invremain = resp.EncInvRemain.1 - (state.d * resp.EncInvRemain.0); - - if recv_invremain != &invremain * Btable { - return Err(ProofError::VerificationFailure); - } - // Verify the proof let mut transcript = Transcript::new(b"blockage migration issuing"); blindissue::verify_compact( @@ -654,17 +625,15 @@ pub fn handle_response( Xblockages: &lox_pub.X[6].compress(), Plevel: &(state.trust_level * resp.P).compress(), Psince: &(resp.level_since * resp.P).compress(), + Pinvremain: &(resp.invremain * resp.P).compress(), TId: &resp.TId.compress(), TBucket: &resp.TBucket.compress(), - TInvRemain: &resp.TInvRemain.compress(), TBlockages: &resp.TBlockages.compress(), D: &state.D.compress(), EncId0: &EncId.0.compress(), EncId1: &EncId.1.compress(), EncBucket0: &state.EncBucket.0.compress(), EncBucket1: &state.EncBucket.1.compress(), - EncInvRemain0: &resp.EncInvRemain.0.compress(), - EncInvRemain1: &resp.EncInvRemain.1.compress(), EncBlockages0: &state.EncBlockages.0.compress(), EncBlockages1: &state.EncBlockages.1.compress(), }, From 3b2ee73babc2270bbc1ab6a3d842f15e4955109b Mon Sep 17 00:00:00 2001 From: onyinyang Date: Thu, 5 Oct 2023 18:48:28 -0400 Subject: [PATCH 45/59] Remove backend options --- crates/lox-library/Cargo.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/crates/lox-library/Cargo.toml b/crates/lox-library/Cargo.toml index 217377a..b3aace3 100644 --- a/crates/lox-library/Cargo.toml +++ b/crates/lox-library/Cargo.toml @@ -28,8 +28,4 @@ thiserror = "1.0.49" zkp = { git = "https://gitlab.torproject.org/onyinyang/lox-zkp" } [features] -#default = ["u64_backend"] -#u32_backend = ["curve25519-dalek/u32_backend"] -#u64_backend = ["curve25519-dalek/u64_backend"] -#simd_backend = ["curve25519-dalek/simd_backend"] fast = [] From 96a03f1a278fd5d7b2c1833ddaac2ed011f4fd3d Mon Sep 17 00:00:00 2001 From: onyinyang Date: Mon, 23 Oct 2023 16:45:14 -0400 Subject: [PATCH 46/59] Remove non-implicit invremain attribute fields --- Cargo.lock | 4 ++-- crates/lox-library/src/proto/blockage_migration.rs | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cfb312a..d253f79 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2479,8 +2479,8 @@ dependencies = [ [[package]] name = "zkp" -version = "0.7.0" -source = "git+https://gitlab.torproject.org/onyinyang/lox-zkp#0210f272211bd9a4000e3ee9dd9358316b0a8d0c" +version = "0.8.0" +source = "git+https://gitlab.torproject.org/onyinyang/lox-zkp#7dc7562ecdac3a6c7c7ecc31cace192174d34778" dependencies = [ "curve25519-dalek", "merlin", diff --git a/crates/lox-library/src/proto/blockage_migration.rs b/crates/lox-library/src/proto/blockage_migration.rs index 7b18902..c367dcf 100644 --- a/crates/lox-library/src/proto/blockage_migration.rs +++ b/crates/lox-library/src/proto/blockage_migration.rs @@ -98,7 +98,6 @@ pub struct Response { // The new attributes; the trust_level and invites_remaining are // implicit level_since: Scalar, - invremain: Scalar, // The fields for the new Lox credential P: RistrettoPoint, @@ -558,7 +557,6 @@ impl BridgeAuth { Ok(Response { level_since, - invremain, P, EncQ, id_server, @@ -625,7 +623,7 @@ pub fn handle_response( Xblockages: &lox_pub.X[6].compress(), Plevel: &(state.trust_level * resp.P).compress(), Psince: &(resp.level_since * resp.P).compress(), - Pinvremain: &(resp.invremain * resp.P).compress(), + Pinvremain: &(invremain * resp.P).compress(), TId: &resp.TId.compress(), TBucket: &resp.TBucket.compress(), TBlockages: &resp.TBlockages.compress(), From 449d56e43e6b6078c009230028c2f4e6a7b68075 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 23 Oct 2023 21:36:33 +0000 Subject: [PATCH 47/59] Update Rust crate base64 to 0.21.5 --- Cargo.lock | 4 ++-- crates/lox-distributor/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d253f79..798d708 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -147,9 +147,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.4" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] name = "base64ct" diff --git a/crates/lox-distributor/Cargo.toml b/crates/lox-distributor/Cargo.toml index ce30113..aaa00cf 100644 --- a/crates/lox-distributor/Cargo.toml +++ b/crates/lox-distributor/Cargo.toml @@ -12,7 +12,7 @@ keywords = ["tor", "lox", "bridges"] [dependencies] julianday = "1.2.0" -base64 = "0.21.4" +base64 = "0.21.5" hyper = { version = "0.14.27", features = ["server"] } hex_fmt = "0.3" futures = "0.3.28" From 683595abbc201098acf4fb3c241cbecc69635d08 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 26 Oct 2023 04:06:18 +0000 Subject: [PATCH 48/59] Update Rust crate serde to 1.0.190 --- Cargo.lock | 8 ++++---- crates/lox-library/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 798d708..616da61 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1809,18 +1809,18 @@ checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" [[package]] name = "serde" -version = "1.0.189" +version = "1.0.190" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" +checksum = "91d3c334ca1ee894a2c6f6ad698fe8c435b76d504b13d436f0685d648d6d96f7" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.189" +version = "1.0.190" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" +checksum = "67c5609f394e5c2bd7fc51efda478004ea80ef42fee983d5c67a65e34f32c0e3" dependencies = [ "proc-macro2", "quote", diff --git a/crates/lox-library/Cargo.toml b/crates/lox-library/Cargo.toml index b3aace3..087aa33 100644 --- a/crates/lox-library/Cargo.toml +++ b/crates/lox-library/Cargo.toml @@ -14,7 +14,7 @@ ed25519-dalek = { version = "2", features = ["serde", "rand_core"] } bincode = "1" chrono = "0.4" rand = { version = "0.8", features = ["std_rng"]} -serde = "1.0.189" +serde = "1.0.190" serde_with = {version = "3.4.0", features = ["json"]} sha2 = "0.10" statistical = "1.0.0" From 781f3e41428840bf58718cd4a58a0ed91133796b Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 24 Oct 2023 19:04:36 +0000 Subject: [PATCH 49/59] Update Rust crate clap to 4.4.7 --- Cargo.lock | 16 ++++++++-------- crates/lox-distributor/Cargo.toml | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 616da61..7365bc0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -244,9 +244,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.6" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956" +checksum = "ac495e00dcec98c83465d5ad66c5c4fabd652fd6686e7c6269b117e729a6f17b" dependencies = [ "clap_builder", "clap_derive", @@ -254,9 +254,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.6" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45" +checksum = "c77ed9a32a62e6ca27175d00d29d05ca32e396ea1eb5fb01d8256b669cec7663" dependencies = [ "anstream", "anstyle", @@ -266,9 +266,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.2" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck", "proc-macro2", @@ -278,9 +278,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" [[package]] name = "cloudabi" diff --git a/crates/lox-distributor/Cargo.toml b/crates/lox-distributor/Cargo.toml index aaa00cf..a2eb9dc 100644 --- a/crates/lox-distributor/Cargo.toml +++ b/crates/lox-distributor/Cargo.toml @@ -26,7 +26,7 @@ zkp = { git = "https://gitlab.torproject.org/onyinyang/lox-zkp" } lox-library = { path = "../lox-library", version = "0.1.0"} lox_utils = { path = "../lox-utils", version = "0.1.0"} rdsys_backend = { path = "../rdsys-backend-api", version = "0.2"} -clap = { version = "4.4.6", features = ["derive"] } +clap = { version = "4.4.7", features = ["derive"] } serde_json = "1.0.107" sled = "0.34.7" From 7b84337aa12347e477a1fc63395766f7e40fa917 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 26 Oct 2023 15:04:46 +0000 Subject: [PATCH 50/59] Update Rust crate futures to 0.3.29 --- Cargo.lock | 36 ++++++++++++++--------------- crates/lox-distributor/Cargo.toml | 2 +- crates/rdsys-backend-api/Cargo.toml | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7365bc0..454780b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -611,9 +611,9 @@ checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" [[package]] name = "futures" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" dependencies = [ "futures-channel", "futures-core", @@ -626,9 +626,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" dependencies = [ "futures-core", "futures-sink", @@ -636,15 +636,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" dependencies = [ "futures-core", "futures-task", @@ -653,15 +653,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ "proc-macro2", "quote", @@ -670,21 +670,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ "futures-channel", "futures-core", diff --git a/crates/lox-distributor/Cargo.toml b/crates/lox-distributor/Cargo.toml index a2eb9dc..0be884b 100644 --- a/crates/lox-distributor/Cargo.toml +++ b/crates/lox-distributor/Cargo.toml @@ -15,7 +15,7 @@ julianday = "1.2.0" base64 = "0.21.5" hyper = { version = "0.14.27", features = ["server"] } hex_fmt = "0.3" -futures = "0.3.28" +futures = "0.3.29" time = "0.3.30" tokio = { version = "1", features = ["full", "macros", "signal"] } rand = "0.8.5" diff --git a/crates/rdsys-backend-api/Cargo.toml b/crates/rdsys-backend-api/Cargo.toml index b2a8dec..265c3fa 100644 --- a/crates/rdsys-backend-api/Cargo.toml +++ b/crates/rdsys-backend-api/Cargo.toml @@ -17,6 +17,6 @@ sha1 = "0.10.6" tokio = { version = "1", features = ["full", "macros"] } reqwest = { version = "0.11", features = ["json", "stream"]} tokio-stream = "0.1.14" -futures = "0.3.28" +futures = "0.3.29" tokio-util = "0.7.9" chrono = { version = "0.4.31", features = ["serde", "clock"] } From 21159564797c628d1ccff2114f9b1d68188cb34e Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 26 Oct 2023 17:06:06 +0000 Subject: [PATCH 51/59] Update Rust crate tokio-util to 0.7.10 --- Cargo.lock | 4 ++-- crates/rdsys-backend-api/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 454780b..c1af959 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2131,9 +2131,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", diff --git a/crates/rdsys-backend-api/Cargo.toml b/crates/rdsys-backend-api/Cargo.toml index 265c3fa..e55a241 100644 --- a/crates/rdsys-backend-api/Cargo.toml +++ b/crates/rdsys-backend-api/Cargo.toml @@ -18,5 +18,5 @@ tokio = { version = "1", features = ["full", "macros"] } reqwest = { version = "0.11", features = ["json", "stream"]} tokio-stream = "0.1.14" futures = "0.3.29" -tokio-util = "0.7.9" +tokio-util = "0.7.10" chrono = { version = "0.4.31", features = ["serde", "clock"] } From 2f1c48c0aced48dcf0a85550182070e7d97219cc Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 30 Oct 2023 16:36:11 +0000 Subject: [PATCH 52/59] Update Rust crate serde_json to 1.0.108 --- Cargo.lock | 4 ++-- crates/lox-distributor/Cargo.toml | 2 +- crates/lox-utils/Cargo.toml | 2 +- crates/lox-wasm/Cargo.toml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c1af959..c9257a0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1829,9 +1829,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa", "ryu", diff --git a/crates/lox-distributor/Cargo.toml b/crates/lox-distributor/Cargo.toml index 0be884b..1f07a4c 100644 --- a/crates/lox-distributor/Cargo.toml +++ b/crates/lox-distributor/Cargo.toml @@ -27,7 +27,7 @@ lox-library = { path = "../lox-library", version = "0.1.0"} lox_utils = { path = "../lox-utils", version = "0.1.0"} rdsys_backend = { path = "../rdsys-backend-api", version = "0.2"} clap = { version = "4.4.7", features = ["derive"] } -serde_json = "1.0.107" +serde_json = "1.0.108" sled = "0.34.7" [dependencies.chrono] diff --git a/crates/lox-utils/Cargo.toml b/crates/lox-utils/Cargo.toml index dc47a11..c91fe99 100644 --- a/crates/lox-utils/Cargo.toml +++ b/crates/lox-utils/Cargo.toml @@ -14,7 +14,7 @@ repository = "https://gitlab.torproject.org/tpo/anti-censorship/lox.git/" [dependencies] lox-library = {path = "../lox-library", version = "0.1.0"} serde = "1" -serde_json = "1.0.107" +serde_json = "1.0.108" serde_with = "3.4.0" diff --git a/crates/lox-wasm/Cargo.toml b/crates/lox-wasm/Cargo.toml index 20cece6..6707a81 100644 --- a/crates/lox-wasm/Cargo.toml +++ b/crates/lox-wasm/Cargo.toml @@ -17,7 +17,7 @@ lox-library = { path = "../lox-library", version = "0.1.0" } lox_utils = { path = "../lox-utils", version = "0.1.0" } wasm-bindgen = "0.2" time = "0.3.30" -serde_json = "1.0.107" +serde_json = "1.0.108" console_error_panic_hook = "0.1.7" js-sys = "0.3.64" From ba70b1b4d44e2e8fb930c6026496afb928a98a6a Mon Sep 17 00:00:00 2001 From: onyinyang Date: Mon, 30 Oct 2023 12:42:15 -0400 Subject: [PATCH 53/59] Add a MAX_DAILY_BRIDGES to limit invites per day --- Cargo.lock | 22 +++++++++ crates/lox-distributor/src/db_handler.rs | 5 +- crates/lox-distributor/src/lox_context.rs | 19 ++++--- crates/lox-library/Cargo.toml | 1 + crates/lox-library/src/lib.rs | 60 ++++++++++++++++------- crates/lox-library/src/tests.rs | 2 +- crates/lox-library/tests/tests.rs | 2 +- 7 files changed, 83 insertions(+), 28 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c9257a0..1ff565e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1074,6 +1074,7 @@ dependencies = [ "ed25519-dalek", "hex_fmt", "lazy_static", + "prometheus", "rand 0.8.5", "serde", "serde_with", @@ -1458,6 +1459,27 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "prometheus" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" +dependencies = [ + "cfg-if", + "fnv", + "lazy_static", + "memchr", + "parking_lot 0.12.1", + "protobuf", + "thiserror", +] + +[[package]] +name = "protobuf" +version = "2.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" + [[package]] name = "quote" version = "1.0.32" diff --git a/crates/lox-distributor/src/db_handler.rs b/crates/lox-distributor/src/db_handler.rs index 133dbd0..d7a9bf4 100644 --- a/crates/lox-distributor/src/db_handler.rs +++ b/crates/lox-distributor/src/db_handler.rs @@ -123,12 +123,13 @@ fn use_last_context(lox_db: sled::Db) -> lox_context::LoxServerContext { #[cfg(test)] mod tests { use super::lox_context::LoxServerContext; - use super::DB; use super::DbConfig; + use super::DB; #[test] fn test_write_context() { - let (mut lox_db, _context) = DB::open_new_or_existing_db(DbConfig::default(), None).unwrap(); + let (mut lox_db, _context) = + DB::open_new_or_existing_db(DbConfig::default(), None).unwrap(); assert!( lox_db.db.is_empty(), "db read from context that shouldn't exist" diff --git a/crates/lox-distributor/src/lox_context.rs b/crates/lox-distributor/src/lox_context.rs index 492e17f..76e139a 100644 --- a/crates/lox-distributor/src/lox_context.rs +++ b/crates/lox-distributor/src/lox_context.rs @@ -6,7 +6,7 @@ use lox_library::{ blockage_migration, check_blockage, issue_invite, level_up, migration, open_invite, redeem_invite, trust_promotion, }, - BridgeAuth, BridgeDb, IssuerPubKey, + BridgeAuth, BridgeDb, ExceededMaxBridgesError, IssuerPubKey, }; use rdsys_backend::proto::{Resource, ResourceState}; use serde::{Deserialize, Serialize}; @@ -317,10 +317,11 @@ impl LoxServerContext { ] } - fn gen_invite(&self) -> lox_utils::Invite { + fn gen_invite(&self) -> Result { let mut obj = self.db.lock().unwrap(); - lox_utils::Invite { - invite: obj.invite(), + match obj.invite() { + Ok(invite) => Ok(lox_utils::Invite { invite }), + Err(e) => Err(e), } } @@ -382,8 +383,14 @@ impl LoxServerContext { // Generate and return an open invitation token pub fn generate_invite(self) -> Response { let invite = self.gen_invite(); - match serde_json::to_string(&invite) { - Ok(resp) => prepare_header(resp), + match invite { + Ok(invite) => match serde_json::to_string(&invite) { + Ok(resp) => prepare_header(resp), + Err(e) => { + println!("Error parsing Invite to JSON"); + prepare_error_header(e.to_string()) + } + }, Err(e) => { println!("Error parsing Invite to JSON"); prepare_error_header(e.to_string()) diff --git a/crates/lox-library/Cargo.toml b/crates/lox-library/Cargo.toml index 087aa33..647f32c 100644 --- a/crates/lox-library/Cargo.toml +++ b/crates/lox-library/Cargo.toml @@ -23,6 +23,7 @@ hex_fmt = "0.3" aes-gcm = { version = "0.10", features =["aes"]} base64 = "0.21" time = "0.3.30" +prometheus = "0.13.3" subtle = "2.5" thiserror = "1.0.49" zkp = { git = "https://gitlab.torproject.org/onyinyang/lox-zkp" } diff --git a/crates/lox-library/src/lib.rs b/crates/lox-library/src/lib.rs index c929e83..ee75858 100644 --- a/crates/lox-library/src/lib.rs +++ b/crates/lox-library/src/lib.rs @@ -22,6 +22,7 @@ pub mod cred; pub mod dup_filter; pub mod migration_table; +use chrono::Duration; use chrono::{DateTime, Utc}; use sha2::Sha512; @@ -78,6 +79,12 @@ pub enum NoAvailableIDError { ExhaustedIndexer, } +#[derive(Error, Debug)] +pub enum ExceededMaxBridgesError { + #[error("The maximum number of bridges has already been distributed today, please try again tomorrow!")] + ExceededMaxBridges, +} + #[derive(Clone, Debug, Serialize, Deserialize)] pub struct IssuerPrivKey { x0tilde: Scalar, @@ -123,7 +130,10 @@ impl IssuerPubKey { } } +// Number of times a given invitation is ditributed pub const OPENINV_K: u32 = 10; +// TODO: Decide on maximum daily number of invitations to be distributed +pub const MAX_DAILY_BRIDGES: u32 = 100; /// The BridgeDb. This will typically be a singleton object. The /// BridgeDb's role is simply to issue signed "open invitations" to /// people who are not yet part of the system. @@ -136,7 +146,10 @@ pub struct BridgeDb { /// The set of open-invitation buckets openinv_buckets: HashSet, distributed_buckets: Vec, - current_k: u32, + #[serde(skip)] + today: DateTime, + pub current_k: u32, + pub daily_bridges_distributed: u32, } /// An open invitation is a [u8; OPENINV_LENGTH] where the first 32 @@ -159,7 +172,9 @@ impl BridgeDb { pubkey, openinv_buckets: Default::default(), distributed_buckets: Default::default(), + today: Utc::now(), current_k: 0, + daily_bridges_distributed: 0, } } @@ -189,30 +204,39 @@ impl BridgeDb { /// Produce an open invitation such that the next k users, where k is < /// OPENINV_K, will receive the same open invitation bucket /// chosen randomly from the set of open-invitation buckets. - pub fn invite(&mut self) -> [u8; OPENINV_LENGTH] { + pub fn invite(&mut self) -> Result<[u8; OPENINV_LENGTH], ExceededMaxBridgesError> { let mut res: [u8; OPENINV_LENGTH] = [0; OPENINV_LENGTH]; let mut rng = rand::thread_rng(); // Choose a random invitation id (a Scalar) and serialize it let id = Scalar::random(&mut rng); res[0..32].copy_from_slice(&id.to_bytes()); let bucket_num: u32; - if self.current_k < OPENINV_K && !self.distributed_buckets.is_empty() { - bucket_num = *self.distributed_buckets.last().unwrap(); - self.current_k += 1; - } else { - // Choose a random bucket number (from the set of open - // invitation buckets) and serialize it - let openinv_vec: Vec<&u32> = self.openinv_buckets.iter().collect(); - bucket_num = *openinv_vec[rng.gen_range(0..openinv_vec.len())]; - self.mark_distributed(bucket_num); - self.remove_openinv(&bucket_num); - self.current_k = 1; + if Utc::now() >= (self.today + Duration::days(1)) { + self.today = Utc::now(); + self.daily_bridges_distributed = 0; + } + if self.daily_bridges_distributed < MAX_DAILY_BRIDGES { + if self.current_k < OPENINV_K && !self.distributed_buckets.is_empty() { + bucket_num = *self.distributed_buckets.last().unwrap(); + self.current_k += 1; + } else { + // Choose a random bucket number (from the set of open + // invitation buckets) and serialize it + let openinv_vec: Vec<&u32> = self.openinv_buckets.iter().collect(); + bucket_num = *openinv_vec[rng.gen_range(0..openinv_vec.len())]; + self.mark_distributed(bucket_num); + self.remove_openinv(&bucket_num); + self.current_k = 1; + self.daily_bridges_distributed += 1; + } + res[32..(32 + 4)].copy_from_slice(&bucket_num.to_le_bytes()); + // Sign the first 36 bytes and serialize it + let sig = self.keypair.sign(&res[0..(32 + 4)]); + res[(32 + 4)..].copy_from_slice(&sig.to_bytes()); + Ok(res) + } else { + Err(ExceededMaxBridgesError::ExceededMaxBridges) } - res[32..(32 + 4)].copy_from_slice(&bucket_num.to_le_bytes()); - // Sign the first 36 bytes and serialize it - let sig = self.keypair.sign(&res[0..(32 + 4)]); - res[(32 + 4)..].copy_from_slice(&sig.to_bytes()); - res } /// Verify an open invitation. Returns the invitation id and the diff --git a/crates/lox-library/src/tests.rs b/crates/lox-library/src/tests.rs index 83fd061..3c47e84 100644 --- a/crates/lox-library/src/tests.rs +++ b/crates/lox-library/src/tests.rs @@ -64,7 +64,7 @@ impl TestHarness { fn open_invite(&mut self) -> (PerfStat, (cred::Lox, bridge_table::BridgeLine)) { // Issue an open invitation - let inv = self.bdb.invite(); + let inv = self.bdb.invite().unwrap(); let req_start = Instant::now(); // Use it to get a Lox credential diff --git a/crates/lox-library/tests/tests.rs b/crates/lox-library/tests/tests.rs index a270194..9bc376f 100644 --- a/crates/lox-library/tests/tests.rs +++ b/crates/lox-library/tests/tests.rs @@ -10,7 +10,7 @@ fn test_bridgedb() { for i in &[1u32, 5, 7, 12, 19, 20, 22] { bdb.insert_openinv(*i); } - let inv = bdb.invite(); + let inv = bdb.invite().unwrap(); println!("{:?}", inv); let res = BridgeDb::verify(inv, bdb.pubkey); println!("{:?}", res); From 0edc2a3ac3e726af2710e2c1b486d0b8f5a94690 Mon Sep 17 00:00:00 2001 From: onyinyang Date: Mon, 30 Oct 2023 12:54:59 -0400 Subject: [PATCH 54/59] Add metrics setup --- Cargo.lock | 1 + crates/lox-distributor/Cargo.toml | 1 + crates/lox-distributor/src/db_handler.rs | 10 +- crates/lox-distributor/src/lox_context.rs | 24 +++- crates/lox-distributor/src/main.rs | 1 + crates/lox-distributor/src/metrics.rs | 103 ++++++++++++++++++ crates/lox-distributor/src/request_handler.rs | 2 + 7 files changed, 136 insertions(+), 6 deletions(-) create mode 100644 crates/lox-distributor/src/metrics.rs diff --git a/Cargo.lock b/Cargo.lock index 1ff565e..5e7eb2e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1050,6 +1050,7 @@ dependencies = [ "julianday", "lox-library", "lox_utils", + "prometheus", "rand 0.8.5", "rdsys_backend", "reqwest", diff --git a/crates/lox-distributor/Cargo.toml b/crates/lox-distributor/Cargo.toml index 1f07a4c..ea017e0 100644 --- a/crates/lox-distributor/Cargo.toml +++ b/crates/lox-distributor/Cargo.toml @@ -28,6 +28,7 @@ lox_utils = { path = "../lox-utils", version = "0.1.0"} rdsys_backend = { path = "../rdsys-backend-api", version = "0.2"} clap = { version = "4.4.7", features = ["derive"] } serde_json = "1.0.108" +prometheus = "0.13.3" sled = "0.34.7" [dependencies.chrono] diff --git a/crates/lox-distributor/src/db_handler.rs b/crates/lox-distributor/src/db_handler.rs index d7a9bf4..f14ded6 100644 --- a/crates/lox-distributor/src/db_handler.rs +++ b/crates/lox-distributor/src/db_handler.rs @@ -1,5 +1,6 @@ use std::sync::{Arc, Mutex}; +use crate::metrics::Metrics; use crate::{lox_context, DbConfig}; use chrono::{naive::Days, DateTime, Local, NaiveDateTime, Utc}; use lox_library::{BridgeAuth, BridgeDb}; @@ -31,12 +32,13 @@ impl DB { db_config: DbConfig, roll_back_date: Option, ) -> Result<(DB, lox_context::LoxServerContext), sled::Error> { - let context: lox_context::LoxServerContext; + let mut context: lox_context::LoxServerContext; let (lox_db, context) = match sled::open(db_config.db_path) { Ok(lox_db) => { // Check if the lox_db already exists if lox_db.was_recovered() { context = read_lox_context_from_db(lox_db.clone(), roll_back_date); + context.metrics = Metrics::default(); //Otherwise, create a new Lox context } else { let new_db = BridgeDb::new(); @@ -46,6 +48,7 @@ impl DB { ba: Arc::new(Mutex::new(new_ba)), extra_bridges: Arc::new(Mutex::new(Vec::new())), to_be_replaced_bridges: Arc::new(Mutex::new(Vec::new())), + metrics: Metrics::default(), }; } (DB { db: lox_db }, context) @@ -123,13 +126,12 @@ fn use_last_context(lox_db: sled::Db) -> lox_context::LoxServerContext { #[cfg(test)] mod tests { use super::lox_context::LoxServerContext; - use super::DbConfig; use super::DB; + use super::DbConfig; #[test] fn test_write_context() { - let (mut lox_db, _context) = - DB::open_new_or_existing_db(DbConfig::default(), None).unwrap(); + let (mut lox_db, _context) = DB::open_new_or_existing_db(DbConfig::default(), None).unwrap(); assert!( lox_db.db.is_empty(), "db read from context that shouldn't exist" diff --git a/crates/lox-distributor/src/lox_context.rs b/crates/lox-distributor/src/lox_context.rs index 76e139a..da77437 100644 --- a/crates/lox-distributor/src/lox_context.rs +++ b/crates/lox-distributor/src/lox_context.rs @@ -6,7 +6,7 @@ use lox_library::{ blockage_migration, check_blockage, issue_invite, level_up, migration, open_invite, redeem_invite, trust_promotion, }, - BridgeAuth, BridgeDb, ExceededMaxBridgesError, IssuerPubKey, + BridgeAuth, BridgeDb, ExceededMaxBridgesError, IssuerPubKey, MAX_DAILY_BRIDGES, }; use rdsys_backend::proto::{Resource, ResourceState}; use serde::{Deserialize, Serialize}; @@ -19,6 +19,7 @@ use std::{ use zkp::ProofError; use crate::resource_parser::{parse_into_bridgelines, sort_for_parsing}; +use crate::metrics::Metrics; #[derive(Clone, Debug, Serialize, Deserialize)] pub struct LoxServerContext { @@ -26,6 +27,8 @@ pub struct LoxServerContext { pub ba: Arc>, pub extra_bridges: Arc>>, pub to_be_replaced_bridges: Arc>>, + #[serde(skip)] + pub metrics: Metrics, } impl LoxServerContext { @@ -320,7 +323,16 @@ impl LoxServerContext { fn gen_invite(&self) -> Result { let mut obj = self.db.lock().unwrap(); match obj.invite() { - Ok(invite) => Ok(lox_utils::Invite { invite }), + Ok(invite) => { + if obj.current_k == 1 { + self.metrics.k_reset_count.inc(); + } + // Count the number of total bridge requests + if obj.daily_bridges_distributed <= MAX_DAILY_BRIDGES { + self.metrics.buckets_requested_today.inc(); + } + Ok(lox_utils::Invite { invite }) + } Err(e) => Err(e), } } @@ -431,6 +443,7 @@ impl LoxServerContext { match self.open_inv(req) { Ok(resp) => { let response = serde_json::to_string(&resp).unwrap(); + self.metrics.open_inv_count.inc(); prepare_header(response) } Err(e) => { @@ -448,6 +461,7 @@ impl LoxServerContext { match self.trust_promo(req) { Ok(resp) => { let response = serde_json::to_string(&resp).unwrap(); + self.metrics.trust_promo_count.inc(); prepare_header(response) } Err(e) => { @@ -465,6 +479,7 @@ impl LoxServerContext { match self.trust_migration(req) { Ok(resp) => { let response = serde_json::to_string(&resp).unwrap(); + self.metrics.trust_mig_count.inc(); prepare_header(response) } Err(e) => { @@ -482,6 +497,7 @@ impl LoxServerContext { match self.level_up(req) { Ok(resp) => { let response = serde_json::to_string(&resp).unwrap(); + self.metrics.level_up_count.inc(); prepare_header(response) } Err(e) => { @@ -499,6 +515,7 @@ impl LoxServerContext { match self.issue_invite(req) { Ok(resp) => { let response = serde_json::to_string(&resp).unwrap(); + self.metrics.issue_invite_count.inc(); prepare_header(response) } Err(e) => { @@ -516,6 +533,7 @@ impl LoxServerContext { match self.redeem_invite(req) { Ok(resp) => { let response = serde_json::to_string(&resp).unwrap(); + self.metrics.redeem_invite_count.inc(); prepare_header(response) } Err(e) => { @@ -533,6 +551,7 @@ impl LoxServerContext { match self.check_blockage(req) { Ok(resp) => { let response = serde_json::to_string(&resp).unwrap(); + self.metrics.check_blockage_count.inc(); prepare_header(response) } Err(e) => { @@ -550,6 +569,7 @@ impl LoxServerContext { match self.blockage_migration(req) { Ok(resp) => { let response = serde_json::to_string(&resp).unwrap(); + self.metrics.blockage_migration_count.inc(); prepare_header(response) } Err(e) => { diff --git a/crates/lox-distributor/src/main.rs b/crates/lox-distributor/src/main.rs index 2b36e82..ce77d90 100644 --- a/crates/lox-distributor/src/main.rs +++ b/crates/lox-distributor/src/main.rs @@ -16,6 +16,7 @@ use std::{ mod db_handler; use db_handler::DB; mod lox_context; +mod metrics; mod request_handler; use request_handler::handle; mod resource_parser; diff --git a/crates/lox-distributor/src/metrics.rs b/crates/lox-distributor/src/metrics.rs new file mode 100644 index 0000000..5fbe171 --- /dev/null +++ b/crates/lox-distributor/src/metrics.rs @@ -0,0 +1,103 @@ +use futures::executor::block_on; +use prometheus::{Counter, Encoder, Opts, Registry, TextEncoder}; + +#[derive(Debug, Clone)] +pub struct Metrics { + pub open_inv_count: Counter, + pub trust_promo_count: Counter, + pub trust_mig_count: Counter, + pub level_up_count: Counter, + pub issue_invite_count: Counter, + pub redeem_invite_count: Counter, + pub check_blockage_count: Counter, + pub blockage_migration_count: Counter, + pub k_reset_count: Counter, + pub buckets_requested_today: Counter, +} + +impl Default for Metrics { + fn default() -> Self { + // Create counters. + let open_inv_count = Counter::with_opts(Opts::new( + "open_inv_counter", + "number of open invitations distributed", + )) + .unwrap(); + let trust_promo_count = Counter::with_opts(Opts::new( + "trust_promo_counter", + "number of trust promotions requests", + )) + .unwrap(); + let trust_mig_count = Counter::with_opts(Opts::new( + "trust_mig_counter", + "number of trust migrations requests", + )) + .unwrap(); + let level_up_count = + Counter::with_opts(Opts::new("level_up_counter", "number of level up requests")) + .unwrap(); + let issue_invite_count = Counter::with_opts(Opts::new( + "issue_invite_counter", + "number of issue invite requests", + )) + .unwrap(); + let redeem_invite_count = + Counter::with_opts(Opts::new("redeem_invite_counter", "number of level up requests")) + .unwrap(); + let check_blockage_count = Counter::with_opts(Opts::new( + "check_blockage_counter", + "number of check blockage requests", + )) + .unwrap(); + let blockage_migration_count = Counter::with_opts(Opts::new( + "blockage_migration_counter", + "number of blockage migration requests", + )) + .unwrap(); + let k_reset_count = Counter::with_opts(Opts::new( + "k_reset_counter", + "number of times k has reset to 0", + )) + .unwrap(); + let buckets_requested_today = Counter::with_opts(Opts::new( + "buckets_requested_today", + "number of buckets used today", + )) + .unwrap(); + + // Create a Registry and register Counter. + let r = Registry::new(); + r.register(Box::new(open_inv_count.clone())).unwrap(); + r.register(Box::new(trust_promo_count.clone())).unwrap(); + r.register(Box::new(trust_mig_count.clone())).unwrap(); + r.register(Box::new(level_up_count.clone())).unwrap(); + r.register(Box::new(issue_invite_count.clone())).unwrap(); + r.register(Box::new(redeem_invite_count.clone())).unwrap(); + r.register(Box::new(check_blockage_count.clone())).unwrap(); + r.register(Box::new(blockage_migration_count.clone())).unwrap(); + r.register(Box::new(k_reset_count.clone())).unwrap(); + r.register(Box::new(buckets_requested_today.clone())).unwrap(); + + // Gather the metrics. + /* let mut buffer = vec![]; + let encoder = TextEncoder::new(); + let metric_families = r.gather(); + encoder.encode(&metric_families, &mut buffer).unwrap(); +*/ + + // Output to the standard output. + // println!("{}", String::from_utf8(buffer).unwrap()); + Metrics { + open_inv_count, + trust_promo_count, + trust_mig_count, + level_up_count, + issue_invite_count, + redeem_invite_count, + check_blockage_count, + blockage_migration_count, + k_reset_count, + buckets_requested_today, + } + } +} diff --git a/crates/lox-distributor/src/request_handler.rs b/crates/lox-distributor/src/request_handler.rs index 260923a..48ca6a8 100644 --- a/crates/lox-distributor/src/request_handler.rs +++ b/crates/lox-distributor/src/request_handler.rs @@ -68,6 +68,7 @@ pub async fn handle( #[cfg(test)] mod tests { use crate::lox_context; + use crate::metrics::Metrics; use super::*; @@ -230,6 +231,7 @@ mod tests { ba: Arc::new(Mutex::new(lox_auth)), extra_bridges: Arc::new(Mutex::new(Vec::new())), to_be_replaced_bridges: Arc::new(Mutex::new(Vec::new())), + metrics: Metrics::default(), }; Self { context } } From 2597cb53f7972663fecd38cc2eec54e348a8cdb7 Mon Sep 17 00:00:00 2001 From: onyinyang Date: Wed, 25 Oct 2023 13:58:24 -0400 Subject: [PATCH 55/59] Add prometheus http server --- Cargo.lock | 511 +++++++++++++++++++++- crates/lox-distributor/Cargo.toml | 3 + crates/lox-distributor/config.json | 1 + crates/lox-distributor/src/db_handler.rs | 11 +- crates/lox-distributor/src/lox_context.rs | 2 +- crates/lox-distributor/src/main.rs | 43 +- crates/lox-distributor/src/metrics.rs | 192 +++++--- 7 files changed, 661 insertions(+), 102 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5e7eb2e..5b8ef71 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,198 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "actix-codec" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "617a8268e3537fe1d8c9ead925fca49ef6400927ee7bc26750e90ecee14ce4b8" +dependencies = [ + "bitflags 1.3.2", + "bytes", + "futures-core", + "futures-sink", + "memchr", + "pin-project-lite", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "actix-http" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a92ef85799cba03f76e4f7c10f533e66d87c9a7e7055f3391f09000ad8351bc9" +dependencies = [ + "actix-codec", + "actix-rt", + "actix-service", + "actix-utils", + "ahash", + "base64", + "bitflags 2.3.3", + "brotli", + "bytes", + "bytestring", + "derive_more", + "encoding_rs", + "flate2", + "futures-core", + "h2", + "http", + "httparse", + "httpdate", + "itoa", + "language-tags", + "local-channel", + "mime", + "percent-encoding", + "pin-project-lite", + "rand 0.8.5", + "sha1", + "smallvec", + "tokio", + "tokio-util", + "tracing", + "zstd", +] + +[[package]] +name = "actix-macros" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" +dependencies = [ + "quote", + "syn 2.0.32", +] + +[[package]] +name = "actix-router" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66ff4d247d2b160861fa2866457e85706833527840e4133f8f49aa423a38799" +dependencies = [ + "bytestring", + "http", + "regex", + "serde", + "tracing", +] + +[[package]] +name = "actix-rt" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28f32d40287d3f402ae0028a9d54bef51af15c8769492826a69d28f81893151d" +dependencies = [ + "futures-core", + "tokio", +] + +[[package]] +name = "actix-server" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eb13e7eef0423ea6eab0e59f6c72e7cb46d33691ad56a726b3cd07ddec2c2d4" +dependencies = [ + "actix-rt", + "actix-service", + "actix-utils", + "futures-core", + "futures-util", + "mio", + "socket2 0.5.5", + "tokio", + "tracing", +] + +[[package]] +name = "actix-service" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b894941f818cfdc7ccc4b9e60fa7e53b5042a2e8567270f9147d5591893373a" +dependencies = [ + "futures-core", + "paste", + "pin-project-lite", +] + +[[package]] +name = "actix-utils" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a1dcdff1466e3c2488e1cb5c36a71822750ad43839937f85d2f4d9f8b705d8" +dependencies = [ + "local-waker", + "pin-project-lite", +] + +[[package]] +name = "actix-web" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4a5b5e29603ca8c94a77c65cf874718ceb60292c5a5c3e5f4ace041af462b9" +dependencies = [ + "actix-codec", + "actix-http", + "actix-macros", + "actix-router", + "actix-rt", + "actix-server", + "actix-service", + "actix-utils", + "actix-web-codegen", + "ahash", + "bytes", + "bytestring", + "cfg-if", + "cookie", + "derive_more", + "encoding_rs", + "futures-core", + "futures-util", + "itoa", + "language-tags", + "log", + "mime", + "once_cell", + "pin-project-lite", + "regex", + "serde", + "serde_json", + "serde_urlencoded", + "smallvec", + "socket2 0.5.5", + "time", + "url", +] + +[[package]] +name = "actix-web-codegen" +version = "4.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb1f50ebbb30eca122b188319a4398b3f7bb4a8cdf50ecfb73bfc6a3c3ce54f5" +dependencies = [ + "actix-router", + "proc-macro2", + "quote", + "syn 2.0.32", +] + +[[package]] +name = "actix-web-prom" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f23f332a652836b8f3a6876103c70c9ed436d0e69fa779ab5d7f57b1d5c8d488" +dependencies = [ + "actix-web", + "futures-core", + "pin-project-lite", + "prometheus", + "regex", +] + [[package]] name = "addr2line" version = "0.20.0" @@ -52,6 +244,43 @@ dependencies = [ "subtle", ] +[[package]] +name = "ahash" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd7d5a2cecb58716e47d67d5703a249964b14c7be1ec3cad3affc295b2d1c35d" +dependencies = [ + "cfg-if", + "getrandom 0.2.10", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +dependencies = [ + "memchr", +] + +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + [[package]] name = "android-tzdata" version = "0.1.1" @@ -187,6 +416,27 @@ dependencies = [ "generic-array", ] +[[package]] +name = "brotli" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "516074a47ef4bce09577a3b379392300159ce5b1ba2e501ff1c819950066100f" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da74e2b81409b1b743f8f0c62cc6254afefb8b8e50bbfe3735550f7aeefa3448" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + [[package]] name = "bumpalo" version = "3.13.0" @@ -205,11 +455,23 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +[[package]] +name = "bytestring" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "238e4886760d98c4f899360c834fa93e62cf7f721ac3c2da375cbdf4b8679aae" +dependencies = [ + "bytes", +] + [[package]] name = "cc" version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +dependencies = [ + "jobserver", +] [[package]] name = "cfg-if" @@ -273,7 +535,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn", + "syn 2.0.32", ] [[package]] @@ -313,6 +575,23 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "cookie" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb" +dependencies = [ + "percent-encoding", + "time", + "version_check", +] + [[package]] name = "core-foundation" version = "0.9.3" @@ -422,7 +701,7 @@ checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.32", ] [[package]] @@ -446,7 +725,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn", + "syn 2.0.32", ] [[package]] @@ -457,7 +736,7 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core", "quote", - "syn", + "syn 2.0.32", ] [[package]] @@ -480,6 +759,19 @@ dependencies = [ "serde", ] +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 1.0.109", +] + [[package]] name = "digest" version = "0.10.7" @@ -490,6 +782,12 @@ dependencies = [ "crypto-common", ] +[[package]] +name = "dtoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" + [[package]] name = "ed25519" version = "2.2.2" @@ -563,6 +861,16 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0870c84016d4b481be5c9f323c24f65e31e901ae618f0e80f4308fb00de1d2d" +[[package]] +name = "flate2" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + [[package]] name = "fnv" version = "1.0.7" @@ -665,7 +973,7 @@ checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.32", ] [[package]] @@ -865,7 +1173,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.9", "tokio", "tower-service", "tracing", @@ -976,6 +1284,15 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +[[package]] +name = "jobserver" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +dependencies = [ + "libc", +] + [[package]] name = "js-sys" version = "0.3.64" @@ -1003,6 +1320,12 @@ dependencies = [ "cpufeatures", ] +[[package]] +name = "language-tags" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" + [[package]] name = "lazy_static" version = "1.4.0" @@ -1011,9 +1334,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "linux-raw-sys" @@ -1021,6 +1344,23 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" +[[package]] +name = "local-channel" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a493488de5f18c8ffcba89eebb8532ffc562dc400490eb65b84893fae0b178" +dependencies = [ + "futures-core", + "futures-sink", + "local-waker", +] + +[[package]] +name = "local-waker" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e34f76eb3611940e0e7d53a9aaa4e6a3151f69541a282fd0dad5571420c53ff1" + [[package]] name = "lock_api" version = "0.4.10" @@ -1041,6 +1381,8 @@ checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" name = "lox-distributor" version = "0.1.0" dependencies = [ + "actix-web", + "actix-web-prom", "base64", "chrono", "clap", @@ -1051,6 +1393,7 @@ dependencies = [ "lox-library", "lox_utils", "prometheus", + "prometheus-client", "rand 0.8.5", "rdsys_backend", "reqwest", @@ -1165,6 +1508,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", + "log", "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys", ] @@ -1318,7 +1662,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.32", ] [[package]] @@ -1387,6 +1731,12 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + [[package]] name = "percent-encoding" version = "2.3.0" @@ -1475,6 +1825,29 @@ dependencies = [ "thiserror", ] +[[package]] +name = "prometheus-client" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "510c4f1c9d81d556458f94c98f857748130ea9737bbd6053da497503b26ea63c" +dependencies = [ + "dtoa", + "itoa", + "parking_lot 0.12.1", + "prometheus-client-derive-encode", +] + +[[package]] +name = "prometheus-client-derive-encode" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] + [[package]] name = "protobuf" version = "2.28.0" @@ -1713,6 +2086,35 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "regex" +version = "1.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12de2eff854e5fa4b1295edd650e227e9d8fb0c9e90b12e7f36d6a6811791a29" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + [[package]] name = "reqwest" version = "0.11.18" @@ -1847,7 +2249,7 @@ checksum = "67c5609f394e5c2bd7fc51efda478004ea80ef42fee983d5c67a65e34f32c0e3" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.32", ] [[package]] @@ -1899,7 +2301,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 2.0.32", ] [[package]] @@ -1980,6 +2382,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys", +] + [[package]] name = "spki" version = "0.7.2" @@ -2014,9 +2426,20 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" -version = "2.0.29" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" dependencies = [ "proc-macro2", "quote", @@ -2053,7 +2476,7 @@ checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.32", ] [[package]] @@ -2115,7 +2538,7 @@ dependencies = [ "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.4.9", "tokio-macros", "windows-sys", ] @@ -2128,7 +2551,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.32", ] [[package]] @@ -2179,6 +2602,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", + "log", "pin-project-lite", "tracing-core", ] @@ -2306,7 +2730,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.32", "wasm-bindgen-shared", ] @@ -2340,7 +2764,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.32", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2480,6 +2904,26 @@ dependencies = [ "winapi", ] +[[package]] +name = "zerocopy" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8db0ac2df3d060f81ec0380ccc5b71c2a7c092cfced671feeee1320e95559c87" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b6093bc6d5265ff40b479c834cdd25d8e20784781a2a29a8106327393d0a9ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] + [[package]] name = "zeroize" version = "1.6.0" @@ -2497,7 +2941,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.32", ] [[package]] @@ -2512,3 +2956,32 @@ dependencies = [ "serde_derive", "thiserror", ] + +[[package]] +name = "zstd" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "6.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.9+zstd.1.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" +dependencies = [ + "cc", + "pkg-config", +] diff --git a/crates/lox-distributor/Cargo.toml b/crates/lox-distributor/Cargo.toml index ea017e0..d6af14e 100644 --- a/crates/lox-distributor/Cargo.toml +++ b/crates/lox-distributor/Cargo.toml @@ -30,6 +30,9 @@ clap = { version = "4.4.7", features = ["derive"] } serde_json = "1.0.108" prometheus = "0.13.3" sled = "0.34.7" +actix-web = "4.4.0" +actix-web-prom = "0.7.0" +prometheus-client = "0.22.0" [dependencies.chrono] version = "0.4.31" diff --git a/crates/lox-distributor/config.json b/crates/lox-distributor/config.json index 06f6fdc..438cab1 100644 --- a/crates/lox-distributor/config.json +++ b/crates/lox-distributor/config.json @@ -3,6 +3,7 @@ "db_path": "lox_db" }, + "metrics_port": 5222, "bridge_config": { "percent_spares": 50 }, diff --git a/crates/lox-distributor/src/db_handler.rs b/crates/lox-distributor/src/db_handler.rs index f14ded6..acf0cfe 100644 --- a/crates/lox-distributor/src/db_handler.rs +++ b/crates/lox-distributor/src/db_handler.rs @@ -31,6 +31,7 @@ impl DB { pub fn open_new_or_existing_db( db_config: DbConfig, roll_back_date: Option, + metrics: Metrics, ) -> Result<(DB, lox_context::LoxServerContext), sled::Error> { let mut context: lox_context::LoxServerContext; let (lox_db, context) = match sled::open(db_config.db_path) { @@ -38,7 +39,7 @@ impl DB { // Check if the lox_db already exists if lox_db.was_recovered() { context = read_lox_context_from_db(lox_db.clone(), roll_back_date); - context.metrics = Metrics::default(); + context.metrics = metrics; //Otherwise, create a new Lox context } else { let new_db = BridgeDb::new(); @@ -48,7 +49,7 @@ impl DB { ba: Arc::new(Mutex::new(new_ba)), extra_bridges: Arc::new(Mutex::new(Vec::new())), to_be_replaced_bridges: Arc::new(Mutex::new(Vec::new())), - metrics: Metrics::default(), + metrics, }; } (DB { db: lox_db }, context) @@ -126,12 +127,14 @@ fn use_last_context(lox_db: sled::Db) -> lox_context::LoxServerContext { #[cfg(test)] mod tests { use super::lox_context::LoxServerContext; - use super::DB; use super::DbConfig; + use super::Metrics; + use super::DB; #[test] fn test_write_context() { - let (mut lox_db, _context) = DB::open_new_or_existing_db(DbConfig::default(), None).unwrap(); + let (mut lox_db, _context) = + DB::open_new_or_existing_db(DbConfig::default(), None, Metrics::default()).unwrap(); assert!( lox_db.db.is_empty(), "db read from context that shouldn't exist" diff --git a/crates/lox-distributor/src/lox_context.rs b/crates/lox-distributor/src/lox_context.rs index da77437..317692a 100644 --- a/crates/lox-distributor/src/lox_context.rs +++ b/crates/lox-distributor/src/lox_context.rs @@ -18,8 +18,8 @@ use std::{ }; use zkp::ProofError; -use crate::resource_parser::{parse_into_bridgelines, sort_for_parsing}; use crate::metrics::Metrics; +use crate::resource_parser::{parse_into_bridgelines, sort_for_parsing}; #[derive(Clone, Debug, Serialize, Deserialize)] pub struct LoxServerContext { diff --git a/crates/lox-distributor/src/main.rs b/crates/lox-distributor/src/main.rs index ce77d90..8aba55a 100644 --- a/crates/lox-distributor/src/main.rs +++ b/crates/lox-distributor/src/main.rs @@ -6,17 +6,24 @@ use hyper::{ Body, Request, Response, Server, }; +use prometheus_client::registry::Registry; use rdsys_backend::{proto::ResourceState, request_resources}; use serde::Deserialize; use std::{ - convert::Infallible, fs::File, io::BufReader, net::SocketAddr, path::PathBuf, time::Duration, + convert::Infallible, + fs::File, + io::BufReader, + net::{IpAddr, Ipv4Addr, SocketAddr}, + path::PathBuf, + time::Duration, }; mod db_handler; use db_handler::DB; mod lox_context; mod metrics; +use metrics::Metrics; mod request_handler; use request_handler::handle; mod resource_parser; @@ -55,6 +62,7 @@ struct Args { #[derive(Debug, Deserialize)] struct Config { db: DbConfig, + metrics_port: u16, bridge_config: BridgeConfig, rtype: ResourceInfo, } @@ -144,15 +152,23 @@ async fn parse_bridges(rdsys_tx: mpsc::Sender, mut rx: mpsc::Receiver){ + tokio::select! { + lox_metrics = metrics::start_metrics_server(metrics_addr, registry) => lox_metrics, + _ = kill.recv() => {println!("Shut down metrics server");}, + } +} + async fn create_context_manager( db_config: DbConfig, bridge_config: BridgeConfig, roll_back_date: Option, + metrics: Metrics, context_rx: mpsc::Receiver, mut kill: broadcast::Receiver<()>, ) { tokio::select! { - create_context = context_manager(db_config, bridge_config, roll_back_date, context_rx) => create_context, + create_context = context_manager(db_config, bridge_config, roll_back_date, metrics, context_rx) => create_context, _ = kill.recv() => {println!("Shut down context_manager");}, } } @@ -164,14 +180,16 @@ async fn context_manager( db_config: DbConfig, bridge_config: BridgeConfig, roll_back_date: Option, + metrics: Metrics, mut context_rx: mpsc::Receiver, ) { - let (mut lox_db, context) = match DB::open_new_or_existing_db(db_config, roll_back_date) { - Ok((lox_db, context)) => (lox_db, context), - Err(e) => { - panic!("Error: {:?}", e); - } - }; + let (mut lox_db, context) = + match DB::open_new_or_existing_db(db_config, roll_back_date, metrics) { + Ok((lox_db, context)) => (lox_db, context), + Err(e) => { + panic!("Error: {:?}", e); + } + }; while let Some(cmd) = context_rx.recv().await { use Command::*; @@ -252,6 +270,7 @@ async fn main() { // create the shutdown broadcast channel and clone for every thread let (shutdown_tx, mut shutdown_rx) = broadcast::channel(16); let kill_stream = shutdown_tx.subscribe(); + let kill_metrics = shutdown_tx.subscribe(); let kill_parser = shutdown_tx.subscribe(); let kill_context = shutdown_tx.subscribe(); @@ -270,11 +289,18 @@ async fn main() { } }); + let metrics = Metrics::default(); + let registry = metrics.register(); + let metrics_addr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), config.metrics_port); + let metrics_handler = + spawn(async move { start_metrics_collector(metrics_addr, registry, kill_metrics).await }); + let context_manager = spawn(async move { create_context_manager( config.db, config.bridge_config, args.roll_back_date, + metrics, context_rx, kill_context, ) @@ -312,6 +338,7 @@ async fn main() { eprintln!("server error: {}", e); } future::join_all([ + metrics_handler, rdsys_request_handler, rdsys_resource_receiver, context_manager, diff --git a/crates/lox-distributor/src/metrics.rs b/crates/lox-distributor/src/metrics.rs index 5fbe171..9a12684 100644 --- a/crates/lox-distributor/src/metrics.rs +++ b/crates/lox-distributor/src/metrics.rs @@ -1,5 +1,10 @@ -use futures::executor::block_on; -use prometheus::{Counter, Encoder, Opts, Registry, TextEncoder}; +use hyper::{ + service::{make_service_fn, service_fn}, + Body, Request, Response, Server, +}; +use prometheus_client::{encoding::text::encode, metrics::counter::Counter, registry::Registry}; +use std::{future::Future, io, net::SocketAddr, pin::Pin, sync::Arc}; +use tokio::signal::unix::{signal, SignalKind}; #[derive(Debug, Clone)] pub struct Metrics { @@ -18,75 +23,17 @@ pub struct Metrics { impl Default for Metrics { fn default() -> Self { // Create counters. - let open_inv_count = Counter::with_opts(Opts::new( - "open_inv_counter", - "number of open invitations distributed", - )) - .unwrap(); - let trust_promo_count = Counter::with_opts(Opts::new( - "trust_promo_counter", - "number of trust promotions requests", - )) - .unwrap(); - let trust_mig_count = Counter::with_opts(Opts::new( - "trust_mig_counter", - "number of trust migrations requests", - )) - .unwrap(); - let level_up_count = - Counter::with_opts(Opts::new("level_up_counter", "number of level up requests")) - .unwrap(); - let issue_invite_count = Counter::with_opts(Opts::new( - "issue_invite_counter", - "number of issue invite requests", - )) - .unwrap(); - let redeem_invite_count = - Counter::with_opts(Opts::new("redeem_invite_counter", "number of level up requests")) - .unwrap(); - let check_blockage_count = Counter::with_opts(Opts::new( - "check_blockage_counter", - "number of check blockage requests", - )) - .unwrap(); - let blockage_migration_count = Counter::with_opts(Opts::new( - "blockage_migration_counter", - "number of blockage migration requests", - )) - .unwrap(); - let k_reset_count = Counter::with_opts(Opts::new( - "k_reset_counter", - "number of times k has reset to 0", - )) - .unwrap(); - let buckets_requested_today = Counter::with_opts(Opts::new( - "buckets_requested_today", - "number of buckets used today", - )) - .unwrap(); + let open_inv_count = Counter::default(); + let trust_promo_count = Counter::default(); + let trust_mig_count = Counter::default(); + let level_up_count = Counter::default(); + let issue_invite_count = Counter::default(); + let redeem_invite_count = Counter::default(); + let check_blockage_count = Counter::default(); + let blockage_migration_count = Counter::default(); + let k_reset_count = Counter::default(); + let buckets_requested_today = Counter::default(); - // Create a Registry and register Counter. - let r = Registry::new(); - r.register(Box::new(open_inv_count.clone())).unwrap(); - r.register(Box::new(trust_promo_count.clone())).unwrap(); - r.register(Box::new(trust_mig_count.clone())).unwrap(); - r.register(Box::new(level_up_count.clone())).unwrap(); - r.register(Box::new(issue_invite_count.clone())).unwrap(); - r.register(Box::new(redeem_invite_count.clone())).unwrap(); - r.register(Box::new(check_blockage_count.clone())).unwrap(); - r.register(Box::new(blockage_migration_count.clone())).unwrap(); - r.register(Box::new(k_reset_count.clone())).unwrap(); - r.register(Box::new(buckets_requested_today.clone())).unwrap(); - - // Gather the metrics. - /* let mut buffer = vec![]; - let encoder = TextEncoder::new(); - let metric_families = r.gather(); - encoder.encode(&metric_families, &mut buffer).unwrap(); -*/ - - // Output to the standard output. - // println!("{}", String::from_utf8(buffer).unwrap()); Metrics { open_inv_count, trust_promo_count, @@ -101,3 +48,108 @@ impl Default for Metrics { } } } + +impl Metrics { + pub fn register(&self) -> Registry { + // Create a Registry and register Counter. + let mut r = ::with_prefix("lox-metrics"); + r.register( + "open_inv_counter", + "number of open invitations distributed", + self.open_inv_count.clone(), + ); + r.register( + "trust_promo_counter", + "number of trust promotions requests", + self.trust_promo_count.clone(), + ); + r.register( + "trust_mig_counter", + "number of trust migrations requests", + self.trust_mig_count.clone(), + ); + r.register( + "level_up_counter", + "number of level up requests", + self.level_up_count.clone(), + ); + r.register( + "issue_invite_counter", + "number of issue invite requests", + self.issue_invite_count.clone(), + ); + r.register( + "redeem_invite_counter", + "number of level up requests", + self.redeem_invite_count.clone(), + ); + r.register( + "check_blockage_counter", + "number of check blockage requests", + self.check_blockage_count.clone(), + ); + r.register( + "blockage_migration_counter", + "number of blockage migration requests", + self.blockage_migration_count.clone(), + ); + r.register( + "k_reset_counter", + "number of times k has reset to 0", + self.k_reset_count.clone(), + ); + r.register( + "buckets_requested_today", + "number of buckets used today", + self.buckets_requested_today.clone(), + ); + r + } +} + +/// Start a HTTP server to report metrics. +pub async fn start_metrics_server(metrics_addr: SocketAddr, registry: Registry) { + let mut shutdown_stream = signal(SignalKind::terminate()).unwrap(); + + eprintln!("Starting metrics server on {metrics_addr}"); + + let registry = Arc::new(registry); + Server::bind(&metrics_addr) + .serve(make_service_fn(move |_conn| { + let registry = registry.clone(); + async move { + let handler = make_handler(registry); + Ok::<_, io::Error>(service_fn(handler)) + } + })) + .with_graceful_shutdown(async move { + shutdown_stream.recv().await; + }) + .await + .unwrap(); +} + +/// This function returns a HTTP handler (i.e. another function) +pub fn make_handler( + registry: Arc, +) -> impl Fn(Request) -> Pin>> + Send>> { + // This closure accepts a request and responds with the OpenMetrics encoding of our metrics. + move |_req: Request| { + let reg = registry.clone(); + Box::pin(async move { + let mut buf = String::new(); + encode(&mut buf, ®.clone()) + .map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e)) + .map(|_| { + let body = Body::from(buf); + Response::builder() + .header( + hyper::header::CONTENT_TYPE, + "application/openmetrics-text; version=1.0.0; charset=utf-8", + ) + .body(body) + .unwrap() + }) + }) + } +} From b1d8ce7d8f0c0872de2ab1385047740f4a97e637 Mon Sep 17 00:00:00 2001 From: onyinyang Date: Thu, 26 Oct 2023 12:19:28 -0400 Subject: [PATCH 56/59] Update metrics to count bridges --- Cargo.lock | 475 +--------------------- crates/lox-distributor/Cargo.toml | 2 - crates/lox-distributor/src/lox_context.rs | 13 +- crates/lox-distributor/src/main.rs | 9 +- crates/lox-distributor/src/metrics.rs | 32 ++ 5 files changed, 65 insertions(+), 466 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5b8ef71..8dce977 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,198 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "actix-codec" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "617a8268e3537fe1d8c9ead925fca49ef6400927ee7bc26750e90ecee14ce4b8" -dependencies = [ - "bitflags 1.3.2", - "bytes", - "futures-core", - "futures-sink", - "memchr", - "pin-project-lite", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "actix-http" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92ef85799cba03f76e4f7c10f533e66d87c9a7e7055f3391f09000ad8351bc9" -dependencies = [ - "actix-codec", - "actix-rt", - "actix-service", - "actix-utils", - "ahash", - "base64", - "bitflags 2.3.3", - "brotli", - "bytes", - "bytestring", - "derive_more", - "encoding_rs", - "flate2", - "futures-core", - "h2", - "http", - "httparse", - "httpdate", - "itoa", - "language-tags", - "local-channel", - "mime", - "percent-encoding", - "pin-project-lite", - "rand 0.8.5", - "sha1", - "smallvec", - "tokio", - "tokio-util", - "tracing", - "zstd", -] - -[[package]] -name = "actix-macros" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" -dependencies = [ - "quote", - "syn 2.0.32", -] - -[[package]] -name = "actix-router" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66ff4d247d2b160861fa2866457e85706833527840e4133f8f49aa423a38799" -dependencies = [ - "bytestring", - "http", - "regex", - "serde", - "tracing", -] - -[[package]] -name = "actix-rt" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28f32d40287d3f402ae0028a9d54bef51af15c8769492826a69d28f81893151d" -dependencies = [ - "futures-core", - "tokio", -] - -[[package]] -name = "actix-server" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eb13e7eef0423ea6eab0e59f6c72e7cb46d33691ad56a726b3cd07ddec2c2d4" -dependencies = [ - "actix-rt", - "actix-service", - "actix-utils", - "futures-core", - "futures-util", - "mio", - "socket2 0.5.5", - "tokio", - "tracing", -] - -[[package]] -name = "actix-service" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b894941f818cfdc7ccc4b9e60fa7e53b5042a2e8567270f9147d5591893373a" -dependencies = [ - "futures-core", - "paste", - "pin-project-lite", -] - -[[package]] -name = "actix-utils" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88a1dcdff1466e3c2488e1cb5c36a71822750ad43839937f85d2f4d9f8b705d8" -dependencies = [ - "local-waker", - "pin-project-lite", -] - -[[package]] -name = "actix-web" -version = "4.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4a5b5e29603ca8c94a77c65cf874718ceb60292c5a5c3e5f4ace041af462b9" -dependencies = [ - "actix-codec", - "actix-http", - "actix-macros", - "actix-router", - "actix-rt", - "actix-server", - "actix-service", - "actix-utils", - "actix-web-codegen", - "ahash", - "bytes", - "bytestring", - "cfg-if", - "cookie", - "derive_more", - "encoding_rs", - "futures-core", - "futures-util", - "itoa", - "language-tags", - "log", - "mime", - "once_cell", - "pin-project-lite", - "regex", - "serde", - "serde_json", - "serde_urlencoded", - "smallvec", - "socket2 0.5.5", - "time", - "url", -] - -[[package]] -name = "actix-web-codegen" -version = "4.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1f50ebbb30eca122b188319a4398b3f7bb4a8cdf50ecfb73bfc6a3c3ce54f5" -dependencies = [ - "actix-router", - "proc-macro2", - "quote", - "syn 2.0.32", -] - -[[package]] -name = "actix-web-prom" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f23f332a652836b8f3a6876103c70c9ed436d0e69fa779ab5d7f57b1d5c8d488" -dependencies = [ - "actix-web", - "futures-core", - "pin-project-lite", - "prometheus", - "regex", -] - [[package]] name = "addr2line" version = "0.20.0" @@ -244,43 +52,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "ahash" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7d5a2cecb58716e47d67d5703a249964b14c7be1ec3cad3affc295b2d1c35d" -dependencies = [ - "cfg-if", - "getrandom 0.2.10", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "aho-corasick" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" -dependencies = [ - "memchr", -] - -[[package]] -name = "alloc-no-stdlib" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" - -[[package]] -name = "alloc-stdlib" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" -dependencies = [ - "alloc-no-stdlib", -] - [[package]] name = "android-tzdata" version = "0.1.1" @@ -416,27 +187,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "brotli" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "516074a47ef4bce09577a3b379392300159ce5b1ba2e501ff1c819950066100f" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", - "brotli-decompressor", -] - -[[package]] -name = "brotli-decompressor" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da74e2b81409b1b743f8f0c62cc6254afefb8b8e50bbfe3735550f7aeefa3448" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", -] - [[package]] name = "bumpalo" version = "3.13.0" @@ -455,23 +205,11 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" -[[package]] -name = "bytestring" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "238e4886760d98c4f899360c834fa93e62cf7f721ac3c2da375cbdf4b8679aae" -dependencies = [ - "bytes", -] - [[package]] name = "cc" version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" -dependencies = [ - "jobserver", -] [[package]] name = "cfg-if" @@ -535,7 +273,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.32", + "syn", ] [[package]] @@ -575,23 +313,6 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - -[[package]] -name = "cookie" -version = "0.16.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb" -dependencies = [ - "percent-encoding", - "time", - "version_check", -] - [[package]] name = "core-foundation" version = "0.9.3" @@ -701,7 +422,7 @@ checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn", ] [[package]] @@ -725,7 +446,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.32", + "syn", ] [[package]] @@ -736,7 +457,7 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core", "quote", - "syn 2.0.32", + "syn", ] [[package]] @@ -759,19 +480,6 @@ dependencies = [ "serde", ] -[[package]] -name = "derive_more" -version = "0.99.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" -dependencies = [ - "convert_case", - "proc-macro2", - "quote", - "rustc_version", - "syn 1.0.109", -] - [[package]] name = "digest" version = "0.10.7" @@ -861,16 +569,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0870c84016d4b481be5c9f323c24f65e31e901ae618f0e80f4308fb00de1d2d" -[[package]] -name = "flate2" -version = "1.0.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - [[package]] name = "fnv" version = "1.0.7" @@ -973,7 +671,7 @@ checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn", ] [[package]] @@ -1173,7 +871,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.9", + "socket2", "tokio", "tower-service", "tracing", @@ -1284,15 +982,6 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" -[[package]] -name = "jobserver" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" -dependencies = [ - "libc", -] - [[package]] name = "js-sys" version = "0.3.64" @@ -1320,12 +1009,6 @@ dependencies = [ "cpufeatures", ] -[[package]] -name = "language-tags" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" - [[package]] name = "lazy_static" version = "1.4.0" @@ -1344,23 +1027,6 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" -[[package]] -name = "local-channel" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a493488de5f18c8ffcba89eebb8532ffc562dc400490eb65b84893fae0b178" -dependencies = [ - "futures-core", - "futures-sink", - "local-waker", -] - -[[package]] -name = "local-waker" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e34f76eb3611940e0e7d53a9aaa4e6a3151f69541a282fd0dad5571420c53ff1" - [[package]] name = "lock_api" version = "0.4.10" @@ -1381,8 +1047,6 @@ checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" name = "lox-distributor" version = "0.1.0" dependencies = [ - "actix-web", - "actix-web-prom", "base64", "chrono", "clap", @@ -1508,7 +1172,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", - "log", "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys", ] @@ -1662,7 +1325,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn", ] [[package]] @@ -1731,12 +1394,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "paste" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" - [[package]] name = "percent-encoding" version = "2.3.0" @@ -1845,7 +1502,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn", ] [[package]] @@ -2086,35 +1743,6 @@ dependencies = [ "bitflags 1.3.2", ] -[[package]] -name = "regex" -version = "1.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12de2eff854e5fa4b1295edd650e227e9d8fb0c9e90b12e7f36d6a6811791a29" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" - [[package]] name = "reqwest" version = "0.11.18" @@ -2249,7 +1877,7 @@ checksum = "67c5609f394e5c2bd7fc51efda478004ea80ef42fee983d5c67a65e34f32c0e3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn", ] [[package]] @@ -2301,7 +1929,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.32", + "syn", ] [[package]] @@ -2382,16 +2010,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "socket2" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" -dependencies = [ - "libc", - "windows-sys", -] - [[package]] name = "spki" version = "0.7.2" @@ -2424,17 +2042,6 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - [[package]] name = "syn" version = "2.0.32" @@ -2476,7 +2083,7 @@ checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn", ] [[package]] @@ -2538,7 +2145,7 @@ dependencies = [ "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", - "socket2 0.4.9", + "socket2", "tokio-macros", "windows-sys", ] @@ -2551,7 +2158,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn", ] [[package]] @@ -2602,7 +2209,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", - "log", "pin-project-lite", "tracing-core", ] @@ -2730,7 +2336,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.32", + "syn", "wasm-bindgen-shared", ] @@ -2764,7 +2370,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2904,26 +2510,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "zerocopy" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8db0ac2df3d060f81ec0380ccc5b71c2a7c092cfced671feeee1320e95559c87" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b6093bc6d5265ff40b479c834cdd25d8e20784781a2a29a8106327393d0a9ff" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.32", -] - [[package]] name = "zeroize" version = "1.6.0" @@ -2941,7 +2527,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn", ] [[package]] @@ -2956,32 +2542,3 @@ dependencies = [ "serde_derive", "thiserror", ] - -[[package]] -name = "zstd" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" -dependencies = [ - "zstd-safe", -] - -[[package]] -name = "zstd-safe" -version = "6.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" -dependencies = [ - "libc", - "zstd-sys", -] - -[[package]] -name = "zstd-sys" -version = "2.0.9+zstd.1.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" -dependencies = [ - "cc", - "pkg-config", -] diff --git a/crates/lox-distributor/Cargo.toml b/crates/lox-distributor/Cargo.toml index d6af14e..6a1e955 100644 --- a/crates/lox-distributor/Cargo.toml +++ b/crates/lox-distributor/Cargo.toml @@ -30,8 +30,6 @@ clap = { version = "4.4.7", features = ["derive"] } serde_json = "1.0.108" prometheus = "0.13.3" sled = "0.34.7" -actix-web = "4.4.0" -actix-web-prom = "0.7.0" prometheus-client = "0.22.0" [dependencies.chrono] diff --git a/crates/lox-distributor/src/lox_context.rs b/crates/lox-distributor/src/lox_context.rs index 317692a..4c5bcb4 100644 --- a/crates/lox-distributor/src/lox_context.rs +++ b/crates/lox-distributor/src/lox_context.rs @@ -85,10 +85,12 @@ impl LoxServerContext { bridge.uid_fingerprint ); accounted_for_bridges.push(bridge.uid_fingerprint); + self.metrics.existing_or_updated_bridges.inc(); // Assume non-failing bridges that are not found in the bridge table are new bridges and save them for later } else { println!("BridgeLine: {:?} not found in Lox's Bridgetable. Save it as a new resource for now!", bridge.uid_fingerprint); self.append_extra_bridges(bridge); + self.metrics.new_bridges.inc(); } } accounted_for_bridges @@ -109,6 +111,7 @@ impl LoxServerContext { bridge.uid_fingerprint ); accounted_for_bridges.push(bridge.uid_fingerprint); + self.metrics.existing_or_updated_bridges.inc(); } } // Next, handle the failing bridges. If resource last passed tests >=ACCEPTED_HOURS_OF_FAILURE ago, @@ -121,6 +124,7 @@ impl LoxServerContext { bridge.uid_fingerprint ); accounted_for_bridges.push(bridge.uid_fingerprint); + self.metrics.removed_bridges.inc(); } else if res == lox_library::ReplaceSuccess::NotReplaced { // Add the bridge to the list of to_be_replaced bridges in the Lox context and try // again to replace at the next update (nothing changes in the Lox Authority) @@ -129,6 +133,7 @@ impl LoxServerContext { bridge.uid_fingerprint ); self.new_to_be_replaced_bridge(bridge); + self.metrics.existing_or_updated_bridges.inc(); accounted_for_bridges.push(bridge.uid_fingerprint); } else { // NotFound @@ -166,14 +171,16 @@ impl LoxServerContext { let unaccounted_for = ba_clone.find_and_remove_unaccounted_for_bridges(accounted_for_bridges); for bridgeline in unaccounted_for { match self.replace_with_new(bridgeline) { - lox_library::ReplaceSuccess::Replaced => println!( - "BridgeLine {:?} not found in rdsys update was successfully replaced.", bridgeline.uid_fingerprint), + lox_library::ReplaceSuccess::Replaced => { + println!("BridgeLine {:?} not found in rdsys update was successfully replaced.", bridgeline.uid_fingerprint); + self.metrics.removed_bridges.inc();} lox_library::ReplaceSuccess::NotReplaced => { // Add the bridge to the list of to_be_replaced bridges in the Lox context and try // again to replace at the next update (nothing changes in the Lox Authority) println!("BridgeLine {:?} not found in rdsys update NOT replaced, saved for next update!", bridgeline.uid_fingerprint); - self.new_to_be_replaced_bridge(bridgeline) + self.new_to_be_replaced_bridge(bridgeline); + self.metrics.existing_or_updated_bridges.inc(); } lox_library::ReplaceSuccess::NotFound => println!( "BridgeLine {:?} no longer in reachable bridges.", diff --git a/crates/lox-distributor/src/main.rs b/crates/lox-distributor/src/main.rs index 8aba55a..e49db81 100644 --- a/crates/lox-distributor/src/main.rs +++ b/crates/lox-distributor/src/main.rs @@ -152,7 +152,11 @@ async fn parse_bridges(rdsys_tx: mpsc::Sender, mut rx: mpsc::Receiver){ +async fn start_metrics_collector( + metrics_addr: SocketAddr, + registry: Registry, + mut kill: broadcast::Receiver<()>, +) { tokio::select! { lox_metrics = metrics::start_metrics_server(metrics_addr, registry) => lox_metrics, _ = kill.recv() => {println!("Shut down metrics server");}, @@ -291,7 +295,8 @@ async fn main() { let metrics = Metrics::default(); let registry = metrics.register(); - let metrics_addr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), config.metrics_port); + let metrics_addr = + SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), config.metrics_port); let metrics_handler = spawn(async move { start_metrics_collector(metrics_addr, registry, kill_metrics).await }); diff --git a/crates/lox-distributor/src/metrics.rs b/crates/lox-distributor/src/metrics.rs index 9a12684..998131b 100644 --- a/crates/lox-distributor/src/metrics.rs +++ b/crates/lox-distributor/src/metrics.rs @@ -8,6 +8,10 @@ use tokio::signal::unix::{signal, SignalKind}; #[derive(Debug, Clone)] pub struct Metrics { + pub existing_or_updated_bridges: Counter, + pub new_bridges: Counter, + pub removed_bridges: Counter, + pub blocked_bridges: Counter, pub open_inv_count: Counter, pub trust_promo_count: Counter, pub trust_mig_count: Counter, @@ -23,6 +27,10 @@ pub struct Metrics { impl Default for Metrics { fn default() -> Self { // Create counters. + let existing_or_updated_bridges = Counter::default(); + let new_bridges = Counter::default(); + let removed_bridges = Counter::default(); + let blocked_bridges = Counter::default(); let open_inv_count = Counter::default(); let trust_promo_count = Counter::default(); let trust_mig_count = Counter::default(); @@ -35,6 +43,10 @@ impl Default for Metrics { let buckets_requested_today = Counter::default(); Metrics { + existing_or_updated_bridges, + new_bridges, + removed_bridges, + blocked_bridges, open_inv_count, trust_promo_count, trust_mig_count, @@ -53,6 +65,26 @@ impl Metrics { pub fn register(&self) -> Registry { // Create a Registry and register Counter. let mut r = ::with_prefix("lox-metrics"); + r.register( + "existing_or_updated_bridges", + "number of existing or updated bridges recorded at rdsys sync", + self.existing_or_updated_bridges.clone(), + ); + r.register( + "new_bridges", + "number of new bridges added to bridge table", + self.new_bridges.clone(), + ); + r.register( + "removed_bridges", + "number of bridges removed from the bridgetable", + self.removed_bridges.clone(), + ); + r.register( + "blocked_bridges", + "number of bridges blocked", + self.blocked_bridges.clone(), + ); r.register( "open_inv_counter", "number of open invitations distributed", From 9ac2df642ab867dd0d9c9ef2004672fa04eab78b Mon Sep 17 00:00:00 2001 From: onyinyang Date: Thu, 26 Oct 2023 13:22:19 -0400 Subject: [PATCH 57/59] Add new bridges when first populated --- crates/lox-distributor/src/lox_context.rs | 5 +++-- crates/lox-distributor/src/main.rs | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/lox-distributor/src/lox_context.rs b/crates/lox-distributor/src/lox_context.rs index 4c5bcb4..1b3cccd 100644 --- a/crates/lox-distributor/src/lox_context.rs +++ b/crates/lox-distributor/src/lox_context.rs @@ -173,14 +173,15 @@ impl LoxServerContext { match self.replace_with_new(bridgeline) { lox_library::ReplaceSuccess::Replaced => { println!("BridgeLine {:?} not found in rdsys update was successfully replaced.", bridgeline.uid_fingerprint); - self.metrics.removed_bridges.inc();} + self.metrics.removed_bridges.inc(); + } lox_library::ReplaceSuccess::NotReplaced => { // Add the bridge to the list of to_be_replaced bridges in the Lox context and try // again to replace at the next update (nothing changes in the Lox Authority) println!("BridgeLine {:?} not found in rdsys update NOT replaced, saved for next update!", bridgeline.uid_fingerprint); self.new_to_be_replaced_bridge(bridgeline); - self.metrics.existing_or_updated_bridges.inc(); + self.metrics.existing_or_updated_bridges.inc(); } lox_library::ReplaceSuccess::NotFound => println!( "BridgeLine {:?} no longer in reachable bridges.", diff --git a/crates/lox-distributor/src/main.rs b/crates/lox-distributor/src/main.rs index e49db81..290110a 100644 --- a/crates/lox-distributor/src/main.rs +++ b/crates/lox-distributor/src/main.rs @@ -204,6 +204,7 @@ async fn context_manager( if context.bridgetable_is_empty() { if let Some(working_resources) = resources.working { let bridgelines = parse_into_bridgelines(working_resources); + context.metrics.new_bridges.inc_by(bridgelines.len() as u64); let (buckets, leftovers) = parse_into_buckets(bridgelines); for leftover in leftovers { context.append_extra_bridges(leftover); From f7fc44cbb11a2b041a0c0402ee1451c626255072 Mon Sep 17 00:00:00 2001 From: onyinyang Date: Tue, 31 Oct 2023 11:15:47 -0400 Subject: [PATCH 58/59] Fix up metrics for invites distributed --- crates/lox-distributor/src/lox_context.rs | 7 ++----- crates/lox-distributor/src/metrics.rs | 12 ++++++------ 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/crates/lox-distributor/src/lox_context.rs b/crates/lox-distributor/src/lox_context.rs index 1b3cccd..744ace1 100644 --- a/crates/lox-distributor/src/lox_context.rs +++ b/crates/lox-distributor/src/lox_context.rs @@ -6,7 +6,7 @@ use lox_library::{ blockage_migration, check_blockage, issue_invite, level_up, migration, open_invite, redeem_invite, trust_promotion, }, - BridgeAuth, BridgeDb, ExceededMaxBridgesError, IssuerPubKey, MAX_DAILY_BRIDGES, + BridgeAuth, BridgeDb, ExceededMaxBridgesError, IssuerPubKey, }; use rdsys_backend::proto::{Resource, ResourceState}; use serde::{Deserialize, Serialize}; @@ -335,10 +335,6 @@ impl LoxServerContext { if obj.current_k == 1 { self.metrics.k_reset_count.inc(); } - // Count the number of total bridge requests - if obj.daily_bridges_distributed <= MAX_DAILY_BRIDGES { - self.metrics.buckets_requested_today.inc(); - } Ok(lox_utils::Invite { invite }) } Err(e) => Err(e), @@ -402,6 +398,7 @@ impl LoxServerContext { // Generate and return an open invitation token pub fn generate_invite(self) -> Response { + self.metrics.invites_requested.inc(); let invite = self.gen_invite(); match invite { Ok(invite) => match serde_json::to_string(&invite) { diff --git a/crates/lox-distributor/src/metrics.rs b/crates/lox-distributor/src/metrics.rs index 998131b..2dcc4a3 100644 --- a/crates/lox-distributor/src/metrics.rs +++ b/crates/lox-distributor/src/metrics.rs @@ -21,7 +21,7 @@ pub struct Metrics { pub check_blockage_count: Counter, pub blockage_migration_count: Counter, pub k_reset_count: Counter, - pub buckets_requested_today: Counter, + pub invites_requested: Counter, } impl Default for Metrics { @@ -40,7 +40,7 @@ impl Default for Metrics { let check_blockage_count = Counter::default(); let blockage_migration_count = Counter::default(); let k_reset_count = Counter::default(); - let buckets_requested_today = Counter::default(); + let invites_requested = Counter::default(); Metrics { existing_or_updated_bridges, @@ -56,7 +56,7 @@ impl Default for Metrics { check_blockage_count, blockage_migration_count, k_reset_count, - buckets_requested_today, + invites_requested, } } } @@ -131,9 +131,9 @@ impl Metrics { self.k_reset_count.clone(), ); r.register( - "buckets_requested_today", - "number of buckets used today", - self.buckets_requested_today.clone(), + "invites_requested", + "number of invites requested", + self.invites_requested.clone(), ); r } From e1b94ada3be441f5f7bc02c95e7e2d775dd10301 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 1 Nov 2023 16:37:23 +0000 Subject: [PATCH 59/59] Update Rust crate js-sys to 0.3.65 --- Cargo.lock | 24 ++++++++++++------------ crates/lox-wasm/Cargo.toml | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8dce977..ca870ab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -984,9 +984,9 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" dependencies = [ "wasm-bindgen", ] @@ -2317,9 +2317,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2327,9 +2327,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" dependencies = [ "bumpalo", "log", @@ -2354,9 +2354,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2364,9 +2364,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" dependencies = [ "proc-macro2", "quote", @@ -2377,9 +2377,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" [[package]] name = "wasm-streams" diff --git a/crates/lox-wasm/Cargo.toml b/crates/lox-wasm/Cargo.toml index 6707a81..3a5ccfd 100644 --- a/crates/lox-wasm/Cargo.toml +++ b/crates/lox-wasm/Cargo.toml @@ -20,7 +20,7 @@ time = "0.3.30" serde_json = "1.0.108" console_error_panic_hook = "0.1.7" -js-sys = "0.3.64" +js-sys = "0.3.65" rand = { version = "0.7", features = ["wasm-bindgen"] } zkp = { git = "https://gitlab.torproject.org/onyinyang/lox-zkp" }