author
int64
658
755k
date
stringlengths
19
19
timezone
int64
-46,800
43.2k
hash
stringlengths
40
40
message
stringlengths
5
490
mods
list
language
stringclasses
20 values
license
stringclasses
3 values
repo
stringlengths
5
68
original_message
stringlengths
12
491
20,244
23.07.2020 14:42:19
14,400
e50b50a027a11bb0b08cc384d5546424a07c204f
Update web30 This patch prevents transaction sends that use more gas than our current balance
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "@@ -631,7 +631,7 @@ dependencies = [\n\"num 0.3.0\",\n\"num256\",\n\"rand 0.7.3\",\n- \"web30 0.5.0\",\n+ \"web30 0.5.0 (git+https://github.com/althea-net/web30?rev=53d83bc74a0218eddc4221cf2fb6eefe49fba1d9)\",\n]\n[[package]]\n@@ -3284,7 +3284,7 @@ dependencies = [\n\"tokio-io\",\n\"trust-dns-resolver 0.10.3\",\n\"web30 0.4.3\",\n- \"web30 0.5.0\",\n+ \"web30 0.5.0 (git+https://github.com/althea-net/web30?rev=ced518b6a3f82756e46bf061f5eb547695cbe868)\",\n]\n[[package]]\n@@ -4485,6 +4485,27 @@ dependencies = [\n\"tokio 0.1.22\",\n]\n+[[package]]\n+name = \"web30\"\n+version = \"0.5.0\"\n+source = \"git+https://github.com/althea-net/web30?rev=53d83bc74a0218eddc4221cf2fb6eefe49fba1d9#53d83bc74a0218eddc4221cf2fb6eefe49fba1d9\"\n+dependencies = [\n+ \"actix 0.9.0\",\n+ \"actix-web 2.0.0\",\n+ \"assert-json-diff\",\n+ \"bytes 0.5.4\",\n+ \"clarity\",\n+ \"failure\",\n+ \"futures 0.3.5\",\n+ \"futures-timer 3.0.2\",\n+ \"log\",\n+ \"num256\",\n+ \"serde 1.0.110\",\n+ \"serde_derive\",\n+ \"serde_json\",\n+ \"tokio 0.2.21\",\n+]\n+\n[[package]]\nname = \"web30\"\nversion = \"0.5.0\"\n" }, { "change_type": "MODIFY", "old_path": "auto_bridge/Cargo.toml", "new_path": "auto_bridge/Cargo.toml", "diff": "@@ -5,7 +5,7 @@ authors = [\"Jehan <jehan.tremback@gmail.com>, Justin <justin@althea.net>\"]\nedition = \"2018\"\n[dependencies]\n-web30 = { git = \"https://github.com/althea-net/web30\", rev = \"ced518b6a3f82756e46bf061f5eb547695cbe868\" }\n+web30 = { git = \"https://github.com/althea-net/web30\", rev = \"53d83bc74a0218eddc4221cf2fb6eefe49fba1d9\" }\nfutures = \"0.3\"\nfailure = \"0.1\"\nnum256 = \"0.2\"\n" }, { "change_type": "MODIFY", "old_path": "rita/Cargo.toml", "new_path": "rita/Cargo.toml", "diff": "@@ -29,7 +29,7 @@ web30 = {git = \"https://github.com/althea-net/web30\", branch = \"master\"}\n# duplicate async dependencies, we are currently carrying both futures 0.1 and modern async/await dependencies\n# these will be kept here for quite some time until the switch is completed.\n-async-web30 = {package=\"web30\", git = \"https://github.com/althea-net/web30\", rev = \"ced518b6a3f82756e46bf061f5eb547695cbe868\" }\n+async-web30 = {package=\"web30\", git = \"https://github.com/althea-net/web30\", rev = \"53d83bc74a0218eddc4221cf2fb6eefe49fba1d9\" }\nactix-async = {package=\"actix\", version = \"0.9\"}\nactix-web-async = {package=\"actix-web\", version = \"2.0\", default_features = false, features= [\"openssl\"] }\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Update web30 This patch prevents transaction sends that use more gas than our current balance
20,244
23.07.2020 16:57:47
14,400
fa8b7227b8f596c3607538ef8e9c59006747436e
Use tokio timeout not async_std timeout Dramatically reduces the number of dependencies. Mostly becuase actix also uses tokio and many can be de-duplicated
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "@@ -567,46 +567,6 @@ dependencies = [\n\"serde_json\",\n]\n-[[package]]\n-name = \"async-channel\"\n-version = \"1.1.1\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"ee81ba99bee79f3c8ae114ae4baa7eaa326f63447cf2ec65e4393618b63f8770\"\n-dependencies = [\n- \"concurrent-queue\",\n- \"event-listener\",\n- \"futures-core\",\n-]\n-\n-[[package]]\n-name = \"async-std\"\n-version = \"1.6.2\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"00d68a33ebc8b57800847d00787307f84a562224a14db069b0acefe4c2abbf5d\"\n-dependencies = [\n- \"async-task\",\n- \"crossbeam-utils 0.7.2\",\n- \"futures-channel\",\n- \"futures-core\",\n- \"futures-io\",\n- \"kv-log-macro\",\n- \"log\",\n- \"memchr\",\n- \"num_cpus\",\n- \"once_cell\",\n- \"pin-project-lite\",\n- \"pin-utils\",\n- \"slab\",\n- \"smol\",\n- \"wasm-bindgen-futures\",\n-]\n-\n-[[package]]\n-name = \"async-task\"\n-version = \"3.0.0\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"c17772156ef2829aadc587461c7753af20b7e8db1529bc66855add962a3b35d3\"\n-\n[[package]]\nname = \"async-trait\"\nversion = \"0.1.36\"\n@@ -618,12 +578,6 @@ dependencies = [\n\"syn 1.0.35\",\n]\n-[[package]]\n-name = \"atomic-waker\"\n-version = \"1.0.0\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a\"\n-\n[[package]]\nname = \"atty\"\nversion = \"0.2.14\"\n@@ -640,7 +594,6 @@ name = \"auto-bridge\"\nversion = \"0.1.5\"\ndependencies = [\n\"actix 0.9.0\",\n- \"async-std\",\n\"clarity\",\n\"failure\",\n\"futures 0.3.5\",\n@@ -648,6 +601,7 @@ dependencies = [\n\"num 0.3.0\",\n\"num256\",\n\"rand 0.7.3\",\n+ \"tokio 0.2.22\",\n\"web30 0.5.0\",\n]\n@@ -794,20 +748,6 @@ dependencies = [\n\"byte-tools\",\n]\n-[[package]]\n-name = \"blocking\"\n-version = \"0.4.7\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"d2468ff7bf85066b4a3678fede6fe66db31846d753ff0adfbfab2c6a6e81612b\"\n-dependencies = [\n- \"async-channel\",\n- \"atomic-waker\",\n- \"futures-lite\",\n- \"once_cell\",\n- \"parking\",\n- \"waker-fn\",\n-]\n-\n[[package]]\nname = \"brotli-sys\"\nversion = \"0.3.2\"\n@@ -889,12 +829,6 @@ version = \"1.1.1\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"4964518bd3b4a8190e832886cdc0da9794f12e8e6c1613a9e90ff331c4c8724b\"\n-[[package]]\n-name = \"cache-padded\"\n-version = \"1.1.1\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba\"\n-\n[[package]]\nname = \"cc\"\nversion = \"1.0.41\"\n@@ -1007,15 +941,6 @@ dependencies = [\n\"serde_json\",\n]\n-[[package]]\n-name = \"concurrent-queue\"\n-version = \"1.1.1\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"f83c06aff61f2d899eb87c379df3cbf7876f14471dcab474e0b6dc90ab96c080\"\n-dependencies = [\n- \"cache-padded\",\n-]\n-\n[[package]]\nname = \"config\"\nversion = \"0.10.1\"\n@@ -1362,12 +1287,6 @@ dependencies = [\n\"backtrace\",\n]\n-[[package]]\n-name = \"event-listener\"\n-version = \"2.2.0\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"699d84875f1b72b4da017e6b0f77dfa88c0137f089958a88974d15938cbc2976\"\n-\n[[package]]\nname = \"exit_db\"\nversion = \"0.1.0\"\n@@ -1430,12 +1349,6 @@ dependencies = [\n\"ascii_utils\",\n]\n-[[package]]\n-name = \"fastrand\"\n-version = \"1.3.3\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"36a9cb09840f81cd211e435d00a4e487edd263dc3c8ff815c32dd76ad668ebed\"\n-\n[[package]]\nname = \"flate2\"\nversion = \"1.0.16\"\n@@ -1561,21 +1474,6 @@ version = \"0.3.5\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789\"\n-[[package]]\n-name = \"futures-lite\"\n-version = \"0.1.8\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"180d8fc9819eb48a0c976672fbeea13a73e10999e812bdc9e14644c25ad51d60\"\n-dependencies = [\n- \"fastrand\",\n- \"futures-core\",\n- \"futures-io\",\n- \"memchr\",\n- \"parking\",\n- \"pin-project-lite\",\n- \"waker-fn\",\n-]\n-\n[[package]]\nname = \"futures-macro\"\nversion = \"0.3.5\"\n@@ -2077,15 +1975,6 @@ dependencies = [\n\"winapi-build\",\n]\n-[[package]]\n-name = \"kv-log-macro\"\n-version = \"1.0.7\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f\"\n-dependencies = [\n- \"log\",\n-]\n-\n[[package]]\nname = \"language-tags\"\nversion = \"0.2.2\"\n@@ -2670,12 +2559,6 @@ dependencies = [\n\"stable_deref_trait\",\n]\n-[[package]]\n-name = \"parking\"\n-version = \"1.0.5\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"50d4a6da31f8144a32532fe38fe8fb439a6842e0ec633f0037f0144c14e7f907\"\n-\n[[package]]\nname = \"parking_lot\"\nversion = \"0.7.1\"\n@@ -3421,12 +3304,6 @@ dependencies = [\n\"parking_lot 0.11.0\",\n]\n-[[package]]\n-name = \"scoped-tls\"\n-version = \"1.0.0\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2\"\n-\n[[package]]\nname = \"scopeguard\"\nversion = \"0.3.3\"\n@@ -3682,27 +3559,6 @@ version = \"1.4.1\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"3757cb9d89161a2f24e1cf78efa0c1fcff485d18e3f55e0aa3480824ddaa0f3f\"\n-[[package]]\n-name = \"smol\"\n-version = \"0.1.18\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"620cbb3c6e34da57d3a248cda0cd01cd5848164dc062e764e65d06fe3ea7aed5\"\n-dependencies = [\n- \"async-task\",\n- \"blocking\",\n- \"concurrent-queue\",\n- \"fastrand\",\n- \"futures-io\",\n- \"futures-util\",\n- \"libc\",\n- \"once_cell\",\n- \"scoped-tls\",\n- \"slab\",\n- \"socket2\",\n- \"wepoll-sys-stjepang\",\n- \"winapi 0.3.9\",\n-]\n-\n[[package]]\nname = \"socket2\"\nversion = \"0.3.12\"\n@@ -4429,12 +4285,6 @@ version = \"0.9.2\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed\"\n-[[package]]\n-name = \"waker-fn\"\n-version = \"1.0.0\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"9571542c2ce85ce642e6b58b3364da2fb53526360dfb7c211add4f5c23105ff7\"\n-\n[[package]]\nname = \"want\"\nversion = \"0.3.0\"\n@@ -4571,15 +4421,6 @@ dependencies = [\n\"tokio 0.2.22\",\n]\n-[[package]]\n-name = \"wepoll-sys-stjepang\"\n-version = \"1.0.6\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"6fd319e971980166b53e17b1026812ad66c6b54063be879eb182342b55284694\"\n-dependencies = [\n- \"cc\",\n-]\n-\n[[package]]\nname = \"widestring\"\nversion = \"0.2.2\"\n" }, { "change_type": "MODIFY", "old_path": "auto_bridge/Cargo.toml", "new_path": "auto_bridge/Cargo.toml", "diff": "@@ -13,7 +13,7 @@ clarity = \"0.1\"\nrand = \"0.7\"\nnum = \"0.3\"\nlog = \"0.4\"\n-async-std = \"1.6\"\n+tokio = {version = \"0.2\", default_features = false, features = [\"time\"]}\n[dev-dependencies]\nactix = \"0.9\"\n" }, { "change_type": "MODIFY", "old_path": "auto_bridge/src/lib.rs", "new_path": "auto_bridge/src/lib.rs", "diff": "#[macro_use]\nextern crate log;\n-use async_std::future::timeout as future_timeout;\nuse clarity::abi::encode_call;\nuse clarity::{Address, PrivateKey};\nuse failure::bail;\n@@ -9,6 +8,7 @@ use failure::Error;\nuse num::Bounded;\nuse num256::Uint256;\nuse std::time::Duration;\n+use tokio::time::timeout as future_timeout;\nuse web30::client::Web3;\nuse web30::types::SendTxOption;\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Use tokio timeout not async_std timeout Dramatically reduces the number of dependencies. Mostly becuase actix also uses tokio and many can be de-duplicated
20,244
23.07.2020 17:24:02
14,400
bf49de04226ef0a7f778eb0b69b03f07140084e8
Unmonitor tunnels when re-creating them This is a pretty large oversight, we need to unmonitor not just delete the tunnel when re-creating it. Seems related to this bug
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_common/tunnel_manager/mod.rs", "new_path": "rita/src/rita_common/tunnel_manager/mod.rs", "diff": "@@ -818,6 +818,12 @@ impl TunnelManager {\n// how many tunnels are still associated with that ID.\n(value, tunnels.len())\n};\n+ // this is an inherent race condition, when we re-create the tunnel\n+ // and monitor it this may not have already completed. This will be fixed\n+ // in the async/await refactor of this module. In an attempt to reduce this\n+ // race condition this code is placed as far up as possible.\n+ tunnel.unmonitor(0);\n+\nif size == 0 {\n// Remove this identity if there are no tunnels associated with it.\nself.tunnels.remove(&key);\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Unmonitor tunnels when re-creating them This is a pretty large oversight, we need to unmonitor not just delete the tunnel when re-creating it. Seems related to this bug https://github.com/jech/babeld/issues/14
20,244
23.07.2020 19:32:20
14,400
67122456f1121ad75418a78b5a5af5d65b0b5aad
Set Detailed withdraw state immediately This makes the dashboard withdraw display show up instantly rather than waiting more than a minute.
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_common/token_bridge/mod.rs", "new_path": "rita/src/rita_common/token_bridge/mod.rs", "diff": "@@ -165,7 +165,7 @@ pub async fn tick_token_bridge() {\n}\ndrop(payment_settings);\n- trace!(\"Launching bridge future\");\n+ trace!(\"Launching bridge future with state {}\", bridge.state);\nmatch system_chain {\nSystemChain::Xdai => state_change(xdai_bridge(bridge.state.clone()).await),\nSystemChain::Ethereum => eth_bridge().await,\n@@ -334,7 +334,10 @@ async fn xdai_bridge(state: State) -> State {\n};\nlet our_dai_balance = match bridge.get_dai_balance(bridge.own_address).await {\nOk(val) => val,\n- Err(_e) => return state,\n+ Err(e) => {\n+ warn!(\"Failed to get dai balance {}\", e);\n+ return state;\n+ }\n};\n// the amount of Eth to retain in WEI. This is the cost of our Uniswap exchange an ERC20 transfer\n// and one ETH transfer. To pay for Uniswap -> send to bridge and keep enough around for a withdraw\n@@ -597,10 +600,11 @@ pub fn withdraw(msg: Withdraw) -> Result<(), Error> {\n_ => {\nstate_change(State::WithdrawRequest {\nto,\n- amount,\n+ amount: amount.clone(),\ntimestamp: Instant::now(),\nwithdraw_all,\n});\n+ detailed_state_change(DetailedBridgeState::XdaiToDai { amount });\nOk(())\n}\n}\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Set Detailed withdraw state immediately This makes the dashboard withdraw display show up instantly rather than waiting more than a minute.
20,244
24.07.2020 11:00:03
14,400
49779642d134f3b97e986d951d03676d52baafbf
Fix minimum to exchange display for dashboard
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_common/token_bridge/mod.rs", "new_path": "rita/src/rita_common/token_bridge/mod.rs", "diff": "@@ -80,16 +80,6 @@ pub fn eth_to_wei(eth: u64) -> Uint256 {\nwei.into()\n}\n-// /// 1c in of dai in wei\n-// pub const DAI_WEI_CENT: u128 = 10_000_000_000_000_000u128;\n-// fn wei_dai_to_dai_cents(dai_wei: Uint256) -> Uint256 {\n-// dai_wei / DAI_WEI_CENT.into()\n-// }\n-// /// Provided an amount in DAI (wei dai so 1*10^18 per dollar) returns the equal amount in wei (or ETH if divided by 1*10^18)\n-// pub fn eth_equal(dai_in_wei: Uint256, wei_per_cent: Uint256) -> Uint256 {\n-// wei_dai_to_dai_cents(dai_in_wei) * wei_per_cent\n-// }\n-\n#[derive(Clone, Debug, Eq, PartialEq)]\npub enum State {\nReady,\n@@ -325,6 +315,7 @@ async fn xdai_bridge(state: State) -> State {\nreturn state;\n}\n};\n+ let wei_per_cent = wei_per_dollar.clone() / 100u32.into();\nlet our_eth_balance = match bridge.eth_web3.eth_get_balance(bridge.own_address).await {\nOk(val) => val,\nErr(e) => {\n@@ -345,8 +336,8 @@ async fn xdai_bridge(state: State) -> State {\nlet reserve_amount = get_reserve_amount(eth_gas_price.clone());\nlet minimum_to_exchange = reserve_amount.clone() * 2u32.into();\nset_last_amounts(\n- lossy_u32(minimum_to_exchange.clone() / wei_per_dollar.clone()),\n- lossy_u32(reserve_amount.clone() / wei_per_dollar.clone()),\n+ lossy_u32(minimum_to_exchange.clone() / wei_per_cent.clone()),\n+ lossy_u32(reserve_amount.clone() / wei_per_cent.clone()),\n);\n// the minimum amount to transfer, this is in DAI wei, but we want it to be equal to the value\n// of two ERC20 transfers.\n@@ -354,8 +345,8 @@ async fn xdai_bridge(state: State) -> State {\nmatch state {\nState::Ready { .. } => {\ninfo!(\n- \"Ticking in bridge State::Ready. Eth Address: {}\",\n- bridge.own_address\n+ \"Ticking in bridge State::Ready. Eth Address: {}, Reserve amount: {}, Minimum to exchange: {}, Minimum DAI rescue: {}, Wei Per dollar: {}\",\n+ bridge.own_address, reserve_amount, minimum_to_exchange, minimum_stranded_dai_transfer, wei_per_dollar\n);\nlet res = rescue_dai(\nbridge.clone(),\n@@ -683,10 +674,13 @@ pub fn get_bridge_status() -> BridgeStatus {\nlet withdraw_chain = payment_settings.withdraw_chain;\ndrop(payment_settings);\nlet bridge = BRIDGE.read().unwrap().clone();\n+ // amounts is in cents, we need to convert to dollars for the dashboard display\nlet amounts = AMOUNTS.read().unwrap().clone();\n+ let reserve_amount = div_round_closest(amounts.reserve_amount, 100);\n+ let minimum_to_exchange = div_round_closest(amounts.minimum_to_exchange, 100);\nBridgeStatus {\n- reserve_amount: amounts.reserve_amount,\n- minimum_deposit: amounts.minimum_to_exchange,\n+ reserve_amount,\n+ minimum_deposit: minimum_to_exchange,\nwithdraw_chain,\nstate: bridge.detailed_state,\n}\n@@ -718,3 +712,7 @@ fn lossy_u32(input: Uint256) -> u32 {\nErr(_e) => u32::MAX,\n}\n}\n+\n+fn div_round_closest(a: u32, b: u32) -> u32 {\n+ (a - (b + 1) / 2) / b + 1\n+}\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Fix minimum to exchange display for dashboard
20,244
24.07.2020 13:03:00
14,400
71d4dc0466f4bba49c00aa80ac71d19addd1816c
Fix comment spelling errors in exit enforcement manager
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_exit/database/mod.rs", "new_path": "rita/src/rita_exit/database/mod.rs", "diff": "//! This module contains all the tools and functions that integrate with the clients database\n//! for the exit, which is most exit logic in general. Keep in mind database connections are remote\n-//! and therefore synronous database requests are quite expensive (on the order of tens of milliseconds)\n+//! and therefore synchronous database requests are quite expensive (on the order of tens of milliseconds)\nuse crate::rita_common::debt_keeper::get_debts_list_sync;\nuse crate::rita_common::debt_keeper::DebtAction;\n@@ -574,11 +574,11 @@ pub fn enforce_exit_clients(\n// TODO this is a hacky emergency kill switch for when we detect that\n// the actix loop may be running too slowly, when that happens requests to\n// the full node timeout and transactions will not be processed resulting in\n- // wallet drain, this is worse than the possiblity of the exit not coming back up\n- // As a method of detection this is just a decent proxy not a 100% acurate method\n+ // wallet drain, this is worse than the possibility of the exit not coming back up\n+ // As a method of detection this is just a decent proxy not a 100% accurate method\n// as it seems that http requests and anything that touches shelling out slow down\n// the most in these situations. Hopefully we can figure out more about why the\n- // futures loop starts acting stragely.\n+ // futures loop starts acting strangely.\nconst PANIC_TIME: u64 = 10;\nif start.elapsed().as_secs() > PANIC_TIME {\nlet fail_mesg = format!(\"Exit enforcement took more than {} seconds!\", PANIC_TIME);\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Fix comment spelling errors in exit enforcement manager
20,244
24.07.2020 15:47:05
14,400
8ca2239d9462615b178b99a020767715d37cbbeb
Cleanup all IPs in antenna forwarding client This should hopefully stop polluting the interfaces with dozens of different randomly generated source and destiantion addresses
[ { "change_type": "MODIFY", "old_path": "althea_kernel_interface/src/interface_tools.rs", "new_path": "althea_kernel_interface/src/interface_tools.rs", "diff": "@@ -79,6 +79,41 @@ impl dyn KernelInterface {\n}\n}\n}\n+\n+ /// Gets all the IPv4 addresses from an interface and returns the address and it's netmask\n+ /// as a tuple.\n+ pub fn get_ip_from_iface(&self, name: &str) -> Result<Vec<(IpAddr, u8)>, Error> {\n+ let output = self.run_command(\"ip\", &[\"address\", \"show\", \"dev\", name])?;\n+ let stdout = String::from_utf8(output.stdout)?;\n+\n+ lazy_static! {\n+ static ref RE: Regex = Regex::new(r\"((\\d){1,3}\\.){3}(\\d){1,3}/(\\d){1,3}\")\n+ .expect(\"Unable to compile regular expression\");\n+ }\n+ let mut ret = Vec::new();\n+ for line in stdout.lines() {\n+ let cap = RE.captures(&line);\n+ // we captured something on this line\n+ if let Some(cap) = cap {\n+ for ip_cap in cap.iter() {\n+ if let Some(ip_cap) = ip_cap {\n+ let mut split = ip_cap.as_str().split('/');\n+ let ip_str = split.next();\n+ let netmask = split.next();\n+ if let (Some(ip_str), Some(netmask)) = (ip_str, netmask) {\n+ if let (Ok(parsed_ip), Ok(parsed_netmask)) =\n+ (ip_str.parse(), netmask.parse())\n+ {\n+ ret.push((parsed_ip, parsed_netmask));\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+\n+ Ok(ret)\n+ }\n}\n#[test]\n@@ -158,3 +193,53 @@ fn test_get_wg_remote_ip() {\n\"fe80::78e4:1cff:fe61:560d\".parse::<IpAddr>().unwrap()\n);\n}\n+\n+#[test]\n+fn test_get_ip_addresses_linux() {\n+ use crate::KI;\n+\n+ use std::os::unix::process::ExitStatusExt;\n+ use std::process::ExitStatus;\n+ use std::process::Output;\n+\n+ KI.set_mock(Box::new(move |program, args| {\n+ assert_eq!(program, \"ip\");\n+ assert_eq!(args, &[\"address\", \"show\", \"dev\", \"eth8\"]);\n+\n+ Ok(Output {\n+ stdout: b\"\n+ 13: eth8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000\n+ link/ether 00:e0:4c:67:a1:57 brd ff:ff:ff:ff:ff:ff\n+ inet 192.168.1.203/32 scope global eth8\n+ valid_lft forever preferred_lft forever\n+ inet 192.168.1.154/32 scope global eth8\n+ valid_lft forever preferred_lft forever\n+ inet 192.168.1.73/32 scope global eth8\n+ valid_lft forever preferred_lft forever\n+ inet 192.168.1.137/32 scope global eth8\n+ valid_lft forever preferred_lft forever\n+ inet 192.168.88.20/32 scope global eth8\n+ valid_lft forever preferred_lft forever\n+ inet 192.168.88.197/32 scope global eth8\n+ valid_lft forever preferred_lft forever\n+ inet 192.168.88.214/32 scope global eth8\n+ valid_lft forever preferred_lft forever\n+ inet 192.168.1.206/32 scope global eth8\n+ valid_lft forever preferred_lft forever\n+ inet 192.168.1.35/32 scope global eth8\n+ valid_lft forever preferred_lft forever\n+ inet6 fde6::1/128 scope global\n+ valid_lft forever preferred_lft forever\n+ inet6 fe80::2e0:4cff:fe67:a157/64 scope link\n+ valid_lft forever preferred_lft forever\n+ \"\n+ .to_vec(),\n+ stderr: b\"\".to_vec(),\n+ status: ExitStatus::from_raw(0),\n+ })\n+ }));\n+\n+ let interfaces = KI.get_ip_from_iface(\"eth8\").unwrap();\n+ let val = (\"192.168.1.203\".parse().unwrap(), 32);\n+ assert!(interfaces.contains(&val))\n+}\n" }, { "change_type": "MODIFY", "old_path": "antenna_forwarding_client/src/lib.rs", "new_path": "antenna_forwarding_client/src/lib.rs", "diff": "@@ -316,14 +316,13 @@ fn find_antenna<S: ::std::hash::BuildHasher>(\n// dangerous if our default route overlaps, or if you enter an exit route ip\nlet _ = KI.run_command(\"ip\", &[\"route\", \"del\", &format!(\"{}/32\", target_ip)]);\nfor iface in interfaces {\n- let _ = KI.run_command(\n- \"ip\",\n- &[\"addr\", \"del\", &format!(\"{}/32\", our_ip), \"dev\", iface],\n- );\n- let _ = KI.run_command(\n- \"ip\",\n- &[\"addr\", \"del\", &format!(\"{}/32\", target_ip), \"dev\", iface],\n- );\n+ // cleans up all previous forwarding ip's in some way this is more dangerous than the previous\n+ // solution, which only cleaned up the target and destination ip's. But the more through cleanup\n+ // will hopefully prevent strange aliasing issues with devices on the lan or other networks that\n+ // may overlap with these routes.\n+ // this function only errors out when the underlying attempt at running a command fails. So it should\n+ // not cause issues with failing the find antenna command\n+ cleanup_interface(iface)?;\n}\nlet res = KI.run_command(\n\"ip\",\n@@ -434,6 +433,18 @@ fn send_error_message(server_stream: &mut TcpStream, message: String) {\nlet _res = server_stream.shutdown(Shutdown::Both);\n}\n+fn cleanup_interface(iface: &str) -> Result<(), Error> {\n+ let values = KI.get_ip_from_iface(iface)?;\n+ for (ip, netmask) in values {\n+ // we only clean up very specific routes, this doesn't prevent us from causing problems\n+ // but it does help prevent us from doing things like removing the default route.\n+ if netmask == 32 {\n+ let _ = KI.run_command(\"ip\", &[\"addr\", \"del\", &format!(\"{}/32\", ip), \"dev\", iface]);\n+ }\n+ }\n+ Ok(())\n+}\n+\n#[cfg(test)]\nmod tests {\nuse super::*;\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Cleanup all IPs in antenna forwarding client This should hopefully stop polluting the interfaces with dozens of different randomly generated source and destiantion addresses
20,244
24.07.2020 16:07:27
14,400
92292537ef83fe5729b131a3d7ce691d02a6bdd8
Update release feed handling Previously we made the release feed act as an easily deserializable string to simplify the flatfile oracles of yesteryear. Now that we've replace that with the operator tools we should just send the full enum value. This reduces potential problems with parsing.
[ { "change_type": "MODIFY", "old_path": "althea_types/src/interop.rs", "new_path": "althea_types/src/interop.rs", "diff": "@@ -431,9 +431,11 @@ pub struct OperatorUpdateMessage {\n/// The withdraw blockchain that is currently being used, if it is 'none' here it is\n/// interpreted as \"don't change anything\"\npub withdraw_chain: Option<SystemChain>,\n+ /// To be removed in beta 16, moving to use the ReleaseStatus enum on 'firmware_release'\n+ pub release_feed: Option<String>,\n/// A release feed to be applied to the /etc/opkg/customfeeds.config, None means do not\n/// change the currently configured release feed\n- pub release_feed: Option<String>,\n+ pub firmware_feed: Option<ReleaseStatus>,\n/// A json payload to be merged into the existing settings, this payload is checked\n/// not to include a variety of things that might break the router but is still not\n/// risk free for example the url fields require http:// or https:// or the router will\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_client/operator_update/mod.rs", "new_path": "rita/src/rita_client/operator_update/mod.rs", "diff": "@@ -19,7 +19,7 @@ use althea_kernel_interface::opkg_feeds::set_release_feed;\nuse althea_types::NeighborStatus;\nuse althea_types::OperatorAction;\nuse althea_types::OperatorCheckinMessage;\n-use althea_types::OperatorUpdateMessage;\n+use althea_types::{OperatorUpdateMessage, ReleaseStatus};\nuse futures01::Future;\nuse num256::Uint256;\nuse serde_json::Map;\n@@ -202,8 +202,8 @@ fn checkin() {\n// gated on \"None\" to prevent reading a file if there is\n// no update. Maybe someday match will be smart enough to\n// avoid that on it's own\n- if new_settings.release_feed.is_some() {\n- handle_release_feed_update(new_settings.release_feed);\n+ if new_settings.firmware_feed.is_some() {\n+ handle_release_feed_update(new_settings.firmware_feed);\n}\nmatch new_settings.operator_action {\n@@ -240,18 +240,13 @@ fn checkin() {\n/// Allows for online updating of the release feed, note that this not run\n/// on every device startup meaning just editing it the config is not sufficient\n-fn handle_release_feed_update(val: Option<String>) {\n+fn handle_release_feed_update(val: Option<ReleaseStatus>) {\nmatch (val, get_release_feed()) {\n(None, _) => {}\n(Some(_new_feed), Err(e)) => {\nerror!(\"Failed to read current release feed! {:?}\", e);\n}\n(Some(new_feed), Ok(old_feed)) => {\n- // we parse rather than just matching on a ReleaseState enum because\n- // that's the easiest way to get the Custom(val) variant to deserialize\n- // since from_str is implemented in althea types to work well with that\n- // case, serde can't handle it well in the general case for various reasons\n- if let Ok(new_feed) = new_feed.parse() {\nif new_feed != old_feed {\nif let Err(e) = set_release_feed(new_feed) {\nerror!(\"Failed to set new release feed! {:?}\", e);\n@@ -260,7 +255,6 @@ fn handle_release_feed_update(val: Option<String>) {\n}\n}\n}\n-}\n/// Merges an arbitrary settings string, after first filtering for several\n/// forbidden values\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Update release feed handling Previously we made the release feed act as an easily deserializable string to simplify the flatfile oracles of yesteryear. Now that we've replace that with the operator tools we should just send the full enum value. This reduces potential problems with parsing.
20,244
24.07.2020 17:10:36
14,400
685be4bbd54de197c4a2f9f2e365bbc1af6c943b
Bump for Beta 15 RC1
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "@@ -3170,7 +3170,7 @@ dependencies = [\n[[package]]\nname = \"rita\"\n-version = \"0.5.56\"\n+version = \"0.5.57\"\ndependencies = [\n\"actix 0.7.11\",\n\"actix 0.9.0\",\n" }, { "change_type": "MODIFY", "old_path": "rita/Cargo.toml", "new_path": "rita/Cargo.toml", "diff": "[package]\nname = \"rita\"\n-version = \"0.5.56\"\n+version = \"0.5.57\"\nauthors = [\"Justin <justin@althea.net>\", \"Jehan <jehan.tremback@gmail.com>\", \"Ben <wangben3@gmail.com>\"]\nbuild = \"build.rs\"\nedition = \"2018\"\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/dashboard/own_info.rs", "new_path": "rita/src/rita_common/dashboard/own_info.rs", "diff": "@@ -7,7 +7,7 @@ use failure::Error;\nuse num256::{Int256, Uint256};\nuse settings::RitaCommonSettings;\n-pub static READABLE_VERSION: &str = \"Beta 14 RC10\";\n+pub static READABLE_VERSION: &str = \"Beta 15 RC1\";\n#[derive(Serialize)]\npub struct OwnInfo {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Bump for Beta 15 RC1
20,244
27.07.2020 08:18:28
14,400
a2448c80452e3f048c36210ea217b429611533bd
Record gas price on token bridge tick
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_common/token_bridge/mod.rs", "new_path": "rita/src/rita_common/token_bridge/mod.rs", "diff": "@@ -345,8 +345,8 @@ async fn xdai_bridge(state: State) -> State {\nmatch state {\nState::Ready { .. } => {\ninfo!(\n- \"Ticking in bridge State::Ready. Eth Address: {}, Reserve amount: {}, Minimum to exchange: {}, Minimum DAI rescue: {}, Wei Per dollar: {}\",\n- bridge.own_address, reserve_amount, minimum_to_exchange, minimum_stranded_dai_transfer, wei_per_dollar\n+ \"Ticking in bridge State::Ready. Eth Address: {}, Reserve amount: {}, Minimum to exchange: {}, Minimum DAI rescue: {}, Wei Per dollar: {}, Eth Gas Price: {}\",\n+ bridge.own_address, reserve_amount, minimum_to_exchange, minimum_stranded_dai_transfer, wei_per_dollar, eth_gas_price\n);\nlet res = rescue_dai(\nbridge.clone(),\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Record gas price on token bridge tick
20,244
27.07.2020 13:31:56
14,400
27a58a0de24932f9bd6a5ac6e92a5132bb70b5e3
Fix spelling in payment_validator
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_common/payment_validator/mod.rs", "new_path": "rita/src/rita_common/payment_validator/mod.rs", "diff": "@@ -97,7 +97,7 @@ impl Default for PaymentValidator {\n/// until they are validated, dropped for validity issues, or time out without being inserted\n/// into the blockchain. Transactions that are too old are prevented from being played back\n/// by using a history of successful transactions.\n-/// This endpoint specifically (and only this one) is fully imdepotent so that we can retry\n+/// This endpoint specifically (and only this one) is fully idempotent so that we can retry\n/// txid transmissions\n#[derive(Message)]\npub struct ValidateLater(pub ToValidate);\n@@ -229,7 +229,7 @@ pub fn validate_transaction(ts: &ToValidate) {\nlet res = web3\n.eth_block_number()\n.join(web3.eth_get_transaction_by_hash(txid.clone()))\n- // even though we sepcify the timeout above don't remove this, we need it to 100% ensure that operations time out\n+ // even though we specify the timeout above don't remove this, we need it to 100% ensure that operations time out\n// for example Actix may run slowly, web3 timeouts only care about actual request time\n.timeout(TRANSACTION_VERIFICATION_TIMEOUT)\n.and_then(move |(block_num, tx_status)| {\n@@ -326,7 +326,7 @@ fn handle_tx_messaging(\n.then(|_| Ok(()));\nArbiter::spawn(res);\n}\n- // we suceessfully paid someone\n+ // we successfully paid someone\n(false, true, true) => {\nlet res = PaymentValidator::from_registry()\n.send(Remove {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Fix spelling in payment_validator
20,244
27.07.2020 13:33:31
14,400
589c8ae3f0cbb64e3ea011876fca52758755adea
Bump for Beta 15 RC2
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "@@ -3170,7 +3170,7 @@ dependencies = [\n[[package]]\nname = \"rita\"\n-version = \"0.5.57\"\n+version = \"0.5.58\"\ndependencies = [\n\"actix 0.7.11\",\n\"actix 0.9.0\",\n" }, { "change_type": "MODIFY", "old_path": "rita/Cargo.toml", "new_path": "rita/Cargo.toml", "diff": "[package]\nname = \"rita\"\n-version = \"0.5.57\"\n+version = \"0.5.58\"\nauthors = [\"Justin <justin@althea.net>\", \"Jehan <jehan.tremback@gmail.com>\", \"Ben <wangben3@gmail.com>\"]\nbuild = \"build.rs\"\nedition = \"2018\"\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/dashboard/own_info.rs", "new_path": "rita/src/rita_common/dashboard/own_info.rs", "diff": "@@ -7,7 +7,7 @@ use failure::Error;\nuse num256::{Int256, Uint256};\nuse settings::RitaCommonSettings;\n-pub static READABLE_VERSION: &str = \"Beta 15 RC1\";\n+pub static READABLE_VERSION: &str = \"Beta 15 RC2\";\n#[derive(Serialize)]\npub struct OwnInfo {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Bump for Beta 15 RC2
20,244
03.08.2020 17:14:28
14,400
dab09771ae7172c5e77aefaadc4e331079d89c39
Don't reserve enough for a withdraw it's simply too expensive
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_common/token_bridge/mod.rs", "new_path": "rita/src/rita_common/token_bridge/mod.rs", "diff": "@@ -695,8 +695,11 @@ fn get_core() -> TokenBridgeCore {\n/// the amount of Eth to retain in WEI. This is the cost of our Uniswap exchange an ERC20 transfer\n/// and one ETH transfer. To pay for Uniswap -> send to bridge and keep enough around for a withdraw\n/// which involves a Uniswap exchange -> Eth send (since the ERC20 send is paid by the bridge)\n+/// this ensures that a withdraw is always possible. Currently we have reduced this to only ensure\n+/// that the deposit goes through. Because reserving enough funds is too expensive.\nfn get_reserve_amount(eth_gas_price: Uint256) -> Uint256 {\n- eth_gas_price * (ERC20_GAS_LIMIT + (UNISWAP_GAS_LIMIT * 2) + ETH_TRANSACTION_GAS_LIMIT).into()\n+ // eth_gas_price * (ERC20_GAS_LIMIT + (UNISWAP_GAS_LIMIT * 2) + ETH_TRANSACTION_GAS_LIMIT).into()\n+ eth_gas_price * (ERC20_GAS_LIMIT + UNISWAP_GAS_LIMIT).into()\n}\n/// the amount of Eth to retain in WEI. This time for withdraws such that we always leave enough\n/// to pay for the next withdraw\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Don't reserve enough for a withdraw it's simply too expensive
20,244
03.08.2020 17:15:04
14,400
90f3d95af37f34e7f22be65e4468c90e4b374ce9
Update reservation request types Wyre has released their reservation request to prod with some api changes
[ { "change_type": "MODIFY", "old_path": "althea_types/src/user_info.rs", "new_path": "althea_types/src/user_info.rs", "diff": "@@ -98,6 +98,14 @@ pub struct WyreReservationRequest {\npub street1: String,\n#[serde(rename = \"postalCode\")]\npub postal_code: String,\n+ #[serde(rename = \"lockFields\")]\n+ pub lock_fields: Vec<String>,\n+ #[serde(rename = \"redirectUrl\")]\n+ pub redirect_url: String,\n+ #[serde(rename = \"failureRedirectUrl\")]\n+ pub failure_redirect_url: String,\n+ #[serde(rename = \"referrerAccountId\")]\n+ pub referrer_account_id: String,\n}\n#[derive(Debug, Clone, Serialize, Deserialize)]\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Update reservation request types Wyre has released their reservation request to prod with some api changes
20,244
03.08.2020 17:39:09
14,400
798fda8b29869ae59fdf585404f82908ab9b3d74
Remove WyreReservation toggle Now that the WyreReservation flow works moving forward it will always be used
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_client/dashboard/localization.rs", "new_path": "rita/src/rita_client/dashboard/localization.rs", "diff": "@@ -21,7 +21,6 @@ pub struct LocalizationReturn {\npub wyre_account_id: String,\npub display_currency_symbol: bool,\npub support_number: String,\n- pub wyre_reservation_flow: bool,\n}\nimpl From<LocalizationSettings> for LocalizationReturn {\n@@ -35,7 +34,6 @@ impl From<LocalizationSettings> for LocalizationReturn {\n.format()\n.mode(Mode::National)\n.to_string(),\n- wyre_reservation_flow: input.wyre_reservation_flow,\n}\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "settings/src/localization.rs", "new_path": "settings/src/localization.rs", "diff": "@@ -12,12 +12,6 @@ fn default_display_currency_symbol() -> bool {\ntrue\n}\n-// disable the wyre reservation flow as it is half baked\n-// as of this release\n-fn default_wyre_reservation_flow() -> bool {\n- false\n-}\n-\nfn default_support_number() -> PhoneNumber {\n\"+18664ALTHEA\".parse().unwrap()\n}\n@@ -41,11 +35,6 @@ pub struct LocalizationSettings {\n/// a locally relevant one if possible.\n#[serde(default = \"default_support_number\")]\npub support_number: PhoneNumber,\n- /// If we use the wyre hosted debit card widget flow or the reservation flow, the reservation\n- /// flow calls out to the operator tools to get a reservation link whereas the pre-reservation flow\n- /// is simply a link to the wyre widget\n- #[serde(default = \"default_wyre_reservation_flow\")]\n- pub wyre_reservation_flow: bool,\n}\nimpl Default for LocalizationSettings {\n@@ -55,7 +44,6 @@ impl Default for LocalizationSettings {\nwyre_account_id: default_wyre_account_id(),\ndisplay_currency_symbol: default_display_currency_symbol(),\nsupport_number: default_support_number(),\n- wyre_reservation_flow: default_wyre_reservation_flow(),\n}\n}\n}\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Remove WyreReservation toggle Now that the WyreReservation flow works moving forward it will always be used
20,244
03.08.2020 17:41:56
14,400
0a61cc903a763028749b910c323b4bc632a54070
Remove Wyre account ID This is now held in the reservation flow, so it can be removed
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_client/dashboard/localization.rs", "new_path": "rita/src/rita_client/dashboard/localization.rs", "diff": "@@ -18,7 +18,6 @@ use std::time::Duration;\n#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)]\npub struct LocalizationReturn {\npub wyre_enabled: bool,\n- pub wyre_account_id: String,\npub display_currency_symbol: bool,\npub support_number: String,\n}\n@@ -27,7 +26,6 @@ impl From<LocalizationSettings> for LocalizationReturn {\nfn from(input: LocalizationSettings) -> Self {\nLocalizationReturn {\nwyre_enabled: input.wyre_enabled,\n- wyre_account_id: input.wyre_account_id,\ndisplay_currency_symbol: input.display_currency_symbol,\nsupport_number: input\n.support_number\n" }, { "change_type": "MODIFY", "old_path": "settings/src/localization.rs", "new_path": "settings/src/localization.rs", "diff": "@@ -4,10 +4,6 @@ fn default_wyre_enabled() -> bool {\ntrue\n}\n-fn default_wyre_account_id() -> String {\n- \"AC_2J6LWQEGW8P\".to_string()\n-}\n-\nfn default_display_currency_symbol() -> bool {\ntrue\n}\n@@ -22,9 +18,6 @@ pub struct LocalizationSettings {\n/// cryptocurrency through Wyre as part of the funding flow.\n#[serde(default = \"default_wyre_enabled\")]\npub wyre_enabled: bool,\n- /// Wyre account_id used to associate transactions with a specific Wyre account\n- #[serde(default = \"default_wyre_account_id\")]\n- pub wyre_account_id: String,\n/// If we should display the $ symbol or just the DAI star symbol next\n/// to the balance, designed to help manage how prominently we want the cryptocurrency\n/// aspect of Althea to be displayed to the user.\n@@ -41,7 +34,6 @@ impl Default for LocalizationSettings {\nfn default() -> LocalizationSettings {\nLocalizationSettings {\nwyre_enabled: default_wyre_enabled(),\n- wyre_account_id: default_wyre_account_id(),\ndisplay_currency_symbol: default_display_currency_symbol(),\nsupport_number: default_support_number(),\n}\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Remove Wyre account ID This is now held in the reservation flow, so it can be removed
20,244
03.08.2020 17:46:37
14,400
633d958220133f70afe974cb6c8f6f22ead78f4b
Update for Beta 15 RC3
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "@@ -3170,7 +3170,7 @@ dependencies = [\n[[package]]\nname = \"rita\"\n-version = \"0.5.58\"\n+version = \"0.5.59\"\ndependencies = [\n\"actix 0.7.11\",\n\"actix 0.9.0\",\n" }, { "change_type": "MODIFY", "old_path": "rita/Cargo.toml", "new_path": "rita/Cargo.toml", "diff": "[package]\nname = \"rita\"\n-version = \"0.5.58\"\n+version = \"0.5.59\"\nauthors = [\"Justin <justin@althea.net>\", \"Jehan <jehan.tremback@gmail.com>\", \"Ben <wangben3@gmail.com>\"]\nbuild = \"build.rs\"\nedition = \"2018\"\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/dashboard/own_info.rs", "new_path": "rita/src/rita_common/dashboard/own_info.rs", "diff": "@@ -7,7 +7,7 @@ use failure::Error;\nuse num256::{Int256, Uint256};\nuse settings::RitaCommonSettings;\n-pub static READABLE_VERSION: &str = \"Beta 15 RC2\";\n+pub static READABLE_VERSION: &str = \"Beta 15 RC3\";\n#[derive(Serialize)]\npub struct OwnInfo {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Update for Beta 15 RC3
20,244
03.08.2020 17:52:49
14,400
d9488e3f5aca8d52fd3562d745fe049b96aa3ad9
Add comment about wyre reservations There's really no reason this could not be used generally, we should consider naming it generally
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_client/dashboard/localization.rs", "new_path": "rita/src/rita_client/dashboard/localization.rs", "diff": "@@ -47,6 +47,11 @@ pub struct AmountRequest {\namount: f32,\n}\n+/// This retrieves the reservation url from the operator tools server, which\n+/// has to go through the process of getting a link using the bearer auth token\n+/// wyre provides. In theory this is actually a general 'redirect user to payment\n+/// processor' endpoint that we could integrate with Moonpay or another provider\n+/// TODO generalize naming of this endpoint\npub fn get_wyre_reservation(\namount: Json<AmountRequest>,\n) -> Box<dyn Future<Item = HttpResponse, Error = Error>> {\n@@ -57,9 +62,7 @@ pub fn get_wyre_reservation(\nlet payload = WyreReservationRequestCarrier {\namount: amount.amount,\naddress: payment.eth_address.unwrap(),\n- // todo fix this\ncontact_info: exit_client.contact_info.clone().unwrap().into(),\n- // todo fix this\nbilling_details: operator.billing_details.clone().unwrap(),\n};\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Add comment about wyre reservations There's really no reason this could not be used generally, we should consider naming it generally
20,244
06.08.2020 19:00:34
14,400
e6c8f5d799697a30999eebe212e60cb26f2c8e13
Restart Rita-exit when exit loop restart fails When the recovery loop in rita-exit is failing we should fall back to restarting the process as a whole until things start working
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_exit/rita_loop/mod.rs", "new_path": "rita/src/rita_exit/rita_loop/mod.rs", "diff": "@@ -57,6 +57,7 @@ pub const EXIT_LOOP_TIMEOUT: Duration = Duration::from_secs(4);\npub fn start_rita_exit_loop() {\nlet system = System::current();\nsetup_exit_wg_tunnel();\n+ let mut last_restart = Instant::now();\n// outer thread is a watchdog, inner thread is the runner\nthread::spawn(move || {\n// this will always be an error, so it's really just a loop statement\n@@ -90,6 +91,11 @@ pub fn start_rita_exit_loop() {\n.join()\n} {\nerror!(\"Exit loop thread paniced! Respawning {:?}\", e);\n+ if Instant::now() - last_restart < Duration::from_secs(60) {\n+ error!(\"Restarting too quickly, leaving it to systemd!\");\n+ system.stop_with_code(121)\n+ }\n+ last_restart = Instant::now();\n}\n});\n}\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Restart Rita-exit when exit loop restart fails When the recovery loop in rita-exit is failing we should fall back to restarting the process as a whole until things start working
20,244
13.08.2020 15:04:14
14,400
21d1f523a7381d042d2318a8e50f2b2ad1b3c535
Add test for -d16 Openwrt has added a new arch classification for the wrt32x. I wanted to ensure that parsing worked for the future.
[ { "change_type": "MODIFY", "old_path": "althea_kernel_interface/src/opkg_feeds.rs", "new_path": "althea_kernel_interface/src/opkg_feeds.rs", "diff": "@@ -124,3 +124,11 @@ fn test_regex_net() {\nget_arch(\"src/gz openwrt_althea https://updates.althea.net/packages/mipsel_24kc/althea\");\nassert_eq!(&val.unwrap(), \"mipsel_24kc\");\n}\n+\n+#[test]\n+fn test_regex_arm() {\n+ let val = get_arch(\n+ \"src/gz openwrt_althea https://updates.althea.net/packages/arm_cortex-a9_vfpv3-d16/althea\",\n+ );\n+ assert_eq!(&val.unwrap(), \"arm_cortex-a9_vfpv3-d16\");\n+}\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Add test for -d16 Openwrt has added a new arch classification for the wrt32x. I wanted to ensure that parsing worked for the future.
20,244
18.08.2020 11:29:33
14,400
0328fb22fb7dea9a3e5f65488520c9eb6b413df0
Bump for Beta 15 RC4
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "@@ -3170,7 +3170,7 @@ dependencies = [\n[[package]]\nname = \"rita\"\n-version = \"0.5.59\"\n+version = \"0.5.60\"\ndependencies = [\n\"actix 0.7.11\",\n\"actix 0.9.0\",\n" }, { "change_type": "MODIFY", "old_path": "rita/Cargo.toml", "new_path": "rita/Cargo.toml", "diff": "[package]\nname = \"rita\"\n-version = \"0.5.59\"\n+version = \"0.5.60\"\nauthors = [\"Justin <justin@althea.net>\", \"Jehan <jehan.tremback@gmail.com>\", \"Ben <wangben3@gmail.com>\"]\nbuild = \"build.rs\"\nedition = \"2018\"\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/dashboard/own_info.rs", "new_path": "rita/src/rita_common/dashboard/own_info.rs", "diff": "@@ -7,7 +7,7 @@ use failure::Error;\nuse num256::{Int256, Uint256};\nuse settings::RitaCommonSettings;\n-pub static READABLE_VERSION: &str = \"Beta 15 RC3\";\n+pub static READABLE_VERSION: &str = \"Beta 15 RC4\";\n#[derive(Serialize)]\npub struct OwnInfo {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Bump for Beta 15 RC4
20,244
03.09.2020 08:16:45
14,400
9bff02e4e805f8ec0157fbd5beb51e43c9d8095f
Fix iter().next() clippy nit
[ { "change_type": "MODIFY", "old_path": "althea_kernel_interface/src/hardware_info.rs", "new_path": "althea_kernel_interface/src/hardware_info.rs", "diff": "@@ -46,7 +46,7 @@ fn get_load_avg() -> Result<(f32, f32, f32), Error> {\n// cpu load average\nlet load_average_error = Err(format_err!(\"Failed to get load average\"));\nlet lines = get_lines(\"/proc/loadavg\")?;\n- let load_avg = match lines.iter().next() {\n+ let load_avg = match lines.get(0) {\nSome(line) => line,\nNone => return load_average_error,\n};\n@@ -109,20 +109,23 @@ fn get_numcpus() -> Result<u32, Error> {\nfn maybe_get_single_line_u64(path: &str) -> Option<u64> {\nmatch get_lines(path) {\n- Ok(line) => match line.iter().next() {\n+ Ok(line) => {\n+ let var_name = line.get(0);\n+ match var_name {\nSome(val) => match val.parse() {\nOk(res) => Some(res),\nErr(_e) => None,\n},\nNone => None,\n- },\n+ }\n+ }\nErr(_e) => None,\n}\n}\nfn maybe_get_single_line_string(path: &str) -> Option<String> {\nmatch get_lines(path) {\n- Ok(line) => match line.iter().next() {\n+ Ok(line) => match line.get(0) {\nSome(val) => Some(val.to_string()),\nNone => None,\n},\n" }, { "change_type": "MODIFY", "old_path": "antenna_forwarding_client/src/lib.rs", "new_path": "antenna_forwarding_client/src/lib.rs", "diff": "@@ -108,7 +108,7 @@ pub fn start_antenna_forwarding_proxy<S: 'static + std::marker::Send + ::std::ha\n) {\nOk(messages) => {\n// read messages will return a vec of at least one,\n- match messages.iter().next() {\n+ match messages.get(0) {\nSome(ForwardingProtocolMessage::ForwardMessage {\nip,\nserver_port: _server_port,\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Fix iter().next() clippy nit
20,244
03.09.2020 08:24:18
14,400
5516638912efe3e797cf68db20028895a71c2939
Add UpdateNow operator command This allows operators to control updates with more granularity.
[ { "change_type": "MODIFY", "old_path": "althea_types/src/interop.rs", "new_path": "althea_types/src/interop.rs", "diff": "@@ -365,10 +365,26 @@ impl FromStr for ReleaseStatus {\n/// Something the operator may want to do to a router under their control\n#[derive(Debug, Clone, Copy, Serialize, Deserialize, Hash, Eq, PartialEq)]\npub enum OperatorAction {\n+ /// Resets the Rita dashboard password. This is the password users use to login\n+ /// to the router dashboard, which is distinct from the WiFi password. This\n+ /// password is also used for ssh login on the LAN. This reset operation does\n+ /// not change that password but it will be changed when the dashboard password\n+ /// is set again by the user.\nResetRouterPassword,\n+ /// This resets the WiFi password to the default 'ChangeMe' and restarts the wifi\n+ /// subsystem (without restarting the router).\nResetWiFiPassword,\n+ /// This resets the traffic shaper to 'unlimited' speed for all connections. It can\n+ /// be useful when the shaper is showing obviously incorrect values for some peer\n+ /// usually caused by bad network transients. While the shaper will eventually recover\n+ /// this allows a human to do it right away\nResetShaper,\n+ /// Fully reboots the router, this includes a power cycle not just a restart of the\n+ /// routing processes. For x86 machines this action comes with some risk as devices may\n+ /// get stuck in the BIOS if not configured properly.\nReboot,\n+ /// Runs the update script now instead of waiting for the cron job to run on the hour mark\n+ UpdateNow,\n}\nimpl FromStr for OperatorAction {\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_client/operator_update/mod.rs", "new_path": "rita/src/rita_client/operator_update/mod.rs", "diff": "@@ -217,6 +217,12 @@ fn checkin() {\nSome(OperatorAction::ResetWiFiPassword) => {\nlet _res = reset_wifi_pass();\n}\n+ Some(OperatorAction::UpdateNow) => {\n+ // this runs the update shell script, if an update is found a reboot will occur\n+ // it is possible that the script fails to grab the package index or a package\n+ // due to network conditions this will cause the operation to do nothing.\n+ let _res = KI.run_command(\"ash\", &[\"/etc/update.ash\"]);\n+ }\nNone => {}\n}\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Add UpdateNow operator command This allows operators to control updates with more granularity.
20,244
03.09.2020 19:23:27
14,400
cf42685c8a829bdabd6d48a22b57e28176417a16
Remove debugging println Snuck into master here
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_client/operator_update/mod.rs", "new_path": "rita/src/rita_client/operator_update/mod.rs", "diff": "@@ -290,7 +290,6 @@ fn merge_settings_safely(new_settings: Value) {\nfn contains_forbidden_key(map: Map<String, Value>, forbidden_values: &[&str]) -> bool {\n// check if any top level keys are forbidden\nfor item in forbidden_values.iter() {\n- println!(\"Checking key {} versus {:?}\", item, map);\nif map.contains_key(*item) {\nreturn true;\n}\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Remove debugging println Snuck into master here
20,244
04.09.2020 11:53:09
14,400
d9f6a1b93c93f60edae8883686de88adc959ad58
Make WyreReservationRequest public This type wasn't accessible to construct in operator tools, we need to construct it there to redirect users to moonpay
[ { "change_type": "MODIFY", "old_path": "althea_types/src/user_info.rs", "new_path": "althea_types/src/user_info.rs", "diff": "@@ -110,6 +110,6 @@ pub struct WyreReservationRequest {\n#[derive(Debug, Clone, Serialize, Deserialize)]\npub struct WyreReservationResponse {\n- url: String,\n- reservation: String,\n+ pub url: String,\n+ pub reservation: String,\n}\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Make WyreReservationRequest public This type wasn't accessible to construct in operator tools, we need to construct it there to redirect users to moonpay
20,244
18.09.2020 12:08:31
14,400
8306d126c18c61fcba1f4bf757e997ffc8275c91
Fix clippy babel monitor nits
[ { "change_type": "MODIFY", "old_path": "babel_monitor/src/lib.rs", "new_path": "babel_monitor/src/lib.rs", "diff": "@@ -214,7 +214,7 @@ fn read_babel_sync(output: &str) -> Result<String, BabelMonitorError> {\nlet mut ret = String::new();\nfor line in output.lines() {\nret.push_str(line);\n- ret.push_str(\"\\n\");\n+ ret.push('\\n');\nmatch line.trim() {\n\"ok\" => {\ntrace!(\n@@ -794,7 +794,7 @@ ok\\n\";\nassert_eq!(route.price, 3072);\n// assert that these are equal within the minimum comparison difference\n// of float values\n- assert!(route.full_path_rtt - 22.805 < f32::EPSILON);\n+ assert!(route.full_path_rtt - 22.805 < f32::EPSILON.abs());\n}\n#[test]\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Fix clippy babel monitor nits
20,244
18.09.2020 12:12:38
14,400
d750dafd9d250f997280e2bcaa8d4f2e88f079e1
Bump for Beta 16 RC1
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "@@ -3170,7 +3170,7 @@ dependencies = [\n[[package]]\nname = \"rita\"\n-version = \"0.5.60\"\n+version = \"0.5.61\"\ndependencies = [\n\"actix 0.7.11\",\n\"actix 0.9.0\",\n" }, { "change_type": "MODIFY", "old_path": "rita/Cargo.toml", "new_path": "rita/Cargo.toml", "diff": "[package]\nname = \"rita\"\n-version = \"0.5.60\"\n+version = \"0.5.61\"\nauthors = [\"Justin <justin@althea.net>\", \"Jehan <jehan.tremback@gmail.com>\", \"Ben <wangben3@gmail.com>\"]\nbuild = \"build.rs\"\nedition = \"2018\"\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/dashboard/own_info.rs", "new_path": "rita/src/rita_common/dashboard/own_info.rs", "diff": "@@ -7,7 +7,7 @@ use failure::Error;\nuse num256::{Int256, Uint256};\nuse settings::RitaCommonSettings;\n-pub static READABLE_VERSION: &str = \"Beta 15 RC4\";\n+pub static READABLE_VERSION: &str = \"Beta 16 RC1\";\n#[derive(Serialize)]\npub struct OwnInfo {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Bump for Beta 16 RC1
20,244
24.09.2020 18:18:37
14,400
da76a990a7dd698d45191559784b2b2daf2d07c1
Update dependencies Some minor dependency updates. Obviously there are many potential updates we are skipping over as we slowly migrate to async/await specifically the ecosystem wide removal of failure will have to wait due to the huge amount of implied conversions.
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "@@ -34,7 +34,7 @@ version = \"0.9.0\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"a4af87564ff659dee8f9981540cac9418c45e910c8072fdedd643a262a38fcaf\"\ndependencies = [\n- \"actix-http\",\n+ \"actix-http 1.0.1\",\n\"actix-rt\",\n\"actix_derive 0.5.0\",\n\"bitflags\",\n@@ -53,6 +53,31 @@ dependencies = [\n\"trust-dns-resolver 0.18.0-alpha.2\",\n]\n+[[package]]\n+name = \"actix\"\n+version = \"0.10.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"1be241f88f3b1e7e9a3fbe3b5a8a0f6915b5a1d7ee0d9a248d3376d01068cc60\"\n+dependencies = [\n+ \"actix-rt\",\n+ \"actix_derive 0.5.0\",\n+ \"bitflags\",\n+ \"bytes 0.5.6\",\n+ \"crossbeam-channel 0.4.3\",\n+ \"derive_more\",\n+ \"futures-channel\",\n+ \"futures-util\",\n+ \"log\",\n+ \"once_cell\",\n+ \"parking_lot 0.11.0\",\n+ \"pin-project\",\n+ \"smallvec 1.4.1\",\n+ \"tokio 0.2.22\",\n+ \"tokio-util 0.3.1\",\n+ \"trust-dns-proto 0.19.5\",\n+ \"trust-dns-resolver 0.19.5\",\n+]\n+\n[[package]]\nname = \"actix-codec\"\nversion = \"0.2.0\"\n@@ -68,16 +93,32 @@ dependencies = [\n\"tokio-util 0.2.0\",\n]\n+[[package]]\n+name = \"actix-codec\"\n+version = \"0.3.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"78d1833b3838dbe990df0f1f87baf640cf6146e898166afe401839d1b001e570\"\n+dependencies = [\n+ \"bitflags\",\n+ \"bytes 0.5.6\",\n+ \"futures-core\",\n+ \"futures-sink\",\n+ \"log\",\n+ \"pin-project\",\n+ \"tokio 0.2.22\",\n+ \"tokio-util 0.3.1\",\n+]\n+\n[[package]]\nname = \"actix-connect\"\nversion = \"1.0.2\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"c95cc9569221e9802bf4c377f6c18b90ef10227d787611decf79fd47d2a8e76c\"\ndependencies = [\n- \"actix-codec\",\n+ \"actix-codec 0.2.0\",\n\"actix-rt\",\n\"actix-service\",\n- \"actix-utils\",\n+ \"actix-utils 1.0.6\",\n\"derive_more\",\n\"either\",\n\"futures 0.3.5\",\n@@ -89,19 +130,40 @@ dependencies = [\n\"trust-dns-resolver 0.18.0-alpha.2\",\n]\n+[[package]]\n+name = \"actix-connect\"\n+version = \"2.0.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"177837a10863f15ba8d3ae3ec12fac1099099529ed20083a27fdfe247381d0dc\"\n+dependencies = [\n+ \"actix-codec 0.3.0\",\n+ \"actix-rt\",\n+ \"actix-service\",\n+ \"actix-utils 2.0.0\",\n+ \"derive_more\",\n+ \"either\",\n+ \"futures-util\",\n+ \"http 0.2.1\",\n+ \"log\",\n+ \"openssl\",\n+ \"tokio-openssl 0.4.0\",\n+ \"trust-dns-proto 0.19.5\",\n+ \"trust-dns-resolver 0.19.5\",\n+]\n+\n[[package]]\nname = \"actix-http\"\nversion = \"1.0.1\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"c16664cc4fdea8030837ad5a845eb231fb93fc3c5c171edfefb52fad92ce9019\"\ndependencies = [\n- \"actix-codec\",\n- \"actix-connect\",\n+ \"actix-codec 0.2.0\",\n+ \"actix-connect 1.0.2\",\n\"actix-rt\",\n\"actix-service\",\n\"actix-threadpool\",\n- \"actix-tls\",\n- \"actix-utils\",\n+ \"actix-tls 1.0.0\",\n+ \"actix-utils 1.0.6\",\n\"base64 0.11.0\",\n\"bitflags\",\n\"brotli2\",\n@@ -133,7 +195,53 @@ dependencies = [\n\"serde_urlencoded 0.6.1\",\n\"sha1\",\n\"slab\",\n- \"time\",\n+ \"time 0.1.43\",\n+]\n+\n+[[package]]\n+name = \"actix-http\"\n+version = \"2.0.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"05dd80ba8f27c4a34357c07e338c8f5c38f8520e6d626ca1727d8fecc41b0cab\"\n+dependencies = [\n+ \"actix-codec 0.3.0\",\n+ \"actix-connect 2.0.0\",\n+ \"actix-rt\",\n+ \"actix-service\",\n+ \"actix-threadpool\",\n+ \"actix-tls 2.0.0\",\n+ \"actix-utils 2.0.0\",\n+ \"base64 0.12.3\",\n+ \"bitflags\",\n+ \"bytes 0.5.6\",\n+ \"cookie 0.14.2\",\n+ \"copyless\",\n+ \"derive_more\",\n+ \"either\",\n+ \"encoding_rs\",\n+ \"futures-channel\",\n+ \"futures-core\",\n+ \"futures-util\",\n+ \"fxhash\",\n+ \"h2 0.2.6\",\n+ \"http 0.2.1\",\n+ \"httparse\",\n+ \"indexmap\",\n+ \"itoa\",\n+ \"language-tags\",\n+ \"lazy_static\",\n+ \"log\",\n+ \"mime\",\n+ \"percent-encoding 2.1.0\",\n+ \"pin-project\",\n+ \"rand 0.7.3\",\n+ \"regex\",\n+ \"serde 1.0.114\",\n+ \"serde_json\",\n+ \"serde_urlencoded 0.6.1\",\n+ \"sha-1 0.9.1\",\n+ \"slab\",\n+ \"time 0.2.21\",\n]\n[[package]]\n@@ -207,10 +315,10 @@ version = \"1.0.3\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"e6d74b464215a473c973a2d7d03a69cc10f4ce1f4b38a7659c5193dc5c675630\"\ndependencies = [\n- \"actix-codec\",\n+ \"actix-codec 0.2.0\",\n\"actix-rt\",\n\"actix-service\",\n- \"actix-utils\",\n+ \"actix-utils 1.0.6\",\n\"futures-channel\",\n\"futures-util\",\n\"log\",\n@@ -223,9 +331,9 @@ dependencies = [\n[[package]]\nname = \"actix-service\"\n-version = \"1.0.5\"\n+version = \"1.0.6\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"d3e4fc95dfa7e24171b2d0bb46b85f8ab0e8499e4e3caec691fc4ea65c287564\"\n+checksum = \"0052435d581b5be835d11f4eb3bce417c8af18d87ddf8ace99f8e67e595882bb\"\ndependencies = [\n\"futures-util\",\n\"pin-project\",\n@@ -266,10 +374,10 @@ version = \"1.0.0\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"a4e5b4faaf105e9a6d389c606c298dcdb033061b00d532af9df56ff3a54995a8\"\ndependencies = [\n- \"actix-codec\",\n+ \"actix-codec 0.2.0\",\n\"actix-rt\",\n\"actix-service\",\n- \"actix-utils\",\n+ \"actix-utils 1.0.6\",\n\"derive_more\",\n\"either\",\n\"futures 0.3.5\",\n@@ -278,13 +386,27 @@ dependencies = [\n\"tokio-openssl 0.4.0\",\n]\n+[[package]]\n+name = \"actix-tls\"\n+version = \"2.0.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"24789b7d7361cf5503a504ebe1c10806896f61e96eca9a7350e23001aca715fb\"\n+dependencies = [\n+ \"actix-codec 0.3.0\",\n+ \"actix-service\",\n+ \"actix-utils 2.0.0\",\n+ \"futures-util\",\n+ \"openssl\",\n+ \"tokio-openssl 0.4.0\",\n+]\n+\n[[package]]\nname = \"actix-utils\"\nversion = \"1.0.6\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"fcf8f5631bf01adec2267808f00e228b761c60c0584cc9fa0b5364f41d147f4e\"\ndependencies = [\n- \"actix-codec\",\n+ \"actix-codec 0.2.0\",\n\"actix-rt\",\n\"actix-service\",\n\"bitflags\",\n@@ -296,6 +418,26 @@ dependencies = [\n\"slab\",\n]\n+[[package]]\n+name = \"actix-utils\"\n+version = \"2.0.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"2e9022dec56632d1d7979e59af14f0597a28a830a9c1c7fec8b2327eb9f16b5a\"\n+dependencies = [\n+ \"actix-codec 0.3.0\",\n+ \"actix-rt\",\n+ \"actix-service\",\n+ \"bitflags\",\n+ \"bytes 0.5.6\",\n+ \"either\",\n+ \"futures-channel\",\n+ \"futures-sink\",\n+ \"futures-util\",\n+ \"log\",\n+ \"pin-project\",\n+ \"slab\",\n+]\n+\n[[package]]\nname = \"actix-web\"\nversion = \"0.7.19\"\n@@ -308,7 +450,7 @@ dependencies = [\n\"bitflags\",\n\"byteorder\",\n\"bytes 0.4.12\",\n- \"cookie\",\n+ \"cookie 0.11.3\",\n\"encoding\",\n\"failure\",\n\"futures 0.1.29\",\n@@ -336,7 +478,7 @@ dependencies = [\n\"sha1\",\n\"slab\",\n\"smallvec 0.6.13\",\n- \"time\",\n+ \"time 0.1.43\",\n\"tokio 0.1.22\",\n\"tokio-current-thread\",\n\"tokio-io\",\n@@ -355,8 +497,8 @@ version = \"2.0.0\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"3158e822461040822f0dbf1735b9c2ce1f95f93b651d7a7aded00b1efbb1f635\"\ndependencies = [\n- \"actix-codec\",\n- \"actix-http\",\n+ \"actix-codec 0.2.0\",\n+ \"actix-http 1.0.1\",\n\"actix-macros\",\n\"actix-router\",\n\"actix-rt\",\n@@ -364,10 +506,10 @@ dependencies = [\n\"actix-service\",\n\"actix-testing\",\n\"actix-threadpool\",\n- \"actix-tls\",\n- \"actix-utils\",\n- \"actix-web-codegen\",\n- \"awc\",\n+ \"actix-tls 1.0.0\",\n+ \"actix-utils 1.0.6\",\n+ \"actix-web-codegen 0.2.2\",\n+ \"awc 1.0.1\",\n\"bytes 0.5.6\",\n\"derive_more\",\n\"encoding_rs\",\n@@ -382,7 +524,47 @@ dependencies = [\n\"serde 1.0.114\",\n\"serde_json\",\n\"serde_urlencoded 0.6.1\",\n- \"time\",\n+ \"time 0.1.43\",\n+ \"url 2.1.1\",\n+]\n+\n+[[package]]\n+name = \"actix-web\"\n+version = \"3.0.2\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"36de80175eb1f0a5c518024ce0d23646b54a23008279e090ca1848f6f1448bf4\"\n+dependencies = [\n+ \"actix-codec 0.3.0\",\n+ \"actix-http 2.0.0\",\n+ \"actix-macros\",\n+ \"actix-router\",\n+ \"actix-rt\",\n+ \"actix-server\",\n+ \"actix-service\",\n+ \"actix-testing\",\n+ \"actix-threadpool\",\n+ \"actix-tls 2.0.0\",\n+ \"actix-utils 2.0.0\",\n+ \"actix-web-codegen 0.3.0\",\n+ \"awc 2.0.0\",\n+ \"bytes 0.5.6\",\n+ \"derive_more\",\n+ \"encoding_rs\",\n+ \"futures-channel\",\n+ \"futures-core\",\n+ \"futures-util\",\n+ \"fxhash\",\n+ \"log\",\n+ \"mime\",\n+ \"openssl\",\n+ \"pin-project\",\n+ \"regex\",\n+ \"serde 1.0.114\",\n+ \"serde_json\",\n+ \"serde_urlencoded 0.6.1\",\n+ \"socket2\",\n+ \"time 0.2.21\",\n+ \"tinyvec\",\n\"url 2.1.1\",\n]\n@@ -397,6 +579,17 @@ dependencies = [\n\"syn 1.0.35\",\n]\n+[[package]]\n+name = \"actix-web-codegen\"\n+version = \"0.3.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"750ca8fb60bbdc79491991650ba5d2ae7cd75f3fc00ead51390cfe9efda0d4d8\"\n+dependencies = [\n+ \"proc-macro2 1.0.19\",\n+ \"quote 1.0.7\",\n+ \"syn 1.0.35\",\n+]\n+\n[[package]]\nname = \"actix-web-httpauth\"\nversion = \"0.2.0\"\n@@ -623,8 +816,8 @@ version = \"1.0.1\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"d7601d4d1d7ef2335d6597a41b5fe069f6ab799b85f53565ab390e7b7065aac5\"\ndependencies = [\n- \"actix-codec\",\n- \"actix-http\",\n+ \"actix-codec 0.2.0\",\n+ \"actix-http 1.0.1\",\n\"actix-rt\",\n\"actix-service\",\n\"base64 0.11.0\",\n@@ -641,6 +834,30 @@ dependencies = [\n\"serde_urlencoded 0.6.1\",\n]\n+[[package]]\n+name = \"awc\"\n+version = \"2.0.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"150e00c06683ab44c5f97d033950e5d87a7a042d06d77f5eecb443cbd23d0575\"\n+dependencies = [\n+ \"actix-codec 0.3.0\",\n+ \"actix-http 2.0.0\",\n+ \"actix-rt\",\n+ \"actix-service\",\n+ \"base64 0.12.3\",\n+ \"bytes 0.5.6\",\n+ \"derive_more\",\n+ \"futures-core\",\n+ \"log\",\n+ \"mime\",\n+ \"openssl\",\n+ \"percent-encoding 2.1.0\",\n+ \"rand 0.7.3\",\n+ \"serde 1.0.114\",\n+ \"serde_json\",\n+ \"serde_urlencoded 0.6.1\",\n+]\n+\n[[package]]\nname = \"babel_monitor\"\nversion = \"0.1.0\"\n@@ -680,6 +897,12 @@ dependencies = [\n\"rustc-demangle\",\n]\n+[[package]]\n+name = \"base-x\"\n+version = \"0.2.6\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"1b20b618342cf9891c292c4f5ac2cde7287cc5c87e87e9c769d617793607dec1\"\n+\n[[package]]\nname = \"base64\"\nversion = \"0.9.3\"\n@@ -733,10 +956,20 @@ version = \"0.7.3\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b\"\ndependencies = [\n- \"block-padding\",\n+ \"block-padding 0.1.5\",\n\"byte-tools\",\n\"byteorder\",\n- \"generic-array\",\n+ \"generic-array 0.12.3\",\n+]\n+\n+[[package]]\n+name = \"block-buffer\"\n+version = \"0.9.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4\"\n+dependencies = [\n+ \"block-padding 0.2.1\",\n+ \"generic-array 0.14.4\",\n]\n[[package]]\n@@ -748,6 +981,12 @@ dependencies = [\n\"byte-tools\",\n]\n+[[package]]\n+name = \"block-padding\"\n+version = \"0.2.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae\"\n+\n[[package]]\nname = \"brotli-sys\"\nversion = \"0.3.2\"\n@@ -849,7 +1088,7 @@ checksum = \"c74d84029116787153e02106bf53e66828452a4b325cc8652b788b5967c0a0b6\"\ndependencies = [\n\"num-integer\",\n\"num-traits 0.2.12\",\n- \"time\",\n+ \"time 0.1.43\",\n]\n[[package]]\n@@ -869,7 +1108,7 @@ dependencies = [\n\"serde-rlp\",\n\"serde_bytes\",\n\"serde_derive\",\n- \"sha3\",\n+ \"sha3 0.8.2\",\n]\n[[package]]\n@@ -957,6 +1196,12 @@ dependencies = [\n\"yaml-rust\",\n]\n+[[package]]\n+name = \"const_fn\"\n+version = \"0.4.2\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"ce90df4c658c62f12d78f7508cf92f9173e5184a539c10bfe54a3107b3ffd0f2\"\n+\n[[package]]\nname = \"cookie\"\nversion = \"0.11.3\"\n@@ -964,7 +1209,18 @@ source = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"5795cda0897252e34380a27baf884c53aa7ad9990329cdad96d4c5d027015d44\"\ndependencies = [\n\"percent-encoding 2.1.0\",\n- \"time\",\n+ \"time 0.1.43\",\n+]\n+\n+[[package]]\n+name = \"cookie\"\n+version = \"0.14.2\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"1373a16a4937bc34efec7b391f9c1500c30b8478a701a4f44c9165cc0475a6e0\"\n+dependencies = [\n+ \"percent-encoding 2.1.0\",\n+ \"time 0.2.21\",\n+ \"version_check 0.9.2\",\n]\n[[package]]\n@@ -989,6 +1245,12 @@ version = \"0.7.0\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac\"\n+[[package]]\n+name = \"cpuid-bool\"\n+version = \"0.1.2\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634\"\n+\n[[package]]\nname = \"crc32fast\"\nversion = \"1.2.0\"\n@@ -1122,9 +1384,24 @@ version = \"0.8.1\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5\"\ndependencies = [\n- \"generic-array\",\n+ \"generic-array 0.12.3\",\n]\n+[[package]]\n+name = \"digest\"\n+version = \"0.9.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066\"\n+dependencies = [\n+ \"generic-array 0.14.4\",\n+]\n+\n+[[package]]\n+name = \"discard\"\n+version = \"1.0.4\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0\"\n+\n[[package]]\nname = \"docopt\"\nversion = \"1.1.0\"\n@@ -1151,9 +1428,9 @@ checksum = \"134951f4028bdadb9b84baf4232681efbf277da25144b9b0ad65df75946c422b\"\n[[package]]\nname = \"either\"\n-version = \"1.5.3\"\n+version = \"1.6.1\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3\"\n+checksum = \"e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457\"\n[[package]]\nname = \"email\"\n@@ -1166,7 +1443,7 @@ dependencies = [\n\"encoding\",\n\"lazy_static\",\n\"rand 0.4.6\",\n- \"time\",\n+ \"time 0.1.43\",\n\"version_check 0.1.5\",\n]\n@@ -1561,6 +1838,16 @@ dependencies = [\n\"typenum\",\n]\n+[[package]]\n+name = \"generic-array\"\n+version = \"0.14.4\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817\"\n+dependencies = [\n+ \"typenum\",\n+ \"version_check 0.9.2\",\n+]\n+\n[[package]]\nname = \"get_if_addrs\"\nversion = \"0.5.3\"\n@@ -1639,14 +1926,14 @@ dependencies = [\n[[package]]\nname = \"handlebars\"\n-version = \"3.3.0\"\n+version = \"3.5.0\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"86dbc8a0746b08f363d2e00da48e6c9ceb75c198ac692d2715fcbb5bee74c87d\"\n+checksum = \"dcd1b5399b9884f9ae18b5d4105d180720c8f602aeb73d3ceae9d6b1d13a5fa7\"\ndependencies = [\n\"log\",\n\"pest\",\n\"pest_derive\",\n- \"quick-error\",\n+ \"quick-error 2.0.0\",\n\"serde 1.0.114\",\n\"serde_json\",\n]\n@@ -1686,22 +1973,9 @@ checksum = \"644f9158b2f133fd50f5fb3242878846d9eb792e445c893805ff0e3824006e35\"\n[[package]]\nname = \"hex-literal\"\n-version = \"0.2.1\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"961de220ec9a91af2e1e5bd80d02109155695e516771762381ef8581317066e0\"\n-dependencies = [\n- \"hex-literal-impl\",\n- \"proc-macro-hack\",\n-]\n-\n-[[package]]\n-name = \"hex-literal-impl\"\n-version = \"0.2.2\"\n+version = \"0.3.1\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"853f769599eb31de176303197b7ba4973299c38c7a7604a6bc88c3eef05b9b46\"\n-dependencies = [\n- \"proc-macro-hack\",\n-]\n+checksum = \"5af1f635ef1bc545d78392b136bfe1c9809e029023c84a3638a864a10b8819c8\"\n[[package]]\nname = \"hostname\"\n@@ -1768,7 +2042,7 @@ version = \"1.3.0\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f\"\ndependencies = [\n- \"quick-error\",\n+ \"quick-error 1.2.3\",\n]\n[[package]]\n@@ -1788,7 +2062,7 @@ dependencies = [\n\"itoa\",\n\"pin-project\",\n\"socket2\",\n- \"time\",\n+ \"time 0.1.43\",\n\"tokio 0.2.22\",\n\"tower-service 0.3.0\",\n\"tracing\",\n@@ -2021,7 +2295,7 @@ dependencies = [\n\"email\",\n\"lettre\",\n\"mime\",\n- \"time\",\n+ \"time 0.1.43\",\n\"uuid\",\n]\n@@ -2231,9 +2505,9 @@ dependencies = [\n[[package]]\nname = \"mockito\"\n-version = \"0.25.3\"\n+version = \"0.27.0\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"5a3ae325bcceb48a24302ac57e1055f9173f5fd53be535603ea0ed41dea92db5\"\n+checksum = \"3a634720d366bcbce30fb05871a35da229cef101ad0b2ea4e46cf5abf031a273\"\ndependencies = [\n\"assert-json-diff\",\n\"colored\",\n@@ -2496,6 +2770,12 @@ version = \"0.2.3\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c\"\n+[[package]]\n+name = \"opaque-debug\"\n+version = \"0.3.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5\"\n+\n[[package]]\nname = \"openssl\"\nversion = \"0.10.30\"\n@@ -2710,7 +2990,7 @@ checksum = \"54be6e404f5317079812fc8f9f5279de376d8856929e21c184ecf6bbd692a11d\"\ndependencies = [\n\"maplit\",\n\"pest\",\n- \"sha-1\",\n+ \"sha-1 0.8.2\",\n]\n[[package]]\n@@ -2848,6 +3128,12 @@ version = \"1.2.3\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0\"\n+[[package]]\n+name = \"quick-error\"\n+version = \"2.0.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"3ac73b1112776fc109b2e61909bc46c7e1bf0d7f690ffb1676553acce16d5cda\"\n+\n[[package]]\nname = \"quick-xml\"\nversion = \"0.17.2\"\n@@ -3165,17 +3451,17 @@ source = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"11834e137f3b14e309437a8276714eed3a80d1ef894869e510f2c0c0b98b9f4a\"\ndependencies = [\n\"hostname 0.3.1\",\n- \"quick-error\",\n+ \"quick-error 1.2.3\",\n]\n[[package]]\nname = \"rita\"\nversion = \"0.5.61\"\ndependencies = [\n+ \"actix 0.10.0\",\n\"actix 0.7.11\",\n- \"actix 0.9.0\",\n\"actix-web 0.7.19\",\n- \"actix-web 2.0.0\",\n+ \"actix-web 3.0.2\",\n\"actix-web-httpauth\",\n\"actix_derive 0.5.0\",\n\"althea_kernel_interface\",\n@@ -3223,7 +3509,7 @@ dependencies = [\n\"serde_derive\",\n\"serde_json\",\n\"settings\",\n- \"sha3\",\n+ \"sha3 0.9.1\",\n\"sodiumoxide\",\n\"tokio 0.1.22\",\n\"tokio-codec\",\n@@ -3243,7 +3529,7 @@ dependencies = [\n\"libc\",\n\"rand 0.3.23\",\n\"rustc-serialize\",\n- \"time\",\n+ \"time 0.1.43\",\n]\n[[package]]\n@@ -3503,10 +3789,23 @@ version = \"0.8.2\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df\"\ndependencies = [\n- \"block-buffer\",\n- \"digest\",\n+ \"block-buffer 0.7.3\",\n+ \"digest 0.8.1\",\n\"fake-simd\",\n- \"opaque-debug\",\n+ \"opaque-debug 0.2.3\",\n+]\n+\n+[[package]]\n+name = \"sha-1\"\n+version = \"0.9.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"170a36ea86c864a3f16dd2687712dd6646f7019f301e57537c7f4dc9f5916770\"\n+dependencies = [\n+ \"block-buffer 0.9.0\",\n+ \"cfg-if\",\n+ \"cpuid-bool\",\n+ \"digest 0.9.0\",\n+ \"opaque-debug 0.3.0\",\n]\n[[package]]\n@@ -3521,11 +3820,23 @@ version = \"0.8.2\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"dd26bc0e7a2e3a7c959bc494caf58b72ee0c71d67704e9520f736ca7e4853ecf\"\ndependencies = [\n- \"block-buffer\",\n+ \"block-buffer 0.7.3\",\n\"byte-tools\",\n- \"digest\",\n+ \"digest 0.8.1\",\n\"keccak\",\n- \"opaque-debug\",\n+ \"opaque-debug 0.2.3\",\n+]\n+\n+[[package]]\n+name = \"sha3\"\n+version = \"0.9.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809\"\n+dependencies = [\n+ \"block-buffer 0.9.0\",\n+ \"digest 0.9.0\",\n+ \"keccak\",\n+ \"opaque-debug 0.3.0\",\n]\n[[package]]\n@@ -3588,12 +3899,70 @@ version = \"1.2.0\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3\"\n+[[package]]\n+name = \"standback\"\n+version = \"0.2.10\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"33a71ea1ea5f8747d1af1979bfb7e65c3a025a70609f04ceb78425bc5adad8e6\"\n+dependencies = [\n+ \"version_check 0.9.2\",\n+]\n+\n[[package]]\nname = \"static_assertions\"\nversion = \"1.1.0\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f\"\n+[[package]]\n+name = \"stdweb\"\n+version = \"0.4.20\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5\"\n+dependencies = [\n+ \"discard\",\n+ \"rustc_version\",\n+ \"stdweb-derive\",\n+ \"stdweb-internal-macros\",\n+ \"stdweb-internal-runtime\",\n+ \"wasm-bindgen\",\n+]\n+\n+[[package]]\n+name = \"stdweb-derive\"\n+version = \"0.5.3\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef\"\n+dependencies = [\n+ \"proc-macro2 1.0.19\",\n+ \"quote 1.0.7\",\n+ \"serde 1.0.114\",\n+ \"serde_derive\",\n+ \"syn 1.0.35\",\n+]\n+\n+[[package]]\n+name = \"stdweb-internal-macros\"\n+version = \"0.2.9\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11\"\n+dependencies = [\n+ \"base-x\",\n+ \"proc-macro2 1.0.19\",\n+ \"quote 1.0.7\",\n+ \"serde 1.0.114\",\n+ \"serde_derive\",\n+ \"serde_json\",\n+ \"sha1\",\n+ \"syn 1.0.35\",\n+]\n+\n+[[package]]\n+name = \"stdweb-internal-runtime\"\n+version = \"0.1.5\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0\"\n+\n[[package]]\nname = \"string\"\nversion = \"0.2.1\"\n@@ -3677,6 +4046,26 @@ dependencies = [\n\"winapi-util\",\n]\n+[[package]]\n+name = \"thiserror\"\n+version = \"1.0.20\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"7dfdd070ccd8ccb78f4ad66bf1982dc37f620ef696c6b5028fe2ed83dd3d0d08\"\n+dependencies = [\n+ \"thiserror-impl\",\n+]\n+\n+[[package]]\n+name = \"thiserror-impl\"\n+version = \"1.0.20\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"bd80fc12f73063ac132ac92aceea36734f04a1d93c1240c6944e23a3b8841793\"\n+dependencies = [\n+ \"proc-macro2 1.0.19\",\n+ \"quote 1.0.7\",\n+ \"syn 1.0.35\",\n+]\n+\n[[package]]\nname = \"thread_local\"\nversion = \"1.0.1\"\n@@ -3705,6 +4094,44 @@ dependencies = [\n\"winapi 0.3.9\",\n]\n+[[package]]\n+name = \"time\"\n+version = \"0.2.21\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"2c2e31fb28e2a9f01f5ed6901b066c1ba2333c04b64dc61254142bafcb3feb2c\"\n+dependencies = [\n+ \"const_fn\",\n+ \"libc\",\n+ \"standback\",\n+ \"stdweb\",\n+ \"time-macros\",\n+ \"version_check 0.9.2\",\n+ \"winapi 0.3.9\",\n+]\n+\n+[[package]]\n+name = \"time-macros\"\n+version = \"0.1.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"9ae9b6e9f095bc105e183e3cd493d72579be3181ad4004fceb01adbe9eecab2d\"\n+dependencies = [\n+ \"proc-macro-hack\",\n+ \"time-macros-impl\",\n+]\n+\n+[[package]]\n+name = \"time-macros-impl\"\n+version = \"0.1.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"e5c3be1edfad6027c69f5491cf4cb310d1a71ecd6af742788c6ff8bced86b8fa\"\n+dependencies = [\n+ \"proc-macro-hack\",\n+ \"proc-macro2 1.0.19\",\n+ \"quote 1.0.7\",\n+ \"standback\",\n+ \"syn 1.0.35\",\n+]\n+\n[[package]]\nname = \"tinyvec\"\nversion = \"0.3.3\"\n@@ -3997,6 +4424,7 @@ checksum = \"be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499\"\ndependencies = [\n\"bytes 0.5.6\",\n\"futures-core\",\n+ \"futures-io\",\n\"futures-sink\",\n\"log\",\n\"pin-project-lite\",\n@@ -4097,6 +4525,26 @@ dependencies = [\n\"url 2.1.1\",\n]\n+[[package]]\n+name = \"trust-dns-proto\"\n+version = \"0.19.5\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"cdd7061ba6f4d4d9721afedffbfd403f20f39a4301fee1b70d6fcd09cca69f28\"\n+dependencies = [\n+ \"async-trait\",\n+ \"backtrace\",\n+ \"enum-as-inner\",\n+ \"futures 0.3.5\",\n+ \"idna 0.2.0\",\n+ \"lazy_static\",\n+ \"log\",\n+ \"rand 0.7.3\",\n+ \"smallvec 1.4.1\",\n+ \"thiserror\",\n+ \"tokio 0.2.22\",\n+ \"url 2.1.1\",\n+]\n+\n[[package]]\nname = \"trust-dns-resolver\"\nversion = \"0.10.3\"\n@@ -4135,6 +4583,26 @@ dependencies = [\n\"trust-dns-proto 0.18.0-alpha.2\",\n]\n+[[package]]\n+name = \"trust-dns-resolver\"\n+version = \"0.19.5\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"0f23cdfdc3d8300b3c50c9e84302d3bd6d860fb9529af84ace6cf9665f181b77\"\n+dependencies = [\n+ \"backtrace\",\n+ \"cfg-if\",\n+ \"futures 0.3.5\",\n+ \"ipconfig 0.2.2\",\n+ \"lazy_static\",\n+ \"log\",\n+ \"lru-cache\",\n+ \"resolv-conf\",\n+ \"smallvec 1.4.1\",\n+ \"thiserror\",\n+ \"tokio 0.2.22\",\n+ \"trust-dns-proto 0.19.5\",\n+]\n+\n[[package]]\nname = \"try-lock\"\nversion = \"0.2.3\"\n" }, { "change_type": "MODIFY", "old_path": "rita/Cargo.toml", "new_path": "rita/Cargo.toml", "diff": "@@ -30,8 +30,8 @@ web30 = {git = \"https://github.com/althea-net/web30\", rev = \"4002ac7deca2e7ecbda\n# duplicate async dependencies, we are currently carrying both futures 0.1 and modern async/await dependencies\n# these will be kept here for quite some time until the switch is completed.\nasync-web30 = {package=\"web30\", git = \"https://github.com/althea-net/web30\", rev = \"53d83bc74a0218eddc4221cf2fb6eefe49fba1d9\" }\n-actix-async = {package=\"actix\", version = \"0.9\"}\n-actix-web-async = {package=\"actix-web\", version = \"2.0\", default_features = false, features= [\"openssl\"] }\n+actix-async = {package=\"actix\", version = \"0.10\"}\n+actix-web-async = {package=\"actix-web\", version = \"3.0\", default_features = false, features= [\"openssl\"] }\nactix = \"0.7\"\nactix-web = { version = \"0.7\", default_features = false, features= [\"ssl\"] }\n@@ -45,12 +45,12 @@ env_logger = \"0.7\"\nfailure = \"0.1\"\nfutures01 = { package = \"futures\", version = \"0.1\"}\nfutures = { version = \"0.3\", features = [\"compat\"] }\n-handlebars = \"3.0\"\n+handlebars = \"3.5\"\nipnetwork = \"0.14\"\nlazy_static = \"1.4\"\nlog = { version = \"0.4\", features = [\"release_max_level_info\"] }\nminihttpse = \"0.1\"\n-mockito = \"0.25\"\n+mockito = \"0.27\"\nmockstream = \"0.0\"\nrand = \"0.7\"\nserde = \"1.0\"\n@@ -68,8 +68,8 @@ lettre = \"0.9\"\nlettre_email = \"0.9\"\nphonenumber = \"0.2\"\nr2d2 = \"0.8\"\n-sha3 = \"0.8\"\n-hex-literal = \"0.2\"\n+sha3 = \"0.9\"\n+hex-literal = \"0.3\"\nsodiumoxide = \"0.2\"\ncompressed_log = \"0.2\"\nflate2 = { version = \"1.0\", features = [\"rust_backend\"], default-features = false }\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_client/dashboard/auth.rs", "new_path": "rita/src/rita_client/dashboard/auth.rs", "diff": "use crate::ARGS;\nuse crate::KI;\nuse crate::SETTING;\n-use ::actix_web::{HttpResponse, Json};\n-use ::settings::FileWrite;\n+use actix_web::{HttpResponse, Json};\nuse clarity::utils::bytes_to_hex_str;\nuse failure::Error;\n+use settings::FileWrite;\nuse settings::RitaCommonSettings;\n-use sha3::digest::FixedOutput;\nuse sha3::{Digest, Sha3_512};\n#[derive(Serialize, Deserialize, Default, Clone, Debug)]\n@@ -21,8 +20,8 @@ pub fn set_pass(router_pass: Json<RouterPassword>) -> Result<HttpResponse, Error\ndebug!(\"Using {} as sha3 512 input\", input_string);\nlet mut hasher = Sha3_512::new();\n- hasher.input(input_string.as_bytes());\n- let hashed_pass = bytes_to_hex_str(&hasher.fixed_result().to_vec());\n+ hasher.update(input_string.as_bytes());\n+ let hashed_pass = bytes_to_hex_str(&hasher.finalize().to_vec());\nSETTING.get_network_mut().rita_dashboard_password = Some(hashed_pass);\n// try and save the config and fail if we can't\n@@ -46,8 +45,8 @@ fn test_hash() {\nlet sha3_output = hex!(\"881c7d6ba98678bcd96e253086c4048c3ea15306d0d13ff48341c6285ee71102a47b6f16e20e4d65c0c3d677be689dfda6d326695609cbadfafa1800e9eb7fc1\");\nlet mut hasher = Sha3_512::new();\n- hasher.input(b\"testing\");\n- let result = hasher.fixed_result().to_vec();\n+ hasher.update(b\"testing\");\n+ let result = hasher.finalize().to_vec();\nassert_eq!(result.len(), sha3_output.len());\nassert_eq!(result, sha3_output.to_vec());\n@@ -58,8 +57,8 @@ fn test_hash_to_string() {\nlet sha3sum_output = \"881c7d6ba98678bcd96e253086c4048c3ea15306d0d13ff48341c6285ee71102a47b6f16e20e4d65c0c3d677be689dfda6d326695609cbadfafa1800e9eb7fc1\";\nlet mut hasher = Sha3_512::new();\n- hasher.input(b\"testing\");\n- let result = hasher.fixed_result().to_vec();\n+ hasher.update(b\"testing\");\n+ let result = hasher.finalize().to_vec();\nassert_eq!(bytes_to_hex_str(&result), sha3sum_output);\n}\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Update dependencies Some minor dependency updates. Obviously there are many potential updates we are skipping over as we slowly migrate to async/await specifically the ecosystem wide removal of failure will have to wait due to the huge amount of implied conversions.
20,244
24.09.2020 18:25:31
14,400
58e035d2e66d12c98cd6a4469d3ca707732ba38f
Use crates.io web30 This is somthing of an improvement, but there are problems with num256 compatibility in order to move to the latest version. I think we will have to provide non-async commit hashes of our old dependencies with upgraded num256 and clarity versions in the medium term.
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "@@ -213,12 +213,14 @@ dependencies = [\n\"actix-utils 2.0.0\",\n\"base64 0.12.3\",\n\"bitflags\",\n+ \"brotli2\",\n\"bytes 0.5.6\",\n\"cookie 0.14.2\",\n\"copyless\",\n\"derive_more\",\n\"either\",\n\"encoding_rs\",\n+ \"flate2\",\n\"futures-channel\",\n\"futures-core\",\n\"futures-util\",\n@@ -3516,7 +3518,7 @@ dependencies = [\n\"tokio-io\",\n\"trust-dns-resolver 0.10.3\",\n\"web30 0.4.3\",\n- \"web30 0.5.0\",\n+ \"web30 0.6.1\",\n]\n[[package]]\n@@ -4889,6 +4891,28 @@ dependencies = [\n\"tokio 0.2.22\",\n]\n+[[package]]\n+name = \"web30\"\n+version = \"0.6.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"d511f2f203b133aaeee2142d191fcb85e9fb7537fed0868ae5a1da450b53bca5\"\n+dependencies = [\n+ \"actix 0.10.0\",\n+ \"actix-web 3.0.2\",\n+ \"assert-json-diff\",\n+ \"bytes 0.5.6\",\n+ \"clarity\",\n+ \"failure\",\n+ \"futures 0.3.5\",\n+ \"futures-timer 3.0.2\",\n+ \"log\",\n+ \"num256\",\n+ \"serde 1.0.114\",\n+ \"serde_derive\",\n+ \"serde_json\",\n+ \"tokio 0.2.22\",\n+]\n+\n[[package]]\nname = \"widestring\"\nversion = \"0.2.2\"\n" }, { "change_type": "MODIFY", "old_path": "rita/Cargo.toml", "new_path": "rita/Cargo.toml", "diff": "@@ -29,7 +29,7 @@ web30 = {git = \"https://github.com/althea-net/web30\", rev = \"4002ac7deca2e7ecbda\n# duplicate async dependencies, we are currently carrying both futures 0.1 and modern async/await dependencies\n# these will be kept here for quite some time until the switch is completed.\n-async-web30 = {package=\"web30\", git = \"https://github.com/althea-net/web30\", rev = \"53d83bc74a0218eddc4221cf2fb6eefe49fba1d9\" }\n+async-web30 = {package=\"web30\", version = \"0.6\"}\nactix-async = {package=\"actix\", version = \"0.10\"}\nactix-web-async = {package=\"actix-web\", version = \"3.0\", default_features = false, features= [\"openssl\"] }\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Use crates.io web30 This is somthing of an improvement, but there are problems with num256 compatibility in order to move to the latest version. I think we will have to provide non-async commit hashes of our old dependencies with upgraded num256 and clarity versions in the medium term.
20,244
24.09.2020 18:57:06
14,400
c46a2eff1a54f105007538798771b114d44f13b5
Add user specified speed limit This is a very simple backend for a user specified data speed limit. The goal here is to allow users to control their own usage effectively currently there is no frontend or api exposed for this feature and it's hand configuration only while we test it out.
[ { "change_type": "MODIFY", "old_path": "althea_kernel_interface/src/exit_client_tunnel.rs", "new_path": "althea_kernel_interface/src/exit_client_tunnel.rs", "diff": "@@ -24,6 +24,10 @@ pub struct ClientExitTunnelConfig {\n/// interface, I'm nearly positive this can be safely removed because the implementation of\n/// peer discovery has been changed since it was first needed\npub rita_hello_port: u16,\n+ /// This is a user provided bandwidth limit (upload and download) to be enforced\n+ /// by cake. Traffic is shaped incoming on wg_exit and outgoing on br_lan resulting\n+ /// in a symmetrical limit of the users choice. Specified in mbit/s\n+ pub user_specified_speed: Option<usize>,\n}\nimpl dyn KernelInterface {\n@@ -141,7 +145,8 @@ impl dyn KernelInterface {\n.into());\n}\n- let _res = self.set_codel_shaping(\"wg_exit\", None, true);\n+ let _res = self.set_codel_shaping(\"wg_exit\", args.user_specified_speed, true);\n+ let _res = self.set_codel_shaping(\"br-lan\", args.user_specified_speed, false);\nOk(())\n}\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_client/exit_manager/mod.rs", "new_path": "rita/src/rita_client/exit_manager/mod.rs", "diff": "@@ -67,6 +67,7 @@ fn linux_setup_exit_tunnel(\nlocal_ip: our_details.client_internal_ip,\nnetmask: general_details.netmask,\nrita_hello_port: SETTING.get_network().rita_hello_port,\n+ user_specified_speed: SETTING.get_network().user_bandwidth_limit,\n};\nKI.set_client_exit_tunnel_config(args)?;\n" }, { "change_type": "MODIFY", "old_path": "settings/src/network.rs", "new_path": "settings/src/network.rs", "diff": "@@ -107,6 +107,11 @@ pub struct NetworkSettings {\n/// where there is significant jitter that's not caused by traffic load\n#[serde(default = \"default_shaper_settings\")]\npub shaper_settings: ShaperSettings,\n+ /// This is a user provided bandwidth limit (upload and download) to be enforced\n+ /// by cake. Traffic is shaped incoming on wg_exit and outgoing on br_lan resulting\n+ /// in a symmetrical limit of the users choice. Specified in mbit/s\n+ #[serde(default)]\n+ pub user_bandwidth_limit: Option<usize>,\n}\nimpl Default for NetworkSettings {\n@@ -137,6 +142,7 @@ impl Default for NetworkSettings {\ndevice: None,\nnickname: None,\nusage_tracker_file: default_usage_tracker_file(),\n+ user_bandwidth_limit: None,\n}\n}\n}\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Add user specified speed limit This is a very simple backend for a user specified data speed limit. The goal here is to allow users to control their own usage effectively currently there is no frontend or api exposed for this feature and it's hand configuration only while we test it out.
20,244
26.09.2020 08:59:14
14,400
7fff1eb6ab830cdce1d3d53864e93c6271fa6084
Fix change operator endpoint Since we're still using the backwards compatible dao endpoints this endpoint was never tested. So while the function takes a path argument the route specification does not provide for one.
[ { "change_type": "MODIFY", "old_path": "rita/src/client.rs", "new_path": "rita/src/client.rs", "diff": "@@ -270,7 +270,7 @@ fn start_client_dashboard() {\n.route(\"/dao_fee\", Method::GET, get_dao_fee)\n.route(\"/dao_fee/{fee}\", Method::POST, set_dao_fee)\n.route(\"/operator\", Method::GET, get_operator)\n- .route(\"/operator\", Method::POST, change_operator)\n+ .route(\"/operator/{address}\", Method::POST, change_operator)\n.route(\"/operator/remove\", Method::POST, remove_operator)\n.route(\"/operator_fee\", Method::GET, get_operator_fee)\n.route(\"/operator_debt\", Method::GET, get_operator_debt)\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Fix change operator endpoint Since we're still using the backwards compatible dao endpoints this endpoint was never tested. So while the function takes a path argument the route specification does not provide for one.
20,244
28.09.2020 09:48:07
14,400
dee0dae7fd091a06fe60e6a625b7702f741cfcce
Sync up auto bridge async web3 with rita async web3 This was silently breaking the token bridge becuase different actix versions would not allow requests to be successfully spawned and processed. Hopefully the re-sync will also reduce the horrifying binary size increase we've been seeing.
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "@@ -28,31 +28,6 @@ dependencies = [\n\"uuid\",\n]\n-[[package]]\n-name = \"actix\"\n-version = \"0.9.0\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"a4af87564ff659dee8f9981540cac9418c45e910c8072fdedd643a262a38fcaf\"\n-dependencies = [\n- \"actix-http 1.0.1\",\n- \"actix-rt\",\n- \"actix_derive 0.5.0\",\n- \"bitflags\",\n- \"bytes 0.5.6\",\n- \"crossbeam-channel 0.4.3\",\n- \"derive_more\",\n- \"futures 0.3.5\",\n- \"lazy_static\",\n- \"log\",\n- \"parking_lot 0.10.2\",\n- \"pin-project\",\n- \"smallvec 1.4.1\",\n- \"tokio 0.2.22\",\n- \"tokio-util 0.2.0\",\n- \"trust-dns-proto 0.18.0-alpha.2\",\n- \"trust-dns-resolver 0.18.0-alpha.2\",\n-]\n-\n[[package]]\nname = \"actix\"\nversion = \"0.10.0\"\n@@ -109,27 +84,6 @@ dependencies = [\n\"tokio-util 0.3.1\",\n]\n-[[package]]\n-name = \"actix-connect\"\n-version = \"1.0.2\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"c95cc9569221e9802bf4c377f6c18b90ef10227d787611decf79fd47d2a8e76c\"\n-dependencies = [\n- \"actix-codec 0.2.0\",\n- \"actix-rt\",\n- \"actix-service\",\n- \"actix-utils 1.0.6\",\n- \"derive_more\",\n- \"either\",\n- \"futures 0.3.5\",\n- \"http 0.2.1\",\n- \"log\",\n- \"openssl\",\n- \"tokio-openssl 0.4.0\",\n- \"trust-dns-proto 0.18.0-alpha.2\",\n- \"trust-dns-resolver 0.18.0-alpha.2\",\n-]\n-\n[[package]]\nname = \"actix-connect\"\nversion = \"2.0.0\"\n@@ -151,53 +105,6 @@ dependencies = [\n\"trust-dns-resolver 0.19.5\",\n]\n-[[package]]\n-name = \"actix-http\"\n-version = \"1.0.1\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"c16664cc4fdea8030837ad5a845eb231fb93fc3c5c171edfefb52fad92ce9019\"\n-dependencies = [\n- \"actix-codec 0.2.0\",\n- \"actix-connect 1.0.2\",\n- \"actix-rt\",\n- \"actix-service\",\n- \"actix-threadpool\",\n- \"actix-tls 1.0.0\",\n- \"actix-utils 1.0.6\",\n- \"base64 0.11.0\",\n- \"bitflags\",\n- \"brotli2\",\n- \"bytes 0.5.6\",\n- \"chrono\",\n- \"copyless\",\n- \"derive_more\",\n- \"either\",\n- \"encoding_rs\",\n- \"flate2\",\n- \"futures-channel\",\n- \"futures-core\",\n- \"futures-util\",\n- \"fxhash\",\n- \"h2 0.2.6\",\n- \"http 0.2.1\",\n- \"httparse\",\n- \"indexmap\",\n- \"language-tags\",\n- \"lazy_static\",\n- \"log\",\n- \"mime\",\n- \"percent-encoding 2.1.0\",\n- \"pin-project\",\n- \"rand 0.7.3\",\n- \"regex\",\n- \"serde 1.0.114\",\n- \"serde_json\",\n- \"serde_urlencoded 0.6.1\",\n- \"sha1\",\n- \"slab\",\n- \"time 0.1.43\",\n-]\n-\n[[package]]\nname = \"actix-http\"\nversion = \"2.0.0\"\n@@ -205,11 +112,11 @@ source = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"05dd80ba8f27c4a34357c07e338c8f5c38f8520e6d626ca1727d8fecc41b0cab\"\ndependencies = [\n\"actix-codec 0.3.0\",\n- \"actix-connect 2.0.0\",\n+ \"actix-connect\",\n\"actix-rt\",\n\"actix-service\",\n\"actix-threadpool\",\n- \"actix-tls 2.0.0\",\n+ \"actix-tls\",\n\"actix-utils 2.0.0\",\n\"base64 0.12.3\",\n\"bitflags\",\n@@ -370,24 +277,6 @@ dependencies = [\n\"threadpool\",\n]\n-[[package]]\n-name = \"actix-tls\"\n-version = \"1.0.0\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"a4e5b4faaf105e9a6d389c606c298dcdb033061b00d532af9df56ff3a54995a8\"\n-dependencies = [\n- \"actix-codec 0.2.0\",\n- \"actix-rt\",\n- \"actix-service\",\n- \"actix-utils 1.0.6\",\n- \"derive_more\",\n- \"either\",\n- \"futures 0.3.5\",\n- \"log\",\n- \"openssl\",\n- \"tokio-openssl 0.4.0\",\n-]\n-\n[[package]]\nname = \"actix-tls\"\nversion = \"2.0.0\"\n@@ -493,43 +382,6 @@ dependencies = [\n\"version_check 0.1.5\",\n]\n-[[package]]\n-name = \"actix-web\"\n-version = \"2.0.0\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"3158e822461040822f0dbf1735b9c2ce1f95f93b651d7a7aded00b1efbb1f635\"\n-dependencies = [\n- \"actix-codec 0.2.0\",\n- \"actix-http 1.0.1\",\n- \"actix-macros\",\n- \"actix-router\",\n- \"actix-rt\",\n- \"actix-server\",\n- \"actix-service\",\n- \"actix-testing\",\n- \"actix-threadpool\",\n- \"actix-tls 1.0.0\",\n- \"actix-utils 1.0.6\",\n- \"actix-web-codegen 0.2.2\",\n- \"awc 1.0.1\",\n- \"bytes 0.5.6\",\n- \"derive_more\",\n- \"encoding_rs\",\n- \"futures 0.3.5\",\n- \"fxhash\",\n- \"log\",\n- \"mime\",\n- \"net2\",\n- \"openssl\",\n- \"pin-project\",\n- \"regex\",\n- \"serde 1.0.114\",\n- \"serde_json\",\n- \"serde_urlencoded 0.6.1\",\n- \"time 0.1.43\",\n- \"url 2.1.1\",\n-]\n-\n[[package]]\nname = \"actix-web\"\nversion = \"3.0.2\"\n@@ -537,7 +389,7 @@ source = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"36de80175eb1f0a5c518024ce0d23646b54a23008279e090ca1848f6f1448bf4\"\ndependencies = [\n\"actix-codec 0.3.0\",\n- \"actix-http 2.0.0\",\n+ \"actix-http\",\n\"actix-macros\",\n\"actix-router\",\n\"actix-rt\",\n@@ -545,10 +397,10 @@ dependencies = [\n\"actix-service\",\n\"actix-testing\",\n\"actix-threadpool\",\n- \"actix-tls 2.0.0\",\n+ \"actix-tls\",\n\"actix-utils 2.0.0\",\n- \"actix-web-codegen 0.3.0\",\n- \"awc 2.0.0\",\n+ \"actix-web-codegen\",\n+ \"awc\",\n\"bytes 0.5.6\",\n\"derive_more\",\n\"encoding_rs\",\n@@ -570,17 +422,6 @@ dependencies = [\n\"url 2.1.1\",\n]\n-[[package]]\n-name = \"actix-web-codegen\"\n-version = \"0.2.2\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"a71bf475cbe07281d0b3696abb48212db118e7e23219f13596ce865235ff5766\"\n-dependencies = [\n- \"proc-macro2 1.0.19\",\n- \"quote 1.0.7\",\n- \"syn 1.0.35\",\n-]\n-\n[[package]]\nname = \"actix-web-codegen\"\nversion = \"0.3.0\"\n@@ -788,7 +629,7 @@ dependencies = [\nname = \"auto-bridge\"\nversion = \"0.1.5\"\ndependencies = [\n- \"actix 0.9.0\",\n+ \"actix 0.10.0\",\n\"clarity\",\n\"failure\",\n\"futures 0.3.5\",\n@@ -797,7 +638,7 @@ dependencies = [\n\"num256\",\n\"rand 0.7.3\",\n\"tokio 0.2.22\",\n- \"web30 0.5.0\",\n+ \"web30 0.6.1\",\n]\n[[package]]\n@@ -812,30 +653,6 @@ version = \"1.0.0\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d\"\n-[[package]]\n-name = \"awc\"\n-version = \"1.0.1\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"d7601d4d1d7ef2335d6597a41b5fe069f6ab799b85f53565ab390e7b7065aac5\"\n-dependencies = [\n- \"actix-codec 0.2.0\",\n- \"actix-http 1.0.1\",\n- \"actix-rt\",\n- \"actix-service\",\n- \"base64 0.11.0\",\n- \"bytes 0.5.6\",\n- \"derive_more\",\n- \"futures-core\",\n- \"log\",\n- \"mime\",\n- \"openssl\",\n- \"percent-encoding 2.1.0\",\n- \"rand 0.7.3\",\n- \"serde 1.0.114\",\n- \"serde_json\",\n- \"serde_urlencoded 0.6.1\",\n-]\n-\n[[package]]\nname = \"awc\"\nversion = \"2.0.0\"\n@@ -843,7 +660,7 @@ source = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"150e00c06683ab44c5f97d033950e5d87a7a042d06d77f5eecb443cbd23d0575\"\ndependencies = [\n\"actix-codec 0.3.0\",\n- \"actix-http 2.0.0\",\n+ \"actix-http\",\n\"actix-rt\",\n\"actix-service\",\n\"base64 0.12.3\",\n@@ -924,12 +741,6 @@ dependencies = [\n\"byteorder\",\n]\n-[[package]]\n-name = \"base64\"\n-version = \"0.11.0\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7\"\n-\n[[package]]\nname = \"base64\"\nversion = \"0.12.3\"\n@@ -2862,16 +2673,6 @@ dependencies = [\n\"rustc_version\",\n]\n-[[package]]\n-name = \"parking_lot\"\n-version = \"0.10.2\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e\"\n-dependencies = [\n- \"lock_api 0.3.4\",\n- \"parking_lot_core 0.7.2\",\n-]\n-\n[[package]]\nname = \"parking_lot\"\nversion = \"0.11.0\"\n@@ -2911,20 +2712,6 @@ dependencies = [\n\"winapi 0.3.9\",\n]\n-[[package]]\n-name = \"parking_lot_core\"\n-version = \"0.7.2\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3\"\n-dependencies = [\n- \"cfg-if\",\n- \"cloudabi 0.0.3\",\n- \"libc\",\n- \"redox_syscall\",\n- \"smallvec 1.4.1\",\n- \"winapi 0.3.9\",\n-]\n-\n[[package]]\nname = \"parking_lot_core\"\nversion = \"0.8.0\"\n@@ -4507,26 +4294,6 @@ dependencies = [\n\"url 1.7.2\",\n]\n-[[package]]\n-name = \"trust-dns-proto\"\n-version = \"0.18.0-alpha.2\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"2a7f3a2ab8a919f5eca52a468866a67ed7d3efa265d48a652a9a3452272b413f\"\n-dependencies = [\n- \"async-trait\",\n- \"enum-as-inner\",\n- \"failure\",\n- \"futures 0.3.5\",\n- \"idna 0.2.0\",\n- \"lazy_static\",\n- \"log\",\n- \"rand 0.7.3\",\n- \"smallvec 1.4.1\",\n- \"socket2\",\n- \"tokio 0.2.22\",\n- \"url 2.1.1\",\n-]\n-\n[[package]]\nname = \"trust-dns-proto\"\nversion = \"0.19.5\"\n@@ -4566,25 +4333,6 @@ dependencies = [\n\"trust-dns-proto 0.6.3\",\n]\n-[[package]]\n-name = \"trust-dns-resolver\"\n-version = \"0.18.0-alpha.2\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"6f90b1502b226f8b2514c6d5b37bafa8c200d7ca4102d57dc36ee0f3b7a04a2f\"\n-dependencies = [\n- \"cfg-if\",\n- \"failure\",\n- \"futures 0.3.5\",\n- \"ipconfig 0.2.2\",\n- \"lazy_static\",\n- \"log\",\n- \"lru-cache\",\n- \"resolv-conf\",\n- \"smallvec 1.4.1\",\n- \"tokio 0.2.22\",\n- \"trust-dns-proto 0.18.0-alpha.2\",\n-]\n-\n[[package]]\nname = \"trust-dns-resolver\"\nversion = \"0.19.5\"\n@@ -4870,27 +4618,6 @@ dependencies = [\n\"tokio 0.1.22\",\n]\n-[[package]]\n-name = \"web30\"\n-version = \"0.5.0\"\n-source = \"git+https://github.com/althea-net/web30?rev=53d83bc74a0218eddc4221cf2fb6eefe49fba1d9#53d83bc74a0218eddc4221cf2fb6eefe49fba1d9\"\n-dependencies = [\n- \"actix 0.9.0\",\n- \"actix-web 2.0.0\",\n- \"assert-json-diff\",\n- \"bytes 0.5.6\",\n- \"clarity\",\n- \"failure\",\n- \"futures 0.3.5\",\n- \"futures-timer 3.0.2\",\n- \"log\",\n- \"num256\",\n- \"serde 1.0.114\",\n- \"serde_derive\",\n- \"serde_json\",\n- \"tokio 0.2.22\",\n-]\n-\n[[package]]\nname = \"web30\"\nversion = \"0.6.1\"\n" }, { "change_type": "MODIFY", "old_path": "auto_bridge/Cargo.toml", "new_path": "auto_bridge/Cargo.toml", "diff": "@@ -5,7 +5,7 @@ authors = [\"Jehan <jehan.tremback@gmail.com>, Justin <justin@althea.net>\"]\nedition = \"2018\"\n[dependencies]\n-web30 = { git = \"https://github.com/althea-net/web30\", rev = \"53d83bc74a0218eddc4221cf2fb6eefe49fba1d9\" }\n+web30 = \"0.6\"\nfutures = \"0.3\"\nfailure = \"0.1\"\nnum256 = \"0.2\"\n@@ -16,4 +16,4 @@ log = \"0.4\"\ntokio = {version = \"0.2\", default_features = false, features = [\"time\"]}\n[dev-dependencies]\n-actix = \"0.9\"\n+actix = \"0.10\"\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Sync up auto bridge async web3 with rita async web3 This was silently breaking the token bridge becuase different actix versions would not allow requests to be successfully spawned and processed. Hopefully the re-sync will also reduce the horrifying binary size increase we've been seeing.
20,244
28.09.2020 09:49:43
14,400
4282c9efbb15a9f41f8dfc4896edfb1a3cfca279
Improve token bridge logging
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_common/rita_loop/slow_loop.rs", "new_path": "rita/src/rita_common/rita_loop/slow_loop.rs", "diff": "@@ -25,12 +25,13 @@ pub fn start_rita_slow_loop() {\nwhile let Err(e) = {\nthread::spawn(move || loop {\nlet start = Instant::now();\n- trace!(\"Common Slow tick!\");\n+ info!(\"Common Slow tick!\");\nlet res = System::run(move || {\nArbiter::spawn(async move {\ntick_token_bridge().await;\ntick_simulated_tx().await;\n+ info!(\"Common Slow tick async completed!\");\nSystem::current().stop();\n});\n});\n@@ -41,6 +42,7 @@ pub fn start_rita_slow_loop() {\n// we really only need to run this on startup, but doing so periodically\n// could catch the edge case where babel is restarted under us\nset_babel_price();\n+ info!(\"Common Slow tick completed!\");\n// sleep until it has been SLOW_LOOP_SPEED seconds from start, whenever that may be\n// if it has been more than SLOW_LOOP_SPEED seconds from start, go right ahead\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/token_bridge/mod.rs", "new_path": "rita/src/rita_common/token_bridge/mod.rs", "diff": "@@ -155,7 +155,7 @@ pub async fn tick_token_bridge() {\n}\ndrop(payment_settings);\n- trace!(\"Launching bridge future with state {}\", bridge.state);\n+ info!(\"Launching bridge future with state {}\", bridge.state);\nmatch system_chain {\nSystemChain::Xdai => state_change(xdai_bridge(bridge.state.clone()).await),\nSystemChain::Ethereum => eth_bridge().await,\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Improve token bridge logging
20,244
28.09.2020 14:53:52
14,400
a014e60857bd02328be46ec8f72bb2873000db71
Don't double gas prices specify exact web30 version together these seem to solve the beta 16 bridge problems.
[ { "change_type": "MODIFY", "old_path": "auto_bridge/Cargo.toml", "new_path": "auto_bridge/Cargo.toml", "diff": "@@ -5,7 +5,7 @@ authors = [\"Jehan <jehan.tremback@gmail.com>, Justin <justin@althea.net>\"]\nedition = \"2018\"\n[dependencies]\n-web30 = \"0.6\"\n+web30 = \"0.6.1\"\nfutures = \"0.3\"\nfailure = \"0.1\"\nnum256 = \"0.2\"\n" }, { "change_type": "MODIFY", "old_path": "auto_bridge/src/lib.rs", "new_path": "auto_bridge/src/lib.rs", "diff": "@@ -160,10 +160,7 @@ impl TokenBridge {\neth_amount,\nown_address,\nsecret,\n- vec![\n- SendTxOption::GasLimit(UNISWAP_GAS_LIMIT.into()),\n- SendTxOption::GasPriceMultiplier(2u32.into()),\n- ],\n+ vec![SendTxOption::GasLimit(UNISWAP_GAS_LIMIT.into())],\n),\n)\n.await??;\n@@ -295,10 +292,7 @@ impl TokenBridge {\n0u32.into(),\nown_address,\nsecret,\n- vec![\n- SendTxOption::GasLimit(UNISWAP_GAS_LIMIT.into()),\n- SendTxOption::GasPriceMultiplier(2u32.into()),\n- ],\n+ vec![SendTxOption::GasLimit(UNISWAP_GAS_LIMIT.into())],\n),\n)\n.await?;\n@@ -348,10 +342,7 @@ impl TokenBridge {\n0u32.into(),\nown_address,\nsecret,\n- vec![\n- SendTxOption::GasLimit(ERC20_GAS_LIMIT.into()),\n- SendTxOption::GasPriceMultiplier(2u32.into()),\n- ],\n+ vec![SendTxOption::GasLimit(ERC20_GAS_LIMIT.into())],\n)\n.await?;\n" }, { "change_type": "MODIFY", "old_path": "rita/Cargo.toml", "new_path": "rita/Cargo.toml", "diff": "@@ -29,7 +29,7 @@ web30 = {git = \"https://github.com/althea-net/web30\", rev = \"4002ac7deca2e7ecbda\n# duplicate async dependencies, we are currently carrying both futures 0.1 and modern async/await dependencies\n# these will be kept here for quite some time until the switch is completed.\n-async-web30 = {package=\"web30\", version = \"0.6\"}\n+async-web30 = {package=\"web30\", version = \"0.6.1\"}\nactix-async = {package=\"actix\", version = \"0.10\"}\nactix-web-async = {package=\"actix-web\", version = \"3.0\", default_features = false, features= [\"openssl\"] }\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Don't double gas prices specify exact web30 version together these seem to solve the beta 16 bridge problems.
20,244
29.09.2020 11:05:04
14,400
f2905d8b8618ac46c9bc5fd743d225a4507cfc34
Bump for Beta 16 RC2
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "@@ -3245,7 +3245,7 @@ dependencies = [\n[[package]]\nname = \"rita\"\n-version = \"0.5.61\"\n+version = \"0.5.62\"\ndependencies = [\n\"actix 0.10.0\",\n\"actix 0.7.11\",\n" }, { "change_type": "MODIFY", "old_path": "rita/Cargo.toml", "new_path": "rita/Cargo.toml", "diff": "[package]\nname = \"rita\"\n-version = \"0.5.61\"\n+version = \"0.5.62\"\nauthors = [\"Justin <justin@althea.net>\", \"Jehan <jehan.tremback@gmail.com>\", \"Ben <wangben3@gmail.com>\"]\nbuild = \"build.rs\"\nedition = \"2018\"\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/dashboard/own_info.rs", "new_path": "rita/src/rita_common/dashboard/own_info.rs", "diff": "@@ -7,7 +7,7 @@ use failure::Error;\nuse num256::{Int256, Uint256};\nuse settings::RitaCommonSettings;\n-pub static READABLE_VERSION: &str = \"Beta 16 RC1\";\n+pub static READABLE_VERSION: &str = \"Beta 16 RC2\";\n#[derive(Serialize)]\npub struct OwnInfo {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Bump for Beta 16 RC2
20,244
29.09.2020 16:04:41
14,400
11ea261ce4524219ab476bf5503a9cf99ace8779
Complete self bandwidth limiting feature This patch adds configuration endpoints and remote monitoring support for local bandwidth limiting. At this point it's actually fully usable for most users and we're just missing some testing before it can be rolled out.
[ { "change_type": "MODIFY", "old_path": "althea_types/src/interop.rs", "new_path": "althea_types/src/interop.rs", "diff": "@@ -555,6 +555,9 @@ pub struct OperatorCheckinMessage {\n/// Info about the current state of this device, including it's model, CPU,\n/// memory, and temperature if sensors are available\npub hardware_info: Option<HardwareInfo>,\n+ /// This is a user set bandwidth limit value, it will cap the users download\n+ /// and upload to the provided value of their choosing. Denoted in mbps\n+ pub user_bandwidth_limit: Option<usize>,\n}\n#[derive(Debug, Clone, Serialize, Deserialize)]\n" }, { "change_type": "MODIFY", "old_path": "rita/src/client.rs", "new_path": "rita/src/client.rs", "diff": "@@ -62,6 +62,7 @@ use crate::rita_common::utils::env_vars_contains;\nuse crate::rita_client::dashboard::auth::*;\nuse crate::rita_client::dashboard::backup_created::*;\n+use crate::rita_client::dashboard::bandwidth_limit::*;\nuse crate::rita_client::dashboard::contact_info::*;\nuse crate::rita_client::dashboard::eth_private_key::*;\nuse crate::rita_client::dashboard::exits::*;\n@@ -394,6 +395,12 @@ fn start_client_dashboard() {\n)\n.route(\"/billing_details\", Method::GET, get_billing_details)\n.route(\"/billing_details\", Method::POST, set_billing_details)\n+ .route(\"/bandwidth_limit\", Method::GET, get_bandwidth_limit)\n+ .route(\n+ \"/bandwidth_limit/{limit}\",\n+ Method::POST,\n+ set_bandwidth_limit,\n+ )\n.route(\n\"/operator_setup/{enabled}\",\nMethod::POST,\n" }, { "change_type": "ADD", "old_path": null, "new_path": "rita/src/rita_client/dashboard/bandwidth_limit.rs", "diff": "+//! Beta 16 introduces a feature where users can select their own self imposed router bandwidth limit\n+//! these dashboard endpoints facilitate users setting that value.\n+\n+use crate::ARGS;\n+use crate::KI;\n+use crate::SETTING;\n+use actix_web::HttpResponse;\n+use actix_web::{HttpRequest, Path};\n+use failure::Error;\n+use settings::FileWrite;\n+use settings::RitaCommonSettings;\n+\n+pub fn get_bandwidth_limit(_req: HttpRequest) -> HttpResponse {\n+ let val = SETTING.get_network().user_bandwidth_limit;\n+ HttpResponse::Ok().json(val)\n+}\n+\n+pub fn set_bandwidth_limit(path: Path<String>) -> Result<HttpResponse, Error> {\n+ let value = path.into_inner();\n+ debug!(\"Set bandwidth limit!\");\n+ let mut net = SETTING.get_network_mut();\n+ if value.is_empty() || value == \"disable\" {\n+ net.user_bandwidth_limit = None;\n+ } else if let Ok(parsed) = value.parse() {\n+ net.user_bandwidth_limit = Some(parsed);\n+ } else {\n+ return Ok(HttpResponse::BadRequest().finish());\n+ }\n+ let _res = KI.set_codel_shaping(\"wg_exit\", net.user_bandwidth_limit, true);\n+ let _res = KI.set_codel_shaping(\"br-lan\", net.user_bandwidth_limit, false);\n+ drop(net);\n+\n+ // try and save the config and fail if we can't\n+ if let Err(e) = SETTING.write().unwrap().write(&ARGS.flag_config) {\n+ return Err(e);\n+ }\n+ Ok(HttpResponse::Ok().json(()))\n+}\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_client/dashboard/mod.rs", "new_path": "rita/src/rita_client/dashboard/mod.rs", "diff": "pub mod auth;\npub mod backup_created;\n+pub mod bandwidth_limit;\npub mod contact_info;\npub mod eth_private_key;\npub mod exits;\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_client/operator_update/mod.rs", "new_path": "rita/src/rita_client/operator_update/mod.rs", "diff": "@@ -102,6 +102,7 @@ fn checkin() {\nlet contact_info = option_convert(SETTING.get_exit_client().contact_info.clone());\nlet install_details = operator_settings.installation_details.clone();\nlet billing_details = operator_settings.billing_details.clone();\n+ let user_bandwidth_limit = SETTING.get_network().user_bandwidth_limit;\ndrop(operator_settings);\n@@ -149,6 +150,7 @@ fn checkin() {\ninstall_details,\nbilling_details,\nhardware_info,\n+ user_bandwidth_limit,\n})\n.unwrap()\n.send()\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Complete self bandwidth limiting feature This patch adds configuration endpoints and remote monitoring support for local bandwidth limiting. At this point it's actually fully usable for most users and we're just missing some testing before it can be rolled out.
20,244
29.09.2020 18:35:50
14,400
57e29ec852d792bb05913b7eb47a3885d7c77801
Upgrade test script for postgres 13 fixes the integration test
[ { "change_type": "MODIFY", "old_path": "integration-tests/container/Dockerfile", "new_path": "integration-tests/container/Dockerfile", "diff": "@@ -5,8 +5,8 @@ RUN apt-get update && apt-get install -y sudo iputils-ping iproute2 jq vim netca\nRUN apt-get install -y -t unstable iperf3\nRUN curl https://sh.rustup.rs -sSf | sh -s -- -y\nENV POSTGRES_USER=postgres\n-ENV POSTGRES_BIN=/usr/lib/postgresql/12/bin/postgres\n-ENV INITDB_BIN=/usr/lib/postgresql/12/bin/initdb\n+ENV POSTGRES_BIN=/usr/lib/postgresql/13/bin/postgres\n+ENV INITDB_BIN=/usr/lib/postgresql/13/bin/initdb\nRUN PATH=$PATH:$HOME/.cargo/bin cargo install diesel_cli --force\nARG NODES\nENV NODES=$NODES\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Upgrade test script for postgres 13 fixes the integration test
20,244
30.09.2020 15:56:13
14,400
a436e075c065601a8057e971f3f4a1535f519ac4
Improve tunnel struct comments
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_common/tunnel_manager/mod.rs", "new_path": "rita/src/rita_common/tunnel_manager/mod.rs", "diff": "@@ -131,15 +131,28 @@ fn test_payment_state() {\n#[derive(PartialEq, Debug, Clone, Eq, Hash)]\npub struct Tunnel {\n- pub ip: IpAddr, // Tunnel endpoint\n- pub iface_name: String, // name of wg#\n- pub listen_ifidx: u32, // the physical interface this tunnel is listening on\n- pub listen_port: u16, // the local port this tunnel is listening on\n- pub neigh_id: LocalIdentity, // the identity of the counterparty tunnel\n- pub last_contact: Instant, // When's the last we heard from the other end of this tunnel?\n- created: Instant, // when this tunnel was created, private to prevent outside editing\n- pub speed_limit: Option<usize>, // banwidth limit in mbps, used for Codel shaping\n- pub light_client_details: Option<Ipv4Addr>, // if Some this tunnel is for a light client\n+ /// The tunnel endpoint\n+ pub ip: IpAddr,\n+ /// the name of the tunnel in the format of wg# numbers are assigned\n+ /// in an incrementing fashion but may become inconsistent as tunnels\n+ /// are closed and reopened.\n+ pub iface_name: String,\n+ /// The linux interface id for the physical interface this tunnel is listening on\n+ pub listen_ifidx: u32,\n+ /// The port this tunnel is listening on\n+ pub listen_port: u16,\n+ /// The identity of the counter party tunnel\n+ pub neigh_id: LocalIdentity,\n+ /// An instant representing the last time we heard from this tunnel r\n+ pub last_contact: Instant,\n+ /// When this tunnel was created\n+ created: Instant,\n+ /// Bandwidth limit for codel shaping on this interface, set in mbps be aware this\n+ /// many or may not actually be set depending on if the host supports codel although\n+ /// all routers do only exits are in question\n+ pub speed_limit: Option<usize>,\n+ /// If true this tunnel is for a light client and is working over ipv4 endpoints\n+ pub light_client_details: Option<Ipv4Addr>,\nstate: TunnelState,\n}\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Improve tunnel struct comments
20,244
07.10.2020 09:43:55
14,400
5b1e0c2b3407cc5d496efee5f4e28a108b42102a
Bump for Beta 16 RC3
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "@@ -3240,7 +3240,7 @@ dependencies = [\n[[package]]\nname = \"rita\"\n-version = \"0.5.62\"\n+version = \"0.5.63\"\ndependencies = [\n\"actix 0.10.0\",\n\"actix 0.7.11\",\n" }, { "change_type": "MODIFY", "old_path": "rita/Cargo.toml", "new_path": "rita/Cargo.toml", "diff": "[package]\nname = \"rita\"\n-version = \"0.5.62\"\n+version = \"0.5.63\"\nauthors = [\"Justin <justin@althea.net>\", \"Jehan <jehan.tremback@gmail.com>\", \"Ben <wangben3@gmail.com>\"]\nbuild = \"build.rs\"\nedition = \"2018\"\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/dashboard/own_info.rs", "new_path": "rita/src/rita_common/dashboard/own_info.rs", "diff": "@@ -7,7 +7,7 @@ use failure::Error;\nuse num256::{Int256, Uint256};\nuse settings::RitaCommonSettings;\n-pub static READABLE_VERSION: &str = \"Beta 16 RC2\";\n+pub static READABLE_VERSION: &str = \"Beta 16 RC3\";\n#[derive(Serialize)]\npub struct OwnInfo {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Bump for Beta 16 RC3
20,244
07.10.2020 11:35:56
14,400
0993f89eec5ddca9e2656891f38404efd199ce81
Add scale test script This patch adds a scale test script and some helpers to make it more practical to run
[ { "change_type": "MODIFY", "old_path": "integration-tests/integration-test-script/rita.py", "new_path": "integration-tests/integration-test-script/rita.py", "diff": "@@ -70,9 +70,9 @@ RITA_EXIT = RITA_EXIT_DEFAULT\nCOMPAT_LAYOUT = os.getenv('COMPAT_LAYOUT', None)\nBACKOFF_FACTOR = float(os.getenv('BACKOFF_FACTOR', 1))\n-CONVERGENCE_DELAY = float(os.getenv('CONVERGENCE_DELAY', 300))\n+CONVERGENCE_DELAY = float(os.getenv('CONVERGENCE_DELAY', 600))\nDEBUG = os.getenv('DEBUG') is not None\n-INITIAL_POLL_INTERVAL = float(os.getenv('INITIAL_POLL_INTERVAL', 1))\n+INITIAL_POLL_INTERVAL = float(os.getenv('INITIAL_POLL_INTERVAL', 10))\nPING6 = os.getenv('PING6', 'ping6')\nVERBOSE = os.getenv('VERBOSE', None)\nNODES = os.getenv('NODES', None)\n@@ -334,6 +334,9 @@ def main():\nworld.create(VERBOSE, COMPAT_LAYOUT, COMPAT_LAYOUTS, RITA, RITA_EXIT, DIR_A, DIR_B, RITA_A, RITA_EXIT_A, RITA_B, RITA_EXIT_B, NETWORK_LAB,\nBABELD, POSTGRES_DATABASE, POSTGRES_USER, POSTGRES_CONFIG, POSTGRES_BIN, INITDB_BIN, EXIT_NAMESPACE, EXIT_SETTINGS, dname)\n+ # in scale configuration we reduce some testing and otherwise reduce disk io\n+ scale_configuration = len(world.nodes) > 10\n+\nprint(\"Waiting for network to stabilize\")\nstart_time = time.time()\n@@ -350,8 +353,10 @@ def main():\nwhile (time.time() - start_time) <= CONVERGENCE_DELAY:\nall_reachable = world.test_reach_all(\nPING6, verbose=False, global_fail=False)\n+ # test all routes, but not in the case of a scale configuration since we\n+ # don't write out the logs in that case\nroutes_ok = world.test_routes(\n- all_routes, verbose=False, global_fail=False)\n+ all_routes, verbose=False, global_fail=False) or scale_configuration\nif all_reachable and routes_ok:\nbreak # We converged!\ntime.sleep(interval) # Let's check again after a delay\n@@ -360,13 +365,14 @@ def main():\nprint(\"%.2fs/%.2fs (going to sleep for %.2fs)\" %\n(time.time() - start_time, CONVERGENCE_DELAY, interval))\n- print(\"Test reachabibility and optimum routes...\")\n- time.sleep(120)\n+ print(\"Test reachability and optimum routes...\")\nduration = time.time() - start_time\n- # Test (and fail if necessary) for real and print stats on success\n- if world.test_reach_all(PING6) and world.test_routes(all_routes):\n+ # Test (and fail if necessary) for real and print stats on success if we are in a scale\n+ # configuration don't test routes. The route dumping produces disk load that's not possible\n+ # to deal with above a few nodes\n+ if world.test_reach_all(PING6) and (scale_configuration or world.test_routes(all_routes)):\nprint((\"Converged in \" + colored(\"%.2f seconds\", \"green\")) % duration)\nelse:\nprint((\"No convergence after more than \" +\n@@ -406,7 +412,7 @@ def main():\n# wait a few seconds after traffic generation for all nodes to update their debts\ntime.sleep(10)\ntraffic = world.get_debts()\n- print(\"Test post-traffic blanace agreement...\")\n+ print(\"Test post-traffic balance agreement...\")\nworld.test_debts_reciprocal_matching(traffic)\nworld.test_debts_values(traffic_test_pairs, TIME,\nSPEED, traffic, all_routes, EXIT_ID, world.exit_price)\n@@ -417,6 +423,8 @@ def main():\nassert_test(not check_log_contains(\"rita-n{}.log\".format(id),\n\"suspending forwarding\"), \"Suspension of {}\".format(id))\n+ # we reduce logging when doing larger tests and this check isn't possible.\n+ if len(world.nodes) < 10:\nassert_test(check_log_contains(\"rita-n{}.log\".format(GATEWAY_ID),\n\"We are a gateway!, Acting accordingly\"), \"Successful gateway/exit detection\")\n" }, { "change_type": "MODIFY", "old_path": "integration-tests/integration-test-script/utils.py", "new_path": "integration-tests/integration-test-script/utils.py", "diff": "@@ -111,7 +111,6 @@ def assert_test(x, description, verbose=True, global_fail=True):\n\"{} Failed\\n\".format(description))\nif global_fail and not x:\n- global TEST_PASSES\nTEST_PASSES = False\nreturn x\n@@ -192,14 +191,14 @@ def cleanup():\nos.system(\"mkdir mail\")\nos.system(\"sync\")\n# TODO: This is very inconsiderate\n- os.system(\"killall babeld rita rita_exit bounty_hunter iperf\")\n+ os.system(\"killall babeld rita rita_exit iperf\")\ndef teardown():\nos.system(\"rm -rf *.pid private-key*\")\nos.system(\"sync\")\n# TODO: This is very inconsiderate\n- os.system(\"killall babeld rita rita_exit bounty_hunter iperf\")\n+ os.system(\"killall babeld rita rita_exit iperf\")\ndef prep_netns(id):\n@@ -233,25 +232,30 @@ def check_log_contains(f, x):\nreturn False\n-def start_babel(node, BABELD):\n+def start_babel(node, log, scale, BABELD):\n+ hello_interval = 1\n+ update_interval = 1\n+ if scale:\n+ hello_interval = 1\n+ update_interval = 1\nexec_or_exit(\n(\n\"ip netns exec netlab-{id} {babeld_path} \" +\n\"-I babeld-n{id}.pid \" +\n- \"-d 1 \" +\n+ \"-d {log} \" +\n\"-r \" +\n\"-L babeld-n{id}.log \" +\n- \"-H 1 \" +\n+ \"-H {hello_interval} \" +\n\"-G 6872 \" +\n'-C \"default enable-timestamps true\" ' +\n- '-C \"default update-interval 1\" ' +\n+ '-C \"default update-interval {update_interval}\" ' +\n\"-w lo\"\n- ).format(babeld_path=BABELD, ifaces=node.get_interfaces(), id=node.id),\n+ ).format(babeld_path=BABELD, ifaces=node.get_interfaces(), id=node.id, log=log, hello_interval=hello_interval, update_interval=update_interval),\nblocking=False\n)\n-def start_rita(node, dname, RITA, EXIT_SETTINGS):\n+def start_rita(node, dname, log, RITA, EXIT_SETTINGS):\nid = node.id\nsettings = get_rita_defaults()\n@@ -265,10 +269,10 @@ def start_rita(node, dname, RITA, EXIT_SETTINGS):\nsave_rita_settings(id, settings)\ntime.sleep(0.2)\nos.system(\n- '(RUST_BACKTRACE=full RUST_LOG=TRACE ip netns exec netlab-{id} {rita} --config=rita-settings-n{id}.toml --platform=linux'\n+ '(RUST_BACKTRACE=full RUST_LOG={log} ip netns exec netlab-{id} {rita} --config=rita-settings-n{id}.toml --platform=linux'\n' 2>&1 & echo $! > rita-n{id}.pid) | '\n'grep -Ev \"<unknown>|mio|tokio_core|tokio_reactor|hyper\" > rita-n{id}.log &'.format(id=id, rita=RITA,\n- pwd=dname)\n+ pwd=dname, log=log)\n)\ntime.sleep(1)\n@@ -310,7 +314,7 @@ def start_rita_exit(node, dname, RITA_EXIT):\ndef ip_to_num(ip):\n- if ip in \"fd00::00\":\n+ if ip in \"fd00::aabb\":\nreturn 0\nelse:\nreturn int(ip.replace(\"fd00::\", \"\"))\n@@ -318,7 +322,7 @@ def ip_to_num(ip):\ndef num_to_ip(num):\nif num is 0:\n- return \"fd00::\"\n+ return \"fd00::aabb\"\nelse:\nreturn \"fd00::{}\".format(num)\n" }, { "change_type": "MODIFY", "old_path": "integration-tests/integration-test-script/world.py", "new_path": "integration-tests/integration-test-script/world.py", "diff": "@@ -65,10 +65,13 @@ class World:\ndef create(self, VERBOSE, COMPAT_LAYOUT, COMPAT_LAYOUTS, RITA, RITA_EXIT, DIR_A, DIR_B, RITA_A, RITA_EXIT_A, RITA_B, RITA_EXIT_B, NETWORK_LAB, BABELD, POSTGRES_DATABASE, POSTGRES_USER, POSTGRES_CONFIG, POSTGRES_BIN, INITDB_BIN, EXIT_NAMESPACE, EXIT_SETTINGS, dname):\ncleanup()\n+ # scale config modifies tests to reduce disk usage and disable\n+ # some infeasible tests to allow for larger numbers of nodes\n+ scale_configuration = len(self.nodes.items()) > 10\nnodes = {}\nfor id in self.nodes:\n- nodes[str(id)] = {\"ip\": \"fd00::{}\".format(id)}\n+ nodes[str(id)] = {\"ip\": num_to_ip(id)}\nedges = []\n@@ -123,8 +126,14 @@ class World:\nprint(\"starting babel\")\n+ # if this is set to zero route checking won't work\n+ # but it will reduce logging pressure in large networks\n+ log = \"1\"\n+ scale = False\n+ if scale_configuration:\n+ log = \"0\"\nfor id, node in self.nodes.items():\n- start_babel(node, BABELD)\n+ start_babel(node, log, scale_configuration, BABELD)\nprint(\"babel started\")\n@@ -144,11 +153,16 @@ class World:\nself.exit_id)[\"payment\"][\"eth_address\"]\nprint(\"starting rita\")\n+ log = \"TRACE\"\n+ # reduce logging in large configurations to keep disk pressure\n+ # from going insane\n+ if scale_configuration:\n+ log = \"ERROR\"\nfor id, node in self.nodes.items():\nif id != self.exit_id and id != self.external:\n(RITA, RITA_EXIT) = switch_binaries(id, VERBOSE, RITA, RITA_EXIT,\nCOMPAT_LAYOUT, COMPAT_LAYOUTS, RITA_A, RITA_EXIT_A, RITA_B, RITA_EXIT_B)\n- start_rita(node, dname, RITA, EXIT_SETTINGS)\n+ start_rita(node, dname, log, RITA, EXIT_SETTINGS)\ntime.sleep(0.5 + random.random() / 2) # wait 0.5s - 1s\nprint()\nprint(\"rita started\")\n" }, { "change_type": "ADD", "old_path": null, "new_path": "scripts/test-scale.sh", "diff": "+#!/bin/bash\n+set -eux\n+NODES=${NODES:='75'}\n+\n+if ! modprobe wireguard ; then\n+ echo \"The container can't load modules into the host kernel\"\n+ echo \"Please install WireGuard https://www.wireguard.com/ and load the kernel module using 'sudo modprobe wireguard'\"\n+ exit 1\n+fi\n+\n+# cleanup docker junk or this script will quickly run you out of room in /\n+#echo \"Docker images take up a lot of space in root if you are running out of space select Yes\"\n+#docker system prune -a -f\n+\n+# Remove existing container instance\n+set +e\n+docker rm -f rita-test\n+set -e\n+\n+DIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\n+DOCKERFOLDER=$DIR/../integration-tests/container/\n+REPOFOLDER=$DIR/..\n+git archive --format=tar.gz -o $DOCKERFOLDER/rita.tar.gz --prefix=althea_rs/ HEAD\n+pushd $DOCKERFOLDER\n+time docker build -t rita-test --build-arg NODES=$NODES .\n+time docker run --name rita-test --privileged -it rita-test\n+rm rita.tar.gz\n+popd\n" }, { "change_type": "MODIFY", "old_path": "scripts/test.sh", "new_path": "scripts/test.sh", "diff": "@@ -26,12 +26,17 @@ fi\n#echo \"Docker images take up a lot of space in root if you are running out of space select Yes\"\n#docker system prune -a -f\n+# Remove existing container instance\n+set +e\n+docker rm -f rita-test\n+set -e\n+\nDIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\nDOCKERFOLDER=$DIR/../integration-tests/container/\nREPOFOLDER=$DIR/..\ngit archive --format=tar.gz -o $DOCKERFOLDER/rita.tar.gz --prefix=althea_rs/ HEAD\npushd $DOCKERFOLDER\ntime docker build -t rita-test --build-arg NODES=$NODES .\n-time docker run --privileged -it rita-test\n+time docker run --name rita-test --privileged -it rita-test\nrm rita.tar.gz\npopd\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Add scale test script This patch adds a scale test script and some helpers to make it more practical to run
20,244
15.10.2020 10:08:09
14,400
323b24a237daa9dceaa11dbb215b8173070bfbd3
Improve Payment Validator logging Also fixes a few spelling mistakes in variable names and comments
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_client/operator_fee_manager/mod.rs", "new_path": "rita/src/rita_client/operator_fee_manager/mod.rs", "diff": "//! to compute the amount it should pay at a time, these micropayments have the effect of pro-rating\n//! the DAO fee amount and preventing the router from drastically making a large payment\n-use crate::rita_common::payment_controller::TRANSACTION_SUBMISSON_TIMEOUT;\n+use crate::rita_common::payment_controller::TRANSACTION_SUBMISSION_TIMEOUT;\nuse crate::rita_common::rita_loop::get_web3_server;\nuse crate::rita_common::simulated_txfee_manager::add_tx_to_total;\nuse crate::rita_common::usage_tracker::UpdatePayments;\n@@ -132,7 +132,7 @@ impl Handler<Tick> for OperatorFeeManager {\n};\nlet full_node = get_web3_server();\n- let web3 = Web3::new(&full_node, TRANSACTION_SUBMISSON_TIMEOUT);\n+ let web3 = Web3::new(&full_node, TRANSACTION_SUBMISSION_TIMEOUT);\nlet tx = Transaction {\nnonce,\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/payment_controller/mod.rs", "new_path": "rita/src/rita_common/payment_controller/mod.rs", "diff": "@@ -23,7 +23,7 @@ use std::time::Instant;\nuse tokio::net::TcpStream as TokioTcpStream;\nuse web30::client::Web3;\n-pub const TRANSACTION_SUBMISSON_TIMEOUT: Duration = Duration::from_secs(15);\n+pub const TRANSACTION_SUBMISSION_TIMEOUT: Duration = Duration::from_secs(15);\npub const MAX_TXID_RETRIES: u8 = 15u8;\npub struct PaymentController();\n@@ -76,7 +76,7 @@ fn make_payment(mut pmt: PaymentTx) -> Result<(), Error> {\nbalance, pmt.amount, our_address, pmt.to.eth_address, nonce\n);\nif balance < pmt.amount {\n- warn!(\"Not enough money to pay debts! Cutoff immenient\");\n+ warn!(\"Not enough money to pay debts! Cutoff imminent\");\nbail!(\"Not enough money!\")\n} else if pmt.amount == 0u32.into() {\nerror!(\"Trying to pay nothing!\");\n@@ -109,10 +109,10 @@ fn make_payment(mut pmt: PaymentTx) -> Result<(), Error> {\n};\nlet full_node = get_web3_server();\n- let web3 = Web3::new(&full_node, TRANSACTION_SUBMISSON_TIMEOUT);\n+ let web3 = Web3::new(&full_node, TRANSACTION_SUBMISSION_TIMEOUT);\nlet tx = Transaction {\n- nonce,\n+ nonce: nonce.clone(),\ngas_price,\ngas_limit: \"21000\".parse().unwrap(),\nto: pmt.to.eth_address,\n@@ -138,7 +138,10 @@ fn make_payment(mut pmt: PaymentTx) -> Result<(), Error> {\nOk(open_stream) => Either::A(transaction_status.then(move |transaction_outcome| {\nmatch transaction_outcome {\nOk(tx_id) => {\n- info!(\"Sending bw payment with txid: {:#066x}\", tx_id);\n+ info!(\n+ \"Sending bw payment with txid {:#066x} current balance: {:?}, payment of {:?}, from address {} to address {} with nonce {}\",\n+ tx_id, balance, pmt.amount, our_address, pmt.to.eth_address, nonce\n+ );\n// add published txid to submission\npmt.txid = Some(tx_id.clone());\nEither::A(\n@@ -147,7 +150,7 @@ fn make_payment(mut pmt: PaymentTx) -> Result<(), Error> {\n.json(&pmt)\n.expect(\"Failed to serialize payment!\")\n.send()\n- .timeout(TRANSACTION_SUBMISSON_TIMEOUT)\n+ .timeout(TRANSACTION_SUBMISSION_TIMEOUT)\n.then(move |neigh_ack| match neigh_ack {\nOk(msg) => {\ninfo!(\n@@ -179,7 +182,7 @@ fn make_payment(mut pmt: PaymentTx) -> Result<(), Error> {\nOk(()) as Result<(), ()>\n}\nErr(e) => {\n- warn!(\"Failed to notify our neighbor of payment {:?}\", e);\n+ warn!(\"Failed to notify our neighbor of payment {:?} txid: {:#066x}\", e, tx_id);\nPaymentController::from_registry().do_send(ResendTxid(ResendInfo{\ntxid: tx_id,\ncontact_socket,\n@@ -252,6 +255,10 @@ fn resend_txid(input: ResendInfo) {\n// at this point the chance of success is too tiny to be worth it\nif attempt > MAX_TXID_RETRIES {\n+ error!(\n+ \"We have failed to send txid {:#066x} this payment will remain uncredited!\",\n+ txid\n+ );\nreturn;\n}\n@@ -265,7 +272,7 @@ fn resend_txid(input: ResendInfo) {\n.json(&pmt)\n.expect(\"Failed to serialize payment!\")\n.send()\n- .timeout(TRANSACTION_SUBMISSON_TIMEOUT)\n+ .timeout(TRANSACTION_SUBMISSION_TIMEOUT)\n.then(move |neigh_ack| match neigh_ack {\nOk(msg) => {\nif !msg.status().is_success() {\n@@ -284,7 +291,10 @@ fn resend_txid(input: ResendInfo) {\nOk(()) as Result<(), ()>\n}\nErr(e) => {\n- warn!(\"Failed to notify our neighbor of payment {:?}\", e);\n+ warn!(\n+ \"Failed to notify our neighbor of payment attempt {} {:?}\",\n+ attempt, e\n+ );\nPaymentController::from_registry().do_send(ResendTxid(ResendInfo {\ntxid,\n@@ -299,8 +309,8 @@ fn resend_txid(input: ResendInfo) {\n),\nErr(e) => {\nwarn!(\n- \"Failed to connect to neighbor for bandwidth payment {:?}\",\n- e\n+ \"Failed to connect to neighbor for bandwidth payment txid: {:#066x} {:?}\",\n+ txid, e\n);\nPaymentController::from_registry().do_send(ResendTxid(ResendInfo {\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/payment_validator/mod.rs", "new_path": "rita/src/rita_common/payment_validator/mod.rs", "diff": "@@ -136,7 +136,7 @@ fn remove(msg: Remove, history: &mut PaymentValidator) {\n/// Marks a transaction as 'checked' in that we have talked to a full node about it\n/// if we fail to talk to a full node about a transaction for the full duration of\n-/// the timeout we will panic and restart.\n+/// the timeout we attempt to restart our node.\nfn checked(msg: ToValidate, history: &mut PaymentValidator) {\nif history.unvalidated_transactions.take(&msg).is_some() {\nlet mut checked_tx = msg;\n@@ -164,9 +164,9 @@ pub async fn validate() {\n);\nif !item.checked {\n- let msg = \"We failed to check txid {:#066x} against full nodes for the full duration of it's timeout period, please check full nodes\";\n+ let msg = format!(\"We failed to check txid {:#066x} against full nodes for the full duration of it's timeout period, please check full nodes\", item.payment.txid.clone().unwrap());\nerror!(\"{}\", msg);\n- panic!(msg)\n+ panic!(msg);\n}\nto_delete.push(item.clone());\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/simulated_txfee_manager/mod.rs", "new_path": "rita/src/rita_common/simulated_txfee_manager/mod.rs", "diff": "//! The maintainer fee is a fraction of all payments that is sent to the firmware maintainer\n-use crate::rita_common::payment_controller::TRANSACTION_SUBMISSON_TIMEOUT;\n+use crate::rita_common::payment_controller::TRANSACTION_SUBMISSION_TIMEOUT;\nuse crate::rita_common::rita_loop::get_web3_server;\nuse crate::rita_common::usage_tracker::update_payments;\nuse crate::SETTING;\n@@ -69,7 +69,7 @@ pub async fn tick_simulated_tx() {\n};\nlet full_node = get_web3_server();\n- let web3 = Web3::new(&full_node, TRANSACTION_SUBMISSON_TIMEOUT);\n+ let web3 = Web3::new(&full_node, TRANSACTION_SUBMISSION_TIMEOUT);\nlet tx = Transaction {\nnonce,\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Improve Payment Validator logging Also fixes a few spelling mistakes in variable names and comments
20,244
15.10.2020 10:43:42
14,400
0f6f948321d4fdfb1f853c260285d16303d2f285
Add fast-crash protection to Rita fast and slow loop This is similar to the protection provided by the Rita exit loop fast crash protection. When the loop is crashing on every iteration or just generally too often it's best to exit and hope we can recover after a full restart
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_common/payment_validator/mod.rs", "new_path": "rita/src/rita_common/payment_validator/mod.rs", "diff": "@@ -166,6 +166,8 @@ pub async fn validate() {\nif !item.checked {\nlet msg = format!(\"We failed to check txid {:#066x} against full nodes for the full duration of it's timeout period, please check full nodes\", item.payment.txid.clone().unwrap());\nerror!(\"{}\", msg);\n+ // drop history here to avoid poisoning the lock\n+ drop(history);\npanic!(msg);\n}\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/rita_loop/fast_loop.rs", "new_path": "rita/src/rita_common/rita_loop/fast_loop.rs", "diff": "@@ -14,7 +14,7 @@ use crate::KI;\nuse crate::SETTING;\nuse actix::{\nActor, ActorContext, Addr, Arbiter, AsyncContext, Context, Handler, Message, Supervised,\n- SystemService,\n+ System, SystemService,\n};\nuse actix_async::Arbiter as AsyncArbiter;\nuse actix_async::System as AsyncSystem;\n@@ -242,6 +242,10 @@ impl Handler<Tick> for RitaFastLoop {\n/// runs as a thread with async/await support and one that runs as a actor using old futures\n/// slowly things will be migrated into this new sync loop as we move to async/await\npub fn start_rita_fast_loop() {\n+ let mut last_restart = Instant::now();\n+ // this is a reference to the non-async actix system since this can bring down the whole process\n+ let system = System::current();\n+ // outer thread is a watchdog inner thread is the runner\nthread::spawn(move || {\n// this will always be an error, so it's really just a loop statement\n// with some fancy destructuring\n@@ -276,6 +280,11 @@ pub fn start_rita_fast_loop() {\n.join()\n} {\nerror!(\"Rita common fast loop thread paniced! Respawning {:?}\", e);\n+ if Instant::now() - last_restart < Duration::from_secs(60) {\n+ error!(\"Restarting too quickly, leaving it to auto rescue!\");\n+ system.stop_with_code(121)\n+ }\n+ last_restart = Instant::now();\n}\n});\n}\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/rita_loop/slow_loop.rs", "new_path": "rita/src/rita_common/rita_loop/slow_loop.rs", "diff": "@@ -19,6 +19,8 @@ pub const SLOW_LOOP_SPEED: Duration = Duration::from_secs(60);\npub const SLOW_LOOP_TIMEOUT: Duration = Duration::from_secs(15);\npub fn start_rita_slow_loop() {\n+ let system = System::current();\n+ let mut last_restart = Instant::now();\nthread::spawn(move || {\n// this will always be an error, so it's really just a loop statement\n// with some fancy destructuring\n@@ -52,7 +54,12 @@ pub fn start_rita_slow_loop() {\n})\n.join()\n} {\n- error!(\"Rita common slow loop thread paniced! Respawning {:?}\", e);\n+ error!(\"Rita common slow loop thread panicked! Respawning {:?}\", e);\n+ if Instant::now() - last_restart < Duration::from_secs(120) {\n+ error!(\"Restarting too quickly, leaving it to auto rescue!\");\n+ system.stop_with_code(121)\n+ }\n+ last_restart = Instant::now();\n}\n});\n}\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_exit/rita_loop/mod.rs", "new_path": "rita/src/rita_exit/rita_loop/mod.rs", "diff": "@@ -55,8 +55,9 @@ pub const EXIT_LOOP_TIMEOUT: Duration = Duration::from_secs(4);\n/// TODO remove futures on the non http endpoint / actix parts of this\n/// TODO remove futures on the actix parts of this by moving to thread local state\npub fn start_rita_exit_loop() {\n- let system = System::current();\nsetup_exit_wg_tunnel();\n+ // this is a reference to the non-async actix system\n+ let system = System::current();\nlet mut last_restart = Instant::now();\n// outer thread is a watchdog, inner thread is the runner\nthread::spawn(move || {\n@@ -90,7 +91,7 @@ pub fn start_rita_exit_loop() {\n})\n.join()\n} {\n- error!(\"Exit loop thread paniced! Respawning {:?}\", e);\n+ error!(\"Exit loop thread panicked! Respawning {:?}\", e);\nif Instant::now() - last_restart < Duration::from_secs(60) {\nerror!(\"Restarting too quickly, leaving it to systemd!\");\nsystem.stop_with_code(121)\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Add fast-crash protection to Rita fast and slow loop This is similar to the protection provided by the Rita exit loop fast crash protection. When the loop is crashing on every iteration or just generally too often it's best to exit and hope we can recover after a full restart
20,244
15.10.2020 15:58:08
14,400
9fa3d86a779ac239549be77f28e7b6cfa17a63c9
Fix slow loop execution problems I was trying to run Async functions in a pre-async actix system. This patch just disambiguates the names.
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_common/rita_loop/slow_loop.rs", "new_path": "rita/src/rita_common/rita_loop/slow_loop.rs", "diff": "@@ -3,7 +3,8 @@ use crate::rita_common::token_bridge::tick_token_bridge;\nuse crate::rita_common::utils::wait_timeout::wait_timeout;\nuse crate::rita_common::utils::wait_timeout::WaitResult;\nuse crate::SETTING;\n-use actix_async::{Arbiter, System};\n+use actix::System;\n+use actix_async::{Arbiter, System as AsyncSystem};\nuse babel_monitor::open_babel_stream;\nuse babel_monitor::set_local_fee;\nuse babel_monitor::set_metric_factor;\n@@ -29,12 +30,12 @@ pub fn start_rita_slow_loop() {\nlet start = Instant::now();\ninfo!(\"Common Slow tick!\");\n- let res = System::run(move || {\n+ let res = AsyncSystem::run(move || {\nArbiter::spawn(async move {\ntick_token_bridge().await;\ntick_simulated_tx().await;\ninfo!(\"Common Slow tick async completed!\");\n- System::current().stop();\n+ AsyncSystem::current().stop();\n});\n});\nif res.is_err() {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Fix slow loop execution problems I was trying to run Async functions in a pre-async actix system. This patch just disambiguates the names.
20,244
15.10.2020 17:02:47
14,400
d148b6d992b3ac9b631f5960b322aa3497dfe9b0
Update for Beta 16 RC4
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "@@ -3221,7 +3221,7 @@ dependencies = [\n[[package]]\nname = \"rita\"\n-version = \"0.5.63\"\n+version = \"0.5.64\"\ndependencies = [\n\"actix 0.10.0\",\n\"actix 0.7.11\",\n" }, { "change_type": "MODIFY", "old_path": "rita/Cargo.toml", "new_path": "rita/Cargo.toml", "diff": "[package]\nname = \"rita\"\n-version = \"0.5.63\"\n+version = \"0.5.64\"\nauthors = [\"Justin <justin@althea.net>\", \"Jehan <jehan.tremback@gmail.com>\", \"Ben <wangben3@gmail.com>\"]\nbuild = \"build.rs\"\nedition = \"2018\"\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/dashboard/own_info.rs", "new_path": "rita/src/rita_common/dashboard/own_info.rs", "diff": "@@ -7,7 +7,7 @@ use failure::Error;\nuse num256::{Int256, Uint256};\nuse settings::RitaCommonSettings;\n-pub static READABLE_VERSION: &str = \"Beta 16 RC3\";\n+pub static READABLE_VERSION: &str = \"Beta 16 RC4\";\n#[derive(Serialize)]\npub struct OwnInfo {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Update for Beta 16 RC4
20,244
17.10.2020 21:32:19
14,400
46a33e8782f6b2d575fe164bbdd6374fce85c5e9
Fix spelling of SAVE_FREQUENCY
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_common/debt_keeper/mod.rs", "new_path": "rita/src/rita_common/debt_keeper/mod.rs", "diff": "@@ -36,7 +36,7 @@ use std::time::Duration;\nuse std::time::Instant;\n/// How often we save the nodes debt data, currently 30 minutes\n-const SAVE_FREQENCY: Duration = Duration::from_secs(1800);\n+const SAVE_FREQUENCY: Duration = Duration::from_secs(1800);\nlazy_static! {\n/// A locked global ref containing the state for this module. Note that the default implementation\n@@ -328,7 +328,7 @@ impl DebtKeeper {\nfn save_if_needed(&mut self) {\nmatch self.last_save {\nSome(val) => {\n- if Instant::now() - val > SAVE_FREQENCY {\n+ if Instant::now() - val > SAVE_FREQUENCY {\nif let Err(e) = self.save() {\nerror!(\"Failed to save debts {:?}\", e);\n} else {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Fix spelling of SAVE_FREQUENCY
20,244
18.10.2020 09:02:15
14,400
96cd5673a26e5467b88ef4c4e3ecd6c626242ada
Bump for Beta 16 RC5
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "@@ -3221,7 +3221,7 @@ dependencies = [\n[[package]]\nname = \"rita\"\n-version = \"0.5.64\"\n+version = \"0.5.65\"\ndependencies = [\n\"actix 0.10.0\",\n\"actix 0.7.11\",\n" }, { "change_type": "MODIFY", "old_path": "rita/Cargo.toml", "new_path": "rita/Cargo.toml", "diff": "[package]\nname = \"rita\"\n-version = \"0.5.64\"\n+version = \"0.5.65\"\nauthors = [\"Justin <justin@althea.net>\", \"Jehan <jehan.tremback@gmail.com>\", \"Ben <wangben3@gmail.com>\"]\nbuild = \"build.rs\"\nedition = \"2018\"\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/dashboard/own_info.rs", "new_path": "rita/src/rita_common/dashboard/own_info.rs", "diff": "@@ -7,7 +7,7 @@ use failure::Error;\nuse num256::{Int256, Uint256};\nuse settings::RitaCommonSettings;\n-pub static READABLE_VERSION: &str = \"Beta 16 RC4\";\n+pub static READABLE_VERSION: &str = \"Beta 16 RC5\";\n#[derive(Serialize)]\npub struct OwnInfo {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Bump for Beta 16 RC5
20,244
18.10.2020 13:56:00
14,400
3b64a28759ed497002502d033fccae168ecc0407
Fix flipped conditional on handshake time check Good thing I double checked this.
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_common/tunnel_manager/gc.rs", "new_path": "rita/src/rita_common/tunnel_manager/gc.rs", "diff": "@@ -155,7 +155,7 @@ fn tunnel_should_be_kept(\n// for the next gc round in that case.\nif let (Some(since_created), Some(since_last_contact)) = (since_created, since_last_contact) {\nlet handshake_timeout =\n- check_handshake_time(msg.tunnel_handshake_timeout, &tunnel.iface_name);\n+ !check_handshake_time(msg.tunnel_handshake_timeout, &tunnel.iface_name);\nlet created_recently = since_created < msg.tunnel_timeout;\nlet tunnel_up = tunnel_up(&interfaces, &tunnel.iface_name);\nlet contact_timeout = since_last_contact > msg.tunnel_timeout;\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Fix flipped conditional on handshake time check Good thing I double checked this.
20,244
18.10.2020 13:57:02
14,400
8f8f399acd633a482f6b6acd95c9c490e3031721
Bump for Beta 16 RC6
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "@@ -3221,7 +3221,7 @@ dependencies = [\n[[package]]\nname = \"rita\"\n-version = \"0.5.65\"\n+version = \"0.5.66\"\ndependencies = [\n\"actix 0.10.0\",\n\"actix 0.7.11\",\n" }, { "change_type": "MODIFY", "old_path": "rita/Cargo.toml", "new_path": "rita/Cargo.toml", "diff": "[package]\nname = \"rita\"\n-version = \"0.5.65\"\n+version = \"0.5.66\"\nauthors = [\"Justin <justin@althea.net>\", \"Jehan <jehan.tremback@gmail.com>\", \"Ben <wangben3@gmail.com>\"]\nbuild = \"build.rs\"\nedition = \"2018\"\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/dashboard/own_info.rs", "new_path": "rita/src/rita_common/dashboard/own_info.rs", "diff": "@@ -7,7 +7,7 @@ use failure::Error;\nuse num256::{Int256, Uint256};\nuse settings::RitaCommonSettings;\n-pub static READABLE_VERSION: &str = \"Beta 16 RC5\";\n+pub static READABLE_VERSION: &str = \"Beta 16 RC6\";\n#[derive(Serialize)]\npub struct OwnInfo {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Bump for Beta 16 RC6
20,244
03.11.2020 20:26:29
18,000
fa3b57203553d901e7ac701727aac134baff89c3
Bump for Beta 16 RC7
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "@@ -3221,7 +3221,7 @@ dependencies = [\n[[package]]\nname = \"rita\"\n-version = \"0.5.66\"\n+version = \"0.5.67\"\ndependencies = [\n\"actix 0.10.0\",\n\"actix 0.7.11\",\n" }, { "change_type": "MODIFY", "old_path": "rita/Cargo.toml", "new_path": "rita/Cargo.toml", "diff": "[package]\nname = \"rita\"\n-version = \"0.5.66\"\n+version = \"0.5.67\"\nauthors = [\"Justin <justin@althea.net>\", \"Jehan <jehan.tremback@gmail.com>\", \"Ben <wangben3@gmail.com>\"]\nbuild = \"build.rs\"\nedition = \"2018\"\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/dashboard/own_info.rs", "new_path": "rita/src/rita_common/dashboard/own_info.rs", "diff": "@@ -7,7 +7,7 @@ use failure::Error;\nuse num256::{Int256, Uint256};\nuse settings::RitaCommonSettings;\n-pub static READABLE_VERSION: &str = \"Beta 16 RC6\";\n+pub static READABLE_VERSION: &str = \"Beta 16 RC7\";\n#[derive(Serialize)]\npub struct OwnInfo {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Bump for Beta 16 RC7
20,244
31.12.2020 09:37:10
18,000
6cb0d7875336231b47b45db2abcac986bb738c1f
Update Clarity and num256 This updates Clarity and num256 across the board pulling in a very small patch to pre-async web30 that updates these same dependencies over there.
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "@@ -483,10 +483,10 @@ dependencies = [\n\"arrayvec\",\n\"babel_monitor\",\n\"base64 0.13.0\",\n- \"clarity 0.1.27\",\n+ \"clarity 0.4.2\",\n\"hex\",\n\"lettre\",\n- \"num256 0.2.12\",\n+ \"num256 0.3.0\",\n\"phonenumber\",\n\"rand 0.4.6\",\n\"serde 1.0.116\",\n@@ -837,6 +837,12 @@ version = \"0.5.6\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38\"\n+[[package]]\n+name = \"bytes\"\n+version = \"1.0.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"ad1f8e949d755f9d79112b5bb46938e0ef9d3804a0b16dfab13aafcaa5f0fa72\"\n+\n[[package]]\nname = \"bytestring\"\nversion = \"0.1.5\"\n@@ -939,7 +945,7 @@ version = \"0.0.1\"\ndependencies = [\n\"althea_kernel_interface\",\n\"althea_types\",\n- \"clarity 0.1.27\",\n+ \"clarity 0.4.2\",\n\"env_logger\",\n\"failure\",\n\"ipgen\",\n@@ -1591,12 +1597,6 @@ dependencies = [\n\"futures 0.1.30\",\n]\n-[[package]]\n-name = \"futures-timer\"\n-version = \"3.0.2\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c\"\n-\n[[package]]\nname = \"futures-util\"\nversion = \"0.3.6\"\n@@ -3320,7 +3320,7 @@ dependencies = [\n\"babel_monitor\",\n\"byteorder\",\n\"bytes 0.5.6\",\n- \"clarity 0.1.27\",\n+ \"clarity 0.4.2\",\n\"clu\",\n\"compressed_log\",\n\"config\",\n@@ -3345,7 +3345,7 @@ dependencies = [\n\"mockito\",\n\"mockstream\",\n\"num-traits 0.2.12\",\n- \"num256 0.2.12\",\n+ \"num256 0.3.0\",\n\"openssl\",\n\"openssl-probe\",\n\"phonenumber\",\n@@ -3363,8 +3363,8 @@ dependencies = [\n\"tokio-codec\",\n\"tokio-io\",\n\"trust-dns-resolver 0.10.3\",\n+ \"web30 0.10.2\",\n\"web30 0.4.3\",\n- \"web30 0.6.1\",\n]\n[[package]]\n@@ -3618,12 +3618,12 @@ dependencies = [\n\"althea_types\",\n\"arrayvec\",\n\"auto-bridge\",\n- \"clarity 0.1.27\",\n+ \"clarity 0.4.2\",\n\"config\",\n\"failure\",\n\"lazy_static\",\n\"log\",\n- \"num256 0.2.12\",\n+ \"num256 0.3.0\",\n\"owning_ref\",\n\"phonenumber\",\n\"serde 1.0.116\",\n@@ -4645,46 +4645,24 @@ dependencies = [\n[[package]]\nname = \"web30\"\nversion = \"0.4.3\"\n-source = \"git+https://github.com/althea-net/web30?rev=4002ac7deca2e7ecbda76676705fcfcf29669b3e#4002ac7deca2e7ecbda76676705fcfcf29669b3e\"\n+source = \"git+https://github.com/althea-net/web30?rev=a600b8b8ebf2c49badee6b65ac90a56bbdad4ab9#a600b8b8ebf2c49badee6b65ac90a56bbdad4ab9\"\ndependencies = [\n\"actix 0.7.11\",\n\"actix-web 0.7.19\",\n\"assert-json-diff\",\n- \"bytes 0.4.12\",\n- \"clarity 0.1.27\",\n+ \"bytes 1.0.0\",\n+ \"clarity 0.4.2\",\n\"failure\",\n\"futures 0.1.30\",\n- \"futures-timer 0.1.1\",\n+ \"futures-timer\",\n\"log\",\n- \"num256 0.2.12\",\n+ \"num256 0.3.0\",\n\"serde 1.0.116\",\n\"serde_derive\",\n\"serde_json\",\n\"tokio 0.1.22\",\n]\n-[[package]]\n-name = \"web30\"\n-version = \"0.6.1\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"d511f2f203b133aaeee2142d191fcb85e9fb7537fed0868ae5a1da450b53bca5\"\n-dependencies = [\n- \"actix 0.10.0\",\n- \"actix-web 3.1.0\",\n- \"assert-json-diff\",\n- \"bytes 0.5.6\",\n- \"clarity 0.1.27\",\n- \"failure\",\n- \"futures 0.3.6\",\n- \"futures-timer 3.0.2\",\n- \"log\",\n- \"num256 0.2.12\",\n- \"serde 1.0.116\",\n- \"serde_derive\",\n- \"serde_json\",\n- \"tokio 0.2.22\",\n-]\n-\n[[package]]\nname = \"web30\"\nversion = \"0.10.2\"\n" }, { "change_type": "MODIFY", "old_path": "althea_types/Cargo.toml", "new_path": "althea_types/Cargo.toml", "diff": "@@ -8,7 +8,7 @@ license = \"Apache-2.0\"\n[dependencies]\nbabel_monitor = { path = \"../babel_monitor\" }\n-num256 = \"0.2\"\n+num256 = \"0.3\"\nbase64 = \"0.13\"\nserde_derive = \"1.0\"\nserde = \"1.0\"\n@@ -16,7 +16,7 @@ serde_json = \"1.0\"\nhex = \"0.4\"\nsodiumoxide = \"0.2\"\nactix = { version = \"0.7\", optional = true}\n-clarity = \"0.1\"\n+clarity = \"0.4\"\narrayvec = {version= \"0.5\", features = [\"serde\"]}\nphonenumber = \"0.3\"\nlettre = {version = \"0.9\", features = [\"serde\"]}\n" }, { "change_type": "MODIFY", "old_path": "clu/Cargo.toml", "new_path": "clu/Cargo.toml", "diff": "@@ -17,7 +17,7 @@ rand = \"0.7\"\nserde = \"1.0\"\nserde_derive = \"1.0\"\nserde_json = \"1.0\"\n-clarity = \"0.1\"\n+clarity = \"0.4\"\nsodiumoxide = \"0.2\"\n[dependencies.regex]\n" }, { "change_type": "MODIFY", "old_path": "rita/Cargo.toml", "new_path": "rita/Cargo.toml", "diff": "@@ -19,17 +19,17 @@ althea_types = { path = \"../althea_types\", features = [\"actix\"]}\nbabel_monitor = { path = \"../babel_monitor\" }\nclu = { path = \"../clu\" }\nexit_db = { path = \"../exit_db\" }\n-num256 = \"0.2\"\n+num256 = \"0.3\"\nsettings = { path = \"../settings\" }\nantenna_forwarding_client = {path = \"../antenna_forwarding_client\"}\nauto-bridge = {path = \"../auto_bridge\"}\nactix-web-httpauth = {git = \"https://github.com/althea-net/actix-web-httpauth\"}\n-clarity = \"0.1\"\n-web30 = {git = \"https://github.com/althea-net/web30\", rev = \"4002ac7deca2e7ecbda76676705fcfcf29669b3e\"}\n+clarity = \"0.4\"\n+web30 = {git = \"https://github.com/althea-net/web30\", rev = \"a600b8b8ebf2c49badee6b65ac90a56bbdad4ab9\"}\n# duplicate async dependencies, we are currently carrying both futures 0.1 and modern async/await dependencies\n# these will be kept here for quite some time until the switch is completed.\n-async-web30 = {package=\"web30\", version = \"0.6.1\"}\n+async-web30 = {package=\"web30\", version = \"0.10\"}\nactix-async = {package=\"actix\", version = \"0.10\"}\nactix-web-async = {package=\"actix-web\", version = \"3.0\", default_features = false, features= [\"openssl\"] }\n" }, { "change_type": "MODIFY", "old_path": "settings/Cargo.toml", "new_path": "settings/Cargo.toml", "diff": "@@ -9,7 +9,7 @@ config = \"0.10\"\nalthea_types = { path = \"../althea_types\", features = [\"actix\"]}\nalthea_kernel_interface = { path = \"../althea_kernel_interface\" }\nauto-bridge = { path = \"../auto_bridge\" }\n-num256 = \"0.2\"\n+num256 = \"0.3\"\nserde = \"1.0\"\nserde_derive = \"1.0\"\nserde_json = \"1.0\"\n@@ -18,6 +18,6 @@ log = \"0.4\"\nfailure = \"0.1\"\nowning_ref = \"0.4\"\nlazy_static = \"1.4\"\n-clarity = \"0.1\"\n+clarity = \"0.4\"\narrayvec = {version= \"0.5\", features = [\"serde\"]}\nphonenumber = \"0.3\"\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Update Clarity and num256 This updates Clarity and num256 across the board pulling in a very small patch to pre-async web30 that updates these same dependencies over there.
20,244
31.12.2020 09:51:02
18,000
4988686922224d8089b0622e8f1632464dc61abe
Fix compile problems from new Clarity/num256
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_common/blockchain_oracle/mod.rs", "new_path": "rita/src/rita_common/blockchain_oracle/mod.rs", "diff": "@@ -143,22 +143,17 @@ fn update_balance(\n/// a different network than the one we are actually using. For example an address\n/// that contains both real eth and test eth may be tricked into singing a transaction\n/// for real eth while operating on the testnet. Because of this we have warnings behavior\n-fn update_net_version(full_node: &str, net_version: &mut Option<u64>, new_net_version: String) {\n+fn update_net_version(full_node: &str, net_version: &mut Option<u64>, new_net_version: u64) {\ninfo!(\n\"Got response from {} for net_version request {:?}\",\nfull_node, new_net_version\n);\n- match new_net_version.parse::<u64>() {\n- Ok(net_id_num) => {\n- // we could just take the first value and keept it but for now\n+ // we could just take the first value and kept it but for now\n// lets check that all nodes always agree on net version constantly\n- if net_version.is_some() && net_version.unwrap() != net_id_num {\n+ if net_version.is_some() && net_version.unwrap() != new_net_version {\nerror!(\"GOT A DIFFERENT NETWORK ID VALUE, IT IS CRITICAL THAT YOU REVIEW YOUR NODE LIST FOR HOSTILE/MISCONFIGURED NODES\");\n} else if net_version.is_none() {\n- *net_version = Some(net_id_num);\n- }\n- }\n- Err(e) => warn!(\"Failed to parse ETH network ID {:?}\", e),\n+ *net_version = Some(new_net_version);\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/token_bridge/mod.rs", "new_path": "rita/src/rita_common/token_bridge/mod.rs", "diff": "use crate::SETTING;\nuse althea_types::SystemChain;\nuse async_web30::types::SendTxOption;\n-use auto_bridge::TokenBridge as TokenBridgeCore;\nuse auto_bridge::ERC20_GAS_LIMIT;\nuse auto_bridge::ETH_TRANSACTION_GAS_LIMIT;\nuse auto_bridge::UNISWAP_GAS_LIMIT;\n+use auto_bridge::{TokenBridge as TokenBridgeCore, TokenBridgeError};\nuse clarity::Address;\nuse failure::Error;\nuse num256::Uint256;\n@@ -72,8 +72,8 @@ lazy_static! {\n/// they pause the movement of ETH -> DAI -> XDAI that is normal in the\n/// system. Otherwise the normal process will be attempted indefinitely\nconst WITHDRAW_TIMEOUT: Duration = Duration::from_secs(3600 * 6);\n-pub const ETH_TRANSFER_TIMEOUT: u64 = 600u64;\n-const UNISWAP_TIMEOUT: u64 = ETH_TRANSFER_TIMEOUT;\n+pub const ETH_TRANSFER_TIMEOUT: Duration = Duration::from_secs(600);\n+const UNISWAP_TIMEOUT: Duration = ETH_TRANSFER_TIMEOUT;\nfn withdraw_is_timed_out(started: Instant) -> bool {\nInstant::now() - started > WITHDRAW_TIMEOUT\n@@ -199,7 +199,7 @@ async fn rescue_dai(\nbridge: TokenBridgeCore,\nour_address: Address,\nminimum_stranded_dai_transfer: Uint256,\n-) -> Result<(), Error> {\n+) -> Result<(), TokenBridgeError> {\nlet dai_balance = bridge.get_dai_balance(our_address).await?;\ninfo!(\"Our DAI balance is {}\", dai_balance);\nif dai_balance > minimum_stranded_dai_transfer {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Fix compile problems from new Clarity/num256
20,244
31.12.2020 10:03:13
18,000
1352d7d55a2285ce7635f0939c0fe377beae8a19
External dependency updates This patch updates external dependencies that aren't Actix based. Just a lot of minor updates with some very minor code changes to go with them. We also introduce one new test to double check that ip address generation has not changed.
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "@@ -461,7 +461,7 @@ name = \"althea_kernel_interface\"\nversion = \"0.1.0\"\ndependencies = [\n\"althea_types\",\n- \"itertools\",\n+ \"itertools 0.10.0\",\n\"lazy_static\",\n\"log\",\n\"oping\",\n@@ -483,12 +483,12 @@ dependencies = [\n\"arrayvec\",\n\"babel_monitor\",\n\"base64 0.13.0\",\n- \"clarity 0.4.2\",\n+ \"clarity\",\n\"hex\",\n\"lettre\",\n- \"num256 0.3.0\",\n+ \"num256\",\n\"phonenumber\",\n- \"rand 0.4.6\",\n+ \"rand 0.8.0\",\n\"serde 1.0.116\",\n\"serde_derive\",\n\"serde_json\",\n@@ -508,7 +508,7 @@ dependencies = [\n\"lazy_static\",\n\"log\",\n\"oping\",\n- \"rand 0.7.3\",\n+ \"rand 0.8.0\",\n\"serde 1.0.116\",\n\"serde_json\",\n\"sodiumoxide\",\n@@ -519,11 +519,11 @@ name = \"antenna_forwarding_protocol\"\nversion = \"0.1.0\"\ndependencies = [\n\"althea_types\",\n- \"clarity 0.1.27\",\n+ \"clarity\",\n\"failure\",\n\"lazy_static\",\n\"log\",\n- \"rand 0.7.3\",\n+ \"rand 0.8.0\",\n\"serde 1.0.116\",\n\"serde_derive\",\n\"serde_json\",\n@@ -595,11 +595,11 @@ name = \"auto-bridge\"\nversion = \"0.1.5\"\ndependencies = [\n\"actix 0.10.0\",\n- \"clarity 0.4.2\",\n+ \"clarity\",\n\"futures 0.3.6\",\n\"log\",\n\"num 0.3.0\",\n- \"num256 0.3.0\",\n+ \"num256\",\n\"rand 0.8.0\",\n\"serde 1.0.116\",\n\"serde_derive\",\n@@ -809,12 +809,6 @@ version = \"0.3.1\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7\"\n-[[package]]\n-name = \"bytecount\"\n-version = \"0.6.0\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"b0017894339f586ccb943b01b9555de56770c11cda818e7e3d8bd93f4ed7f46e\"\n-\n[[package]]\nname = \"byteorder\"\nversion = \"1.3.4\"\n@@ -883,26 +877,6 @@ dependencies = [\n\"winapi 0.3.9\",\n]\n-[[package]]\n-name = \"clarity\"\n-version = \"0.1.27\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"8afca7131e4f0628a9d42be94895bdb7cea4ba5249832d6f2cc80ed11fd901a0\"\n-dependencies = [\n- \"bytecount\",\n- \"failure\",\n- \"lazy_static\",\n- \"num-bigint 0.3.0\",\n- \"num-traits 0.2.12\",\n- \"num256 0.2.12\",\n- \"secp256k1\",\n- \"serde 1.0.116\",\n- \"serde-rlp\",\n- \"serde_bytes\",\n- \"serde_derive\",\n- \"sha3\",\n-]\n-\n[[package]]\nname = \"clarity\"\nversion = \"0.4.2\"\n@@ -912,7 +886,7 @@ dependencies = [\n\"lazy_static\",\n\"num-bigint 0.3.0\",\n\"num-traits 0.2.12\",\n- \"num256 0.3.0\",\n+ \"num256\",\n\"secp256k1\",\n\"serde 1.0.116\",\n\"serde-rlp\",\n@@ -945,13 +919,13 @@ version = \"0.0.1\"\ndependencies = [\n\"althea_kernel_interface\",\n\"althea_types\",\n- \"clarity 0.4.2\",\n+ \"clarity\",\n\"env_logger\",\n\"failure\",\n\"ipgen\",\n\"lazy_static\",\n\"log\",\n- \"rand 0.7.3\",\n+ \"rand 0.8.0\",\n\"regex\",\n\"serde 1.0.116\",\n\"serde_derive\",\n@@ -1344,9 +1318,9 @@ dependencies = [\n[[package]]\nname = \"env_logger\"\n-version = \"0.7.1\"\n+version = \"0.8.2\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36\"\n+checksum = \"f26ecb66b4bdca6c1409b40fb255eefc2bd4f6d135dab3c3124f80ffa2a9661e\"\ndependencies = [\n\"atty\",\n\"humantime\",\n@@ -1856,12 +1830,9 @@ checksum = \"494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47\"\n[[package]]\nname = \"humantime\"\n-version = \"1.3.0\"\n+version = \"2.0.1\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f\"\n-dependencies = [\n- \"quick-error 1.2.3\",\n-]\n+checksum = \"3c1ad908cc71012b7bea4d0c53ba96a8cba9962f048fa68d143376143d863b7a\"\n[[package]]\nname = \"hyper\"\n@@ -2015,6 +1986,15 @@ dependencies = [\n\"either\",\n]\n+[[package]]\n+name = \"itertools\"\n+version = \"0.10.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"37d572918e350e82412fe766d24b15e6682fb2ed2bbe018280caa810397cb319\"\n+dependencies = [\n+ \"either\",\n+]\n+\n[[package]]\nname = \"itoa\"\nversion = \"0.4.6\"\n@@ -2324,9 +2304,9 @@ dependencies = [\n[[package]]\nname = \"mockito\"\n-version = \"0.27.0\"\n+version = \"0.28.0\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"3a634720d366bcbce30fb05871a35da229cef101ad0b2ea4e46cf5abf031a273\"\n+checksum = \"36a0eb7e686b49b02c1cb87c14b8e2a05de0d36c6eee0293653d0a875906d499\"\ndependencies = [\n\"assert-json-diff\",\n\"colored\",\n@@ -2540,21 +2520,6 @@ dependencies = [\n\"autocfg 1.0.1\",\n]\n-[[package]]\n-name = \"num256\"\n-version = \"0.2.12\"\n-source = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"e770d88920fe93e91fcb7a171d68053de7000f220f2bda7ae1bb07fae871907a\"\n-dependencies = [\n- \"failure\",\n- \"lazy_static\",\n- \"num 0.2.1\",\n- \"num-derive\",\n- \"num-traits 0.2.12\",\n- \"serde 1.0.116\",\n- \"serde_derive\",\n-]\n-\n[[package]]\nname = \"num256\"\nversion = \"0.3.0\"\n@@ -2811,7 +2776,7 @@ dependencies = [\n\"bincode\",\n\"either\",\n\"fnv\",\n- \"itertools\",\n+ \"itertools 0.9.0\",\n\"lazy_static\",\n\"nom 5.1.2\",\n\"quick-xml\",\n@@ -3219,9 +3184,9 @@ checksum = \"41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce\"\n[[package]]\nname = \"regex\"\n-version = \"1.3.9\"\n+version = \"1.4.2\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6\"\n+checksum = \"38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c\"\ndependencies = [\n\"aho-corasick\",\n\"memchr\",\n@@ -3243,9 +3208,9 @@ dependencies = [\n[[package]]\nname = \"regex-syntax\"\n-version = \"0.6.18\"\n+version = \"0.6.21\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8\"\n+checksum = \"3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189\"\n[[package]]\nname = \"remove_dir_all\"\n@@ -3319,8 +3284,8 @@ dependencies = [\n\"auto-bridge\",\n\"babel_monitor\",\n\"byteorder\",\n- \"bytes 0.5.6\",\n- \"clarity 0.4.2\",\n+ \"bytes 1.0.0\",\n+ \"clarity\",\n\"clu\",\n\"compressed_log\",\n\"config\",\n@@ -3345,12 +3310,12 @@ dependencies = [\n\"mockito\",\n\"mockstream\",\n\"num-traits 0.2.12\",\n- \"num256 0.3.0\",\n+ \"num256\",\n\"openssl\",\n\"openssl-probe\",\n\"phonenumber\",\n\"r2d2\",\n- \"rand 0.7.3\",\n+ \"rand 0.8.0\",\n\"regex\",\n\"reqwest\",\n\"serde 1.0.116\",\n@@ -3618,12 +3583,12 @@ dependencies = [\n\"althea_types\",\n\"arrayvec\",\n\"auto-bridge\",\n- \"clarity 0.4.2\",\n+ \"clarity\",\n\"config\",\n\"failure\",\n\"lazy_static\",\n\"log\",\n- \"num256 0.3.0\",\n+ \"num256\",\n\"owning_ref\",\n\"phonenumber\",\n\"serde 1.0.116\",\n@@ -4651,12 +4616,12 @@ dependencies = [\n\"actix-web 0.7.19\",\n\"assert-json-diff\",\n\"bytes 1.0.0\",\n- \"clarity 0.4.2\",\n+ \"clarity\",\n\"failure\",\n\"futures 0.1.30\",\n\"futures-timer\",\n\"log\",\n- \"num256 0.3.0\",\n+ \"num256\",\n\"serde 1.0.116\",\n\"serde_derive\",\n\"serde_json\",\n@@ -4671,11 +4636,11 @@ checksum = \"e1492467879d37c07f4d94a2398a957693b1808e32eb077d6c64a3c2f720bcc7\"\ndependencies = [\n\"actix 0.10.0\",\n\"actix-web 3.1.0\",\n- \"clarity 0.4.2\",\n+ \"clarity\",\n\"futures 0.3.6\",\n\"log\",\n\"num 0.3.0\",\n- \"num256 0.3.0\",\n+ \"num256\",\n\"serde 1.0.116\",\n\"serde_derive\",\n\"serde_json\",\n" }, { "change_type": "MODIFY", "old_path": "althea_kernel_interface/Cargo.toml", "new_path": "althea_kernel_interface/Cargo.toml", "diff": "@@ -8,12 +8,12 @@ edition = \"2018\"\n[dependencies]\noping = \"0.3\"\n-itertools = \"0.9\"\n+itertools = \"0.10\"\nlazy_static = \"1.4\"\nlog = \"0.4\"\nalthea_types = { path = \"../althea_types\" }\n[dependencies.regex]\n-version = \"1.3\"\n+version = \"1.4\"\ndefault-features = false\nfeatures = [\"std\"]\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "althea_types/Cargo.toml", "new_path": "althea_types/Cargo.toml", "diff": "@@ -22,5 +22,5 @@ phonenumber = \"0.3\"\nlettre = {version = \"0.9\", features = [\"serde\"]}\n[dev-dependencies]\n-rand = \"0.4\"\n+rand = \"0.8\"\n" }, { "change_type": "MODIFY", "old_path": "antenna_forwarding_client/Cargo.toml", "new_path": "antenna_forwarding_client/Cargo.toml", "diff": "@@ -5,7 +5,7 @@ authors = [\"Justin Kilpatrick <justin@althea.net>\"]\nedition = \"2018\"\n[dependencies]\n-env_logger = \"0.7\"\n+env_logger = \"0.8\"\nlog = \"0.4\"\noping = \"0.3\"\nsodiumoxide = \"0.2\"\n@@ -17,4 +17,4 @@ serde = \"1.0\"\nfailure = \"0.1\"\nget_if_addrs = \"0.5\"\nlazy_static = \"1.4\"\n-rand = \"0.7\"\n\\ No newline at end of file\n+rand = \"0.8\"\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "antenna_forwarding_protocol/Cargo.toml", "new_path": "antenna_forwarding_protocol/Cargo.toml", "diff": "@@ -11,9 +11,9 @@ serde_derive = \"1.0\"\nserde = \"1.0\"\nsodiumoxide = \"0.2\"\nfailure = \"0.1\"\n-clarity = \"0.1\"\n+clarity = \"0.4\"\nlog = \"0.4\"\nlazy_static = \"1.4\"\n[dev-dependencies]\n-rand = \"0.7\"\n\\ No newline at end of file\n+rand = \"0.8\"\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "babel_monitor/Cargo.toml", "new_path": "babel_monitor/Cargo.toml", "diff": "@@ -6,7 +6,7 @@ edition = \"2018\"\n[dependencies]\nascii = \"1.0\"\n-env_logger = \"0.7\"\n+env_logger = \"0.8\"\nfailure = \"0.1\"\nipnetwork = \"0.14\"\nlog = \"0.4\"\n" }, { "change_type": "MODIFY", "old_path": "clu/Cargo.toml", "new_path": "clu/Cargo.toml", "diff": "@@ -10,10 +10,10 @@ althea_kernel_interface = { path = \"../althea_kernel_interface\" }\nalthea_types = { path = \"../althea_types\" }\nlazy_static = \"1.4\"\nlog = \"0.4\"\n-env_logger = \"0.7\"\n+env_logger = \"0.8\"\nfailure = \"0.1\"\nipgen = \"0.0.4\"\n-rand = \"0.7\"\n+rand = \"0.8\"\nserde = \"1.0\"\nserde_derive = \"1.0\"\nserde_json = \"1.0\"\n@@ -21,6 +21,6 @@ clarity = \"0.4\"\nsodiumoxide = \"0.2\"\n[dependencies.regex]\n-version = \"1.3\"\n+version = \"1.4\"\ndefault-features = false\nfeatures = [\"std\"]\n" }, { "change_type": "MODIFY", "old_path": "clu/src/lib.rs", "new_path": "clu/src/lib.rs", "diff": "@@ -29,7 +29,8 @@ pub enum CluError {\n}\npub fn generate_mesh_ip() -> Result<IpAddr, Error> {\n- let seed: String = thread_rng().sample_iter(&Alphanumeric).take(50).collect();\n+ let seed: String =\n+ String::from_utf8(thread_rng().sample_iter(&Alphanumeric).take(50).collect()).unwrap();\nlet mesh_ip = match ipgen::ip(&seed, \"fd00::/8\") {\nOk(ip) => ip,\nErr(msg) => bail!(msg), // For some reason, ipgen devs decided to use Strings for all errors\n@@ -297,11 +298,27 @@ pub fn exit_init(platform: &str, settings: Arc<RwLock<settings::exit::RitaExitSe\n#[cfg(test)]\nmod tests {\n+ use crate::generate_mesh_ip;\nuse crate::validate_mesh_ip;\nuse althea_types::WgKey;\nuse sodiumoxide::crypto::box_::curve25519xsalsa20poly1305::SecretKey;\n+ use std::collections::HashSet;\nuse std::net::IpAddr;\n+ /// generate 1000 mesh ip's make sure we succeed and that all are unique\n+ #[test]\n+ fn test_generate_mesh_ip() {\n+ let mut history = HashSet::new();\n+ for _ in 0..1000 {\n+ let ip = generate_mesh_ip().unwrap();\n+ if history.get(&ip).is_some() {\n+ panic!(\"Got duplicate ip {}\", ip)\n+ } else {\n+ history.insert(ip);\n+ }\n+ }\n+ }\n+\n#[test]\nfn test_validate_mesh_ip() {\nlet good_ip = \"fd44:94c:41e2::9e6\".parse::<IpAddr>().unwrap();\n" }, { "change_type": "MODIFY", "old_path": "rita/Cargo.toml", "new_path": "rita/Cargo.toml", "diff": "@@ -36,12 +36,12 @@ actix-web-async = {package=\"actix-web\", version = \"3.0\", default_features = fals\nactix = \"0.7\"\nactix-web = { version = \"0.7\", default_features = false, features= [\"ssl\"] }\nactix_derive = \"0.5\"\n-bytes = \"0.5\"\n+bytes = \"1.0\"\nconfig = \"0.10\"\ndiesel = { version = \"1.4\", features = [\"postgres\", \"r2d2\"] }\ndocopt = \"1.1\"\ndotenv = \"0.15\"\n-env_logger = \"0.7\"\n+env_logger = \"0.8\"\nfailure = \"0.1\"\nfutures01 = { package = \"futures\", version = \"0.1\"}\nfutures = { version = \"0.3\", features = [\"compat\"] }\n@@ -50,9 +50,9 @@ ipnetwork = \"0.14\"\nlazy_static = \"1.4\"\nlog = { version = \"0.4\", features = [\"release_max_level_info\"] }\nminihttpse = \"0.1\"\n-mockito = \"0.27\"\n+mockito = \"0.28\"\nmockstream = \"0.0\"\n-rand = \"0.7\"\n+rand = \"0.8\"\nserde = \"1.0\"\nserde_derive = \"1.0\"\nserde_json = \"1.0\"\n@@ -83,7 +83,7 @@ jemallocator = {version = \"0.3\", optional = true}\nopenssl = {version = \"0.10\", features = [\"vendored\"], optional = true}\n[dependencies.regex]\n-version = \"1.3\"\n+version = \"1.4\"\ndefault-features = false\nfeatures = [\"std\"]\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/rita_loop/mod.rs", "new_path": "rita/src/rita_common/rita_loop/mod.rs", "diff": "@@ -46,7 +46,7 @@ pub fn get_web3_server() -> String {\n}\nlet node_list = SETTING.get_payment().node_list.clone();\nlet mut rng = thread_rng();\n- let val = rng.gen_range(0, node_list.len());\n+ let val = rng.gen_range(0..node_list.len());\nnode_list[val].clone()\n}\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/tunnel_manager/mod.rs", "new_path": "rita/src/rita_common/tunnel_manager/mod.rs", "diff": "@@ -646,7 +646,7 @@ impl TunnelManager {\nfn get_port(&mut self, level: usize) -> Option<u16> {\nlet udp_table = KI.used_ports();\nlet mut rng = thread_rng();\n- let val = rng.gen_range(0, self.free_ports.len());\n+ let val = rng.gen_range(0..self.free_ports.len());\nlet port = self.free_ports.remove(val);\nmatch (port, udp_table) {\n(p, Ok(used_ports)) => {\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_exit/database/struct_tools.rs", "new_path": "rita/src/rita_exit/database/struct_tools.rs", "diff": "@@ -66,7 +66,7 @@ pub fn client_to_new_db_client(\ncountry: String,\n) -> models::Client {\nlet mut rng = rand::thread_rng();\n- let rand_code: u64 = rng.gen_range(0, 999_999);\n+ let rand_code: u64 = rng.gen_range(0..999_999);\nmodels::Client {\nwg_port: i32::from(client.wg_port),\nmesh_ip: client.global.mesh_ip.to_string(),\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
External dependency updates This patch updates external dependencies that aren't Actix based. Just a lot of minor updates with some very minor code changes to go with them. We also introduce one new test to double check that ip address generation has not changed.
20,244
31.12.2020 10:06:19
18,000
92b71d8e7eb0ca6cc219e3b81976d85cf940c303
Delete pre-monorepo .gitignore All of these but one had redundant statmenets left over from the pre-monorepo days when many of these crates where in their own repo.
[ { "change_type": "MODIFY", "old_path": ".gitignore", "new_path": ".gitignore", "diff": "@@ -16,6 +16,7 @@ test.db-journal\n/scripts/staging_dir/\nintegration-tests/private-key*\n+integration-tests/deps*\nintegration-tests/rita-settings*\nintegration-tests/staging*\nintegration-tests/althea_rs_*\n" }, { "change_type": "DELETE", "old_path": "althea_kernel_interface/.gitignore", "new_path": null, "diff": "-\n-/target/\n-**/*.rs.bk\n-Cargo.lock\n" }, { "change_type": "DELETE", "old_path": "althea_types/.gitignore", "new_path": null, "diff": "-\n-/target/\n-**/*.rs.bk\n-Cargo.lock\n" }, { "change_type": "DELETE", "old_path": "antenna_forwarding_protocol/.vscode/launch.json", "new_path": null, "diff": "-{\n- // Use IntelliSense to learn about possible attributes.\n- // Hover to view descriptions of existing attributes.\n- // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\n- \"version\": \"0.2.0\",\n- \"configurations\": [\n- {\n- \"name\": \"(gdb) Launch\",\n- \"type\": \"cppdbg\",\n- \"request\": \"launch\",\n- \"program\": \"enter program name, for example ${workspaceFolder}/a.out\",\n- \"args\": [],\n- \"stopAtEntry\": false,\n- \"cwd\": \"${workspaceFolder}\",\n- \"environment\": [],\n- \"externalConsole\": false,\n- \"MIMode\": \"gdb\",\n- \"setupCommands\": [\n- {\n- \"description\": \"Enable pretty-printing for gdb\",\n- \"text\": \"-enable-pretty-printing\",\n- \"ignoreFailures\": true\n- }\n- ]\n- }\n- ]\n-}\n\\ No newline at end of file\n" }, { "change_type": "DELETE", "old_path": "babel_monitor/.gitignore", "new_path": null, "diff": "-/target/\n-**/*.rs.bk\n-Cargo.lock\n" }, { "change_type": "DELETE", "old_path": "integration-tests/.gitignore", "new_path": null, "diff": "-*.log\n-*.pid\n-.cache\n-.vagrant\n-/deps/\n" }, { "change_type": "DELETE", "old_path": "rita/.gitignore", "new_path": null, "diff": "-\n-/target/\n-**/*.rs.bk\n-.DS_Store\n\\ No newline at end of file\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Delete pre-monorepo .gitignore All of these but one had redundant statmenets left over from the pre-monorepo days when many of these crates where in their own repo.
20,244
31.12.2020 10:09:56
18,000
7de880500a68eb69feb5d5958873fcb0d7550be8
Use async remote log While we're on a depdency updating spree this is one of my main targets.
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "@@ -659,12 +659,12 @@ dependencies = [\n[[package]]\nname = \"backoff\"\n-version = \"0.1.6\"\n+version = \"0.2.1\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"66483433ebf577e03c6546df761778e4cc40b00e5a1ea7ed850733ffb555d71f\"\n+checksum = \"721c249ab59cbc483ad4294c9ee2671835c1e43e9ffc277e6b4ecfef733cfdc5\"\ndependencies = [\n\"instant\",\n- \"rand 0.6.5\",\n+ \"rand 0.7.3\",\n]\n[[package]]\n@@ -947,17 +947,16 @@ dependencies = [\n[[package]]\nname = \"compressed_log\"\n-version = \"0.2.2\"\n+version = \"0.3.0\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"9af3e5ff9d575755caa41a1e669c952345892f961aa0fd2e2f04e71c9f7fd278\"\n+checksum = \"d371acfe8d922e4a53841aecb50cd68f71743d02459d40160209c7bcd15db43b\"\ndependencies = [\n- \"actix 0.7.11\",\n- \"actix-web 0.7.19\",\n+ \"actix 0.10.0\",\n+ \"actix-web 3.1.0\",\n\"backoff\",\n\"chrono\",\n- \"failure\",\n\"flate2\",\n- \"futures 0.1.30\",\n+ \"futures 0.3.6\",\n\"log\",\n\"serde 1.0.116\",\n\"serde_derive\",\n" }, { "change_type": "MODIFY", "old_path": "rita/Cargo.toml", "new_path": "rita/Cargo.toml", "diff": "@@ -71,7 +71,7 @@ r2d2 = \"0.8\"\nsha3 = \"0.9\"\nhex-literal = \"0.3\"\nsodiumoxide = \"0.2\"\n-compressed_log = \"0.2\"\n+compressed_log = \"0.3\"\nflate2 = { version = \"1.0\", features = [\"rust_backend\"], default-features = false }\nreqwest = { version = \"0.10\", features = [\"blocking\", \"json\"] }\njemallocator = {version = \"0.3\", optional = true}\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_client/mod.rs", "new_path": "rita/src/rita_client/mod.rs", "diff": "@@ -47,9 +47,15 @@ pub fn enable_remote_logging() -> Result<(), Error> {\nrecord.args()\n)\n}))\n- .build()?;\n+ .build();\n+ if let Err(e) = logger {\n+ bail!(format_err!(\"{}\", e))\n+ }\n+ let logger = logger.unwrap();\n- log::set_boxed_logger(Box::new(logger))?;\n+ if let Err(e) = log::set_boxed_logger(Box::new(logger)) {\n+ bail!(format_err!(\"{}\", e))\n+ }\nlog::set_max_level(level);\nprintln!(\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_exit/mod.rs", "new_path": "rita/src/rita_exit/mod.rs", "diff": "@@ -40,9 +40,15 @@ pub fn enable_remote_logging() -> Result<(), Error> {\nrecord.args()\n)\n}))\n- .build()?;\n+ .build();\n+ if let Err(e) = logger {\n+ bail!(format_err!(\"{}\", e))\n+ }\n+ let logger = logger.unwrap();\n- log::set_boxed_logger(Box::new(logger))?;\n+ if let Err(e) = log::set_boxed_logger(Box::new(logger)) {\n+ bail!(format_err!(\"{}\", e))\n+ }\nlog::set_max_level(level);\nprintln!(\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Use async remote log While we're on a depdency updating spree this is one of my main targets.
20,244
31.12.2020 11:02:21
18,000
8c4490a7e5e17c7b304b68d8cfe711651e36b0d7
Fix config upgrades for xdai_home_helper_address This will allow older devices to upgrade to the new version of the struct without crashing.
[ { "change_type": "MODIFY", "old_path": "auto_bridge/src/lib.rs", "new_path": "auto_bridge/src/lib.rs", "diff": "@@ -20,10 +20,15 @@ pub static UNISWAP_GAS_LIMIT: u128 = 80_000;\npub static ERC20_GAS_LIMIT: u128 = 40_000;\npub static ETH_TRANSACTION_GAS_LIMIT: u128 = 21_000;\n+fn default_xdai_home_helper_address() -> Address {\n+ default_bridge_addresses().xdai_home_helper_address\n+}\n+\n#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)]\npub struct TokenBridgeAddresses {\npub uniswap_address: Address,\npub xdai_home_bridge_address: Address,\n+ #[serde(default = \"default_xdai_home_helper_address\")]\npub xdai_home_helper_address: Address,\npub xdai_foreign_bridge_address: Address,\npub foreign_dai_contract_address: Address,\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Fix config upgrades for xdai_home_helper_address This will allow older devices to upgrade to the new version of the struct without crashing.
20,244
31.12.2020 11:03:01
18,000
91cd0f4b47aac9c445eb8329fb816e7a84ca3a1c
Fix nits for rust 1.49.0 clippy Some really cool new nits have been included, await over lock boundries is going to really improve our lock based threading pattern for Rita.
[ { "change_type": "MODIFY", "old_path": "althea_kernel_interface/src/traffic_control.rs", "new_path": "althea_kernel_interface/src/traffic_control.rs", "diff": "@@ -238,7 +238,7 @@ impl dyn KernelInterface {\n// we need 1kbyte of burst cache per mbit of bandwidth to actually keep things\n// moving\n- let burst = bw * 1000 as u32;\n+ let burst = bw * 1000u32;\n// amount of time a packet can spend in the burst cache, 40ms\nlet latency = 40u32;\n" }, { "change_type": "MODIFY", "old_path": "babel_monitor/src/lib.rs", "new_path": "babel_monitor/src/lib.rs", "diff": "@@ -478,16 +478,9 @@ fn parse_neighs_sync(output: String) -> Result<Vec<Neighbor>, Error> {\nOk(entry) => entry,\nErr(_) => continue,\n},\n- rtt: match find_and_parse_babel_val(\"rtt\", entry) {\n- Ok(entry) => entry,\n- // it's possible that our neigh does not have rtt enabled, handle\n- Err(_) => 0.0,\n- },\n- rttcost: match find_and_parse_babel_val(\"rttcost\", entry) {\n- Ok(entry) => entry,\n- // it's possible that our neigh does not have rtt enabled, handle\n- Err(_) => 0,\n- },\n+ // it's possible that the neighbor does not have rtt enabled\n+ rtt: find_and_parse_babel_val(\"rtt\", entry).unwrap_or(0.0),\n+ rttcost: find_and_parse_babel_val(\"rttcost\", entry).unwrap_or(0),\ncost: match find_and_parse_babel_val(\"cost\", entry) {\nOk(entry) => entry,\nErr(_) => continue,\n" }, { "change_type": "MODIFY", "old_path": "rita/src/middleware.rs", "new_path": "rita/src/middleware.rs", "diff": "@@ -39,7 +39,7 @@ impl<S> Middleware<S> for Headers {\n*resp.status_mut() = StatusCode::OK;\n}\n- if origin != \"\" {\n+ if !origin.is_empty() {\n#[cfg(not(feature = \"dash_debug\"))]\nresp.headers_mut().insert(\nheader::HeaderName::try_from(\"Access-Control-Allow-Origin\").unwrap(),\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_client/dashboard/exits.rs", "new_path": "rita/src/rita_client/dashboard/exits.rs", "diff": "@@ -55,10 +55,9 @@ fn is_selected(exit: &ExitServer, current_exit: Option<&ExitServer>) -> bool {\nfn is_tunnel_working(exit: &ExitServer, current_exit: Option<&ExitServer>) -> bool {\nmatch (current_exit, is_selected(exit, current_exit)) {\n(Some(exit), true) => match exit.info.general_details() {\n- Some(details) => match KI.ping_check(&details.server_internal_ip, EXIT_PING_TIMEOUT) {\n- Ok(ping_result) => ping_result,\n- Err(_) => false,\n- },\n+ Some(details) => KI\n+ .ping_check(&details.server_internal_ip, EXIT_PING_TIMEOUT)\n+ .unwrap_or(false),\nNone => false,\n},\n(_, _) => false,\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/payment_validator/mod.rs", "new_path": "rita/src/rita_common/payment_validator/mod.rs", "diff": "@@ -165,6 +165,7 @@ fn checked(msg: ToValidate, history: &mut PaymentValidator) {\n}\n}\n+#[allow(clippy::await_holding_lock)]\npub async fn validate() {\n// we panic on a failed receive so it should always be longer than the minimum\n// time we expect payments to take to enter the blockchain (the send timeout)\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/peer_listener/mod.rs", "new_path": "rita/src/rita_common/peer_listener/mod.rs", "diff": "@@ -209,10 +209,7 @@ impl ListenInterface {\nlet link_ip = KI.get_link_local_device_ip(&ifname)?;\n// Lookup interface index\n- let iface_index = match KI.get_iface_index(&ifname) {\n- Ok(idx) => idx,\n- Err(_) => 0,\n- };\n+ let iface_index = KI.get_iface_index(&ifname).unwrap_or(0);\n// Bond to multicast discovery address on each listen port\nlet multicast_socketaddr = SocketAddrV6::new(disc_ip, port, 0, iface_index);\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/rita_loop/fast_loop.rs", "new_path": "rita/src/rita_common/rita_loop/fast_loop.rs", "diff": "@@ -298,10 +298,7 @@ fn manage_gateway() {\n// the is_up detection is mostly useless because these ports reside on switches which mark\n// all ports as up all the time.\nlet gateway = match SETTING.get_network().external_nic {\n- Some(ref external_nic) => match KI.is_iface_up(external_nic) {\n- Some(val) => val,\n- None => false,\n- },\n+ Some(ref external_nic) => KI.is_iface_up(external_nic).unwrap_or(false),\nNone => false,\n};\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/tunnel_manager/mod.rs", "new_path": "rita/src/rita_common/tunnel_manager/mod.rs", "diff": "@@ -784,10 +784,8 @@ impl TunnelManager {\nNone => false,\n};\n- let they_have_tunnel = match their_localid.have_tunnel {\n- Some(v) => v,\n- None => true, // when we don't know take the more conservative option\n- };\n+ // when we don't know take the more conservative option and assume they do have a tunnel\n+ let they_have_tunnel = their_localid.have_tunnel.unwrap_or(true);\nlet mut return_bool = false;\nif we_have_tunnel {\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_exit/traffic_watcher/mod.rs", "new_path": "rita/src/rita_exit/traffic_watcher/mod.rs", "diff": "@@ -224,7 +224,7 @@ pub fn watch(\n// Setup the debts table\nfor (_, ident) in identities.clone() {\n- debts.insert(ident, 0 as i128);\n+ debts.insert(ident, 0i128);\n}\n// accounting for 'input'\n" }, { "change_type": "MODIFY", "old_path": "src/lib.rs", "new_path": "src/lib.rs", "diff": "#![forbid(unsafe_code)]\n-\n-#[cfg(test)]\n-mod tests {\n- #[test]\n- fn it_works() {\n- assert_eq!(2 + 2, 4);\n- }\n-}\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Fix nits for rust 1.49.0 clippy Some really cool new nits have been included, await over lock boundries is going to really improve our lock based threading pattern for Rita.
20,244
31.12.2020 11:52:30
18,000
48a360d434a9450ce5e8c01c4876b08d9564d385
Don't bother with round_closest Lets just round down a whole dollar on the fees. This requires further consideration later anyways.
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_common/token_bridge/mod.rs", "new_path": "rita/src/rita_common/token_bridge/mod.rs", "diff": "@@ -705,8 +705,8 @@ pub fn get_bridge_status() -> BridgeStatus {\nlet bridge = BRIDGE.read().unwrap().clone();\n// amounts is in cents, we need to convert to dollars for the dashboard display\nlet amounts = AMOUNTS.read().unwrap().clone();\n- let reserve_amount = div_round_closest(amounts.reserve_amount, 100);\n- let minimum_to_exchange = div_round_closest(amounts.minimum_to_exchange, 100);\n+ let reserve_amount = amounts.reserve_amount / 100;\n+ let minimum_to_exchange = amounts.minimum_to_exchange / 100;\nBridgeStatus {\nreserve_amount,\nminimum_deposit: minimum_to_exchange,\n@@ -744,7 +744,3 @@ fn lossy_u32(input: Uint256) -> u32 {\nErr(_e) => u32::MAX,\n}\n}\n-\n-fn div_round_closest(a: u32, b: u32) -> u32 {\n- (a - (b + 1) / 2) / b + 1\n-}\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Don't bother with round_closest Lets just round down a whole dollar on the fees. This requires further consideration later anyways.
20,244
31.12.2020 13:50:16
18,000
6cb69a0ec181271eca416c2aaab80bdbde161292
Bump compressed_log and increase buffer sizes This fixes some actix executor issues in the async/await version of compressed_log. It also dramatically increases buffer sizes 10x on routers and 100x on exits. The goal here is improved efficiency and a movement to relying on flush() or drop() to get crash messages
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "@@ -947,9 +947,9 @@ dependencies = [\n[[package]]\nname = \"compressed_log\"\n-version = \"0.3.0\"\n+version = \"0.3.2\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"d371acfe8d922e4a53841aecb50cd68f71743d02459d40160209c7bcd15db43b\"\n+checksum = \"42fc69f2ce1ebfd76ddf10a61910b6aaab8f361bac438c9c1632337db7d704ad\"\ndependencies = [\n\"actix 0.10.0\",\n\"actix-web 3.1.0\",\n" }, { "change_type": "MODIFY", "old_path": "rita/Cargo.toml", "new_path": "rita/Cargo.toml", "diff": "@@ -71,7 +71,7 @@ r2d2 = \"0.8\"\nsha3 = \"0.9\"\nhex-literal = \"0.3\"\nsodiumoxide = \"0.2\"\n-compressed_log = \"0.3\"\n+compressed_log = \"0.3.2\"\nflate2 = { version = \"1.0\", features = [\"rust_backend\"], default-features = false }\nreqwest = { version = \"0.10\", features = [\"blocking\", \"json\"] }\njemallocator = {version = \"0.3\", optional = true}\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_client/mod.rs", "new_path": "rita/src/rita_client/mod.rs", "diff": "@@ -38,7 +38,7 @@ pub fn enable_remote_logging() -> Result<(), Error> {\n)\n.set_compression_level(Compression::Fast)\n.set_sink_url(logging_url)\n- .set_threshold(1000)\n+ .set_threshold(10_000)\n.set_format(Box::new(move |record: &Record| {\nformat!(\n\"{} {} rita: {}\\n\",\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_exit/mod.rs", "new_path": "rita/src/rita_exit/mod.rs", "diff": "@@ -31,7 +31,7 @@ pub fn enable_remote_logging() -> Result<(), Error> {\n)\n.set_compression_level(Compression::Fast)\n.set_sink_url(logging_url)\n- .set_threshold(1000)\n+ .set_threshold(100_000)\n.set_format(Box::new(move |record: &Record| {\nformat!(\n\"{} {} rita_exit: {}\\n\",\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Bump compressed_log and increase buffer sizes This fixes some actix executor issues in the async/await version of compressed_log. It also dramatically increases buffer sizes 10x on routers and 100x on exits. The goal here is improved efficiency and a movement to relying on flush() or drop() to get crash messages
20,244
31.12.2020 14:19:57
18,000
6ba09e5e2c95ed1ea8eb4c20065033b47bd679fd
Beta 17 RC0 We're moving to a new release numbering scheme where we can easily parse out what the human readable release name is from the semantic version. Much easier than keeping patch numbers forever.
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "@@ -3268,7 +3268,7 @@ dependencies = [\n[[package]]\nname = \"rita\"\n-version = \"0.5.67\"\n+version = \"0.17.0\"\ndependencies = [\n\"actix 0.10.0\",\n\"actix 0.7.11\",\n" }, { "change_type": "MODIFY", "old_path": "rita/Cargo.toml", "new_path": "rita/Cargo.toml", "diff": "[package]\nname = \"rita\"\n-version = \"0.5.67\"\n+version = \"0.17.0\"\nauthors = [\"Justin <justin@althea.net>\", \"Jehan <jehan.tremback@gmail.com>\", \"Ben <wangben3@gmail.com>\"]\nbuild = \"build.rs\"\nedition = \"2018\"\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/dashboard/own_info.rs", "new_path": "rita/src/rita_common/dashboard/own_info.rs", "diff": "@@ -7,7 +7,7 @@ use failure::Error;\nuse num256::{Int256, Uint256};\nuse settings::RitaCommonSettings;\n-pub static READABLE_VERSION: &str = \"Beta 16 RC7\";\n+pub static READABLE_VERSION: &str = \"Beta 17 RC0\";\n#[derive(Serialize)]\npub struct OwnInfo {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Beta 17 RC0 We're moving to a new release numbering scheme where we can easily parse out what the human readable release name is from the semantic version. Much easier than keeping patch numbers forever.
20,244
01.01.2021 09:47:03
18,000
15fc3f5cae896faf8c1bc3909d47d4433ee5be6c
Upgrade Web30 to work with Geth blocks We get a concise blokc as part of deadline computation for the Uniswap exchange. Geth blocks don't include some fields parity blocks do.
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "@@ -603,7 +603,7 @@ dependencies = [\n\"rand 0.8.0\",\n\"serde 1.0.116\",\n\"serde_derive\",\n- \"web30 0.10.2\",\n+ \"web30 0.10.4\",\n]\n[[package]]\n@@ -3327,7 +3327,7 @@ dependencies = [\n\"tokio-codec\",\n\"tokio-io\",\n\"trust-dns-resolver 0.10.3\",\n- \"web30 0.10.2\",\n+ \"web30 0.10.4\",\n\"web30 0.4.3\",\n]\n@@ -4629,9 +4629,9 @@ dependencies = [\n[[package]]\nname = \"web30\"\n-version = \"0.10.2\"\n+version = \"0.10.4\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"e1492467879d37c07f4d94a2398a957693b1808e32eb077d6c64a3c2f720bcc7\"\n+checksum = \"7d5a65640d3ca3d11d6ca48c29f9fd4fd6af7fc51416d8c7b9af267bf7ec497e\"\ndependencies = [\n\"actix 0.10.0\",\n\"actix-web 3.1.0\",\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Upgrade Web30 to work with Geth blocks We get a concise blokc as part of deadline computation for the Uniswap exchange. Geth blocks don't include some fields parity blocks do.
20,244
01.01.2021 10:54:49
18,000
39ba7c6fffb5375469bdc576e9c62b8e8a116bc2
Upgrade web30 to fix event topics This imports an upstream change that fomats event topics correctly so that we can avoid the 'dai rescue' case when sending funds over the bridge.
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "@@ -603,7 +603,7 @@ dependencies = [\n\"rand 0.8.0\",\n\"serde 1.0.116\",\n\"serde_derive\",\n- \"web30 0.10.4\",\n+ \"web30 0.10.5\",\n]\n[[package]]\n@@ -3327,7 +3327,7 @@ dependencies = [\n\"tokio-codec\",\n\"tokio-io\",\n\"trust-dns-resolver 0.10.3\",\n- \"web30 0.10.4\",\n+ \"web30 0.10.5\",\n\"web30 0.4.3\",\n]\n@@ -4629,9 +4629,9 @@ dependencies = [\n[[package]]\nname = \"web30\"\n-version = \"0.10.4\"\n+version = \"0.10.5\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"7d5a65640d3ca3d11d6ca48c29f9fd4fd6af7fc51416d8c7b9af267bf7ec497e\"\n+checksum = \"21552aa55f1d87170ac2eb511a6b4de23f0e7637c1ef5e3078aa5b714ff28e66\"\ndependencies = [\n\"actix 0.10.0\",\n\"actix-web 3.1.0\",\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Upgrade web30 to fix event topics This imports an upstream change that fomats event topics correctly so that we can avoid the 'dai rescue' case when sending funds over the bridge.
20,244
01.01.2021 11:52:50
18,000
f81a47987621b575ad6788a52fc3f39290072149
Improve logging for funds unlock
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_common/token_bridge/mod.rs", "new_path": "rita/src/rita_common/token_bridge/mod.rs", "diff": "@@ -520,10 +520,12 @@ async fn xdai_bridge(state: State) -> State {\n)\n{\n// can't panic because of the above if/else tree\n+ info!(\"bridge in Withdraw state attempting to unlock funds\");\nlet unlock_details = unlock_details.unwrap();\n- let _ = bridge\n+ let res = bridge\n.submit_signatures_to_unlock_funds(unlock_details, UNISWAP_TIMEOUT)\n.await;\n+ info!(\"Submitting signatures to Ethereum {:?}\", res);\nreturn our_withdrawing_state;\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Improve logging for funds unlock
20,244
01.01.2021 12:59:42
18,000
7e9cc1065ebad7fe9d1a2c790a27168b7573c6fe
Have funds unlock prep the packed payloads This adds some in line Ethereum ABI parsing that is required to prepare the xDai bridge helper payloads for passing into the Ethereum contract. Also added is an extensive test case using (rather expensively) gathered test data from my personal experiments.
[ { "change_type": "MODIFY", "old_path": "auto_bridge/Cargo.toml", "new_path": "auto_bridge/Cargo.toml", "diff": "@@ -6,7 +6,6 @@ edition = \"2018\"\n[dependencies]\nweb30 = \"0.10\"\n-futures = \"0.3\"\nnum256 = \"0.3\"\nclarity = \"0.4\"\nrand = \"0.8\"\n@@ -17,3 +16,4 @@ serde = \"1.0\"\n[dev-dependencies]\nactix = \"0.10\"\n+futures = \"0.3\"\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "auto_bridge/src/error.rs", "new_path": "auto_bridge/src/error.rs", "diff": "@@ -9,6 +9,7 @@ pub enum TokenBridgeError {\nWeb3Error(Web3Error),\nBadUniswapOutput(String),\nHelperMessageNotReady,\n+ HelperMessageIncorrect,\n}\nimpl From<Web3Error> for TokenBridgeError {\n@@ -26,6 +27,9 @@ impl Display for TokenBridgeError {\nf,\n\"xDai validators are not finished preparing this withdraw\",\n),\n+ TokenBridgeError::HelperMessageIncorrect => {\n+ write!(f, \"This can't possibly be a valid helper message\",)\n+ }\n}\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "auto_bridge/src/lib.rs", "new_path": "auto_bridge/src/lib.rs", "diff": "@@ -4,6 +4,7 @@ extern crate log;\nextern crate serde_derive;\nuse clarity::abi::{encode_call, Token};\n+use clarity::utils::bytes_to_hex_str;\nuse clarity::{Address, PrivateKey};\nuse num::Bounded;\nuse num256::Uint256;\n@@ -450,6 +451,7 @@ impl TokenBridge {\nxdai_withdraw_txid: Uint256,\namount_sent: Uint256,\n) -> Result<HelperWithdrawInfo, TokenBridgeError> {\n+ info!(\"bridge getting message hashes\");\nlet own_address = self.own_address;\n// the hash that is then used to look up the signatures, this will always\n// succeed, whereas the signature lookup may need to wait for all sigs\n@@ -478,7 +480,7 @@ impl TokenBridge {\nown_address,\n)\n.await?;\n- if msg == vec![0] {\n+ if msg == vec![0] || msg.len() <= 64 {\nreturn Err(TokenBridgeError::HelperMessageNotReady);\n}\nlet sigs_payload = self\n@@ -490,10 +492,35 @@ impl TokenBridge {\nown_address,\n)\n.await?;\n+ if sigs_payload == vec![0] || sigs_payload.len() <= 64 {\n+ return Err(TokenBridgeError::HelperMessageNotReady);\n+ }\n+ // what we've gotten out of this helper contract is a packed\n+ // encoded message, since we don't have code to unpack it or\n+ // even the a type definition to work with we've got to do some\n+ // hand massaging to get it into the right format.\n+ // 1. discard the first uint256 type specifier, we know what we have\n+ // 2. take the second uint256 it's the length in bytes of the rest of the message\n+ // 3. take the bytes between START (2 uint256 offset) and END (offset plus message length)\n+ let msg_len = Uint256::from_bytes_be(&msg[32..64]);\n+ let sigs_len = Uint256::from_bytes_be(&sigs_payload[32..64]);\n+ if msg_len > usize::MAX.into() || sigs_len > usize::MAX.into() {\n+ return Err(TokenBridgeError::HelperMessageIncorrect);\n+ }\n+ let msg_len: usize = msg_len.to_string().parse().unwrap();\n+ let sigs_len: usize = sigs_len.to_string().parse().unwrap();\n+ const START: usize = 2 * 32;\n+ let msg_end = START + (msg_len);\n+ let sigs_end = START + (sigs_len);\n+ if msg_end > msg.len() || sigs_end > sigs_payload.len() {\n+ return Err(TokenBridgeError::HelperMessageIncorrect);\n+ }\n+ let cleaned_msg = msg[START..msg_end].to_vec();\n+ let cleaned_sigs = sigs_payload[START..sigs_end].to_vec();\nOk(HelperWithdrawInfo {\n- msg,\n- sigs: sigs_payload,\n+ msg: cleaned_msg,\n+ sigs: cleaned_sigs,\n})\n}\n@@ -504,11 +531,12 @@ impl TokenBridge {\ntimeout: Duration,\n) -> Result<Uint256, TokenBridgeError> {\nlet own_address = self.own_address;\n- let payload = encode_call(\n- \"executeSignatures(bytes32,bytes32)\",\n- &[data.msg.into(), data.sigs.into()],\n- )\n- .unwrap();\n+ let payload = get_payload_for_funds_unlock(&data);\n+ trace!(\n+ \"bridge unlocking funds with! {} bytes payload! {}\",\n+ data.msg.len(),\n+ bytes_to_hex_str(&payload),\n+ );\nlet txid = self\n.eth_web3\n@@ -518,7 +546,7 @@ impl TokenBridge {\n0u32.into(),\nown_address,\nself.secret,\n- Vec::new(),\n+ vec![SendTxOption::GasLimit(200_000u64.into())],\n)\n.await?;\n@@ -530,6 +558,18 @@ impl TokenBridge {\n}\n}\n+/// helper function for easier tests\n+fn get_payload_for_funds_unlock(data: &HelperWithdrawInfo) -> Vec<u8> {\n+ encode_call(\n+ \"executeSignatures(bytes,bytes)\",\n+ &[\n+ Token::UnboundedBytes(data.msg.clone()),\n+ Token::UnboundedBytes(data.sigs.clone()),\n+ ],\n+ )\n+ .unwrap()\n+}\n+\npub const UNISWAP_ON_ETH_ADDRESS: &str = \"0x2a1530C4C41db0B0b2bB646CB5Eb1A67b7158667\";\npub const XDAI_BRIDGE_ON_ETH_ADDRESS: &str = \"0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016\";\npub const HELPER_ON_XDAI_ADDRESS: &str = \"0x6A92e97A568f5F58590E8b1f56484e6268CdDC51\";\n@@ -553,6 +593,8 @@ pub fn default_bridge_addresses() -> TokenBridgeAddresses {\n#[cfg(test)]\nmod tests {\n+ use clarity::utils::hex_str_to_bytes;\n+\nuse super::*;\nuse std::str::FromStr;\n@@ -629,6 +671,114 @@ mod tests {\nsystem.run().unwrap();\n}\n+ #[test]\n+ #[ignore]\n+ fn test_funds_unlock_boilerplate() {\n+ let system = actix::System::new(\"test\");\n+\n+ let bridge = new_token_bridge();\n+\n+ actix::spawn(async move {\n+ let details = bridge\n+ .get_relay_message_hash(\n+ \"0x83b76e9e2acfaf57422f1fc194fd672a2bc267f8fe7a6220d78df3a9260b0a65\"\n+ .parse()\n+ .unwrap(),\n+ 38279145422101674969u128.into(),\n+ )\n+ .await\n+ .unwrap();\n+ println!(\n+ \"Got sigs, msg: {} sigs {}\",\n+ bytes_to_hex_str(&details.msg),\n+ bytes_to_hex_str(&details.sigs),\n+ );\n+ bridge\n+ .submit_signatures_to_unlock_funds(details, TIMEOUT)\n+ .await\n+ .unwrap();\n+ actix::System::current().stop();\n+ });\n+ system.run().unwrap();\n+ }\n+\n+ #[test]\n+ /// This tests unlocking funds from the POA Xdai bridge using a lot of specially collected\n+ /// test data for the entire process\n+ fn test_funds_unlock() {\n+ use futures::future::join;\n+ let system = actix::System::new(\"test\");\n+ let dest_address = \"0x310d72afc5eef50b52a47362b6dd1913d4c87972\"\n+ .parse()\n+ .unwrap();\n+ let correct_payload_1 = hex_str_to_bytes(\"0x3f7658fd000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000068310d72afc5eef50b52a47362b6dd1913d4c8797200000000000000000000000000000000000000000000000191d1a75300d852c57b2606e78f2b6b1622598084446fcab1af95828465b0745f345052379ad4c3654aa42145aa6ebf72e164c9bbc74fbd378804501600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c4031b1c1cd0e52f961e3fe727d5fb76ac7ea6789c4359a124c4ea662451471218dcc87e10b8aa42f77d03075e5bbdd768b01f359090d228543aa9cf98e7cac1ac43502829b2e01a41c3b9647ebe869a5030e5d3ac885926bbffe8a709fb06b0701e12a879575df42e83cbbb0087a82814be3390ff2fda83234866d91bc61e405e2be750a17d8c38ff65aadb5bdb42643355584290c0e907a07c3f37983444814ad1035d1e487ee5aa9273fa59dc5d6afc707eb5e2ca6a6d0991e6cf5f773db18552a80ca000000000000000000000000000000000000000000000000000000000\").unwrap();\n+ let _correct_msg_hash_1 =\n+ hex_str_to_bytes(\"0xab89d6524aeb99b0afb21bc4acbcad80d99b22decb725a8b91901ef2fc60b8ee\")\n+ .unwrap();\n+ let correct_msg_1 = hex_str_to_bytes(\"0x310d72afc5eef50b52a47362b6dd1913d4c8797200000000000000000000000000000000000000000000000191d1a75300d852c57b2606e78f2b6b1622598084446fcab1af95828465b0745f345052379ad4c3654aa42145aa6ebf72e164c9bbc74fbd3788045016\").unwrap();\n+ let correct_sigs_1 = hex_str_to_bytes(\"0x031b1c1cd0e52f961e3fe727d5fb76ac7ea6789c4359a124c4ea662451471218dcc87e10b8aa42f77d03075e5bbdd768b01f359090d228543aa9cf98e7cac1ac43502829b2e01a41c3b9647ebe869a5030e5d3ac885926bbffe8a709fb06b0701e12a879575df42e83cbbb0087a82814be3390ff2fda83234866d91bc61e405e2be750a17d8c38ff65aadb5bdb42643355584290c0e907a07c3f37983444814ad1035d1e487ee5aa9273fa59dc5d6afc707eb5e2ca6a6d0991e6cf5f773db18552a80ca0\").unwrap();\n+ let tx_id_1 = \"0x7b2606e78f2b6b1622598084446fcab1af95828465b0745f345052379ad4c365\"\n+ .parse()\n+ .unwrap();\n+ let amount_1 = 28954107454279930565u128;\n+ let correct_payload_2 = hex_str_to_bytes(\"0x3f7658fd000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000068310d72afc5eef50b52a47362b6dd1913d4c87972000000000000000000000000000000000000000000000002133ad7f325e3fbd983b76e9e2acfaf57422f1fc194fd672a2bc267f8fe7a6220d78df3a9260b0a654aa42145aa6ebf72e164c9bbc74fbd378804501600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c4031c1b1b9421be403593fed7ce937bcf6c1f59bc418d04ed6b3dd5f1a75109923ba969306a1bec5bb6b9d5a625af09fffa94a8f4e6c0e1f97e45e53701627af6b2bbd517b8a090e28b6f7d9e86b8ad5c6c6f4778c3e41e2c83b8fe216b425020389fffe263e350426291d8daae63d788acb0cb676d8efb5e5176865d7ddc8089d4260376213ef8ebcb05ff18181eee34edfec9524cc7c6398fef8c7b6ecc31c09fe80bd70dbb75c1380a000c8d231dc5f49db2a3948ee2d9c87fd083c334969d5c54e65500000000000000000000000000000000000000000000000000000000\").unwrap();\n+ let _correct_msg_hash_2 =\n+ hex_str_to_bytes(\"0xcfdd7edcad5241f5f1660879fa46ecd545dbb52c87c361286a32162dc0e64e13\")\n+ .unwrap();\n+ let correct_msg_2 =\n+ hex_str_to_bytes(\"0x310d72afc5eef50b52a47362b6dd1913d4c87972000000000000000000000000000000000000000000000002133ad7f325e3fbd983b76e9e2acfaf57422f1fc194fd672a2bc267f8fe7a6220d78df3a9260b0a654aa42145aa6ebf72e164c9bbc74fbd3788045016\")\n+ .unwrap();\n+ let correct_sigs_2 =\n+ hex_str_to_bytes(\"0x031c1b1b9421be403593fed7ce937bcf6c1f59bc418d04ed6b3dd5f1a75109923ba969306a1bec5bb6b9d5a625af09fffa94a8f4e6c0e1f97e45e53701627af6b2bbd517b8a090e28b6f7d9e86b8ad5c6c6f4778c3e41e2c83b8fe216b425020389fffe263e350426291d8daae63d788acb0cb676d8efb5e5176865d7ddc8089d4260376213ef8ebcb05ff18181eee34edfec9524cc7c6398fef8c7b6ecc31c09fe80bd70dbb75c1380a000c8d231dc5f49db2a3948ee2d9c87fd083c334969d5c54e655\")\n+ .unwrap();\n+ let tx_id_2 = \"0x83b76e9e2acfaf57422f1fc194fd672a2bc267f8fe7a6220d78df3a9260b0a65\"\n+ .parse()\n+ .unwrap();\n+ let amount_2 = 38279145422101674969u128;\n+\n+ let mut bridge = new_token_bridge();\n+ // this will break any tx sending! but we don't do that here.\n+ bridge.own_address = dest_address;\n+\n+ actix::spawn(async move {\n+ // this test may fail if we can't reach our xdai node cluster as we actually go out, call the contract and check\n+ let details_1 = bridge.get_relay_message_hash(tx_id_1, amount_1.into());\n+ let details_2 = bridge.get_relay_message_hash(tx_id_2, amount_2.into());\n+ let (details_1, details_2) = join(details_1, details_2).await;\n+ let details_1 = details_1.unwrap();\n+ let details_2 = details_2.unwrap();\n+ assert_eq!(\n+ bytes_to_hex_str(&details_1.msg),\n+ bytes_to_hex_str(&correct_msg_1)\n+ );\n+ assert_eq!(\n+ bytes_to_hex_str(&details_1.sigs),\n+ bytes_to_hex_str(&correct_sigs_1)\n+ );\n+ assert_eq!(\n+ bytes_to_hex_str(&details_2.msg),\n+ bytes_to_hex_str(&correct_msg_2)\n+ );\n+ assert_eq!(\n+ bytes_to_hex_str(&details_2.sigs),\n+ bytes_to_hex_str(&correct_sigs_2)\n+ );\n+\n+ let payload_1 = get_payload_for_funds_unlock(&details_1);\n+ let payload_2 = get_payload_for_funds_unlock(&details_2);\n+ assert_eq!(\n+ bytes_to_hex_str(&payload_1),\n+ bytes_to_hex_str(&correct_payload_1)\n+ );\n+ assert_eq!(\n+ bytes_to_hex_str(&payload_2),\n+ bytes_to_hex_str(&correct_payload_2)\n+ );\n+ actix::System::current().stop();\n+ });\n+ system.run().unwrap();\n+ }\n+\n#[test]\n#[ignore]\nfn test_eth_to_dai_swap() {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Have funds unlock prep the packed payloads This adds some in line Ethereum ABI parsing that is required to prepare the xDai bridge helper payloads for passing into the Ethereum contract. Also added is an extensive test case using (rather expensively) gathered test data from my personal experiments.
20,244
05.01.2021 12:33:50
18,000
bfa6516555d0e9244d7b3a10edfe95b6585d56d7
Use debug print for TrafficWatcher errors This is far more readable.
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_client/dashboard/usage.rs", "new_path": "rita/src/rita_client/dashboard/usage.rs", "diff": "@@ -12,7 +12,7 @@ use std::collections::VecDeque;\npub fn get_client_usage(\n_req: HttpRequest,\n) -> Box<dyn Future<Item = Json<VecDeque<UsageHour>>, Error = Error>> {\n- trace!(\"/usage/relay hit\");\n+ trace!(\"/usage/client hit\");\nUsageTracker::from_registry()\n.send(GetUsage {\nkind: UsageType::Client,\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_exit/traffic_watcher/mod.rs", "new_path": "rita/src/rita_exit/traffic_watcher/mod.rs", "diff": "@@ -14,7 +14,7 @@ use crate::rita_common::usage_tracker::UpdateUsage;\nuse crate::rita_common::usage_tracker::UsageTracker;\nuse crate::rita_common::usage_tracker::UsageType;\nuse crate::SETTING;\n-use ::actix::{Actor, Context, Handler, Message, Supervised, SystemService};\n+use actix::{Actor, Context, Handler, Message, Supervised, SystemService};\nuse althea_kernel_interface::wg_iface_counter::prepare_usage_history;\nuse althea_kernel_interface::wg_iface_counter::WgUsage;\nuse althea_kernel_interface::KI;\n@@ -245,15 +245,15 @@ pub fn watch(\nhistory.download = bytes.download;\n}\n// debts is generated from identities, this should be impossible\n- None => warn!(\"No debts entry for input entry id {:?}\", id),\n+ None => warn!(\"No debts entry for input entry id {}\", id),\n},\n- (Some(id), Some(_dest), None) => warn!(\"Entry for {:?} should have been created\", id),\n+ (Some(id), Some(_dest), None) => warn!(\"Entry for {} should have been created\", id),\n// this can be caused by a peer that has not yet formed a babel route\n- (Some(id), None, _) => trace!(\"We have an id {:?} but not destination\", id),\n+ (Some(id), None, _) => trace!(\"We have an id {} but not destination\", id),\n// if we have a babel route we should have a peer it's possible we have a mesh client sneaking in?\n- (None, Some(dest), _) => trace!(\"We have a destination {:?} but no id\", dest),\n+ (None, Some(dest), _) => trace!(\"We have a destination {} but no id\", dest),\n// dead entry?\n- (None, None, _) => warn!(\"We have no id or dest for an input counter on {:?}\", wg_key),\n+ (None, None, _) => warn!(\"We have no id or dest for an input counter on {}\", wg_key),\n}\n}\n@@ -274,15 +274,15 @@ pub fn watch(\nhistory.upload = bytes.upload;\n}\n// debts is generated from identities, this should be impossible\n- None => warn!(\"No debts entry for input entry id {:?}\", id),\n+ None => warn!(\"No debts entry for input entry id {}\", id),\n},\n- (Some(id), Some(_dest), None) => warn!(\"Entry for {:?} should have been created\", id),\n+ (Some(id), Some(_dest), None) => warn!(\"Entry for {} should have been created\", id),\n// this can be caused by a peer that has not yet formed a babel route\n- (Some(id), None, _) => trace!(\"We have an id {:?} but not destination\", id),\n+ (Some(id), None, _) => trace!(\"We have an id {} but not destination\", id),\n// if we have a babel route we should have a peer it's possible we have a mesh client sneaking in?\n- (None, Some(dest), _) => warn!(\"We have a destination {:?} but no id\", dest),\n+ (None, Some(dest), _) => warn!(\"We have a destination {} but no id\", dest),\n// dead entry?\n- (None, None, _) => warn!(\"We have no id or dest for an input counter on {:?}\", wg_key),\n+ (None, None, _) => warn!(\"We have no id or dest for an input counter on {}\", wg_key),\n}\n}\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Use debug print for TrafficWatcher errors This is far more readable.
20,244
06.01.2021 17:45:36
18,000
aa9b3298b0502876f5e7b916241deb66652af8b0
Operator actions whitelist This is far less likley to end up giving a lot of power to Operators by mistake.
[ { "change_type": "MODIFY", "old_path": "althea_types/src/interop.rs", "new_path": "althea_types/src/interop.rs", "diff": "@@ -395,6 +395,20 @@ pub enum OperatorAction {\nChangeOperatorAddress { new_address: Option<Address> },\n}\n+impl OperatorAction {\n+ /// is this a list of actions on the whitelist for normal operator tools users\n+ pub fn is_user_action(&self) -> bool {\n+ matches!(\n+ self,\n+ OperatorAction::ResetRouterPassword\n+ | OperatorAction::ResetWiFiPassword\n+ | OperatorAction::ResetShaper\n+ | OperatorAction::Reboot\n+ | OperatorAction::UpdateNow\n+ )\n+ }\n+}\n+\nimpl FromStr for OperatorAction {\ntype Err = Error;\nfn from_str(s: &str) -> Result<OperatorAction, Error> {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Operator actions whitelist This is far less likley to end up giving a lot of power to Operators by mistake.
20,244
11.01.2021 13:46:16
18,000
858951bc560f98587c2444fa02c42c9b4f7c82d3
Add comment describing how the metric factor works This confused me today. Figured it should be a little better documented
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_common/dashboard/babel.rs", "new_path": "rita/src/rita_common/dashboard/babel.rs", "diff": "@@ -63,6 +63,8 @@ pub fn set_local_fee(path: Path<u32>) -> Box<dyn Future<Item = HttpResponse, Err\n}))\n}\n+/// Sets the metric factor for this node, lower values mean a higher price preference while higher\n+/// values mean a higher weight on route quality.\npub fn set_metric_factor(path: Path<u32>) -> Box<dyn Future<Item = HttpResponse, Error = Error>> {\nlet new_factor = path.into_inner();\ndebug!(\"/metric_factor/{} POST hit\", new_factor);\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Add comment describing how the metric factor works This confused me today. Figured it should be a little better documented
20,244
02.02.2021 09:28:31
18,000
e1f49afe86c3220674cf0c1eb74aff40f95a2869
Better logging for wyre payments These errors should not be trace, errors should never be trace.
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_client/dashboard/localization.rs", "new_path": "rita/src/rita_client/dashboard/localization.rs", "diff": "@@ -55,7 +55,7 @@ pub struct AmountRequest {\npub fn get_wyre_reservation(\namount: Json<AmountRequest>,\n) -> Box<dyn Future<Item = HttpResponse, Error = Error>> {\n- trace!(\"Getting wyre reservation\");\n+ info!(\"Getting wyre reservation\");\nlet exit_client = SETTING.get_exit_client();\nlet operator = SETTING.get_operator();\nlet id = SETTING.get_identity();\n@@ -82,13 +82,13 @@ pub fn get_wyre_reservation(\nmove |value: Result<WyreReservationResponse, JsonPayloadError>| match value {\nOk(value) => Ok(HttpResponse::Ok().json(value)),\nErr(e) => {\n- trace!(\"Failed to deserialize wyre response {:?}\", e);\n+ error!(\"Failed to deserialize wyre response {:?}\", e);\nOk(HttpResponse::InternalServerError().finish())\n}\n},\n)),\nErr(e) => {\n- trace!(\"Failed to send wyre request {:?}\", e);\n+ error!(\"Failed to send wyre request {:?}\", e);\nEither::B(future::ok(HttpResponse::InternalServerError().finish()))\n}\n}),\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Better logging for wyre payments These errors should not be trace, errors should never be trace.
20,244
03.02.2021 11:37:55
18,000
ff39c71a9d2163445c372c2cd82332b8993cd0e9
Implement Display for ReleaseStatus This is the inverse of the FromStr operation we've already implemented and is useful over in operator tools for a few utility purposes.
[ { "change_type": "MODIFY", "old_path": "althea_types/src/interop.rs", "new_path": "althea_types/src/interop.rs", "diff": "@@ -362,6 +362,17 @@ impl FromStr for ReleaseStatus {\n}\n}\n+impl Display for ReleaseStatus {\n+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n+ match self {\n+ ReleaseStatus::ReleaseCandidate => write!(f, \"ReleaseCandidate\"),\n+ ReleaseStatus::PreRelease => write!(f, \"PreRelease\"),\n+ ReleaseStatus::GeneralAvailability => write!(f, \"GeneralAvailability\"),\n+ ReleaseStatus::Custom(s) => write!(f, \"{}\", s),\n+ }\n+ }\n+}\n+\n/// Something the operator may want to do to a router under their control\n#[derive(Debug, Clone, Serialize, Deserialize, Hash, Eq, PartialEq)]\npub enum OperatorAction {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Implement Display for ReleaseStatus This is the inverse of the FromStr operation we've already implemented and is useful over in operator tools for a few utility purposes.
20,244
03.02.2021 12:02:06
18,000
1ce7bde04a2207affeac05750e0e22a0e67f3c1a
Add user_set_release_feed This entire patch is a bit of a lark. We've moved to always setting release feeds on the operator tools side so I figured we should make that play nicely with user set feeds.
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_client/dashboard/release_feed.rs", "new_path": "rita/src/rita_client/dashboard/release_feed.rs", "diff": "use crate::KI;\n+use crate::SETTING;\nuse actix_web::http::StatusCode;\nuse actix_web::HttpRequest;\nuse actix_web::HttpResponse;\n@@ -6,6 +7,7 @@ use actix_web::Path;\nuse althea_kernel_interface::opkg_feeds::get_release_feed;\nuse althea_kernel_interface::opkg_feeds::set_release_feed;\nuse failure::Error;\n+use settings::RitaCommonSettings;\npub fn get_release_feed_http(_req: HttpRequest) -> Result<HttpResponse, Error> {\nif !KI.is_openwrt() {\n@@ -36,5 +38,7 @@ pub fn set_release_feed_http(path: Path<String>) -> HttpResponse {\n.json(format!(\"Failed to write new release feed with {:?}\", e));\n}\n+ let mut settings = SETTING.get_network_mut();\n+ settings.user_set_release_feed = true;\nHttpResponse::Ok().json(())\n}\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_client/operator_update/mod.rs", "new_path": "rita/src/rita_client/operator_update/mod.rs", "diff": "@@ -103,6 +103,7 @@ fn checkin() {\nlet install_details = operator_settings.installation_details.clone();\nlet billing_details = operator_settings.billing_details.clone();\nlet user_bandwidth_limit = SETTING.get_network().user_bandwidth_limit;\n+ let user_set_release_feed = SETTING.get_network().user_set_release_feed;\ndrop(operator_settings);\n@@ -204,7 +205,10 @@ fn checkin() {\n// gated on \"None\" to prevent reading a file if there is\n// no update. Maybe someday match will be smart enough to\n// avoid that on it's own\n- if new_settings.firmware_feed.is_some() {\n+ // Also disabled if the user has set their own release feed\n+ // so that they can do that without the operator tools just\n+ // setting it back every time.\n+ if new_settings.firmware_feed.is_some() && !user_set_release_feed {\nhandle_release_feed_update(new_settings.firmware_feed);\n}\n@@ -230,6 +234,10 @@ fn checkin() {\n}\nSome(OperatorAction::ChangeReleaseFeedAndUpdate { feed }) => {\nhandle_release_feed_update(Some(feed));\n+ // this is the escape hatch for the user setting their own release feed. Once an operator manually\n+ // updates them they are back in the 'normal' group\n+ let mut network = SETTING.get_network_mut();\n+ network.user_set_release_feed = false;\n// this runs the update shell script, if an update is found a reboot will occur\n// it is possible that the script fails to grab the package index or a package\n// due to network conditions this will cause the update to be delayed until the\n" }, { "change_type": "MODIFY", "old_path": "settings/src/network.rs", "new_path": "settings/src/network.rs", "diff": "@@ -31,6 +31,10 @@ fn default_light_client_hello_port() -> u16 {\n4878\n}\n+fn default_user_set_release_feed() -> bool {\n+ false\n+}\n+\n#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)]\npub struct NetworkSettings {\n/// How much non-financial metrics matter compared to a route's cost. By default a 2x more\n@@ -114,6 +118,11 @@ pub struct NetworkSettings {\n/// in a symmetrical limit of the users choice. Specified in mbit/s\n#[serde(default)]\npub user_bandwidth_limit: Option<usize>,\n+ /// we store this if the user sets their own release feed, if so we don't update from\n+ /// the operator update message but instead only accept 'update now' commands. Users\n+ /// probably won't like the feed snapping back to 'Custom' every time they change it\n+ #[serde(default = \"default_user_set_release_feed\")]\n+ pub user_set_release_feed: bool,\n}\nimpl Default for NetworkSettings {\n@@ -145,6 +154,7 @@ impl Default for NetworkSettings {\nnickname: None,\nusage_tracker_file: default_usage_tracker_file(),\nuser_bandwidth_limit: None,\n+ user_set_release_feed: false,\n}\n}\n}\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Add user_set_release_feed This entire patch is a bit of a lark. We've moved to always setting release feeds on the operator tools side so I figured we should make that play nicely with user set feeds.
20,244
17.02.2021 17:25:58
18,000
264f1b89142a76efc4c67c6091ef5c01d168c4d0
Clippy nit on functions that only return Ok/Some This is a really great addition to clippy that's identified several places where error handling seemed like it was being performed but in reality the functions simply would not ever actually return an error.
[ { "change_type": "MODIFY", "old_path": "althea_kernel_interface/src/hardware_info.rs", "new_path": "althea_kernel_interface/src/hardware_info.rs", "diff": "@@ -21,10 +21,7 @@ pub fn get_hardware_info(device_name: Option<String>) -> Result<HardwareInfo, Er\nlet num_cpus = get_numcpus()?;\n- let sensor_readings = match get_sensor_readings() {\n- Ok(readings) => Some(readings),\n- Err(_e) => None,\n- };\n+ let sensor_readings = get_sensor_readings();\nlet allocated_memory = match mem_total.checked_sub(mem_free) {\nSome(val) => val,\nNone => return Err(Error::FailedToGetMemoryUsage),\n@@ -133,7 +130,7 @@ fn maybe_get_single_line_string(path: &str) -> Option<String> {\n}\n}\n-fn get_sensor_readings() -> Result<Vec<SensorReading>, Error> {\n+fn get_sensor_readings() -> Option<Vec<SensorReading>> {\n// sensors are zero indexed and there will never be gaps\nlet mut sensor_num = 0;\nlet mut ret = Vec::new();\n@@ -155,7 +152,11 @@ fn get_sensor_readings() -> Result<Vec<SensorReading>, Error> {\nsensor_num += 1;\npath = format!(\"/sys/class/hwmon/hwmon{}\", sensor_num);\n}\n- Ok(ret)\n+ if ret.is_empty() {\n+ None\n+ } else {\n+ Some(ret)\n+ }\n}\n#[test]\n@@ -176,5 +177,5 @@ fn test_numcpus() {\nfn test_sensors() {\nlet res = get_sensor_readings();\nprintln!(\"{:?}\", res);\n- assert!(res.is_ok());\n+ assert!(res.is_some());\n}\n" }, { "change_type": "MODIFY", "old_path": "althea_kernel_interface/src/lib.rs", "new_path": "althea_kernel_interface/src/lib.rs", "diff": "@@ -82,6 +82,7 @@ pub enum KernelInterfaceError {\nEmptyRouteString,\nInvalidRouteString(String),\nTrafficControlError(String),\n+ InvalidArchString(String),\n}\nimpl fmt::Display for KernelInterfaceError {\n@@ -114,6 +115,9 @@ impl fmt::Display for KernelInterfaceError {\nKernelInterfaceError::InvalidRouteString(val) => {\nwrite!(f, \"InvalidRouteString {}\", val)\n}\n+ KernelInterfaceError::InvalidArchString(val) => {\n+ write!(f, \"InvalidArchString {}\", val)\n+ }\n}\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "althea_kernel_interface/src/opkg_feeds.rs", "new_path": "althea_kernel_interface/src/opkg_feeds.rs", "diff": "@@ -60,8 +60,12 @@ fn get_arch(line: &str) -> Result<String, Error> {\n.replace(\"packages\", \"\")\n.replace(\"althea\", \"\")\n.replace(\"/\", \"\");\n+ if arch.is_empty() {\n+ Err(Error::InvalidArchString(arch))\n+ } else {\nOk(arch)\n}\n+}\nfn get_feed(line: &str) -> Result<ReleaseStatus, Error> {\nlazy_static! {\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/peer_listener/mod.rs", "new_path": "rita/src/rita_common/peer_listener/mod.rs", "diff": "@@ -94,19 +94,9 @@ impl Handler<Tick> for PeerListener {\ntype Result = Result<(), Error>;\nfn handle(&mut self, _: Tick, _ctx: &mut Context<Self>) -> Self::Result {\ntrace!(\"Starting PeerListener tick!\");\n- let res = send_im_here(&mut self.interfaces);\n- if res.is_err() {\n- error!(\"Sending ImHere failed with {:?}\", res);\n- }\n+ send_im_here(&mut self.interfaces);\n- match receive_im_here(&mut self.interfaces) {\n- Ok(new_peers) => {\n- self.peers = new_peers;\n- }\n- Err(e) => {\n- error!(\"Receiving ImHere failed with {:?}\", e);\n- }\n- }\n+ self.peers = receive_im_here(&mut self.interfaces);\nself.listen_to_available_ifaces();\n@@ -244,7 +234,7 @@ impl ListenInterface {\n}\n}\n-fn send_im_here(interfaces: &mut HashMap<String, ListenInterface>) -> Result<(), Error> {\n+fn send_im_here(interfaces: &mut HashMap<String, ListenInterface>) {\ntrace!(\"About to send ImHere\");\nfor obj in interfaces.iter_mut() {\nlet listen_interface = obj.1;\n@@ -258,13 +248,13 @@ fn send_im_here(interfaces: &mut HashMap<String, ListenInterface>) -> Result<(),\n.linklocal_socket\n.send_to(&message.encode(), listen_interface.multicast_socketaddr);\ntrace!(\"Sending ImHere to broadcast gets {:?}\", result);\n+ if result.is_err() {\n+ info!(\"Sending ImHere failed with {:?}\", result);\n+ }\n}\n- Ok(())\n}\n-fn receive_im_here(\n- interfaces: &mut HashMap<String, ListenInterface>,\n-) -> Result<HashMap<IpAddr, Peer>, Error> {\n+fn receive_im_here(interfaces: &mut HashMap<String, ListenInterface>) -> HashMap<IpAddr, Peer> {\ntrace!(\"About to dequeue ImHere\");\nlet mut output = HashMap::<IpAddr, Peer>::new();\nfor obj in interfaces.iter_mut() {\n@@ -314,5 +304,5 @@ fn receive_im_here(\noutput.insert(peer.contact_socket.ip(), peer);\n}\n}\n- Ok(output)\n+ output\n}\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/tunnel_manager/mod.rs", "new_path": "rita/src/rita_common/tunnel_manager/mod.rs", "diff": "@@ -933,19 +933,13 @@ impl Handler<TunnelStateChange> for TunnelManager {\nfn handle(&mut self, msg: TunnelStateChange, _: &mut Context<Self>) -> Self::Result {\nfor tunnel in msg.tunnels {\n- let res = tunnel_state_change(tunnel, &mut self.tunnels);\n- if res.is_err() {\n- error!(\"Tunnel state change failed with {:?}\", res);\n- }\n+ tunnel_state_change(tunnel, &mut self.tunnels);\n}\nOk(())\n}\n}\n-fn tunnel_state_change(\n- msg: TunnelChange,\n- tunnels: &mut HashMap<Identity, Vec<Tunnel>>,\n-) -> Result<(), Error> {\n+fn tunnel_state_change(msg: TunnelChange, tunnels: &mut HashMap<Identity, Vec<Tunnel>>) {\nlet id = msg.identity;\nlet action = msg.action;\ntrace!(\n@@ -1048,8 +1042,6 @@ fn tunnel_state_change(\nerror!(\"Bandwidth limiting failed with {:?}\", res);\n}\n}\n-\n- Ok(())\n}\n/// Takes the tunnels list and iterates over it to update all of the traffic control settings\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/usage_tracker/mod.rs", "new_path": "rita/src/rita_common/usage_tracker/mod.rs", "diff": "@@ -357,16 +357,17 @@ impl Handler<UpdatePayments> for UsageTracker {\nlet _res = handle_payments(self, item);\n}\n*queue = Vec::new();\n- handle_payments(self, &msg.payment)\n+ handle_payments(self, &msg.payment);\n+ Ok(())\n}\n}\n-fn handle_payments(history: &mut UsageTracker, payment: &PaymentTx) -> Result<(), Error> {\n+fn handle_payments(history: &mut UsageTracker, payment: &PaymentTx) {\nlet current_hour = match get_current_hour() {\nOk(hour) => hour,\nErr(e) => {\nerror!(\"System time is set earlier than unix epoch! {:?}\", e);\n- return Ok(());\n+ return;\n}\n};\nlet formatted_payment = to_formatted_payment_tx(payment.clone());\n@@ -394,7 +395,6 @@ fn handle_payments(history: &mut UsageTracker, payment: &PaymentTx) -> Result<()\nlet res = history.save();\ninfo!(\"Saving usage data: {:?}\", res);\n}\n- Ok(())\n}\npub struct GetUsage {\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_exit/traffic_watcher/mod.rs", "new_path": "rita/src/rita_exit/traffic_watcher/mod.rs", "diff": "@@ -71,7 +71,7 @@ fn get_babel_info(\nroutes: &[Route],\nour_id: Identity,\nid_from_ip: HashMap<IpAddr, Identity>,\n-) -> Result<HashMap<WgKey, u64>, Error> {\n+) -> HashMap<WgKey, u64> {\n// we assume this matches what is actually set it babel becuase we\n// panic on startup if it does not get set correctly\nlet local_fee = SETTING.get_payment().local_fee;\n@@ -101,7 +101,7 @@ fn get_babel_info(\n}\n}\n}\n- Ok(destinations)\n+ destinations\n}\nstruct HelperMapReturn {\n@@ -109,7 +109,7 @@ struct HelperMapReturn {\nip_to_id: HashMap<IpAddr, Identity>,\n}\n-fn generate_helper_maps(our_id: &Identity, clients: &[Identity]) -> Result<HelperMapReturn, Error> {\n+fn generate_helper_maps(our_id: &Identity, clients: &[Identity]) -> HelperMapReturn {\nlet mut identities: HashMap<WgKey, Identity> = HashMap::new();\nlet mut id_from_ip: HashMap<IpAddr, Identity> = HashMap::new();\nlet our_settings = SETTING.get_network();\n@@ -120,10 +120,10 @@ fn generate_helper_maps(our_id: &Identity, clients: &[Identity]) -> Result<Helpe\nid_from_ip.insert(ident.mesh_ip, *ident);\n}\n- Ok(HelperMapReturn {\n+ HelperMapReturn {\nwg_to_id: identities,\nip_to_id: id_from_ip,\n- })\n+ }\n}\nfn counters_logging(\n@@ -199,10 +199,10 @@ pub fn watch(\n}\n};\n- let ret = generate_helper_maps(&our_id, clients)?;\n+ let ret = generate_helper_maps(&our_id, clients);\nlet identities = ret.wg_to_id;\nlet id_from_ip = ret.ip_to_id;\n- let destinations = get_babel_info(routes, our_id, id_from_ip)?;\n+ let destinations = get_babel_info(routes, our_id, id_from_ip);\nlet counters = match KI.read_wg_counters(\"wg_exit\") {\nOk(res) => res,\n" }, { "change_type": "MODIFY", "old_path": "settings/src/client.rs", "new_path": "settings/src/client.rs", "diff": "@@ -167,7 +167,7 @@ impl RitaSettingsStruct {\ntrace!(\"starting with settings: {:?}\", settings.read().unwrap());\n- spawn_watch_thread(settings.clone(), file_name).unwrap();\n+ spawn_watch_thread(settings.clone(), file_name);\nOk(settings)\n}\n" }, { "change_type": "MODIFY", "old_path": "settings/src/exit.rs", "new_path": "settings/src/exit.rs", "diff": "@@ -287,7 +287,7 @@ impl RitaExitSettingsStruct {\ntrace!(\"starting with settings: {:?}\", settings.read().unwrap());\n- spawn_watch_thread(settings.clone(), file_name).unwrap();\n+ spawn_watch_thread(settings.clone(), file_name);\nOk(settings)\n}\n" }, { "change_type": "MODIFY", "old_path": "settings/src/lib.rs", "new_path": "settings/src/lib.rs", "diff": "@@ -108,10 +108,7 @@ pub trait FileWrite {\nfn write(&self, file_name: &str) -> Result<(), Error>;\n}\n-fn spawn_watch_thread<'de, T: 'static>(\n- settings: Arc<RwLock<T>>,\n- file_path: &str,\n-) -> Result<(), Error>\n+fn spawn_watch_thread<'de, T: 'static>(settings: Arc<RwLock<T>>, file_path: &str)\nwhere\nT: serde::Deserialize<'de> + Sync + Send + std::fmt::Debug + Clone + Eq + FileWrite,\n{\n@@ -132,8 +129,6 @@ where\n}\n}\n});\n-\n- Ok(())\n}\nimpl<T> FileWrite for T\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Clippy nit on functions that only return Ok/Some This is a really great addition to clippy that's identified several places where error handling seemed like it was being performed but in reality the functions simply would not ever actually return an error.
20,244
12.03.2021 17:43:37
18,000
f956320557f69f28496f782a0a64ef4b7760591f
Fix dependencies for fresh install A fresh build on a new system was missing a lot of dependencies. Specifically around liboping and the integrated library.
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "@@ -11,19 +11,19 @@ This is primarily an infrastructure repo, to get a working version of Althea for\nDebian:\n- sudo apt-get install build-essential libssl-dev libsqlite3-dev pkg-config postgresql-server-dev-all\n+ sudo apt-get install build-essential libssl-dev libsqlite3-dev pkg-config postgresql-server-dev-all automake liboping-dev libtool\nUbuntu:\n- sudo apt-get install build-essential libssl-dev libsqlite3-dev pkg-config postgresql-server-dev-all\n+ sudo apt-get install build-essential libssl-dev libsqlite3-dev pkg-config postgresql-server-dev-all autoamke liboping-dev libtool\nCentos:\n- sudo yum install gcc gcc-c++ openssl-devel sqlite-devel make postgresql-devel\n+ sudo yum install gcc gcc-c++ openssl-devel sqlite-devel make postgresql-devel automake liboping-devel libtool\nFedora:\n- sudo dnf install gcc gcc-c++ openssl-devel sqlite-devel make postgresql-devel\n+ sudo dnf install gcc gcc-c++ openssl-devel sqlite-devel make postgresql-devel automake liboping-devel libtool\nArch:\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Fix dependencies for fresh install A fresh build on a new system was missing a lot of dependencies. Specifically around liboping and the integrated library.
20,244
31.03.2021 17:05:06
14,400
b89b2af2f84fb3b4e1bf52e44e0efdd25f29ad4d
Add todo for tunnel up check Finally seeing the output of this in production nearly 9 months after I wrote it. Deleting the tunnel does not seem to have the impact that I hoped and instead of resolving the issue the new tunnel simply gets re-crated with the same issue.
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_common/tunnel_manager/gc.rs", "new_path": "rita/src/rita_common/tunnel_manager/gc.rs", "diff": "@@ -246,6 +246,9 @@ fn into_interfaces_hashmap(interfaces: &[Interface]) -> HashMap<String, bool> {\n/// needs to be deleted. If we do not find the tunnel return true. Because it is possible\n/// that during a tunnel monitor failure we may encounter such a tunnel. We log this case\n/// for later inspection to determine if this ever actually happens.\n+///\n+/// TODO: this does not seem to work, the detection works, the deletion works, but the\n+/// tunnel that is remade has the same issue, requires further root cause investigation\nfn tunnel_up(interfaces: &HashMap<String, bool>, tunnel_name: &str) -> bool {\ntrace!(\"Checking if {} is up\", tunnel_name);\nif let Some(up) = interfaces.get(tunnel_name) {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Add todo for tunnel up check Finally seeing the output of this in production nearly 9 months after I wrote it. Deleting the tunnel does not seem to have the impact that I hoped and instead of resolving the issue the new tunnel simply gets re-crated with the same issue.
20,244
31.03.2021 19:54:44
14,400
6bdcab356e076ca2ee25aba144b2095921d05d3f
Bump for Beta 17 RC1
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "@@ -3311,7 +3311,7 @@ dependencies = [\n[[package]]\nname = \"rita\"\n-version = \"0.17.0\"\n+version = \"0.17.1\"\ndependencies = [\n\"actix 0.10.0\",\n\"actix 0.7.11\",\n" }, { "change_type": "MODIFY", "old_path": "rita/Cargo.toml", "new_path": "rita/Cargo.toml", "diff": "[package]\nname = \"rita\"\n-version = \"0.17.0\"\n+version = \"0.17.1\"\nauthors = [\"Justin <justin@althea.net>\", \"Jehan <jehan.tremback@gmail.com>\", \"Ben <wangben3@gmail.com>\"]\nbuild = \"build.rs\"\nedition = \"2018\"\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/dashboard/own_info.rs", "new_path": "rita/src/rita_common/dashboard/own_info.rs", "diff": "@@ -7,7 +7,7 @@ use failure::Error;\nuse num256::{Int256, Uint256};\nuse settings::RitaCommonSettings;\n-pub static READABLE_VERSION: &str = \"Beta 17 RC0\";\n+pub static READABLE_VERSION: &str = \"Beta 17 RC1\";\n#[derive(Serialize)]\npub struct OwnInfo {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Bump for Beta 17 RC1
20,244
31.03.2021 20:20:32
14,400
ca615b6c6187c0f32a6282b98db83084603fc9ee
test_funds_unlock() is a one off test This can only be run manually by a developer and should not be run by default.
[ { "change_type": "MODIFY", "old_path": "auto_bridge/src/lib.rs", "new_path": "auto_bridge/src/lib.rs", "diff": "@@ -702,6 +702,7 @@ mod tests {\n}\n#[test]\n+ #[ignore]\n/// This tests unlocking funds from the POA Xdai bridge using a lot of specially collected\n/// test data for the entire process\nfn test_funds_unlock() {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
test_funds_unlock() is a one off test This can only be run manually by a developer and should not be run by default.
20,244
13.05.2021 08:26:38
14,400
b55a7119d086f861938f09bc25adf9044026f244
Resolve new clippy nits in kernel interface
[ { "change_type": "MODIFY", "old_path": "althea_kernel_interface/src/hardware_info.rs", "new_path": "althea_kernel_interface/src/hardware_info.rs", "diff": "@@ -122,10 +122,7 @@ fn maybe_get_single_line_u64(path: &str) -> Option<u64> {\nfn maybe_get_single_line_string(path: &str) -> Option<String> {\nmatch get_lines(path) {\n- Ok(line) => match line.get(0) {\n- Some(val) => Some(val.to_string()),\n- None => None,\n- },\n+ Ok(line) => line.get(0).map(|val| val.to_string()),\nErr(_e) => None,\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "althea_kernel_interface/src/interface_tools.rs", "new_path": "althea_kernel_interface/src/interface_tools.rs", "diff": "@@ -93,8 +93,8 @@ impl dyn KernelInterface {\nlet cap = RE.captures(&line);\n// we captured something on this line\nif let Some(cap) = cap {\n- for ip_cap in cap.iter() {\n- if let Some(ip_cap) = ip_cap {\n+ // flatten drops the 'none' values in this array\n+ for ip_cap in cap.iter().flatten() {\nlet mut split = ip_cap.as_str().split('/');\nlet ip_str = split.next();\nlet netmask = split.next();\n@@ -108,7 +108,6 @@ impl dyn KernelInterface {\n}\n}\n}\n- }\nOk(ret)\n}\n" }, { "change_type": "MODIFY", "old_path": "althea_kernel_interface/src/ip_addr.rs", "new_path": "althea_kernel_interface/src/ip_addr.rs", "diff": "@@ -12,10 +12,7 @@ impl dyn KernelInterface {\n// Get the first line, check if it has state \"UP\"\nmatch String::from_utf8(output.stdout) {\n- Ok(stdout) => match stdout.lines().next() {\n- Some(line) => Some(line.contains(\"state UP\")),\n- _ => None,\n- },\n+ Ok(stdout) => stdout.lines().next().map(|line| line.contains(\"state UP\")),\n_ => None,\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "althea_kernel_interface/src/ip_route.rs", "new_path": "althea_kernel_interface/src/ip_route.rs", "diff": "@@ -133,11 +133,11 @@ impl FromStr for IpRoute {\nOk(IpRoute::ToSubnet(ToSubnet {\ndst,\nsubnet,\n- nic,\nvia,\n+ nic,\nproto,\n- metric,\nsrc,\n+ metric,\nscope,\n}))\n} else {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Resolve new clippy nits in kernel interface
20,244
13.05.2021 08:26:51
14,400
8fa3df03a401834bab2469a72f5e51ed5c9c117a
Upgrade arrayvec and resolve clippy nits
[ { "change_type": "MODIFY", "old_path": "althea_types/Cargo.toml", "new_path": "althea_types/Cargo.toml", "diff": "@@ -17,7 +17,7 @@ hex = \"0.4\"\nsodiumoxide = \"0.2\"\nactix = { version = \"0.7\", optional = true}\nclarity = \"0.4\"\n-arrayvec = {version= \"0.5\", features = [\"serde\"]}\n+arrayvec = {version= \"0.7\", features = [\"serde\"]}\nphonenumber = \"0.3\"\nlettre = {version = \"0.9\", features = [\"serde\"]}\n" }, { "change_type": "MODIFY", "old_path": "althea_types/src/contact_info.rs", "new_path": "althea_types/src/contact_info.rs", "diff": "@@ -48,10 +48,7 @@ impl ContactType {\nphone_code: None,\nemail_code: None,\n};\n- match ContactStorage::convert(same) {\n- Some(val) => Some(val.into()),\n- None => None,\n- }\n+ ContactStorage::convert(same).map(|val| val.into())\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "althea_types/src/interop.rs", "new_path": "althea_types/src/interop.rs", "diff": "@@ -22,7 +22,7 @@ pub struct Identity {\npub mesh_ip: IpAddr,\npub eth_address: Address,\npub wg_public_key: WgKey,\n- pub nickname: Option<ArrayString<[u8; 32]>>,\n+ pub nickname: Option<ArrayString<32>>,\n}\nimpl Display for Identity {\n@@ -47,7 +47,7 @@ impl Identity {\nmesh_ip: IpAddr,\neth_address: Address,\nwg_public_key: WgKey,\n- nickname: Option<ArrayString<[u8; 32]>>,\n+ nickname: Option<ArrayString<32>>,\n) -> Identity {\nIdentity {\nmesh_ip,\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Upgrade arrayvec and resolve clippy nits
20,244
13.05.2021 08:29:50
14,400
b8fddc81201c7f724e5cb100a6686076e9186197
Upgrade autobridge to latest web30
[ { "change_type": "MODIFY", "old_path": "auto_bridge/Cargo.toml", "new_path": "auto_bridge/Cargo.toml", "diff": "@@ -5,15 +5,15 @@ authors = [\"Jehan <jehan.tremback@gmail.com>, Justin <justin@althea.net>\"]\nedition = \"2018\"\n[dependencies]\n-web30 = \"0.10\"\n+web30 = \"0.13\"\nnum256 = \"0.3\"\nclarity = \"0.4\"\nrand = \"0.8\"\n-num = \"0.3\"\n+num = \"0.4\"\nlog = \"0.4\"\nserde_derive = \"1.0\"\nserde = \"1.0\"\n[dev-dependencies]\n-actix = \"0.10\"\n+actix = \"0.11\"\nfutures = \"0.3\"\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "auto_bridge/src/lib.rs", "new_path": "auto_bridge/src/lib.rs", "diff": "@@ -134,6 +134,7 @@ impl TokenBridge {\n\"getEthToTokenInputPrice(uint256)\",\n&[amount.into()],\nown_address,\n+ None,\n)\n.await?;\n@@ -160,6 +161,7 @@ impl TokenBridge {\n\"getTokenToEthInputPrice(uint256)\",\n&[amount.into()],\nown_address,\n+ None,\n)\n.await?;\n@@ -242,6 +244,7 @@ impl TokenBridge {\n\"allowance(address,address)\",\n&[own_address.into(), uniswap_address.into()],\nown_address,\n+ None,\n)\n.await?;\n@@ -466,6 +469,7 @@ impl TokenBridge {\nToken::Bytes(xdai_withdraw_txid.to_bytes_be()),\n],\nown_address,\n+ None,\n)\n.await?;\n// this may return 0x0 if the value is not yet ready, in this case\n@@ -477,6 +481,7 @@ impl TokenBridge {\n\"getMessage(bytes32)\",\n&[Token::Bytes(msg_hash.clone())],\nown_address,\n+ None,\n)\n.await?;\nif msg == vec![0] || msg.len() <= 64 {\n@@ -489,6 +494,7 @@ impl TokenBridge {\n\"getSignatures(bytes32)\",\n&[Token::Bytes(msg_hash)],\nown_address,\n+ None,\n)\n.await?;\nif sigs_payload == vec![0] || sigs_payload.len() <= 64 {\n@@ -644,7 +650,7 @@ mod tests {\n))\n.unwrap();\n- let system = actix::System::new(\"test\");\n+ let system = actix::System::new();\nlet token_bridge = new_token_bridge();\n@@ -673,7 +679,7 @@ mod tests {\n#[test]\n#[ignore]\nfn test_funds_unlock_boilerplate() {\n- let system = actix::System::new(\"test\");\n+ let system = actix::System::new();\nlet bridge = new_token_bridge();\n@@ -707,7 +713,7 @@ mod tests {\n/// test data for the entire process\nfn test_funds_unlock() {\nuse futures::future::join;\n- let system = actix::System::new(\"test\");\n+ let system = actix::System::new();\nlet dest_address = \"0x310d72afc5eef50b52a47362b6dd1913d4c87972\"\n.parse()\n.unwrap();\n@@ -782,7 +788,7 @@ mod tests {\n#[test]\n#[ignore]\nfn test_eth_to_dai_swap() {\n- let system = actix::System::new(\"test\");\n+ let system = actix::System::new();\nlet token_bridge = new_token_bridge();\n@@ -804,7 +810,7 @@ mod tests {\n#[test]\n#[ignore]\nfn test_dai_to_eth_swap() {\n- let system = actix::System::new(\"test\");\n+ let system = actix::System::new();\nlet token_bridge = new_token_bridge();\nactix::spawn(async move {\n@@ -825,7 +831,7 @@ mod tests {\n#[test]\n#[ignore]\nfn test_dai_to_xdai_bridge() {\n- let system = actix::System::new(\"test\");\n+ let system = actix::System::new();\nlet token_bridge = new_token_bridge();\n@@ -845,7 +851,7 @@ mod tests {\n#[test]\n#[ignore]\nfn test_xdai_to_dai_bridge() {\n- let system = actix::System::new(\"test\");\n+ let system = actix::System::new();\nlet token_bridge = new_token_bridge();\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Upgrade autobridge to latest web30
20,244
13.05.2021 08:34:01
14,400
33549dbf61e11e55464136327cc779edb590f694
Upgrade IpGen in CLU
[ { "change_type": "MODIFY", "old_path": "clu/Cargo.toml", "new_path": "clu/Cargo.toml", "diff": "@@ -12,7 +12,7 @@ lazy_static = \"1.4\"\nlog = \"0.4\"\nenv_logger = \"0.8\"\nfailure = \"0.1\"\n-ipgen = \"0.0.4\"\n+ipgen = \"1.0.1\"\nrand = \"0.8\"\nserde = \"1.0\"\nserde_derive = \"1.0\"\n" }, { "change_type": "MODIFY", "old_path": "clu/src/lib.rs", "new_path": "clu/src/lib.rs", "diff": "@@ -31,7 +31,7 @@ pub enum CluError {\npub fn generate_mesh_ip() -> Result<IpAddr, Error> {\nlet seed: String =\nString::from_utf8(thread_rng().sample_iter(&Alphanumeric).take(50).collect()).unwrap();\n- let mesh_ip = match ipgen::ip(&seed, \"fd00::/8\") {\n+ let mesh_ip = match ipgen::ip(&seed, \"fd00::/8\".parse().unwrap()) {\nOk(ip) => ip,\nErr(msg) => bail!(msg), // For some reason, ipgen devs decided to use Strings for all errors\n};\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Upgrade IpGen in CLU
20,244
13.05.2021 08:34:12
14,400
459ed78af226aa8e8d7cfc1bff09dac226fad0ea
Update arrayvec in settings New const generics powered arrayvec.
[ { "change_type": "MODIFY", "old_path": "settings/Cargo.toml", "new_path": "settings/Cargo.toml", "diff": "@@ -5,7 +5,7 @@ authors = [\"Ben <wangben3@gmail.com>\"]\nedition = \"2018\"\n[dependencies]\n-config = \"0.10\"\n+config = \"0.11\"\nalthea_types = { path = \"../althea_types\", features = [\"actix\"]}\nalthea_kernel_interface = { path = \"../althea_kernel_interface\" }\nauto-bridge = { path = \"../auto_bridge\" }\n@@ -19,5 +19,5 @@ failure = \"0.1\"\nowning_ref = \"0.4\"\nlazy_static = \"1.4\"\nclarity = \"0.4\"\n-arrayvec = {version= \"0.5\", features = [\"serde\"]}\n+arrayvec = {version= \"0.7\", features = [\"serde\"]}\nphonenumber = \"0.3\"\n" }, { "change_type": "MODIFY", "old_path": "settings/src/network.rs", "new_path": "settings/src/network.rs", "diff": "@@ -101,7 +101,7 @@ pub struct NetworkSettings {\npub device: Option<String>,\n/// Nickname of the device on the network\n#[serde(skip_serializing_if = \"Option::is_none\")]\n- pub nickname: Option<ArrayString<[u8; 32]>>,\n+ pub nickname: Option<ArrayString<32>>,\n/// Full file path for usage tracker storage\n#[serde(default = \"default_usage_tracker_file\")]\npub usage_tracker_file: String,\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Update arrayvec in settings New const generics powered arrayvec.
20,244
13.05.2021 09:03:26
14,400
077baa3a4671a182c4d7255650a0d461c2d78a16
Bump for Beta 17 RC2
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "@@ -3727,7 +3727,7 @@ dependencies = [\n[[package]]\nname = \"rita\"\n-version = \"0.17.1\"\n+version = \"0.17.2\"\ndependencies = [\n\"actix 0.11.1\",\n\"actix 0.7.11\",\n" }, { "change_type": "MODIFY", "old_path": "rita/Cargo.toml", "new_path": "rita/Cargo.toml", "diff": "[package]\nname = \"rita\"\n-version = \"0.17.1\"\n+version = \"0.17.2\"\nauthors = [\"Justin <justin@althea.net>\", \"Jehan <jehan.tremback@gmail.com>\", \"Ben <wangben3@gmail.com>\"]\nbuild = \"build.rs\"\nedition = \"2018\"\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/dashboard/own_info.rs", "new_path": "rita/src/rita_common/dashboard/own_info.rs", "diff": "@@ -7,7 +7,7 @@ use failure::Error;\nuse num256::{Int256, Uint256};\nuse settings::RitaCommonSettings;\n-pub static READABLE_VERSION: &str = \"Beta 17 RC1\";\n+pub static READABLE_VERSION: &str = \"Beta 17 RC2\";\n#[derive(Serialize)]\npub struct OwnInfo {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Bump for Beta 17 RC2
20,244
13.05.2021 16:20:02
14,400
59b61be219fa5888079488eb037dae93737d63e6
Remove Tunnel MembershipState The subnet dao is no longer a concept in the Althea system and therefore this is all just legacy cruft that should be removed.
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_common/tunnel_manager/mod.rs", "new_path": "rita/src/rita_common/tunnel_manager/mod.rs", "diff": "pub mod gc;\npub mod id_callback;\n+pub mod neighbor_status;\npub mod shaping;\nuse crate::rita_common;\n@@ -55,14 +56,9 @@ pub enum TunnelManagerError {\n_InvalidStateError,\n}\n-/// Action that progresses the state machine\n+/// Used to trigger the enforcement handler\n#[derive(Debug, Clone)]\n-#[allow(dead_code)]\npub enum TunnelAction {\n- /// Received confirmed membership of an identity\n- MembershipConfirmed,\n- /// Membership expired for an identity\n- MembershipExpired,\n/// Payment is not up to date for identity\nPaymentOverdue,\n/// Payment has resumed\n@@ -75,25 +71,9 @@ impl fmt::Display for TunnelAction {\n}\n}\n-/// TunnelState indicates a state where a tunnel is currently in. Made into an enum for adding new\n-/// states more easily\n-///\n-/// State changes:\n-/// NotRegistered -> MembershipConfirmed(not implemented therefore not added) -> Registered\n-#[derive(PartialEq, Debug, Eq, Hash, Clone, Copy)]\n-pub struct TunnelState {\n- payment_state: PaymentState,\n- registration_state: RegistrationState,\n-}\n-\n-#[derive(PartialEq, Debug, Clone, Copy, Eq, Hash)]\n-pub enum RegistrationState {\n- /// Tunnel is not registered\n- NotRegistered,\n- /// Tunnel is registered (default)\n- Registered,\n-}\n-\n+/// TunnelState indicates the payment state a tunnel is currently in\n+/// if this is Overdue the tunnel will use a tbf qdisc to limit traffic on\n+/// the interface\n#[derive(PartialEq, Debug, Clone, Copy, Eq, Hash)]\npub enum PaymentState {\n/// Tunnel is paid (default)\n@@ -102,27 +82,12 @@ pub enum PaymentState {\nOverdue,\n}\n-impl fmt::Display for RegistrationState {\n- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {\n- write!(f, \"{:?}\", self)\n- }\n-}\n-\nimpl fmt::Display for PaymentState {\nfn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {\nwrite!(f, \"{:?}\", self)\n}\n}\n-#[test]\n-fn test_registration_state() {\n- assert_eq!(\n- RegistrationState::NotRegistered.to_string(),\n- \"NotRegistered\"\n- );\n- assert_eq!(RegistrationState::Registered.to_string(), \"Registered\");\n-}\n-\n#[test]\nfn test_payment_state() {\nassert_eq!(PaymentState::Paid.to_string(), \"Paid\");\n@@ -153,12 +118,12 @@ pub struct Tunnel {\npub speed_limit: Option<usize>,\n/// If true this tunnel is for a light client and is working over ipv4 endpoints\npub light_client_details: Option<Ipv4Addr>,\n- state: TunnelState,\n+ payment_state: PaymentState,\n}\nimpl Display for Tunnel {\nfn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n- write!(f, \"Tunnel: IP: {} IFACE_NAME: {} IFIDX: {}, PORT: {} WG: {} ETH: {} MESH_IP: {} LAST_SEEN {}, SPEED_LIMIT {:?}, LC {:?}, STATE: {:?}\" ,\n+ write!(f, \"Tunnel: IP: {} IFACE_NAME: {} IFIDX: {}, PORT: {} WG: {} ETH: {} MESH_IP: {} LAST_SEEN {}, SPEED_LIMIT {:?}, LC {:?}, PAYMENT_STATE: {:?}\" ,\nself.ip,\nself.iface_name,\nself.listen_ifidx,\n@@ -169,7 +134,7 @@ impl Display for Tunnel {\n(Instant::now() - self.last_contact).as_secs(),\nself.speed_limit,\nself.light_client_details,\n- self.state)\n+ self.payment_state)\n}\n}\n@@ -213,11 +178,8 @@ impl Tunnel {\ncreated: now,\nspeed_limit,\nlight_client_details,\n- // By default new tunnels are in Registered state\n- state: TunnelState {\n+ // By default new tunnels are in paid state\npayment_state: PaymentState::Paid,\n- registration_state: RegistrationState::Registered,\n- },\n};\nmatch light_client_details {\n@@ -967,41 +929,9 @@ fn tunnel_state_change(msg: TunnelChange, tunnels: &mut HashMap<Identity, Vec<Tu\nfor tunnel in tunnels.iter_mut() {\ntrace!(\"Handle action {} on tunnel {:?}\", action, tunnel);\nmatch action {\n- TunnelAction::MembershipConfirmed => {\n- trace!(\n- \"Membership confirmed for identity {:?} returned tunnel {:?}\",\n- id,\n- tunnel\n- );\n- match tunnel.state.registration_state {\n- RegistrationState::NotRegistered => {\n- if tunnel.light_client_details.is_none() {\n- tunnel.monitor(0);\n- }\n- tunnel.state.registration_state = RegistrationState::Registered;\n- }\n- RegistrationState::Registered => {\n- continue;\n- }\n- }\n- }\n- TunnelAction::MembershipExpired => {\n- trace!(\"Membership for identity {:?} is expired\", id);\n- match tunnel.state.registration_state {\n- RegistrationState::Registered => {\n- if tunnel.light_client_details.is_none() {\n- tunnel.unmonitor(0);\n- }\n- tunnel.state.registration_state = RegistrationState::NotRegistered;\n- }\n- RegistrationState::NotRegistered => {\n- continue;\n- }\n- }\n- }\nTunnelAction::PaidOnTime => {\ntrace!(\"identity {:?} has paid!\", id);\n- match tunnel.state.payment_state {\n+ match tunnel.payment_state {\nPaymentState::Paid => {\ncontinue;\n}\n@@ -1010,7 +940,7 @@ fn tunnel_state_change(msg: TunnelChange, tunnels: &mut HashMap<Identity, Vec<Tu\n\"Tunnel {} has returned to a paid state.\",\ntunnel.neigh_id.global.wg_public_key\n);\n- tunnel.state.payment_state = PaymentState::Paid;\n+ tunnel.payment_state = PaymentState::Paid;\ntunnel_bw_limits_need_change = true;\n// latency detector probably got confused while enforcement\n// occurred\n@@ -1020,13 +950,13 @@ fn tunnel_state_change(msg: TunnelChange, tunnels: &mut HashMap<Identity, Vec<Tu\n}\nTunnelAction::PaymentOverdue => {\ntrace!(\"No payment from identity {:?}\", id);\n- match tunnel.state.payment_state {\n+ match tunnel.payment_state {\nPaymentState::Paid => {\ninfo!(\n\"Tunnel {} has entered an overdue state.\",\ntunnel.neigh_id.global.wg_public_key\n);\n- tunnel.state.payment_state = PaymentState::Overdue;\n+ tunnel.payment_state = PaymentState::Overdue;\ntunnel_bw_limits_need_change = true;\n}\nPaymentState::Overdue => {\n@@ -1065,7 +995,7 @@ fn tunnel_bw_limit_update(tunnels: &HashMap<Identity, Vec<Tunnel>>) -> Result<()\nlet mut limited_interfaces = 0u16;\nfor sublist in tunnels.iter() {\nfor tunnel in sublist.1.iter() {\n- if tunnel.state.payment_state == PaymentState::Overdue {\n+ if tunnel.payment_state == PaymentState::Overdue {\nlimited_interfaces += 1;\n}\n}\n@@ -1078,7 +1008,7 @@ fn tunnel_bw_limit_update(tunnels: &HashMap<Identity, Vec<Tunnel>>) -> Result<()\nfor sublist in tunnels.iter() {\nfor tunnel in sublist.1.iter() {\n- let payment_state = &tunnel.state.payment_state;\n+ let payment_state = &tunnel.payment_state;\nlet iface_name = &tunnel.iface_name;\nlet has_limit = KI.has_limit(iface_name)?;\n@@ -1095,8 +1025,6 @@ fn tunnel_bw_limit_update(tunnels: &HashMap<Identity, Vec<Tunnel>>) -> Result<()\n#[cfg(test)]\npub mod tests {\nuse super::PaymentState;\n- use super::TunnelState;\n- use crate::rita_common::tunnel_manager::RegistrationState;\nuse crate::rita_common::tunnel_manager::Tunnel;\nuse crate::rita_common::tunnel_manager::TunnelManager;\nuse althea_types::Identity;\n@@ -1149,10 +1077,7 @@ pub mod tests {\ncreated: Instant::now(),\nspeed_limit: None,\nlight_client_details,\n- state: TunnelState {\npayment_state: PaymentState::Paid,\n- registration_state: RegistrationState::Registered,\n- },\n}\n}\n@@ -1184,12 +1109,9 @@ pub mod tests {\nlet existing_tunnel =\nget_mut_tunnel_by_ifidx(0u32, tunnel_manager.tunnels.get_mut(&id).unwrap())\n.expect(\"Unable to find existing tunnel\");\n- assert_eq!(\n- existing_tunnel.state.registration_state,\n- RegistrationState::Registered\n- );\n+ assert_eq!(existing_tunnel.payment_state, PaymentState::Paid);\n// Verify mutability - manual modifications shouldn't happen elsewhere\n- existing_tunnel.state.registration_state = RegistrationState::NotRegistered;\n+ existing_tunnel.payment_state = PaymentState::Overdue;\n}\n// Verify if object is modified\n@@ -1197,10 +1119,7 @@ pub mod tests {\nlet existing_tunnel =\nget_mut_tunnel_by_ifidx(0u32, tunnel_manager.tunnels.get_mut(&id).unwrap())\n.expect(\"Unable to find existing tunnel\");\n- assert_eq!(\n- existing_tunnel.state.registration_state,\n- RegistrationState::NotRegistered\n- );\n+ assert_eq!(existing_tunnel.payment_state, PaymentState::Overdue);\n}\n}\n}\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Remove Tunnel MembershipState The subnet dao is no longer a concept in the Althea system and therefore this is all just legacy cruft that should be removed.
20,244
13.05.2021 16:20:53
14,400
fdbfdaaaae0b549e122214850fc809fadb536d83
Send enforcement status to operator tools This patch allows us to send enforcement data to operator tools which will be useful to detect payment problems and allow us to display more debugging info.
[ { "change_type": "MODIFY", "old_path": "althea_types/src/interop.rs", "new_path": "althea_types/src/interop.rs", "diff": "@@ -642,12 +642,14 @@ pub struct SensorReading {\n/// Struct for storing peer status data for reporting to the operator tools server\n/// the goal is to give a full picture of all links in the network to the operator\n/// so we include not only the link speed but also the stats history of the link\n-#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq)]\n+#[derive(Debug, Copy, Clone, Serialize, Deserialize, Eq, PartialEq)]\npub struct NeighborStatus {\n/// the id of the neighbor\npub id: Identity,\n/// their shaped wg interface speed in mbps\npub shaper_speed: Option<usize>,\n+ /// If this user is currently being enforced upon\n+ pub enforced: bool,\n}\n/// Heartbeat sent to the operator server to help monitor\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_client/operator_update/mod.rs", "new_path": "rita/src/rita_client/operator_update/mod.rs", "diff": "@@ -5,8 +5,8 @@ use crate::rita_client::dashboard::wifi::reset_wifi_pass;\nuse crate::rita_client::rita_loop::is_gateway_client;\nuse crate::rita_client::rita_loop::CLIENT_LOOP_TIMEOUT;\nuse crate::rita_common::rita_loop::is_gateway;\n+use crate::rita_common::tunnel_manager::neighbor_status::get_neighbor_status;\nuse crate::rita_common::tunnel_manager::shaping::flag_reset_shaper;\n-use crate::rita_common::tunnel_manager::shaping::get_shaping_status;\nuse crate::rita_common::utils::option_convert;\nuse crate::KI;\nuse crate::SETTING;\n@@ -16,7 +16,6 @@ use actix_web::{client, HttpMessage};\nuse althea_kernel_interface::hardware_info::get_hardware_info;\nuse althea_kernel_interface::opkg_feeds::get_release_feed;\nuse althea_kernel_interface::opkg_feeds::set_release_feed;\n-use althea_types::NeighborStatus;\nuse althea_types::OperatorAction;\nuse althea_types::OperatorCheckinMessage;\nuse althea_types::{OperatorUpdateMessage, ReleaseStatus};\n@@ -123,13 +122,10 @@ fn checkin() {\n),\n}\n- let speeds = get_shaping_status();\n+ let status = get_neighbor_status();\nlet mut neighbor_info = Vec::new();\n- for (id, speed) in speeds {\n- neighbor_info.push(NeighborStatus {\n- id,\n- shaper_speed: speed,\n- });\n+ for (_, status) in status {\n+ neighbor_info.push(status);\n}\nlet hardware_info = match get_hardware_info(SETTING.get_network().device.clone()) {\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/network_monitor/mod.rs", "new_path": "rita/src/rita_common/network_monitor/mod.rs", "diff": "@@ -32,6 +32,8 @@ use std::collections::HashMap;\nuse std::time::Duration;\nuse std::time::Instant;\n+use super::tunnel_manager::neighbor_status::UpdateNeighborStatus;\n+\n/// 10 minutes in seconds, the amount of time we wait for an interface to be\n/// 'good' before we start trying to increase it's speed\nconst BACK_OFF_TIME: Duration = Duration::from_secs(600);\n@@ -282,7 +284,11 @@ fn observe_network(\n// shape the misbehaving tunnels, we do this all at once for the sake\n// of efficiency as lots of do_sends have a high chance of getting lost\n+ // also there's nontrivial overhead\nTunnelManager::from_registry().do_send(ShapeMany { to_shape });\n+\n+ // update NeighborStatus info for operator tools\n+ TunnelManager::from_registry().do_send(UpdateNeighborStatus);\n}\nfn get_wg_key_by_ifname(neigh: &BabelNeighbor, rita_neighbors: &[RitaNeighbor]) -> Option<WgKey> {\n" }, { "change_type": "ADD", "old_path": null, "new_path": "rita/src/rita_common/tunnel_manager/neighbor_status.rs", "diff": "+use super::{PaymentState, TunnelManager};\n+use actix::{Context, Handler, Message};\n+use althea_types::Identity;\n+use althea_types::NeighborStatus;\n+use std::collections::HashMap;\n+use std::sync::{Arc, RwLock};\n+\n+lazy_static! {\n+ static ref NEIGHBOR_STATUS: Arc<RwLock<HashMap<Identity, NeighborStatus>>> =\n+ Arc::new(RwLock::new(HashMap::new()));\n+}\n+\n+/// A cross thread accessible object representing the status of a given interface, this is not perfect as it's\n+/// a mapping by identity, meaning that if a given id has multiple tunnels using different shaped speeds it may not\n+/// paint the full picture, that being said my observation is that this never seems to be the case, I can of course be wrong\n+#[allow(dead_code)]\n+pub fn get_neighbor_status() -> HashMap<Identity, NeighborStatus> {\n+ NEIGHBOR_STATUS.read().unwrap().clone()\n+}\n+\n+pub struct UpdateNeighborStatus;\n+\n+impl Message for UpdateNeighborStatus {\n+ type Result = ();\n+}\n+\n+impl Handler<UpdateNeighborStatus> for TunnelManager {\n+ type Result = ();\n+\n+ fn handle(&mut self, _: UpdateNeighborStatus, _: &mut Context<Self>) -> Self::Result {\n+ let mut external_list = NEIGHBOR_STATUS.write().unwrap();\n+ for (id, tunnel_list) in self.tunnels.iter() {\n+ // we may have many tunnels with this same peer, we want to get\n+ // the lowest shaper value of any of the recently active tunnels\n+ let mut lowest_shaper_speed = None;\n+ let mut enforced = false;\n+ for tunnel in tunnel_list.iter() {\n+ match (tunnel.speed_limit, lowest_shaper_speed) {\n+ (Some(new), Some(current)) => {\n+ if new < current {\n+ lowest_shaper_speed = Some(new);\n+ }\n+ }\n+ (Some(new), None) => lowest_shaper_speed = Some(new),\n+ (None, Some(_)) => {}\n+ (None, None) => {}\n+ }\n+ if tunnel.payment_state == PaymentState::Overdue {\n+ enforced = true;\n+ }\n+ }\n+\n+ external_list.insert(\n+ *id,\n+ NeighborStatus {\n+ id: *id,\n+ shaper_speed: lowest_shaper_speed,\n+ enforced,\n+ },\n+ );\n+ }\n+ }\n+}\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/tunnel_manager/shaping.rs", "new_path": "rita/src/rita_common/tunnel_manager/shaping.rs", "diff": "@@ -2,32 +2,14 @@ use super::TunnelManager;\nuse crate::KI;\nuse crate::SETTING;\nuse actix::{Context, Handler, Message};\n-use althea_types::Identity;\nuse settings::RitaCommonSettings;\n-use std::collections::HashMap;\nuse std::sync::atomic::AtomicBool;\nuse std::sync::atomic::Ordering;\n-use std::sync::{Arc, RwLock};\n-\n-lazy_static! {\n- static ref INTERFACE_MBPS: Arc<RwLock<HashMap<Identity, Option<usize>>>> =\n- Arc::new(RwLock::new(HashMap::new()));\n-}\nlazy_static! {\nstatic ref RESET_FLAG: AtomicBool = AtomicBool::new(false);\n}\n-/// A cross thread accessible object representing the shaping level of a given interface, this is not perfect as it's\n-/// a mapping by identity, meaning that if a given id has multiple tunnels using different shaped speeds it may not\n-/// paint the full picture, that being said my observation is that this never seems to be the case, I can of course be wrong\n-/// TODO we only ever interact with tunnel speed shaping here, we should consider moving this subcomponent to locked data\n-/// rather than actor data as part of the actix-removal refactor\n-#[allow(dead_code)]\n-pub fn get_shaping_status() -> HashMap<Identity, Option<usize>> {\n- INTERFACE_MBPS.read().unwrap().clone()\n-}\n-\n#[allow(dead_code)]\npub fn flag_reset_shaper() {\nRESET_FLAG.store(true, Ordering::Relaxed)\n@@ -63,27 +45,6 @@ impl Handler<ShapeMany> for TunnelManager {\nlet bandwidth_limit_enabled = network_settings.shaper_settings.enabled;\ndrop(network_settings);\n- // get the lowest speed from each set of tunnels by\n- // id and store that for external reference\n- let mut external_list = INTERFACE_MBPS.write().unwrap();\n- for (id, tunnel_list) in self.tunnels.iter() {\n- let mut lowest = None;\n- for tunnel in tunnel_list.iter() {\n- match (tunnel.speed_limit, lowest) {\n- (Some(new), Some(current)) => {\n- if new < current {\n- lowest = Some(new);\n- }\n- }\n- (Some(new), None) => lowest = Some(new),\n- (None, Some(_)) => {}\n- (None, None) => {}\n- }\n- }\n- external_list.insert(*id, lowest);\n- }\n- drop(external_list);\n-\n// removes shaping without requiring a restart if the flag is set or\n// if it's set in the settings\nif !bandwidth_limit_enabled || RESET_FLAG.load(Ordering::Relaxed) {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Send enforcement status to operator tools This patch allows us to send enforcement data to operator tools which will be useful to detect payment problems and allow us to display more debugging info.
20,244
14.05.2021 08:01:34
14,400
70fcbd195bd99e74ee15a58751adfabd0c4b6146
Bump for Beta 17 RC3
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "@@ -3689,7 +3689,7 @@ dependencies = [\n[[package]]\nname = \"rita\"\n-version = \"0.17.2\"\n+version = \"0.17.3\"\ndependencies = [\n\"actix 0.11.1\",\n\"actix 0.7.11\",\n" }, { "change_type": "MODIFY", "old_path": "rita/Cargo.toml", "new_path": "rita/Cargo.toml", "diff": "[package]\nname = \"rita\"\n-version = \"0.17.2\"\n+version = \"0.17.3\"\nauthors = [\"Justin <justin@althea.net>\", \"Jehan <jehan.tremback@gmail.com>\", \"Ben <wangben3@gmail.com>\"]\nbuild = \"build.rs\"\nedition = \"2018\"\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/dashboard/own_info.rs", "new_path": "rita/src/rita_common/dashboard/own_info.rs", "diff": "@@ -7,7 +7,7 @@ use failure::Error;\nuse num256::{Int256, Uint256};\nuse settings::RitaCommonSettings;\n-pub static READABLE_VERSION: &str = \"Beta 17 RC2\";\n+pub static READABLE_VERSION: &str = \"Beta 17 RC3\";\n#[derive(Serialize)]\npub struct OwnInfo {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Bump for Beta 17 RC3
20,244
26.05.2021 11:31:04
14,400
febe5f21c04661552bff8f20619acd8ac7a501cb
Increase default HTB settings for 10gbit exits This is a quick patch for what is really a far more complex problem. We need to dig into exit configuration and have it detect what these settings should be optimally. Also research needs to be done about what counts as optimal in the first place.
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_exit/database/mod.rs", "new_path": "rita/src/rita_exit/database/mod.rs", "diff": "@@ -456,9 +456,8 @@ pub fn enforce_exit_clients(\ninfo!(\"Exit is enforcing on {} because their debt of {} is greater than the limit of {}\", client.wg_pubkey, debt_entry.payment_details.debt, close_threshold);\nKI.set_class_limit(\"wg_exit\", free_tier_limit, free_tier_limit, ip)\n} else {\n- // set to 500mbps guaranteed bandwidth and 1gbps\n- // absolute max\n- KI.set_class_limit(\"wg_exit\", 500_000, 1_000_000, ip)\n+ // 10gbit rate and ceil value's we don't want to limit this\n+ KI.set_class_limit(\"wg_exit\", 10_000_000, 10_000_000, ip)\n};\nif res.is_err() {\npanic!(\"Failed to limit {} with {:?}\", ip, res);\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Increase default HTB settings for 10gbit exits This is a quick patch for what is really a far more complex problem. We need to dig into exit configuration and have it detect what these settings should be optimally. Also research needs to be done about what counts as optimal in the first place.
20,243
03.06.2021 11:49:37
14,400
b2998ca006a1de8863a2ef1d89a96b3a8ca07ba1
Fixed added perl to required dependencies Cargo clippy test was failing to build on OpenSSl without this package. I added perl to each of the operating system build command lines on the readme for future users.
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "@@ -11,23 +11,23 @@ This is primarily an infrastructure repo, to get a working version of Althea for\nDebian:\n- sudo apt-get install build-essential libssl-dev libsqlite3-dev pkg-config postgresql-server-dev-all automake liboping-dev libtool\n+ sudo apt-get install build-essential libssl-dev libsqlite3-dev pkg-config postgresql-server-dev-all automake liboping-dev libtool perl\nUbuntu:\n- sudo apt-get install build-essential libssl-dev libsqlite3-dev pkg-config postgresql-server-dev-all autoamke liboping-dev libtool\n+ sudo apt-get install build-essential libssl-dev libsqlite3-dev pkg-config postgresql-server-dev-all autoamke liboping-dev libtool perl\nCentos:\n- sudo yum install gcc gcc-c++ openssl-devel sqlite-devel make postgresql-devel automake liboping-devel libtool\n+ sudo yum install gcc gcc-c++ openssl-devel sqlite-devel make postgresql-devel automake liboping-devel libtool perl\nFedora:\n- sudo dnf install gcc gcc-c++ openssl-devel sqlite-devel make postgresql-devel automake liboping-devel libtool\n+ sudo dnf install gcc gcc-c++ openssl-devel sqlite-devel make postgresql-devel automake liboping-devel libtool perl\nArch:\n- sudo pacman -S gcc gcc-libs openssl sqlite postgressql\n+ sudo pacman -S gcc gcc-libs openssl sqlite postgressql perl\nFinally install [Rust](https://www.rustup.rs/) and add Rustup to your PATH\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Fixed added perl to required dependencies Cargo clippy test was failing to build on OpenSSl without this package. I added perl to each of the operating system build command lines on the readme for future users.
20,243
03.06.2021 19:40:15
14,400
02503ddca0799b672c7c0986c8f539cfb8c07664
Added system uptime bookkeeping code I added system uptime to get_hard_info().I adjusted HardwareInfo Struct, and adjusted KernelInterface Error to include uptime errors. Passed all tests from bash scripts/test.sh
[ { "change_type": "MODIFY", "old_path": "althea_kernel_interface/src/hardware_info.rs", "new_path": "althea_kernel_interface/src/hardware_info.rs", "diff": "@@ -3,6 +3,8 @@ use crate::KernelInterfaceError as Error;\nuse althea_types::HardwareInfo;\nuse althea_types::SensorReading;\nuse std::fs;\n+use std::time::Duration;\n+use std::u64;\n/// Gets the load average and memory of the system from /proc should be plenty\n/// efficient and safe to run. Requires the device name to be passed in because\n@@ -27,6 +29,8 @@ pub fn get_hardware_info(device_name: Option<String>) -> Result<HardwareInfo, Er\nNone => return Err(Error::FailedToGetMemoryUsage),\n};\n+ let system_uptime = get_sys_uptime()?;\n+\nOk(HardwareInfo {\nlogical_processors: num_cpus,\nload_avg_one_minute: one_minute_load_avg,\n@@ -36,9 +40,36 @@ pub fn get_hardware_info(device_name: Option<String>) -> Result<HardwareInfo, Er\nallocated_memory,\nmodel,\nsensor_readings,\n+ system_uptime,\n})\n}\n+fn get_sys_uptime() -> Result<Duration, Error> {\n+ let sys_time_error = Err(Error::FailedToGetSystemTime);\n+\n+ let lines= get_lines(\"/proc/uptime\")?;\n+ let line = match lines.get(0) {\n+ Some(line) => line,\n+ None => return sys_time_error,\n+ };\n+\n+ let mut times= line.split_whitespace();\n+\n+ //Split to convert to unsigned integer as it has a decimal\n+ let uptime:u64 = match times.next() {\n+ Some(val) =>\n+ match val.split('.').next() {\n+ Some(val) => val.parse()?,\n+ None => return sys_time_error,\n+ },\n+ None => return sys_time_error,\n+ };\n+\n+ let dur_time = Duration::new(uptime, 0);\n+\n+ Ok(dur_time)\n+}\n+\nfn get_load_avg() -> Result<(f32, f32, f32), Error> {\n// cpu load average\nlet load_average_error = Err(Error::FailedToGetLoadAverage);\n@@ -176,3 +207,18 @@ fn test_sensors() {\nprintln!(\"{:?}\", res);\nassert!(res.is_some());\n}\n+\n+#[cfg(test)]\n+mod test {\n+\n+}\n+\n+#[test]\n+fn test_sys_time() {\n+ let res = get_sys_uptime();\n+ let dur:Duration = res.unwrap();\n+\n+ let hours = dur.as_secs()/3600;\n+ let minutes = (dur.as_secs()%3600)/60;\n+ println!(\"Hours {}, Minutes {}, Seconds {}\",hours,minutes,(dur.as_secs()%3600)%60);\n+}\n" }, { "change_type": "MODIFY", "old_path": "althea_kernel_interface/src/lib.rs", "new_path": "althea_kernel_interface/src/lib.rs", "diff": "@@ -83,6 +83,7 @@ pub enum KernelInterfaceError {\nInvalidRouteString(String),\nTrafficControlError(String),\nInvalidArchString(String),\n+ FailedToGetSystemTime,\n}\nimpl fmt::Display for KernelInterfaceError {\n@@ -118,6 +119,9 @@ impl fmt::Display for KernelInterfaceError {\nKernelInterfaceError::InvalidArchString(val) => {\nwrite!(f, \"InvalidArchString {}\", val)\n}\n+ KernelInterfaceError::FailedToGetSystemTime => {\n+ write!(f, \"Failed to get system time!\")\n+ }\n}\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "althea_types/src/interop.rs", "new_path": "althea_types/src/interop.rs", "diff": "@@ -12,6 +12,7 @@ use std::hash::{Hash, Hasher};\nuse std::net::IpAddr;\nuse std::net::Ipv4Addr;\nuse std::str::FromStr;\n+use std::time::Duration;\n#[cfg(feature = \"actix\")]\nuse actix::Message;\n@@ -618,6 +619,11 @@ pub struct HardwareInfo {\n/// An array of sensors data, one entry for each sensor discovered by\n/// traversing /sys/class/hwmon\npub sensor_readings: Option<Vec<SensorReading>>,\n+ /// A 64 bit float representing the system uptime located in /proc/uptime\n+ /// This is provided by the linux kernel and is generated on the fly in\n+ /// a tuple format with no commas in the following format.\n+ /// (Up time of system in seconds Time of each core idling)\n+ pub system_uptime: Duration,\n}\n#[derive(Debug, Clone, Serialize, Deserialize)]\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Added system uptime bookkeeping code I added system uptime to get_hard_info().I adjusted HardwareInfo Struct, and adjusted KernelInterface Error to include uptime errors. Passed all tests from bash scripts/test.sh
20,243
04.06.2021 12:10:44
14,400
9b2c61bfdbd762c5cb95147ff8a2350f71f2b130
Adjusted README to include the crate: cross The testing bash script within /test did not include the crate cross causing the test to not fully run all tests. The instruction now in- clude the crate.
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "@@ -41,6 +41,12 @@ If you want to build a development build that contains unsafe options that are n\n## Testing\n+Prior to running the tests, make sure you have the following installed: cross\n+\n+```\n+ cargo install cross\n+```\n+\nIf you wish to test a commit you are developing, or just see Rita in action locally run\nbash scripts/test.sh\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Adjusted README to include the crate: cross The testing bash script within /test did not include the crate cross causing the test to not fully run all tests. The instruction now in- clude the crate.
20,244
07.06.2021 09:56:56
14,400
ee682f4ef315a3070b481c0dc2893bc09ae5d3ff
Upgrade compressed-log and web30
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "@@ -847,7 +847,7 @@ dependencies = [\n\"rand 0.8.3\",\n\"serde 1.0.126\",\n\"serde_derive\",\n- \"web30 0.13.1\",\n+ \"web30 0.14.0\",\n]\n[[package]]\n@@ -2057,9 +2057,9 @@ dependencies = [\n[[package]]\nname = \"handlebars\"\n-version = \"3.5.5\"\n+version = \"4.0.0\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"4498fc115fa7d34de968184e473529abb40eeb6be8bc5f7faba3d08c316cb3e3\"\n+checksum = \"28f0fe89affef47e2c9729030a8f6e79df34cb66b8a44ecf91dad43f31150559\"\ndependencies = [\n\"log\",\n\"pest\",\n@@ -3748,7 +3748,7 @@ dependencies = [\n\"tokio-codec\",\n\"tokio-io\",\n\"trust-dns-resolver 0.10.3\",\n- \"web30 0.13.1\",\n+ \"web30 0.14.0\",\n\"web30 0.4.3\",\n]\n@@ -5073,9 +5073,9 @@ dependencies = [\n[[package]]\nname = \"web30\"\n-version = \"0.13.1\"\n+version = \"0.14.0\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"edc06904de0714b95144d3fad8a0de9fc03404e6ad33d5820b3dbda78c1ade7b\"\n+checksum = \"d771de6834b84f5fde0e5a7fe0f0d60a220654f4bd5c2f62b1a6708a63493842\"\ndependencies = [\n\"actix 0.11.1\",\n\"awc 3.0.0-beta.5\",\n" }, { "change_type": "MODIFY", "old_path": "auto_bridge/Cargo.toml", "new_path": "auto_bridge/Cargo.toml", "diff": "@@ -5,7 +5,7 @@ authors = [\"Jehan <jehan.tremback@gmail.com>, Justin <justin@althea.net>\"]\nedition = \"2018\"\n[dependencies]\n-web30 = \"0.13\"\n+web30 = \"0.14\"\nnum256 = \"0.3\"\nclarity = \"0.4\"\nrand = \"0.8\"\n" }, { "change_type": "MODIFY", "old_path": "auto_bridge/src/lib.rs", "new_path": "auto_bridge/src/lib.rs", "diff": "@@ -288,7 +288,7 @@ impl TokenBridge {\n0u32.into(),\nown_address,\nsecret,\n- vec![SendTxOption::GasPriceMultiplier(2u32.into())],\n+ vec![SendTxOption::GasPriceMultiplier(2.0)],\n)\n.await?;\n@@ -350,7 +350,7 @@ impl TokenBridge {\nsecret,\nvec![\nSendTxOption::GasLimit(UNISWAP_GAS_LIMIT.into()),\n- SendTxOption::GasPriceMultiplier(2u32.into()),\n+ SendTxOption::GasPriceMultiplier(2.0),\n],\n)\n.await?;\n" }, { "change_type": "MODIFY", "old_path": "rita/Cargo.toml", "new_path": "rita/Cargo.toml", "diff": "@@ -29,8 +29,8 @@ web30 = {git = \"https://github.com/althea-net/web30\", rev = \"a600b8b8ebf2c49bade\n# duplicate async dependencies, we are currently carrying both futures 0.1 and modern async/await dependencies\n# these will be kept here for quite some time until the switch is completed.\n-async-web30 = {package=\"web30\", version = \"0.13.1\"}\n-actix-async = {package=\"actix\", version = \"0.11.1\"}\n+async-web30 = {package=\"web30\", version = \"0.14\"}\n+actix-async = {package=\"actix\", version = \"0.11\"}\nactix-web-async = {package=\"actix-web\", version = \"4.0.0-beta.6\", default_features = false, features= [\"openssl\"] }\nactix = \"0.7\"\n@@ -45,7 +45,7 @@ env_logger = \"0.8\"\nfailure = \"0.1\"\nfutures01 = { package = \"futures\", version = \"0.1\"}\nfutures = { version = \"0.3\", features = [\"compat\"] }\n-handlebars = \"3.5\"\n+handlebars = \"4.0\"\nipnetwork = \"0.14\"\nlazy_static = \"1.4\"\nlog = { version = \"0.4\", features = [\"release_max_level_info\"] }\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Upgrade compressed-log and web30
20,244
07.06.2021 10:00:16
14,400
a2c7010b2cb94fba9adededa972a78b7ce783749
Upgrade for Beta 17 RC4
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "@@ -3196,7 +3196,7 @@ dependencies = [\n[[package]]\nname = \"rita\"\n-version = \"0.17.3\"\n+version = \"0.17.4\"\ndependencies = [\n\"actix 0.11.1\",\n\"actix 0.7.11\",\n" }, { "change_type": "MODIFY", "old_path": "rita/Cargo.toml", "new_path": "rita/Cargo.toml", "diff": "[package]\nname = \"rita\"\n-version = \"0.17.3\"\n+version = \"0.17.4\"\nauthors = [\"Justin <justin@althea.net>\", \"Jehan <jehan.tremback@gmail.com>\", \"Ben <wangben3@gmail.com>\"]\nbuild = \"build.rs\"\nedition = \"2018\"\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/dashboard/own_info.rs", "new_path": "rita/src/rita_common/dashboard/own_info.rs", "diff": "@@ -7,7 +7,7 @@ use failure::Error;\nuse num256::{Int256, Uint256};\nuse settings::RitaCommonSettings;\n-pub static READABLE_VERSION: &str = \"Beta 17 RC3\";\n+pub static READABLE_VERSION: &str = \"Beta 17 RC4\";\n#[derive(Serialize)]\npub struct OwnInfo {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Upgrade for Beta 17 RC4
20,244
07.06.2021 14:32:30
14,400
279384bf51b901b5452cdc054b2de6ffa594bab4
Update compressed_log and bump for Beta 17 RC5 Fixes an issue where compressed log could panic because it was trying to adopt the local thread to run futures.
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "@@ -902,9 +902,9 @@ dependencies = [\n[[package]]\nname = \"compressed_log\"\n-version = \"0.3.3\"\n+version = \"0.3.4\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\n-checksum = \"604aff130d37c0a7e752c73fa65ff8a5921c8fb4c933b9c6808250657cf57e6e\"\n+checksum = \"988a21770ae28427f5a507fe6c01d4f9f004e67a3b087603e439153589b39648\"\ndependencies = [\n\"actix 0.11.1\",\n\"awc\",\n@@ -3196,7 +3196,7 @@ dependencies = [\n[[package]]\nname = \"rita\"\n-version = \"0.17.4\"\n+version = \"0.17.5\"\ndependencies = [\n\"actix 0.11.1\",\n\"actix 0.7.11\",\n" }, { "change_type": "MODIFY", "old_path": "rita/Cargo.toml", "new_path": "rita/Cargo.toml", "diff": "[package]\nname = \"rita\"\n-version = \"0.17.4\"\n+version = \"0.17.5\"\nauthors = [\"Justin <justin@althea.net>\", \"Jehan <jehan.tremback@gmail.com>\", \"Ben <wangben3@gmail.com>\"]\nbuild = \"build.rs\"\nedition = \"2018\"\n@@ -71,7 +71,7 @@ r2d2 = \"0.8\"\nsha3 = \"0.9\"\nhex-literal = \"0.3\"\nsodiumoxide = \"0.2\"\n-compressed_log = \"0.3.2\"\n+compressed_log = \"0.3.4\"\nflate2 = { version = \"1.0\", features = [\"rust_backend\"], default-features = false }\nreqwest = { version = \"0.11\", features = [\"blocking\", \"json\"] }\njemallocator = {version = \"0.3\", optional = true}\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/dashboard/own_info.rs", "new_path": "rita/src/rita_common/dashboard/own_info.rs", "diff": "@@ -7,7 +7,7 @@ use failure::Error;\nuse num256::{Int256, Uint256};\nuse settings::RitaCommonSettings;\n-pub static READABLE_VERSION: &str = \"Beta 17 RC4\";\n+pub static READABLE_VERSION: &str = \"Beta 17 RC5\";\n#[derive(Serialize)]\npub struct OwnInfo {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Update compressed_log and bump for Beta 17 RC5 Fixes an issue where compressed log could panic because it was trying to adopt the local thread to run futures.
20,244
08.06.2021 14:11:51
14,400
e60431e334fc12fa4abf1fb9b58ed688a6684838
Openwrt upload should fail on command failure Previously we did not set -x on these files so it would not be printed if for example the wget command failed. This patch fixes that issue by causing the whole script to fail in case of a failed command
[ { "change_type": "MODIFY", "old_path": "scripts/openwrt_build_ipq40xx.sh", "new_path": "scripts/openwrt_build_ipq40xx.sh", "diff": "#!/bin/bash\n+set -eux\nDIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\n# Parse command line arguments\n" }, { "change_type": "MODIFY", "old_path": "scripts/openwrt_build_mips.sh", "new_path": "scripts/openwrt_build_mips.sh", "diff": "#!/bin/bash\n+set -eux\nDIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\n# Parse command line arguments\n" }, { "change_type": "MODIFY", "old_path": "scripts/openwrt_build_mipsel.sh", "new_path": "scripts/openwrt_build_mipsel.sh", "diff": "#!/bin/bash\n+set -eux\nDIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\n# Parse command line arguments\n" }, { "change_type": "MODIFY", "old_path": "scripts/openwrt_build_mvebu.sh", "new_path": "scripts/openwrt_build_mvebu.sh", "diff": "#!/bin/bash\n+set -eux\nDIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\n# Parse command line arguments\n" }, { "change_type": "MODIFY", "old_path": "scripts/openwrt_build_octeon.sh", "new_path": "scripts/openwrt_build_octeon.sh", "diff": "#!/bin/bash\n+set -eux\nDIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\n# Parse command line arguments\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Openwrt upload should fail on command failure Previously we did not set -x on these files so it would not be printed if for example the wget command failed. This patch fixes that issue by causing the whole script to fail in case of a failed command
20,244
08.06.2021 19:22:23
14,400
a453b9647b2816850f48e0c58f9bfe79cad47b75
Provide default for new interop struct fields This adds a default system uptime and enforced var, which will allow operator tools to deserialize old entires successfully from it's database.
[ { "change_type": "MODIFY", "old_path": "althea_types/src/interop.rs", "new_path": "althea_types/src/interop.rs", "diff": "@@ -623,6 +623,7 @@ pub struct HardwareInfo {\n/// This is provided by the linux kernel and is generated on the fly in\n/// a tuple format with no commas in the following format.\n/// (Up time of system in seconds Time of each core idling)\n+ #[serde(default)]\npub system_uptime: Duration,\n}\n@@ -655,6 +656,7 @@ pub struct NeighborStatus {\n/// their shaped wg interface speed in mbps\npub shaper_speed: Option<usize>,\n/// If this user is currently being enforced upon\n+ #[serde(default)]\npub enforced: bool,\n}\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Provide default for new interop struct fields This adds a default system uptime and enforced var, which will allow operator tools to deserialize old entires successfully from it's database.
20,243
10.06.2021 14:07:39
14,400
82d89bc9165568d6b8fca2de0c7c292cdacf8cf0
Modified README to include clang in dependencies The readme command to auto-install dependencies was missing clang.
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "@@ -11,23 +11,22 @@ This is primarily an infrastructure repo, to get a working version of Althea for\nDebian:\n- sudo apt-get install build-essential libssl-dev libsqlite3-dev pkg-config postgresql-server-dev-all automake liboping-dev libtool perl\n+ sudo apt-get install build-essential libssl-dev libsqlite3-dev pkg-config postgresql-server-dev-all automake liboping-dev libtool perl clang\nUbuntu:\n- sudo apt-get install build-essential libssl-dev libsqlite3-dev pkg-config postgresql-server-dev-all autoamke liboping-dev libtool perl\n+ sudo apt-get install build-essential libssl-dev libsqlite3-dev pkg-config postgresql-server-dev-all autoamke liboping-dev libtool perl clang\nCentos:\n- sudo yum install gcc gcc-c++ openssl-devel sqlite-devel make postgresql-devel automake liboping-devel libtool perl\n-\n+ sudo yum install gcc gcc-c++ openssl-devel sqlite-devel make postgresql-devel automake liboping-devel libtool perl clang\nFedora:\n- sudo dnf install gcc gcc-c++ openssl-devel sqlite-devel make postgresql-devel automake liboping-devel libtool perl\n+ sudo dnf install gcc gcc-c++ openssl-devel sqlite-devel make postgresql-devel automake liboping-devel libtool perl clang\nArch:\n- sudo pacman -S gcc gcc-libs openssl sqlite postgressql perl\n+ sudo pacman -S gcc gcc-libs openssl sqlite postgressql perl clang\nFinally install [Rust](https://www.rustup.rs/) and add Rustup to your PATH\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Modified README to include clang in dependencies The readme command to auto-install dependencies was missing clang.
20,243
16.06.2021 11:17:37
14,400
9deabf6c3bfea8b29f84516553a5f4f435d28961
Updated hardware_info struct to contain the full kernel version string I updated the hardware_info struct to contain the full string for fut- ure debugging or other miscellaneous purposes. It may prove useful, an- it was requested by Justin.
[ { "change_type": "MODIFY", "old_path": "althea_kernel_interface/src/hardware_info.rs", "new_path": "althea_kernel_interface/src/hardware_info.rs", "diff": "@@ -30,7 +30,7 @@ pub fn get_hardware_info(device_name: Option<String>) -> Result<HardwareInfo, Er\n};\nlet system_uptime = get_sys_uptime()?;\n- let system_kernel_version = get_kernel_version()?;\n+ let (entire_system_kernel_version,system_kernel_version) = get_kernel_version()?;\nOk(HardwareInfo {\nlogical_processors: num_cpus,\n@@ -43,10 +43,11 @@ pub fn get_hardware_info(device_name: Option<String>) -> Result<HardwareInfo, Er\nsensor_readings,\nsystem_uptime,\nsystem_kernel_version,\n+ entire_system_kernel_version,\n})\n}\n-fn get_kernel_version() -> Result<String, Error> {\n+fn get_kernel_version() -> Result<(String,String), Error> {\nlet sys_kernel_ver_error = Err(Error::FailedToGetSystemKernelVersion);\nlet lines= get_lines(\"/proc/version\")?;\n@@ -58,15 +59,17 @@ fn get_kernel_version() -> Result<String, Error> {\nlet mut times = line.split_whitespace().peekable();\nlet mut kernel_ver = \"\".to_string();\n+ let mut kernel_ver_entire = \"\".to_string();\nwhile times.peek().is_some() {\nif times.next().unwrap().to_string().eq(\"Linux\") && times.next().unwrap().to_string().eq(\"version\") {\nkernel_ver = times.next().unwrap().to_string();\n- break;\n+ kernel_ver_entire.push_str(&times.next().unwrap().to_string());\n}\n+ kernel_ver_entire.push_str(&times.next().unwrap().to_string());\ntimes.next();\n}\n- Ok(kernel_ver)\n+ Ok((kernel_ver_entire,kernel_ver))\n}\nfn get_sys_uptime() -> Result<Duration, Error> {\n@@ -248,7 +251,7 @@ fn test_sys_time() {\n#[test]\nfn test_kernel_version() {\nlet res = get_kernel_version();\n- let str = res.unwrap();\n+ let (str1,str2) = res.unwrap();\n- println!(\"{}\",str);\n+ println!(\"{} {}\",str1,str2);\n}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "althea_types/src/interop.rs", "new_path": "althea_types/src/interop.rs", "diff": "@@ -630,6 +630,10 @@ pub struct HardwareInfo {\n/// running. The format will be a string as it's the most logical format\n#[serde(default = \"default_kernel_version\")]\npub system_kernel_version: String,\n+ /// The entire linux kernel version string just in case we want the extra\n+ /// information. It may be useful for debugging purposes.\n+ #[serde(default = \"default_kernel_version\")]\n+ pub entire_system_kernel_version: String,\n}\nfn default_kernel_version() -> String {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Updated hardware_info struct to contain the full kernel version string I updated the hardware_info struct to contain the full string for fut- ure debugging or other miscellaneous purposes. It may prove useful, an- it was requested by Justin.
20,244
16.06.2021 17:46:08
14,400
243c49a2dfa111a737b851f47be2685c6809e16a
Development mode should use development heartbeat key Now that the test and prod hearbeat encryption keys are different we need to automatically use the right encryption key for testing when debug mode is enabled. This reduces the amount of time wasted on developer error.
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_client/heartbeat/mod.rs", "new_path": "rita/src/rita_client/heartbeat/mod.rs", "diff": "@@ -48,10 +48,19 @@ pub struct HeartbeatCache {\nexit_neighbor_rita: RitaNeighbor,\n}\n+#[cfg(not(feature = \"operator_debug\"))]\nlazy_static! {\npub static ref HEARTBEAT_SERVER_KEY: WgKey = \"hizclQFo/ArWY+/9+AJ0LBY2dTiQK4smy5icM7GA5ng=\"\n.parse()\n.unwrap();\n+}\n+#[cfg(feature = \"operator_debug\")]\n+lazy_static! {\n+ pub static ref HEARTBEAT_SERVER_KEY: WgKey = \"RECW5xQfDzo3bzaZtzepM/+qWRuFTohChKKzUqGA0n4=\"\n+ .parse()\n+ .unwrap();\n+}\n+lazy_static! {\npub static ref HEARTBEAT_CACHE: Arc<RwLock<Option<HeartbeatCache>>> =\nArc::new(RwLock::new(None));\n}\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Development mode should use development heartbeat key Now that the test and prod hearbeat encryption keys are different we need to automatically use the right encryption key for testing when debug mode is enabled. This reduces the amount of time wasted on developer error.
20,244
16.06.2021 17:46:50
14,400
1a8c4426113f26b4e1027025412472c82eb330dc
Openwrt_upload should set development flag Just like openwrt upload by default disables remote logging we should also enable the development feature for improved debugging
[ { "change_type": "MODIFY", "old_path": "scripts/openwrt_upload.sh", "new_path": "scripts/openwrt_upload.sh", "diff": "#!/usr/bin/env bash\nset -eux\n-export TARGET=mipsel\n-export TRIPLE=mipsel-unknown-linux-musl\n+export TARGET=ipq40xx\n+export TRIPLE=armv7-unknown-linux-musleabihf\nexport ROUTER_IP=192.168.10.1\n-bash scripts/openwrt_build_$TARGET.sh $@\n+bash scripts/openwrt_build_$TARGET.sh --features development\nset +e\nssh root@$ROUTER_IP killall -9 rita\nset -e\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Openwrt_upload should set development flag Just like openwrt upload by default disables remote logging we should also enable the development feature for improved debugging
20,244
23.06.2021 18:39:09
14,400
47e3cefacc6891b1a9f8972f8f25ea3fd9cd5f8f
Fix clippy issues for latest Rust
[ { "change_type": "MODIFY", "old_path": "althea_kernel_interface/src/ip_addr.rs", "new_path": "althea_kernel_interface/src/ip_addr.rs", "diff": "@@ -66,7 +66,7 @@ fn test_add_ipv4() {\nlet val = KI\n.add_ipv4(\"192.168.31.2\".parse().unwrap(), \"eth0\")\n.expect(\"Failure to run ip test\");\n- assert_eq!(false, val);\n+ assert!(!val);\nKI.set_mock(Box::new(move |program, args| {\nassert_eq!(program, \"ip\");\n@@ -94,7 +94,7 @@ fn test_add_ipv4() {\nlet val = KI\n.add_ipv4(\"192.168.31.2\".parse().unwrap(), \"eth0\")\n.expect(\"Failure to run ip test\");\n- assert_eq!(true, val);\n+ assert!(val);\n}\n#[test]\n" }, { "change_type": "MODIFY", "old_path": "clu/src/lib.rs", "new_path": "clu/src/lib.rs", "diff": "@@ -150,7 +150,6 @@ fn linux_init(config: Arc<RwLock<settings::client::RitaSettingsStruct>>) -> Resu\n&Path::new(&network_settings.wg_private_key_path),\n&network_settings\n.wg_private_key\n- .clone()\n.expect(\"How did we get here without generating a key above?\"),\n)?;\n@@ -239,7 +238,6 @@ fn linux_exit_init(\n&Path::new(&network_settings.wg_private_key_path),\n&network_settings\n.wg_private_key\n- .clone()\n.expect(\"How did we get here without generating a key above?\"),\n)?;\n// same thing but with the exit key\n@@ -324,8 +322,8 @@ mod tests {\nfn test_validate_mesh_ip() {\nlet good_ip = \"fd44:94c:41e2::9e6\".parse::<IpAddr>().unwrap();\nlet bad_ip = \"192.168.1.1\".parse::<IpAddr>().unwrap();\n- assert_eq!(validate_mesh_ip(&good_ip), true);\n- assert_eq!(validate_mesh_ip(&bad_ip), false);\n+ assert!(validate_mesh_ip(&good_ip));\n+ assert!(!validate_mesh_ip(&bad_ip));\n}\n#[test]\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/token_bridge/mod.rs", "new_path": "rita/src/rita_common/token_bridge/mod.rs", "diff": "@@ -493,7 +493,7 @@ async fn xdai_bridge(state: State) -> State {\n.get_relay_message_hash(withdraw_xdai_txid.clone(), amount.clone())\n.await;\nif let Ok(info) = res {\n- return State::Withdrawing {\n+ State::Withdrawing {\nwithdraw_xdai_txid: withdraw_xdai_txid.clone(),\nunlock_details: Some(info),\nto,\n@@ -501,9 +501,9 @@ async fn xdai_bridge(state: State) -> State {\ntimestamp,\nwithdraw_all,\namount_actually_exchanged: amount_actually_exchanged.clone(),\n- };\n+ }\n} else {\n- return our_withdrawing_state;\n+ our_withdrawing_state\n}\n// now that we have the details that we need we must create a transaction\n@@ -527,7 +527,7 @@ async fn xdai_bridge(state: State) -> State {\n.await;\ninfo!(\"Submitting signatures to Ethereum {:?}\", res);\n- return our_withdrawing_state;\n+ our_withdrawing_state\n// this conversion is unique in that it's not lossy, when we withdraw\n// a given amount of xdai we will get exactly that many wei in dai back\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/tunnel_manager/gc.rs", "new_path": "rita/src/rita_common/tunnel_manager/gc.rs", "diff": "@@ -195,12 +195,10 @@ fn tunnel_should_be_kept(\nfn insert_into_tunnel_list(input: &Tunnel, tunnels_list: &mut HashMap<Identity, Vec<Tunnel>>) {\nlet identity = &input.neigh_id.global;\nlet input = input.clone();\n- if tunnels_list.contains_key(identity) {\n- tunnels_list.get_mut(identity).unwrap().push(input);\n- } else {\n+ if !tunnels_list.contains_key(identity) {\ntunnels_list.insert(*identity, Vec::new());\n- tunnels_list.get_mut(identity).unwrap().push(input);\n}\n+ tunnels_list.get_mut(identity).unwrap().push(input);\n}\n/// This function checks the handshake time of a tunnel when compared to the handshake timeout,\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Fix clippy issues for latest Rust
20,244
24.06.2021 21:25:05
14,400
35b85b33847c3a956730456103a147a7542a9412
Correct a bunch of mod comments This patch corrects spelling and content in several module comments
[ { "change_type": "MODIFY", "old_path": "rita/src/client.rs", "new_path": "rita/src/client.rs", "diff": "//! vpn system integrated into the Althea network design, as well as API endpoints for a management\n//! dashboard of router functions like wifi, which the exit is not expected to have.\n//!\n-//! This file initilizes the dashboard endpoints for the client as well as the common and client\n+//! This file initializes the dashboard endpoints for the client as well as the common and client\n//! specific actors.\n#![warn(clippy::all)]\n" }, { "change_type": "MODIFY", "old_path": "rita/src/exit.rs", "new_path": "rita/src/exit.rs", "diff": "//! This is the main source file for the Rita exit binary, by 'exit' we mean 'a vpn server, not a\n//! mesh router out in the field'.\n//!\n-//! All meshing and billing functionaltiy is contained in `rita_common` and is common to both rita and\n+//! All meshing and billing functionality is contained in `rita_common` and is common to both rita and\n//! `rita_exit`. The major difference is billing and connection code for the 'exit', the mandatory\n//! vpn system integrated into the Althea network design, as well as API endpoints for a management\n//! dashboard of router functions like wifi, which the exit is not expected to have.\n//!\n-//! This file initilizes the dashboard endpoints for the exit as well as the common and exit\n+//! This file initializes the dashboard endpoints for the exit as well as the common and exit\n//! specific actors.\n#![warn(clippy::all)]\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/debt_keeper/mod.rs", "new_path": "rita/src/rita_common/debt_keeper/mod.rs", "diff": "//! While traffic watcher keeps an eye on how much traffic flows and what that is worth debtkeeper\n-//! maintains the long term memory of who owes who what so that it may later be quiered and paid\n+//! maintains the long term memory of who owes who what so that it may later be queried and paid\n//! by payment_controller\n//!\n//! You may be wondering what's up with incoming payments, why can't we just have debt?\n//! Well this whole module is only slightly more complicated than it needs to be.\n//! Lets say for example that we owe Bob some money, but for reasons unknown Bob pays us, do we\n//! increase the amount we owe Bob? That's probably a vulnerability rabbit hole at the very least.\n-//! Hence we need an incoming paymetns parameter to take money out of. This of course implies half\n+//! Hence we need an incoming payments parameter to take money out of. This of course implies half\n//! of the excess complexity you see, managing an incoming payments pool versus a incoming debts pool\nuse crate::rita_common::payment_controller;\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/payment_controller/mod.rs", "new_path": "rita/src/rita_common/payment_controller/mod.rs", "diff": "-//! Placehodler payment manager, handles single transaction payments as well as\n+//! This modules handles single transaction payments as well as\n//! managing the retry flow for failed payment attempts. We will retry a payment\n-//! so long as we have not published it to a full node, once the payment is on\n+//! until it is successfully in a block, see payment_validator, once the payment is on\n//! the blockchain it's up to the reciever to validate that it's correct\nuse crate::rita_common::debt_keeper::payment_failed;\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/peer_listener/mod.rs", "new_path": "rita/src/rita_common/peer_listener/mod.rs", "diff": "//! PeerListener is used to detect nearby mesh peers, it listens on a ff02::/8 ipv6 address, which is\n//! a link local multicast address, on each listen port.\n//!\n-//! On initilization a set of ListenInterface objects are created, these are important becuase they\n+//! On initialization a set of ListenInterface objects are created, these are important because they\n//! actually hold the sockets required to listen and broadcast on the listen interfaces, every\n-//! rita_loop iteration we send out our own IP as a UDP boradcast packet and then get our peers\n+//! rita_loop iteration we send out our own IP as a UDP broadcast packet and then get our peers\n//! off the queue. These are turned into Peer structs which are passed to TunnelManager to do\n//! whatever remaining work there may be.\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Correct a bunch of mod comments This patch corrects spelling and content in several module comments
20,255
24.06.2021 15:13:11
25,200
3416b2403778bf7475ba8ea0a3c6465c47d422c6
Changed Usage_Tracker Actix implementations to Lazy_Static variables In the file rita_common -> usage_tracker -> mod.rs Removed Actor and Handler implementations for UpdateUsage, UpdatePayments, GetUsage and GetPayment structs and replaced these with function calls using the lazy_static UsageTracker struct
[ { "change_type": "MODIFY", "old_path": "rita/src/rita_client/dashboard/usage.rs", "new_path": "rita/src/rita_client/dashboard/usage.rs", "diff": "use crate::rita_common::usage_tracker::GetUsage;\nuse crate::rita_common::usage_tracker::UsageHour;\n-use crate::rita_common::usage_tracker::UsageTracker;\nuse crate::rita_common::usage_tracker::UsageType;\n-use ::actix::registry::SystemService;\n-use ::actix_web::{AsyncResponder, HttpRequest, Json};\n-use failure::Error;\n-use futures01::Future;\n-use std::boxed::Box;\n+use crate::rita_common::usage_tracker::handle_usage_data;\n+use ::actix_web::{HttpRequest, Json};\nuse std::collections::VecDeque;\npub fn get_client_usage(\n_req: HttpRequest,\n-) -> Box<dyn Future<Item = Json<VecDeque<UsageHour>>, Error = Error>> {\n+) -> Json<VecDeque<UsageHour>> {\ntrace!(\"/usage/client hit\");\n- UsageTracker::from_registry()\n- .send(GetUsage {\n+\n+ Json(handle_usage_data(GetUsage {\nkind: UsageType::Client,\n- })\n- .from_err()\n- .and_then(|reply| Ok(Json(reply?)))\n- .responder()\n+ }))\n+\n}\npub fn get_relay_usage(\n_req: HttpRequest,\n-) -> Box<dyn Future<Item = Json<VecDeque<UsageHour>>, Error = Error>> {\n+) -> Json<VecDeque<UsageHour>> {\ntrace!(\"/usage/relay hit\");\n- UsageTracker::from_registry()\n- .send(GetUsage {\n- kind: UsageType::Relay,\n- })\n- .from_err()\n- .and_then(|reply| Ok(Json(reply?)))\n- .responder()\n+\n+ Json(handle_usage_data(GetUsage {\n+ kind: UsageType::Relay\n+ }))\n}\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_client/operator_fee_manager/mod.rs", "new_path": "rita/src/rita_client/operator_fee_manager/mod.rs", "diff": "@@ -18,7 +18,7 @@ use crate::rita_common::payment_controller::TRANSACTION_SUBMISSION_TIMEOUT;\nuse crate::rita_common::rita_loop::get_web3_server;\nuse crate::rita_common::simulated_txfee_manager::add_tx_to_total;\nuse crate::rita_common::usage_tracker::UpdatePayments;\n-use crate::rita_common::usage_tracker::UsageTracker;\n+use crate::rita_common::usage_tracker::handle_payment_data;\nuse crate::SETTING;\nuse ::actix::{Actor, Arbiter, Context, Handler, Message, Supervised, SystemService};\nuse althea_types::Identity;\n@@ -200,14 +200,17 @@ impl Handler<Tick> for OperatorFeeManager {\n\"Successfully paid the operator {} wei with txid: {:#066x}!\",\namount_to_pay, txid\n);\n- UsageTracker::from_registry().do_send(UpdatePayments {\n+\n+\n+ handle_payment_data(UpdatePayments {\npayment: PaymentTx {\nto: operator_identity,\nfrom: our_id,\namount: amount_to_pay.clone(),\ntxid:Some(txid),\n- },\n+ }\n});\n+\nadd_tx_to_total(amount_to_pay.clone());\nOperatorFeeManager::from_registry().do_send(SuccessfulPayment {\namount: amount_to_pay,\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_client/traffic_watcher/mod.rs", "new_path": "rita/src/rita_client/traffic_watcher/mod.rs", "diff": "@@ -26,8 +26,8 @@ use crate::rita_common::debt_keeper::{\ntraffic_replace, traffic_update, wgkey_insensitive_traffic_update, Traffic,\n};\nuse crate::rita_common::usage_tracker::UpdateUsage;\n-use crate::rita_common::usage_tracker::UsageTracker;\nuse crate::rita_common::usage_tracker::UsageType;\n+use crate::rita_common::usage_tracker::update_usage_data;\nuse crate::KI;\nuse crate::SETTING;\nuse actix::{Actor, Arbiter, Context, Handler, Message, Supervised, SystemService};\n@@ -342,7 +342,9 @@ pub fn local_traffic_calculation(\nif owes_exit > 0 {\ninfo!(\"Total client debt of {} this round\", owes_exit);\n// update the usage tracker with the details of this round's usage\n- UsageTracker::from_registry().do_send(UpdateUsage {\n+\n+\n+ update_usage_data(UpdateUsage {\nkind: UsageType::Client,\nup: output,\ndown: input,\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/dashboard/usage.rs", "new_path": "rita/src/rita_common/dashboard/usage.rs", "diff": "use crate::rita_common::usage_tracker::GetPayments;\nuse crate::rita_common::usage_tracker::PaymentHour;\n-use crate::rita_common::usage_tracker::UsageTracker;\n-use ::actix::registry::SystemService;\n-use ::actix_web::{AsyncResponder, HttpRequest, Json};\n-use failure::Error;\n-use futures01::Future;\n-use std::boxed::Box;\n+use crate::rita_common::usage_tracker::handle_get_payments_data;\n+use ::actix_web::{HttpRequest, Json};\nuse std::collections::VecDeque;\npub fn get_payments(\n_req: HttpRequest,\n-) -> Box<dyn Future<Item = Json<VecDeque<PaymentHour>>, Error = Error>> {\n+) -> Json<VecDeque<PaymentHour>> {\ntrace!(\"/usage/relay hit\");\n- UsageTracker::from_registry()\n- .send(GetPayments {})\n- .from_err()\n- .and_then(|reply| Ok(Json(reply?)))\n- .responder()\n+\n+ Json(handle_get_payments_data(GetPayments{}))\n+\n+\n}\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/traffic_watcher/mod.rs", "new_path": "rita/src/rita_common/traffic_watcher/mod.rs", "diff": "@@ -6,8 +6,8 @@ use crate::rita_common::debt_keeper::traffic_update;\nuse crate::rita_common::debt_keeper::Traffic;\nuse crate::rita_common::tunnel_manager::Neighbor;\nuse crate::rita_common::usage_tracker::UpdateUsage;\n-use crate::rita_common::usage_tracker::UsageTracker;\nuse crate::rita_common::usage_tracker::UsageType;\n+use crate::rita_common::usage_tracker::update_usage_data;\nuse crate::KI;\nuse crate::SETTING;\nuse ::actix::{Actor, Context, Handler, Message, Supervised, SystemService};\n@@ -254,7 +254,9 @@ fn update_usage(\n);\n// update the usage tracker with the details of this round's usage\n- UsageTracker::from_registry().do_send(UpdateUsage {\n+\n+\n+ update_usage_data(UpdateUsage {\nkind: UsageType::Relay,\nup: total_out,\ndown: total_in,\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/usage_tracker/mod.rs", "new_path": "rita/src/rita_common/usage_tracker/mod.rs", "diff": "//! or graph usage they query an endpoint which will request the data from this module.\nuse crate::SETTING;\n-use actix::Actor;\n-use actix::Context;\n-use actix::Handler;\nuse actix::Message;\n-use actix::Supervised;\n-use actix::SystemService;\nuse althea_types::Identity;\nuse althea_types::PaymentTx;\nuse failure::Error;\n@@ -45,6 +40,7 @@ lazy_static! {\n/// later, for now (Beta 15) we want to reduce the amount of changes. So instead these values will be\n/// read off any time this actor is triggered by another payment message\nstatic ref PAYMENT_UPDATE_QUEUE: Arc<RwLock<Vec<PaymentTx>>> = Arc::new(RwLock::new(Vec::new()));\n+ static ref USAGE_TRACKER: Arc<RwLock<UsageTracker>> = Arc::new(RwLock::new(UsageTracker::default()));\n}\n/// In an effort to converge this module between the three possible bw tracking\n@@ -248,16 +244,6 @@ impl UsageTracker {\n}\n}\n-impl Actor for UsageTracker {\n- type Context = Context<Self>;\n-}\n-\n-impl Supervised for UsageTracker {}\n-impl SystemService for UsageTracker {\n- fn service_started(&mut self, _ctx: &mut Context<Self>) {\n- info!(\"UsageTracker started\");\n- }\n-}\n/// Gets the current hour since the unix epoch\nfn get_current_hour() -> Result<u64, Error> {\n@@ -279,22 +265,24 @@ impl Message for UpdateUsage {\ntype Result = Result<(), Error>;\n}\n-impl Handler<UpdateUsage> for UsageTracker {\n- type Result = Result<(), Error>;\n- fn handle(&mut self, msg: UpdateUsage, _: &mut Context<Self>) -> Self::Result {\n- let current_hour = match get_current_hour() {\n+\n+\n+pub fn update_usage_data(msg: UpdateUsage) {\n+\n+ let curr_hour = match get_current_hour() {\nOk(hour) => hour,\nErr(e) => {\n- error!(\"System time is set earlier than unix epoch! {:?}\", e);\n- return Ok(());\n+ error!(\"System time is set earlier than unix epoch {:?}\", e);\n+ return;\n}\n};\n- process_usage_update(current_hour, msg, self);\n- Ok(())\n- }\n+ process_usage_update(curr_hour, msg, &mut *(USAGE_TRACKER.write().unwrap()));\n+\n}\n+\n+\nfn process_usage_update(current_hour: u64, msg: UpdateUsage, data: &mut UsageTracker) {\n// history contains a reference to whatever the correct storage array is\nlet history = match msg.kind {\n@@ -349,17 +337,15 @@ impl Message for UpdatePayments {\ntype Result = Result<(), Error>;\n}\n-impl Handler<UpdatePayments> for UsageTracker {\n- type Result = Result<(), Error>;\n- fn handle(&mut self, msg: UpdatePayments, _: &mut Context<Self>) -> Self::Result {\n+#[allow(dead_code)]\n+pub fn handle_payment_data(msg: UpdatePayments) {\nlet mut queue = PAYMENT_UPDATE_QUEUE.write().unwrap();\nfor item in (*queue).iter() {\n- let _res = handle_payments(self, item);\n+ let _res = handle_payments(&mut *(USAGE_TRACKER.write().unwrap()), item);\n}\n*queue = Vec::new();\n- handle_payments(self, &msg.payment);\n- Ok(())\n- }\n+ handle_payments(&mut *(USAGE_TRACKER.write().unwrap()), &msg.payment);\n+\n}\nfn handle_payments(history: &mut UsageTracker, payment: &PaymentTx) {\n@@ -405,14 +391,13 @@ impl Message for GetUsage {\ntype Result = Result<VecDeque<UsageHour>, Error>;\n}\n-impl Handler<GetUsage> for UsageTracker {\n- type Result = Result<VecDeque<UsageHour>, Error>;\n- fn handle(&mut self, msg: GetUsage, _: &mut Context<Self>) -> Self::Result {\n+#[allow(dead_code)]\n+pub fn handle_usage_data(msg: GetUsage) -> VecDeque<UsageHour> {\n+ let usage_tracker_var = &*(USAGE_TRACKER.write().unwrap());\nmatch msg.kind {\n- UsageType::Client => Ok(self.client_bandwidth.clone()),\n- UsageType::Relay => Ok(self.relay_bandwidth.clone()),\n- UsageType::Exit => Ok(self.exit_bandwidth.clone()),\n- }\n+ UsageType::Client => usage_tracker_var.client_bandwidth.clone(),\n+ UsageType::Relay => usage_tracker_var.relay_bandwidth.clone(),\n+ UsageType::Exit => usage_tracker_var.exit_bandwidth.clone(),\n}\n}\n@@ -422,9 +407,8 @@ impl Message for GetPayments {\ntype Result = Result<VecDeque<PaymentHour>, Error>;\n}\n-impl Handler<GetPayments> for UsageTracker {\n- type Result = Result<VecDeque<PaymentHour>, Error>;\n- fn handle(&mut self, _msg: GetPayments, _: &mut Context<Self>) -> Self::Result {\n- Ok(self.payments.clone())\n- }\n+\n+pub fn handle_get_payments_data(_msg: GetPayments) -> VecDeque<PaymentHour> {\n+ let usage_tracker_var = &*(USAGE_TRACKER.write().unwrap());\n+ usage_tracker_var.payments.clone()\n}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_exit/traffic_watcher/mod.rs", "new_path": "rita/src/rita_exit/traffic_watcher/mod.rs", "diff": "use crate::rita_common::debt_keeper::traffic_update;\nuse crate::rita_common::debt_keeper::Traffic;\nuse crate::rita_common::usage_tracker::UpdateUsage;\n-use crate::rita_common::usage_tracker::UsageTracker;\nuse crate::rita_common::usage_tracker::UsageType;\n+use crate::rita_common::usage_tracker::update_usage_data;\nuse crate::SETTING;\nuse actix::{Actor, Context, Handler, Message, Supervised, SystemService};\nuse althea_kernel_interface::wg_iface_counter::prepare_usage_history;\n@@ -157,8 +157,8 @@ fn counters_logging(\n}\n}\n- // update the usage tracker with the details of this round's usage\n- UsageTracker::from_registry().do_send(UpdateUsage {\n+\n+ update_usage_data(UpdateUsage {\nkind: UsageType::Exit,\nup: total_out,\ndown: total_in,\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Changed Usage_Tracker Actix implementations to Lazy_Static variables In the file rita_common -> usage_tracker -> mod.rs Removed Actor and Handler implementations for UpdateUsage, UpdatePayments, GetUsage and GetPayment structs and replaced these with function calls using the lazy_static UsageTracker struct
20,244
25.06.2021 12:55:58
14,400
43a659d2a63d514873a7c8b2874fa0e526448396
Bump for Beta 18 RC 0 More module migrations is enough to call a cut between Beta 17 and 18 for now. We're going to backport some bug fixes to 17 as we roll it out to hopefully stabalize it properly.
[ { "change_type": "MODIFY", "old_path": "Cargo.lock", "new_path": "Cargo.lock", "diff": "# This file is automatically @generated by Cargo.\n# It is not intended for manual editing.\n+version = 3\n+\n[[package]]\nname = \"actix\"\nversion = \"0.7.11\"\n@@ -3196,7 +3198,7 @@ dependencies = [\n[[package]]\nname = \"rita\"\n-version = \"0.17.5\"\n+version = \"0.18.0\"\ndependencies = [\n\"actix 0.11.1\",\n\"actix 0.7.11\",\n" }, { "change_type": "MODIFY", "old_path": "rita/Cargo.toml", "new_path": "rita/Cargo.toml", "diff": "[package]\nname = \"rita\"\n-version = \"0.17.5\"\n+version = \"0.18.0\"\nauthors = [\"Justin <justin@althea.net>\", \"Jehan <jehan.tremback@gmail.com>\", \"Ben <wangben3@gmail.com>\"]\nbuild = \"build.rs\"\nedition = \"2018\"\n" }, { "change_type": "MODIFY", "old_path": "rita/src/rita_common/dashboard/own_info.rs", "new_path": "rita/src/rita_common/dashboard/own_info.rs", "diff": "@@ -7,7 +7,7 @@ use failure::Error;\nuse num256::{Int256, Uint256};\nuse settings::RitaCommonSettings;\n-pub static READABLE_VERSION: &str = \"Beta 17 RC5\";\n+pub static READABLE_VERSION: &str = \"Beta 18 RC0\";\n#[derive(Serialize)]\npub struct OwnInfo {\n" } ]
Rust
Apache License 2.0
althea-net/althea_rs
Bump for Beta 18 RC 0 More module migrations is enough to call a cut between Beta 17 and 18 for now. We're going to backport some bug fixes to 17 as we roll it out to hopefully stabalize it properly.