From e8ae567b7cc232c6f44c5676b9752153f8b8b435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Thu, 15 Dec 2022 10:36:09 +0100 Subject: [PATCH 01/39] as_ref in aleph-client for Connection types --- aleph-client/src/connections.rs | 14 ++++++++++- aleph-client/src/pallets/session.rs | 9 ++++---- aleph-client/src/waiting.rs | 36 ++++++++++++++++++++++++----- 3 files changed, 48 insertions(+), 11 deletions(-) diff --git a/aleph-client/src/connections.rs b/aleph-client/src/connections.rs index 2d8da43b4b..aba07e6c01 100644 --- a/aleph-client/src/connections.rs +++ b/aleph-client/src/connections.rs @@ -1,4 +1,4 @@ -use std::{thread::sleep, time::Duration}; +use std::{convert::AsRef, thread::sleep, time::Duration}; use anyhow::anyhow; use codec::Decode; @@ -58,6 +58,12 @@ impl SudoCall for RootConnection { } } +impl AsRef for Connection { + fn as_ref(&self) -> &Connection { + self + } +} + impl Connection { const DEFAULT_RETRIES: u32 = 10; const RETRY_WAIT_SECS: u64 = 1; @@ -161,6 +167,12 @@ impl SignedConnection { } } +impl AsRef for SignedConnection { + fn as_ref(&self) -> &Connection { + &self.connection + } +} + impl RootConnection { pub async fn new(address: String, root: KeyPair) -> anyhow::Result { RootConnection::try_from_connection(Connection::new(address).await, root).await diff --git a/aleph-client/src/pallets/session.rs b/aleph-client/src/pallets/session.rs index c5393e2a49..43a8903d12 100644 --- a/aleph-client/src/pallets/session.rs +++ b/aleph-client/src/pallets/session.rs @@ -22,7 +22,7 @@ pub trait SessionUserApi { } #[async_trait::async_trait] -impl SessionApi for Connection { +impl + Sync + ?Sized> SessionApi for C { async fn get_next_session_keys( &self, account: AccountId, @@ -30,13 +30,14 @@ impl SessionApi for Connection { ) -> Option { let addrs = api::storage().session().next_keys(account); - self.get_storage_entry_maybe(&addrs, at).await + self.as_ref().get_storage_entry_maybe(&addrs, at).await } async fn get_session(&self, at: Option) -> SessionIndex { let addrs = api::storage().session().current_index(); - self.get_storage_entry_maybe(&addrs, at) + self.as_ref() + .get_storage_entry_maybe(&addrs, at) .await .unwrap_or_default() } @@ -44,7 +45,7 @@ impl SessionApi for Connection { async fn get_validators(&self, at: Option) -> Vec { let addrs = api::storage().session().validators(); - self.get_storage_entry(&addrs, at).await + self.as_ref().get_storage_entry(&addrs, at).await } } diff --git a/aleph-client/src/waiting.rs b/aleph-client/src/waiting.rs index dcb8b355ef..a9d8aec827 100644 --- a/aleph-client/src/waiting.rs +++ b/aleph-client/src/waiting.rs @@ -34,11 +34,23 @@ pub trait WaitingExt { } #[async_trait::async_trait] -impl AlephWaiting for Connection { +impl + Sync> AlephWaiting for C { async fn wait_for_block bool + Send>(&self, predicate: P, status: BlockStatus) { let mut block_sub = match status { - BlockStatus::Best => self.client.blocks().subscribe_best().await.unwrap(), - BlockStatus::Finalized => self.client.blocks().subscribe_finalized().await.unwrap(), + BlockStatus::Best => self + .as_ref() + .client + .blocks() + .subscribe_best() + .await + .unwrap(), + BlockStatus::Finalized => self + .as_ref() + .client + .blocks() + .subscribe_finalized() + .await + .unwrap(), }; while let Some(Ok(block)) = block_sub.next().await { @@ -54,8 +66,20 @@ impl AlephWaiting for Connection { status: BlockStatus, ) -> T { let mut block_sub = match status { - BlockStatus::Best => self.client.blocks().subscribe_best().await.unwrap(), - BlockStatus::Finalized => self.client.blocks().subscribe_finalized().await.unwrap(), + BlockStatus::Best => self + .as_ref() + .client + .blocks() + .subscribe_best() + .await + .unwrap(), + BlockStatus::Finalized => self + .as_ref() + .client + .blocks() + .subscribe_finalized() + .await + .unwrap(), }; info!(target: "aleph-client", "waiting for event {}.{}", T::PALLET, T::EVENT); @@ -81,7 +105,7 @@ impl AlephWaiting for Connection { async fn wait_for_era(&self, era: EraIndex, status: BlockStatus) { let addrs = aleph_zero::api::constants().staking().sessions_per_era(); - let sessions_per_era = self.client.constants().at(&addrs).unwrap(); + let sessions_per_era = self.as_ref().client.constants().at(&addrs).unwrap(); let first_session_in_era = era * sessions_per_era; self.wait_for_session(first_session_in_era, status).await; From 528f9aa1cd88e132f5ea82dd1da3b165d54dea1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Wed, 14 Dec 2022 23:48:24 +0100 Subject: [PATCH 02/39] rust API for synthetic-network's json API --- .../synthetic-link/Cargo.lock | 1307 +++++++++++++++++ .../synthetic-link/Cargo.toml | 16 + .../synthetic-link/src/lib.rs | 138 ++ .../synthetic-link/src/main.rs | 34 + 4 files changed, 1495 insertions(+) create mode 100644 scripts/synthetic-network/synthetic-link/Cargo.lock create mode 100644 scripts/synthetic-network/synthetic-link/Cargo.toml create mode 100644 scripts/synthetic-network/synthetic-link/src/lib.rs create mode 100644 scripts/synthetic-network/synthetic-link/src/main.rs diff --git a/scripts/synthetic-network/synthetic-link/Cargo.lock b/scripts/synthetic-network/synthetic-link/Cargo.lock new file mode 100644 index 0000000000..0f7701b053 --- /dev/null +++ b/scripts/synthetic-network/synthetic-link/Cargo.lock @@ -0,0 +1,1307 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aho-corasick" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +dependencies = [ + "memchr", +] + +[[package]] +name = "anyhow" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bumpalo" +version = "3.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" + +[[package]] +name = "bytes" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" + +[[package]] +name = "cc" +version = "1.0.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clap" +version = "4.0.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d63b9e9c07271b9957ad22c173bae2a4d9a81127680962039296abcd2f8251d" +dependencies = [ + "bitflags", + "clap_derive", + "clap_lex", + "is-terminal", + "once_cell", + "strsim", + "termcolor", +] + +[[package]] +name = "clap_derive" +version = "4.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + +[[package]] +name = "encoding_rs" +version = "0.8.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "env_logger" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +dependencies = [ + "humantime", + "is-terminal", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "errno" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +dependencies = [ + "errno-dragonfly", + "libc", + "winapi", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "fastrand" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +dependencies = [ + "instant", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures-channel" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" + +[[package]] +name = "futures-sink" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" + +[[package]] +name = "futures-task" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" + +[[package]] +name = "futures-util" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[package]] +name = "h2" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "heck" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] +name = "http" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "hyper" +version = "0.14.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "1.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46112a93252b123d31a119a8d1a1ac19deac4fac6e0e8b0df58f0d4e5870e63c" +dependencies = [ + "libc", + "windows-sys 0.42.0", +] + +[[package]] +name = "ipnet" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec947b7a4ce12e3b87e353abae7ce124d025b6c7d6c5aea5cc0bcf92e9510ded" + +[[package]] +name = "is-terminal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927609f78c2913a6f6ac3c27a4fe87f43e2a35367c0c4b0f8265e8f49a104330" +dependencies = [ + "hermit-abi 0.2.6", + "io-lifetimes", + "rustix", + "windows-sys 0.42.0", +] + +[[package]] +name = "itoa" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" + +[[package]] +name = "js-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.138" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" + +[[package]] +name = "linux-raw-sys" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f9f08d8963a6c613f4b1a78f4f4a4dbfadf8e6545b2d72861731e4858b8b47f" + +[[package]] +name = "lock_api" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "mime" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" + +[[package]] +name = "mio" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" +dependencies = [ + "libc", + "log", + "wasi", + "windows-sys 0.42.0", +] + +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "num_cpus" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" +dependencies = [ + "hermit-abi 0.1.19", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" + +[[package]] +name = "openssl" +version = "0.10.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29d971fd5722fec23977260f6e81aa67d2f22cadbdc2aa049f1022d9a3be1566" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5454462c0eced1e97f2ec09036abc8da362e66802f66fd20f86854d9d8cbcbc4" +dependencies = [ + "autocfg", + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "os_str_bytes" +version = "6.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys 0.42.0", +] + +[[package]] +name = "percent-encoding" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" + +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi", +] + +[[package]] +name = "reqwest" +version = "0.11.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + +[[package]] +name = "rustix" +version = "0.36.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3807b5d10909833d3e9acd1eb5fb988f79376ff10fce42937de71a449c4c588" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.42.0", +] + +[[package]] +name = "ryu" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" + +[[package]] +name = "schannel" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +dependencies = [ + "lazy_static", + "windows-sys 0.36.1", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "security-framework" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "serde" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "256b9932320c590e707b94576e3cc1f7c9024d0ee6612dfbcf1cb106cbe8e055" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4eae9b04cbffdfd550eb462ed33bc6a1b68c935127d008b27444d08380f94e4" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "socket2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "syn" +version = "1.0.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synthetic-link" +version = "0.1.0" +dependencies = [ + "anyhow", + "clap", + "env_logger", + "log", + "reqwest", + "serde", + "serde_json", + "tokio", +] + +[[package]] +name = "tempfile" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +dependencies = [ + "cfg-if", + "fastrand", + "libc", + "redox_syscall", + "remove_dir_all", + "winapi", +] + +[[package]] +name = "termcolor" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "1.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eab6d665857cc6ca78d6e80303a02cea7a7851e85dfbd77cbdc09bd129f1ef46" +dependencies = [ + "autocfg", + "bytes", + "libc", + "memchr", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.42.0", +] + +[[package]] +name = "tokio-macros" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" + +[[package]] +name = "unicode-bidi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" + +[[package]] +name = "unicode-ident" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "url" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log", + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" + +[[package]] +name = "web-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.0", + "windows_i686_gnu 0.42.0", + "windows_i686_msvc 0.42.0", + "windows_x86_64_gnu 0.42.0", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" + +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] diff --git a/scripts/synthetic-network/synthetic-link/Cargo.toml b/scripts/synthetic-network/synthetic-link/Cargo.toml new file mode 100644 index 0000000000..9e2696ee8b --- /dev/null +++ b/scripts/synthetic-network/synthetic-link/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "synthetic-link" +version = "0.1.0" +authors = ["Cardinal Cryptography"] +edition = "2021" +license = "Apache 2.0" + +[dependencies] +anyhow = "1.0.66" +clap = { version = "4.0.29", features = ["derive"] } +env_logger = "0.10.0" +log = "0.4.17" +reqwest = { version = "0.11.13", features = ["json"] } +serde = { version = "1.0.149", features = ["derive"] } +serde_json = "1.0.89" +tokio = { version = "1.23.0", features = ["full"] } diff --git a/scripts/synthetic-network/synthetic-link/src/lib.rs b/scripts/synthetic-network/synthetic-link/src/lib.rs new file mode 100644 index 0000000000..be17642d73 --- /dev/null +++ b/scripts/synthetic-network/synthetic-link/src/lib.rs @@ -0,0 +1,138 @@ +use reqwest::Client; +use serde::{Deserialize, Serialize}; + +// This code is a copy-paste of data structures declared in the `synthetic-network/rush` project. +#[derive(Serialize, Deserialize)] +pub struct SyntheticNetwork { + default_link: SyntheticLink, + flows: Vec, +} + +#[derive(Serialize, Deserialize)] +pub struct SyntheticLink { + ingress: QoS, + egress: QoS, +} + +#[derive(Serialize, Deserialize)] +pub struct QoS { + rate: u64, + loss: f64, + latency: u64, + jitter: u64, + jitter_strength: f64, + reorder_packets: bool, +} + +#[derive(Serialize, Deserialize)] +pub struct SyntheticFlow { + label: String, + flow: Flow, + link: SyntheticLink, +} + +#[derive(Serialize, Deserialize)] +pub struct Flow { + ip: u32, + protocol: u8, + port_min: u16, + port_max: u16, +} + +pub struct SyntheticNetworkClient { + client: Client, + url: String, +} + +pub struct NetworkConfig { + config: SyntheticNetwork, +} + +const DEFAULT_QOS: QoS = QoS { + rate: 1000000000, + loss: 0.0, + latency: 0, + jitter: 0, + jitter_strength: 0.0, + reorder_packets: false, +}; + +impl NetworkConfig { + pub fn new() -> Self { + NetworkConfig { + config: SyntheticNetwork { + default_link: SyntheticLink { + ingress: DEFAULT_QOS, + egress: DEFAULT_QOS, + }, + flows: Vec::default(), + }, + } + } + + pub fn set_out_latency(&mut self, latency_milliseconds: u64) -> &mut Self { + self.config.default_link.egress.latency = latency_milliseconds; + self + } + + pub fn set_in_latency(&mut self, latency_milliseconds: u64) -> &mut Self { + self.config.default_link.ingress.latency = latency_milliseconds; + self + } + + pub fn set_out_rate(&mut self, rate: u64) -> &mut Self { + self.config.default_link.egress.rate = rate; + self + } + + pub fn set_in_rate(&mut self, rate: u64) -> &mut Self { + self.config.default_link.ingress.rate = rate; + self + } + + pub fn into_synthetic_network(&self) -> &SyntheticNetwork { + &self.config + } +} + +impl Default for NetworkConfig { + fn default() -> Self { + NetworkConfig::new() + } +} + +impl From for NetworkConfig { + fn from(synth_net: SyntheticNetwork) -> Self { + Self { config: synth_net } + } +} + +impl SyntheticNetworkClient { + pub fn new_url(url: impl Into) -> Self { + SyntheticNetworkClient { + client: Client::new(), + url: url.into(), + } + } + + pub async fn commit_config(&mut self, config: &NetworkConfig) -> anyhow::Result<()> { + let result = self + .client + .post(&self.url) + .json(config.into_synthetic_network()) + .send() + .await; + Ok(result.map(|_| ())?) + } + + pub async fn load_config(&mut self) -> anyhow::Result { + let result = self + .client + .get(&self.url) + .send() + .await? + .json::() + .await; + Ok(result.map(NetworkConfig::from)?) + } +} diff --git a/scripts/synthetic-network/synthetic-link/src/main.rs b/scripts/synthetic-network/synthetic-link/src/main.rs new file mode 100644 index 0000000000..da0972b444 --- /dev/null +++ b/scripts/synthetic-network/synthetic-link/src/main.rs @@ -0,0 +1,34 @@ +use clap::{arg, Parser}; +use log::info; +use synthetic_link::{SyntheticNetwork, SyntheticNetworkClient}; + +#[derive(Parser, Debug)] +struct Args { + #[arg(short, long, default_value = "http://Node0:80/qos")] + url: String, +} + +#[tokio::main] +async fn main() { + env_logger::init(); + + let args = Args::parse(); + let synth_net_url = args.url; + + info!("reading SyntheticNetwork configuration from stdin"); + let deserializer = serde_json::Deserializer::from_reader(std::io::stdin()); + let synth_net_config: SyntheticNetwork = deserializer + .into_iter() + .next() + .unwrap_or_else(|| panic!("no configuration on stdin")) + .unwrap_or_else(|e| panic!("unable to parse SyntheticNetwork config: {}", e)); + info!("parsed SyntheticNetwork configuration"); + + info!("commiting configuration"); + let mut synth_net_client = SyntheticNetworkClient::new_url(synth_net_url); + synth_net_client + .commit_config(&synth_net_config.into()) + .await + .unwrap_or_else(|e| panic!("failed to commit SyntheticNetwork configuration: {}", e)); + info!("successfully committed new configuration"); +} From 5a98f81188a5009e0e6e2336c7f168a2adad1b9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Thu, 15 Dec 2022 10:08:48 +0100 Subject: [PATCH 03/39] refactored synthetic-link --- .../synthetic-link/src/lib.rs | 171 +++++++++++++++--- .../synthetic-link/src/main.rs | 6 +- 2 files changed, 149 insertions(+), 28 deletions(-) diff --git a/scripts/synthetic-network/synthetic-link/src/lib.rs b/scripts/synthetic-network/synthetic-link/src/lib.rs index be17642d73..391c4193c1 100644 --- a/scripts/synthetic-network/synthetic-link/src/lib.rs +++ b/scripts/synthetic-network/synthetic-link/src/lib.rs @@ -1,21 +1,24 @@ +use std::ops::RangeInclusive; + use reqwest::Client; use serde::{Deserialize, Serialize}; -// This code is a copy-paste of data structures declared in the `synthetic-network/rush` project. +// This section is an exact copy of data structures declared in the `synthetic-network/rush` project. + #[derive(Serialize, Deserialize)] -pub struct SyntheticNetwork { +struct SyntheticNetwork { default_link: SyntheticLink, flows: Vec, } #[derive(Serialize, Deserialize)] -pub struct SyntheticLink { +struct SyntheticLink { ingress: QoS, egress: QoS, } #[derive(Serialize, Deserialize)] -pub struct QoS { +struct QoS { rate: u64, loss: f64, latency: u64, @@ -25,29 +28,30 @@ pub struct QoS { } #[derive(Serialize, Deserialize)] -pub struct SyntheticFlow { +struct SyntheticFlow { label: String, flow: Flow, link: SyntheticLink, } #[derive(Serialize, Deserialize)] -pub struct Flow { +struct Flow { ip: u32, protocol: u8, port_min: u16, port_max: u16, } +// end of copy-paste + +#[derive(Serialize, Deserialize)] +pub struct SyntheticNetworkJson(SyntheticNetwork); + pub struct SyntheticNetworkClient { client: Client, url: String, } -pub struct NetworkConfig { - config: SyntheticNetwork, -} - const DEFAULT_QOS: QoS = QoS { rate: 1000000000, loss: 0.0, @@ -57,41 +61,152 @@ const DEFAULT_QOS: QoS = QoS { reorder_packets: false, }; +const DEFAULT_FLOW: Flow = Flow { + ip: 0, + protocol: 0, + port_min: 0, + port_max: 0, +}; + +const DEFAULT_LINK: SyntheticLink = SyntheticLink { + ingress: DEFAULT_QOS, + egress: DEFAULT_QOS, +}; + +const DEFAULT_NAMED_FLOW: SyntheticFlow = SyntheticFlow { + label: String::new(), + flow: DEFAULT_FLOW, + link: DEFAULT_LINK, +}; + +pub struct NetworkConfig { + config: SyntheticNetwork, +} + impl NetworkConfig { - pub fn new() -> Self { + pub const fn new() -> Self { NetworkConfig { config: SyntheticNetwork { default_link: SyntheticLink { ingress: DEFAULT_QOS, egress: DEFAULT_QOS, }, - flows: Vec::default(), + flows: Vec::new(), }, } } - pub fn set_out_latency(&mut self, latency_milliseconds: u64) -> &mut Self { - self.config.default_link.egress.latency = latency_milliseconds; + pub fn ingress(&mut self, qos: NetworkQoS) -> &mut Self { + self.config.default_link.ingress = qos.qos; + self + } + pub fn egress(&mut self, qos: NetworkQoS) -> &mut Self { + self.config.default_link.egress = qos.qos; self } - pub fn set_in_latency(&mut self, latency_milliseconds: u64) -> &mut Self { - self.config.default_link.ingress.latency = latency_milliseconds; + pub fn add_flow(&mut self, flow: NetworkFlow) -> &mut Self { + self.config.flows.push(flow.flow); self } - pub fn set_out_rate(&mut self, rate: u64) -> &mut Self { - self.config.default_link.egress.rate = rate; + fn into_synthetic_network(&self) -> &SyntheticNetwork { + &self.config + } +} + +pub struct NetworkFlow { + flow: SyntheticFlow, +} + +impl NetworkFlow { + pub const fn new() -> Self { + NetworkFlow { + flow: DEFAULT_NAMED_FLOW, + } + } + + pub fn label(&mut self, label: String) -> &mut Self { + self.flow.label = label; self } - pub fn set_in_rate(&mut self, rate: u64) -> &mut Self { - self.config.default_link.ingress.rate = rate; + pub fn ip(&mut self, ip: IpPattern) -> &mut Self { + let ip = match ip { + IpPattern::All => 0, + IpPattern::Ip(ip) => ip, + }; + self.flow.flow.ip = ip; self } - pub fn into_synthetic_network(&self) -> &SyntheticNetwork { - &self.config + pub fn protocol(&mut self, protocol: Protocol) -> &mut Self { + let protocol_id = match protocol { + Protocol::Icmp => 1, + Protocol::Tcp => 6, + Protocol::Udp => 17, + Protocol::All => 0, + }; + self.flow.flow.protocol = protocol_id; + self + } + + pub fn port_range(&mut self, port_range: RangeInclusive) -> &mut Self { + self.flow.flow.port_min = *port_range.start(); + self.flow.flow.port_max = *port_range.end(); + self + } +} + +pub enum IpPattern { + All, + Ip(u32), +} + +pub enum Protocol { + Icmp, + Tcp, + Udp, + All, +} + +pub struct NetworkLink { + link: SyntheticLink, +} + +impl NetworkLink { + pub const fn new() -> Self { + NetworkLink { link: DEFAULT_LINK } + } + + pub fn ingress(&mut self, qos: NetworkQoS) -> &mut Self { + self.link.ingress = qos.qos; + self + } + + pub fn egress(&mut self, qos: NetworkQoS) -> &mut Self { + self.link.egress = qos.qos; + self + } +} + +pub struct NetworkQoS { + qos: QoS, +} + +impl NetworkQoS { + pub const fn new() -> Self { + NetworkQoS { qos: DEFAULT_QOS } + } + + pub fn latency(&mut self, latency_milliseconds: u64) -> &mut Self { + self.qos.latency = latency_milliseconds; + self + } + + pub fn rate(&mut self, rate: u64) -> &mut Self { + self.qos.rate = rate; + self } } @@ -107,11 +222,17 @@ impl From for NetworkConfig { } } +impl From for NetworkConfig { + fn from(value: SyntheticNetworkJson) -> Self { + NetworkConfig::from(value.0) + } +} + impl SyntheticNetworkClient { - pub fn new_url(url: impl Into) -> Self { + pub fn new(url: String) -> Self { SyntheticNetworkClient { client: Client::new(), - url: url.into(), + url, } } @@ -119,7 +240,7 @@ impl SyntheticNetworkClient { let result = self .client .post(&self.url) - .json(config.into_synthetic_network()) + .json(&config.into_synthetic_network()) .send() .await; Ok(result.map(|_| ())?) diff --git a/scripts/synthetic-network/synthetic-link/src/main.rs b/scripts/synthetic-network/synthetic-link/src/main.rs index da0972b444..3410f23923 100644 --- a/scripts/synthetic-network/synthetic-link/src/main.rs +++ b/scripts/synthetic-network/synthetic-link/src/main.rs @@ -1,6 +1,6 @@ use clap::{arg, Parser}; use log::info; -use synthetic_link::{SyntheticNetwork, SyntheticNetworkClient}; +use synthetic_link::{SyntheticNetworkClient, SyntheticNetworkJson}; #[derive(Parser, Debug)] struct Args { @@ -17,7 +17,7 @@ async fn main() { info!("reading SyntheticNetwork configuration from stdin"); let deserializer = serde_json::Deserializer::from_reader(std::io::stdin()); - let synth_net_config: SyntheticNetwork = deserializer + let synth_net_config: SyntheticNetworkJson = deserializer .into_iter() .next() .unwrap_or_else(|| panic!("no configuration on stdin")) @@ -25,7 +25,7 @@ async fn main() { info!("parsed SyntheticNetwork configuration"); info!("commiting configuration"); - let mut synth_net_client = SyntheticNetworkClient::new_url(synth_net_url); + let mut synth_net_client = SyntheticNetworkClient::new(synth_net_url); synth_net_client .commit_config(&synth_net_config.into()) .await From 9d20ad08ef59b7634966361410bfae2eed6d4e9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Thu, 15 Dec 2022 10:32:59 +0100 Subject: [PATCH 04/39] new e2e-tests: high out-latency --- e2e-tests/Cargo.lock | 382 ++++++++++++++++++++++++++++- e2e-tests/Cargo.toml | 1 + e2e-tests/src/config.rs | 23 ++ e2e-tests/src/lib.rs | 2 + e2e-tests/src/synthetic_network.rs | 27 ++ e2e-tests/src/test/high_latency.rs | 86 +++++++ e2e-tests/src/test/mod.rs | 2 + 7 files changed, 511 insertions(+), 12 deletions(-) create mode 100644 e2e-tests/src/synthetic_network.rs create mode 100644 e2e-tests/src/test/high_latency.rs diff --git a/e2e-tests/Cargo.lock b/e2e-tests/Cargo.lock index 33330c590a..d83ac210d7 100644 --- a/e2e-tests/Cargo.lock +++ b/e2e-tests/Cargo.lock @@ -53,7 +53,7 @@ version = "0.9.4" dependencies = [ "aleph_client", "anyhow", - "clap", + "clap 3.2.23", "env_logger 0.8.4", "frame-support", "frame-system", @@ -70,6 +70,7 @@ dependencies = [ "serde_json", "sp-core 6.0.0", "sp-runtime 6.0.0", + "synthetic-link", "tokio", ] @@ -181,7 +182,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi", ] @@ -386,8 +387,8 @@ checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" dependencies = [ "atty", "bitflags", - "clap_derive", - "clap_lex", + "clap_derive 3.2.18", + "clap_lex 0.2.4", "indexmap", "once_cell", "strsim", @@ -395,6 +396,21 @@ dependencies = [ "textwrap", ] +[[package]] +name = "clap" +version = "4.0.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d63b9e9c07271b9957ad22c173bae2a4d9a81127680962039296abcd2f8251d" +dependencies = [ + "bitflags", + "clap_derive 4.0.21", + "clap_lex 0.3.0", + "is-terminal", + "once_cell", + "strsim", + "termcolor", +] + [[package]] name = "clap_derive" version = "3.2.18" @@ -408,6 +424,19 @@ dependencies = [ "syn", ] +[[package]] +name = "clap_derive" +version = "4.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "clap_lex" version = "0.2.4" @@ -417,6 +446,15 @@ dependencies = [ "os_str_bytes", ] +[[package]] +name = "clap_lex" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" +dependencies = [ + "os_str_bytes", +] + [[package]] name = "codespan-reporting" version = "0.11.1" @@ -837,6 +875,15 @@ dependencies = [ "zeroize", ] +[[package]] +name = "encoding_rs" +version = "0.8.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +dependencies = [ + "cfg-if", +] + [[package]] name = "env_logger" version = "0.8.4" @@ -863,12 +910,46 @@ dependencies = [ "termcolor", ] +[[package]] +name = "env_logger" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +dependencies = [ + "humantime", + "is-terminal", + "log", + "regex", + "termcolor", +] + [[package]] name = "environmental" version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" +[[package]] +name = "errno" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +dependencies = [ + "errno-dragonfly", + "libc", + "winapi", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "escape8259" version = "0.5.2" @@ -927,6 +1008,21 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "form_urlencoded" version = "1.1.0" @@ -1321,6 +1417,15 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + [[package]] name = "hex" version = "0.4.3" @@ -1438,6 +1543,19 @@ dependencies = [ "webpki-roots", ] +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + [[package]] name = "iana-time-zone" version = "0.1.53" @@ -1642,6 +1760,34 @@ dependencies = [ "num-traits", ] +[[package]] +name = "io-lifetimes" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46112a93252b123d31a119a8d1a1ac19deac4fac6e0e8b0df58f0d4e5870e63c" +dependencies = [ + "libc", + "windows-sys 0.42.0", +] + +[[package]] +name = "ipnet" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11b0d96e660696543b251e58030cf9787df56da39dab19ad60eae7353040917e" + +[[package]] +name = "is-terminal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927609f78c2913a6f6ac3c27a4fe87f43e2a35367c0c4b0f8265e8f49a104330" +dependencies = [ + "hermit-abi 0.2.6", + "io-lifetimes", + "rustix", + "windows-sys 0.42.0", +] + [[package]] name = "itertools" version = "0.10.5" @@ -1867,6 +2013,12 @@ dependencies = [ "statrs", ] +[[package]] +name = "linux-raw-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" + [[package]] name = "lock_api" version = "0.4.9" @@ -1966,6 +2118,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "mime" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" + [[package]] name = "minimal-lexical" version = "0.2.1" @@ -2022,6 +2180,24 @@ dependencies = [ "syn", ] +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + [[package]] name = "nohash-hasher" version = "0.2.0" @@ -2119,7 +2295,7 @@ version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", ] @@ -2150,12 +2326,51 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +[[package]] +name = "openssl" +version = "0.10.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29d971fd5722fec23977260f6e81aa67d2f22cadbdc2aa049f1022d9a3be1566" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "openssl-probe" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-sys" +version = "0.9.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5454462c0eced1e97f2ec09036abc8da362e66802f66fd20f86854d9d8cbcbc4" +dependencies = [ + "autocfg", + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "os_str_bytes" version = "6.4.1" @@ -2456,6 +2671,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "pkg-config" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -2724,6 +2945,52 @@ version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi", +] + +[[package]] +name = "reqwest" +version = "0.11.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + [[package]] name = "rfc6979" version = "0.1.0" @@ -2774,6 +3041,20 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" +[[package]] +name = "rustix" +version = "0.36.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3807b5d10909833d3e9acd1eb5fb988f79376ff10fce42937de71a449c4c588" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.42.0", +] + [[package]] name = "rustls" version = "0.20.7" @@ -3009,18 +3290,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.148" +version = "1.0.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e53f64bb4ba0191d6d0676e1b141ca55047d83b74f5607e6d8eb88126c52c2dc" +checksum = "e326c9ec8042f1b5da33252c8a37e9ffbd2c9bef0155215b6e6c80c790e05f91" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.148" +version = "1.0.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55492425aa53521babf6137309e7d34c20bbfbbfcfe2c7f3a047fd1f6b92c0c" +checksum = "42a3df25b0713732468deadad63ab9da1f1fd75a48a15024b50363f128db627e" dependencies = [ "proc-macro2", "quote", @@ -3038,6 +3319,18 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + [[package]] name = "sha-1" version = "0.9.8" @@ -4150,12 +4443,40 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "synthetic-link" +version = "0.1.0" +dependencies = [ + "anyhow", + "clap 4.0.29", + "env_logger 0.10.0", + "log", + "reqwest", + "serde", + "serde_json", + "tokio", +] + [[package]] name = "tap" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +[[package]] +name = "tempfile" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +dependencies = [ + "cfg-if", + "fastrand", + "libc", + "redox_syscall", + "remove_dir_all", + "winapi", +] + [[package]] name = "termcolor" version = "1.1.3" @@ -4236,9 +4557,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.22.0" +version = "1.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76ce4a75fb488c605c54bf610f221cea8b0dafb53333c1a67e8ee199dcd2ae3" +checksum = "eab6d665857cc6ca78d6e80303a02cea7a7851e85dfbd77cbdc09bd129f1ef46" dependencies = [ "autocfg", "bytes", @@ -4251,7 +4572,7 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "winapi", + "windows-sys 0.42.0", ] [[package]] @@ -4265,6 +4586,16 @@ dependencies = [ "syn", ] +[[package]] +name = "tokio-native-tls" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" +dependencies = [ + "native-tls", + "tokio", +] + [[package]] name = "tokio-rustls" version = "0.23.4" @@ -4503,6 +4834,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "version_check" version = "0.9.4" @@ -4562,6 +4899,18 @@ dependencies = [ "wasm-bindgen-shared", ] +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "wasm-bindgen-macro" version = "0.2.83" @@ -4784,6 +5133,15 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] + [[package]] name = "wyz" version = "0.5.1" diff --git a/e2e-tests/Cargo.toml b/e2e-tests/Cargo.toml index 48166153be..e00ffa7e7a 100644 --- a/e2e-tests/Cargo.toml +++ b/e2e-tests/Cargo.toml @@ -27,6 +27,7 @@ pallet-balances = { git = "https://github.com/Cardinal-Cryptography/substrate.gi aleph_client = { path = "../aleph-client" } primitives = { path = "../primitives", features = ["short_session"], default-features = false } pallet-elections = { path = "../pallets/elections" } +synthetic-link = { path = "../scripts/synthetic-network/synthetic-link" } [features] default = ["std"] diff --git a/e2e-tests/src/config.rs b/e2e-tests/src/config.rs index 4dc0bac63f..b3011092be 100644 --- a/e2e-tests/src/config.rs +++ b/e2e-tests/src/config.rs @@ -18,6 +18,7 @@ static GLOBAL_CONFIG: Lazy = Lazy::new(|| { let upgrade_to_version = get_env("UPGRADE_VERSION"); let upgrade_session = get_env("UPGRADE_SESSION"); let upgrade_finalization_wait_sessions = get_env("UPGRADE_FINALIZATION_WAIT_SESSIONS"); + let out_latency = get_env("OUT_LATENCY").unwrap_or(500); Config { node, @@ -30,6 +31,7 @@ static GLOBAL_CONFIG: Lazy = Lazy::new(|| { upgrade_to_version, upgrade_session, upgrade_finalization_wait_sessions, + out_latency, }, } }); @@ -87,6 +89,13 @@ impl Config { .unwrap() } + pub fn validator_names(&self) -> Vec { + ["Node0", "Node1", "Node2", "Node3", "Node4"] + .into_iter() + .map(|n| n.to_string()) + .collect() + } + /// Get a `SignedConnection` where the signer is the first validator. pub async fn get_first_signed_connection(&self) -> SignedConnection { let node = &self.node; @@ -94,6 +103,17 @@ impl Config { let sender = accounts.remove(0); SignedConnection::new(node.clone(), sender).await } + + pub async fn create_signed_connections(&self) -> Vec { + let node = &self.node; + let accounts = get_validators_keys(self); + let mut result = Vec::new(); + for account in accounts { + let connection = SignedConnection::new(node.clone(), account).await; + result.push(connection); + } + result + } } /// Parameters which can be passed to test cases. @@ -113,4 +133,7 @@ pub struct TestCaseParams { /// How many sessions we should wait after upgrade in VersionUpgrade test. pub upgrade_finalization_wait_sessions: Option, + + /// Milliseconds of network latency + pub out_latency: u64, } diff --git a/e2e-tests/src/lib.rs b/e2e-tests/src/lib.rs index 9f150c60b8..1bf9a76cfd 100644 --- a/e2e-tests/src/lib.rs +++ b/e2e-tests/src/lib.rs @@ -9,6 +9,8 @@ mod elections; #[cfg(test)] mod rewards; #[cfg(test)] +mod synthetic_network; +#[cfg(test)] mod test; #[cfg(test)] mod transfer; diff --git a/e2e-tests/src/synthetic_network.rs b/e2e-tests/src/synthetic_network.rs new file mode 100644 index 0000000000..f6bfd7f6bc --- /dev/null +++ b/e2e-tests/src/synthetic_network.rs @@ -0,0 +1,27 @@ +use log::info; +use synthetic_link::{NetworkConfig, NetworkQoS, SyntheticNetworkClient}; + +pub type Milliseconds = u64; + +fn create_client(node_name: impl AsRef) -> SyntheticNetworkClient { + let synthetic_network_url = format!("http://{}:80/qos", node_name.as_ref()); + info!("creating an http client for url {}", synthetic_network_url); + SyntheticNetworkClient::new(synthetic_network_url) +} + +pub async fn set_out_latency(milliseconds: Milliseconds, node_name: impl AsRef) { + info!( + "setting out-latency of node {} to {}ms", + node_name.as_ref(), + milliseconds + ); + let mut config = NetworkConfig::new(); + let mut network_qos = NetworkQoS::default(); + network_qos.latency(milliseconds); + config.egress(network_qos); + let mut client = create_client(node_name); + client + .commit_config(&config) + .await + .expect("unable to commit network configuration"); +} diff --git a/e2e-tests/src/test/high_latency.rs b/e2e-tests/src/test/high_latency.rs new file mode 100644 index 0000000000..b68edea331 --- /dev/null +++ b/e2e-tests/src/test/high_latency.rs @@ -0,0 +1,86 @@ +use std::cmp::max; + +use aleph_client::{ + pallets::session::SessionApi, + waiting::{AlephWaiting, BlockStatus}, +}; +use log::info; + +use crate::{config::setup_test, synthetic_network::set_out_latency}; + +#[tokio::test] +pub async fn high_out_latency() -> anyhow::Result<()> { + let config = setup_test(); + + let connections = config.create_signed_connections().await; + info!("waiting for at least session 3"); + for connection in &connections { + if connection.get_session(None).await < 3 { + connection.wait_for_session(3, BlockStatus::Finalized).await; + } + } + + info!("setting out-latency"); + for validator in config.validator_names() { + info!( + "setting out-latency of node {} to {}", + validator, config.test_case_params.out_latency + ); + set_out_latency(config.test_case_params.out_latency, validator).await; + } + + let mut max_session = 0; + for connection in &connections { + let node_session = connection.get_session(None).await; + max_session = max(max_session, node_session); + } + info!("current session is {}", max_session); + + for connection in connections { + connection + .wait_for_session(max_session + 2, BlockStatus::Finalized) + .await; + } + Ok(()) +} + +#[tokio::test] +pub async fn no_quorum_without_high_out_latency() -> anyhow::Result<()> { + let config = setup_test(); + + let connections = config.create_signed_connections().await; + info!("waiting for at least session 3"); + for connection in &connections { + if connection.get_session(None).await < 3 { + connection.wait_for_session(3, BlockStatus::Finalized).await; + } + } + + info!("setting out-latency"); + for validator in config + .validator_names() + .into_iter() + .take(((config.validator_count - 1) / 3 + 1) as usize) + { + info!( + "setting out-latency of node {} to {}", + validator, config.test_case_params.out_latency + ); + set_out_latency(config.test_case_params.out_latency, validator).await; + } + + let mut max_session = 0; + for connection in &connections { + let node_session = connection.get_session(None).await; + max_session = max(max_session, node_session); + } + info!("current session is {}", max_session); + + info!("waiting for session {}", max_session + 2); + for connection in connections { + connection + .wait_for_session(max_session + 2, BlockStatus::Finalized) + .await; + } + Ok(()) +} diff --git a/e2e-tests/src/test/mod.rs b/e2e-tests/src/test/mod.rs index 392a56f4e5..2289562ad6 100644 --- a/e2e-tests/src/test/mod.rs +++ b/e2e-tests/src/test/mod.rs @@ -6,6 +6,7 @@ pub use era_payout::era_payouts_calculated_correctly; pub use era_validators::era_validators; pub use fee::fee_calculation; pub use finalization::finalization; +pub use high_latency::high_out_latency; pub use rewards::{ change_stake_and_force_new_era, disable_node, force_new_era, points_basic, points_stake_change, }; @@ -24,6 +25,7 @@ mod era_payout; mod era_validators; mod fee; mod finalization; +mod high_latency; mod rewards; mod staking; mod transfer; From 2bf7a6ed32452b2770f30ff117fe34f8beb4321c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Thu, 15 Dec 2022 10:38:40 +0100 Subject: [PATCH 05/39] refactored synthetic-network bash scripts --- .../build_synthetic-network.sh | 22 ++++--------- .../run_consensus_synthetic-network.sh | 24 ++++++++------ .../run_script_for_synthetic-network.sh | 31 +++++++------------ 3 files changed, 32 insertions(+), 45 deletions(-) diff --git a/scripts/synthetic-network/build_synthetic-network.sh b/scripts/synthetic-network/build_synthetic-network.sh index ddb803829c..e25eb456c8 100755 --- a/scripts/synthetic-network/build_synthetic-network.sh +++ b/scripts/synthetic-network/build_synthetic-network.sh @@ -4,27 +4,17 @@ set -euo pipefail source ./scripts/common.sh -GIT_COMMIT=${GIT_COMMIT:-72bbb4fde915e4132c19cd7ce3605364abac58a5} +UPDATE=${UPDATE:-true} -TMPDIR="$(dirname $0)/vendor" -mkdir -p $TMPDIR -log "created a temporary folder at $TMPDIR" +if [[ "$UPDATE" = true ]]; then + git submodule init + git submodule update +fi pushd . - -log "cloning synthetic-network's git repo" -cd $TMPDIR -if [[ ! -d ./synthetic-network ]]; then - git clone https://github.com/daily-co/synthetic-network.git -fi -cd synthetic-network -git fetch origin -git checkout $GIT_COMMIT +cd scripts/synthetic-network/vendor/synthetic-network log "building base docker image for synthetic-network with support for synthetic-network" -log "patching synthetic network" -# aleph-node crashes since it uses newer glibc than this image -sed -i 's/FROM node:12.20.2/FROM node:19.2/' Dockerfile docker build -t syntheticnet . popd diff --git a/scripts/synthetic-network/run_consensus_synthetic-network.sh b/scripts/synthetic-network/run_consensus_synthetic-network.sh index 9c66c4d0f4..6cc4522217 100755 --- a/scripts/synthetic-network/run_consensus_synthetic-network.sh +++ b/scripts/synthetic-network/run_consensus_synthetic-network.sh @@ -15,17 +15,16 @@ Usage: IMPORTANT: this script requires aleph-node:latest docker image. --no-build-image skip docker image build - --commit 72bbb4fde915e4132c19cd7ce3605364abac58a5 - commit hash used to build synthetic-network, default is 72bbb4fde915e4132c19cd7ce3605364abac58a5 + --no-update + skip git-submodule update for the synthetic-network repository EOF exit 0 } function build_test_image() { - local commit=$1 - local path=$2 + local path=$1 - GIT_COMMIT=$commit ${path}/build_synthetic-network.sh + ${path}/build_synthetic-network.sh } while [[ $# -gt 0 ]]; do @@ -34,9 +33,9 @@ while [[ $# -gt 0 ]]; do BUILD_IMAGE=false shift ;; - --commit) - GIT_COMMIT="$2" - shift;shift + --no-update) + UPDATE=false + shift ;; --help) usage @@ -49,12 +48,17 @@ while [[ $# -gt 0 ]]; do done BUILD_IMAGE=${BUILD_IMAGE:-true} -GIT_COMMIT=${GIT_COMMIT:-72bbb4fde915e4132c19cd7ce3605364abac58a5} +UPDATE=${UPDATE:-true} + +if [[ "$UPDATE" = true ]]; then + git submodule init + git submodule update +fi if [[ "$BUILD_IMAGE" = true ]]; then log "building custom docker image for synthetic-network tests" path=$(dirname $0) - build_test_image $GIT_COMMIT $path + build_test_image $path fi log "running synthetic-network" diff --git a/scripts/synthetic-network/run_script_for_synthetic-network.sh b/scripts/synthetic-network/run_script_for_synthetic-network.sh index b8b44d98c3..419df5ad4b 100755 --- a/scripts/synthetic-network/run_script_for_synthetic-network.sh +++ b/scripts/synthetic-network/run_script_for_synthetic-network.sh @@ -12,25 +12,25 @@ Usage: IMPORTANT: first you need to call 'scripts/run_consensus_synthetic-network.sh' and let it run in background. It spawns docker-compose configured with synthetic-network. It requires node.js to run. - --commit 72bbb4fde915e4132c19cd7ce3605364abac58a5 - commit hash used to build synthetic-network, default is 72bbb4fde915e4132c19cd7ce3605364abac58a5 --script-path scripts/vendor/synthetic-network/frontend/udp_rate_sine_demo.js path to a synthetic-network scrypt. Default is a demo scripts/vendor/synthetic-network/frontend/udp_rate_sine_demo.js from the synthetic-network repo. Please consult synthetic-network repo for details: https://github.com/daily-co/synthetic-network + --no-update + skip git-submodule update for the synthetic-network repository EOF exit 0 } while [[ $# -gt 0 ]]; do case $1 in - --commit) - GIT_COMMIT="$2" - shift;shift - ;; --script-path) SCRIPT_PATH="$2" shift;shift ;; + --no-update) + UPDATE=false + shift + ;; --help) usage shift @@ -41,23 +41,16 @@ while [[ $# -gt 0 ]]; do esac done -GIT_COMMIT=${GIT_COMMIT:-72bbb4fde915e4132c19cd7ce3605364abac58a5} SCRIPT_PATH=${SCRIPT_PATH:-scripts/vendor/synthetic-network/frontend/udp_rate_sine_demo.js} SCRIPT_PATH=$(realpath $SCRIPT_PATH) +UPDATE=${UPDATE:-true} -TMPDIR="$(dirname $0)/vendor" -mkdir -p $TMPDIR -log "created a temporary folder at $TMPDIR" - -log "cloning synthetic-network's git repo" -cd $TMPDIR -if [[ ! -d ./synthetic-network ]]; then - git clone https://github.com/daily-co/synthetic-network.git +if [[ "$UPDATE" = true ]]; then + git submodule init + git submodule update fi -cd synthetic-network -git fetch origin -git checkout $GIT_COMMIT -cd frontend + +cd synthetic-network/frontend log "running .js script" node $SCRIPT_PATH ${@:1} From 8a259e0d089077bab8cb4de01143d206d5ba5427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Thu, 15 Dec 2022 10:39:58 +0100 Subject: [PATCH 06/39] added git submodule for synthetic-network --- .gitmodules | 3 +++ scripts/synthetic-network/vendor/synthetic-network | 1 + 2 files changed, 4 insertions(+) create mode 100644 .gitmodules create mode 160000 scripts/synthetic-network/vendor/synthetic-network diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..2a602c4b2c --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "scripts/synthetic-network/vendor/synthetic-network"] + path = scripts/synthetic-network/vendor/synthetic-network + url = https://github.com/daily-co/synthetic-network.git diff --git a/scripts/synthetic-network/vendor/synthetic-network b/scripts/synthetic-network/vendor/synthetic-network new file mode 160000 index 0000000000..72bbb4fde9 --- /dev/null +++ b/scripts/synthetic-network/vendor/synthetic-network @@ -0,0 +1 @@ +Subproject commit 72bbb4fde915e4132c19cd7ce3605364abac58a5 From 0093386943caf38219b2eff137f7cabadc2d1630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Thu, 15 Dec 2022 10:44:34 +0100 Subject: [PATCH 07/39] added nightly e2e test for synthetic-network --- .github/actions/run-e2e-test/action.yml | 16 +++++- .github/scripts/run_consensus.sh | 3 +- .github/workflows/nightly-pipeline.yaml | 71 ++++++++++++++++++++++++- 3 files changed, 85 insertions(+), 5 deletions(-) diff --git a/.github/actions/run-e2e-test/action.yml b/.github/actions/run-e2e-test/action.yml index 870a248989..2ad71d28eb 100644 --- a/.github/actions/run-e2e-test/action.yml +++ b/.github/actions/run-e2e-test/action.yml @@ -26,6 +26,18 @@ inputs: follow-up-finalization-check: description: 'Whether to run a follow-up finalization check.' required: false + image-path: + description: 'Custom path to docker image for aleph-node' + required: false + default: aleph-test-docker + node-image: + description: 'Custom name of aleph-node image' + required: false + default: aleph-node:latest + compose-file: + description: 'Custom docker-compose configuration' + required: false + default: '' runs: using: 'composite' @@ -34,7 +46,7 @@ runs: - name: Download artifact with docker image uses: actions/download-artifact@v2 with: - name: aleph-test-docker + name: ${{ inputs.image-path }} - name: Load node docker image shell: bash @@ -42,7 +54,7 @@ runs: - name: Run consensus party shell: bash - run: ./.github/scripts/run_consensus.sh -m ${{ inputs.min-validator-count }} -n ${{ inputs.node-count }} + run: NODE_IMAGE=${{ inputs.node-image }} DOCKER_COMPOSE=${{ inputs.compose-file }} ./.github/scripts/run_consensus.sh -m ${{ inputs.min-validator-count }} -n ${{ inputs.node-count }} - name: Sleep shell: bash diff --git a/.github/scripts/run_consensus.sh b/.github/scripts/run_consensus.sh index ca40484618..f5f82cbbfc 100755 --- a/.github/scripts/run_consensus.sh +++ b/.github/scripts/run_consensus.sh @@ -8,11 +8,12 @@ NODE_COUNT=5 MIN_VALIDATOR_COUNT=4 DOCKER_COMPOSE=${DOCKER_COMPOSE:-"docker/docker-compose.yml"} OVERRIDE_DOCKER_COMPOSE=${OVERRIDE_DOCKER_COMPOSE:-""} +NODE_IMAGE=${NODE_IMAGE:-aleph-node:latest} # default minimum validator count MIN_VALIDATOR_COUNT=4 -export NODE_IMAGE=aleph-node:latest +export NODE_IMAGE mkdir -p docker/data/ diff --git a/.github/workflows/nightly-pipeline.yaml b/.github/workflows/nightly-pipeline.yaml index fe47743973..8dd294673f 100644 --- a/.github/workflows/nightly-pipeline.yaml +++ b/.github/workflows/nightly-pipeline.yaml @@ -43,6 +43,37 @@ jobs: if-no-files-found: error retention-days: 7 + build-synthetic-network-docker: + needs: [build-test-docker] + name: Build docker image with the test node artifact and support for synthetic-network + runs-on: ubuntu-20.04 + steps: + - name: Checkout source code + uses: actions/checkout@v2 + + - name: Download artifact with docker image for aleph-node + uses: actions/download-artifact@v2 + with: + name: aleph-test-docker + + - name: Load node docker image + shell: bash + run: docker load -i aleph-node.tar + + - name: Build test docker image + id: build-image + run: | + scripts/synthetic-network/build_synthetic-network.sh + docker save -o aleph-node.tar aleph-node:syntheticnet + + - name: Upload test docker image + uses: actions/upload-artifact@v2 + with: + name: aleph-test-synthetic-docker + path: aleph-node.tar + if-no-files-found: error + retention-days: 7 + check-determinism: needs: [build-new-node] name: Verify runtime build determinism @@ -59,7 +90,7 @@ jobs: - name: Install Protoc uses: arduino/setup-protoc@v1 with: - version: '3.6.1' + version: '3.6.1' - name: Install WASM target run: rustup target add wasm32-unknown-unknown @@ -96,7 +127,7 @@ jobs: - name: Install Protoc uses: arduino/setup-protoc@v1 with: - version: '3.6.1' + version: '3.6.1' - name: Restore cache uses: ./.github/actions/restore-cache @@ -140,9 +171,45 @@ jobs: randomized: true timeout-minutes: 60 + run-e2e-high-out-latency: + needs: [build-synthetic-network-docker, build-test-client] + name: Run high out-latency test + runs-on: ubuntu-20.04 + steps: + - name: Checkout source code + uses: actions/checkout@v2 + + - name: Run e2e test + uses: ./.github/actions/run-e2e-test + with: + test-case: high_out_latency + image-path: aleph-test-synthetic-docker + node-image: aleph-node:syntheticnet + compose-file: docker/docker-compose.synthetic-network.yml + timeout-minutes: 30 + + no_quorum_without_high_out_latency: + needs: [build-synthetic-network-docker, build-test-client] + name: Run high out-latency for every quorum + runs-on: ubuntu-20.04 + steps: + - name: Checkout source code + uses: actions/checkout@v2 + + - name: Run e2e test + uses: ./.github/actions/run-e2e-test + with: + test-case: no_quorum_without_high_out_latency + image-path: aleph-test-synthetic-docker + node-image: aleph-node:syntheticnet + compose-file: docker/docker-compose.synthetic-network.yml + timeout-minutes: 15 + check-e2e-test-suite-completion: needs: [ run-e2e-authorities-are-staking, + run-e2e-high-out-latency, + no_quorum_without_high_out_latency, ] name: Check e2e test suite completion runs-on: ubuntu-20.04 From 32eb26d4b55a80a882c0034b602692705cb051f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Thu, 15 Dec 2022 10:58:28 +0100 Subject: [PATCH 08/39] refactored synthetic-link library --- .../synthetic-link/src/lib.rs | 61 +++++++++++++------ 1 file changed, 41 insertions(+), 20 deletions(-) diff --git a/scripts/synthetic-network/synthetic-link/src/lib.rs b/scripts/synthetic-network/synthetic-link/src/lib.rs index 391c4193c1..911ec7bc86 100644 --- a/scripts/synthetic-network/synthetic-link/src/lib.rs +++ b/scripts/synthetic-network/synthetic-link/src/lib.rs @@ -96,12 +96,8 @@ impl NetworkConfig { } } - pub fn ingress(&mut self, qos: NetworkQoS) -> &mut Self { - self.config.default_link.ingress = qos.qos; - self - } - pub fn egress(&mut self, qos: NetworkQoS) -> &mut Self { - self.config.default_link.egress = qos.qos; + pub fn link(&mut self, link: NetworkLink) -> &mut Self { + self.config.default_link = link.link; self } @@ -115,6 +111,24 @@ impl NetworkConfig { } } +impl Default for NetworkConfig { + fn default() -> Self { + NetworkConfig::new() + } +} + +impl From for NetworkConfig { + fn from(synth_net: SyntheticNetwork) -> Self { + Self { config: synth_net } + } +} + +impl From for NetworkConfig { + fn from(value: SyntheticNetworkJson) -> Self { + NetworkConfig::from(value.0) + } +} + pub struct NetworkFlow { flow: SyntheticFlow, } @@ -156,6 +170,19 @@ impl NetworkFlow { self.flow.flow.port_max = *port_range.end(); self } + + pub fn link(&mut self, link: NetworkLink) -> &mut Self { + self.flow.link = link.link; + self + } +} + +impl Default for NetworkFlow { + fn default() -> Self { + Self { + flow: DEFAULT_NAMED_FLOW, + } + } } pub enum IpPattern { @@ -190,6 +217,12 @@ impl NetworkLink { } } +impl Default for NetworkLink { + fn default() -> Self { + Self { link: DEFAULT_LINK } + } +} + pub struct NetworkQoS { qos: QoS, } @@ -210,21 +243,9 @@ impl NetworkQoS { } } -impl Default for NetworkConfig { +impl Default for NetworkQoS { fn default() -> Self { - NetworkConfig::new() - } -} - -impl From for NetworkConfig { - fn from(synth_net: SyntheticNetwork) -> Self { - Self { config: synth_net } - } -} - -impl From for NetworkConfig { - fn from(value: SyntheticNetworkJson) -> Self { - NetworkConfig::from(value.0) + Self { qos: DEFAULT_QOS } } } From fc1a3f0d19b7c850f84f8aa33f798ef142afba7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Thu, 15 Dec 2022 10:59:01 +0100 Subject: [PATCH 09/39] added load_config for synthetic-network e2e test --- e2e-tests/src/synthetic_network.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/e2e-tests/src/synthetic_network.rs b/e2e-tests/src/synthetic_network.rs index f6bfd7f6bc..aa63e1713a 100644 --- a/e2e-tests/src/synthetic_network.rs +++ b/e2e-tests/src/synthetic_network.rs @@ -1,5 +1,5 @@ use log::info; -use synthetic_link::{NetworkConfig, NetworkQoS, SyntheticNetworkClient}; +use synthetic_link::{NetworkLink, NetworkQoS, SyntheticNetworkClient}; pub type Milliseconds = u64; @@ -15,11 +15,18 @@ pub async fn set_out_latency(milliseconds: Milliseconds, node_name: impl AsRef Date: Thu, 15 Dec 2022 12:57:41 +0100 Subject: [PATCH 10/39] more refactoring of synthetic-link --- e2e-tests/src/synthetic_network.rs | 10 +- .../synthetic-link/Cargo.toml | 1 + .../synthetic-link/src/lib.rs | 324 +++++++----------- .../synthetic-link/src/main.rs | 4 +- 4 files changed, 131 insertions(+), 208 deletions(-) diff --git a/e2e-tests/src/synthetic_network.rs b/e2e-tests/src/synthetic_network.rs index aa63e1713a..d7f4ed39c1 100644 --- a/e2e-tests/src/synthetic_network.rs +++ b/e2e-tests/src/synthetic_network.rs @@ -1,5 +1,5 @@ use log::info; -use synthetic_link::{NetworkLink, NetworkQoS, SyntheticNetworkClient}; +use synthetic_link::SyntheticNetworkClient; pub type Milliseconds = u64; @@ -19,13 +19,9 @@ pub async fn set_out_latency(milliseconds: Milliseconds, node_name: impl AsRef, -} - -#[derive(Serialize, Deserialize)] -struct SyntheticLink { - ingress: QoS, - egress: QoS, -} - -#[derive(Serialize, Deserialize)] -struct QoS { - rate: u64, - loss: f64, - latency: u64, - jitter: u64, - jitter_strength: f64, - reorder_packets: bool, -} - -#[derive(Serialize, Deserialize)] -struct SyntheticFlow { - label: String, - flow: Flow, - link: SyntheticLink, -} - -#[derive(Serialize, Deserialize)] -struct Flow { - ip: u32, - protocol: u8, - port_min: u16, - port_max: u16, -} - -// end of copy-paste - -#[derive(Serialize, Deserialize)] -pub struct SyntheticNetworkJson(SyntheticNetwork); +const DEFAULT_SYNTHETIC_NETWORK: SyntheticNetwork = SyntheticNetwork { + default_link: DEFAULT_SYNTHETIC_LINK, + flows: Vec::new(), +}; -pub struct SyntheticNetworkClient { - client: Client, - url: String, -} +const DEFAULT_SYNTHETIC_LINK: SyntheticLink = SyntheticLink { + ingress: DEFAULT_QOS, + egress: DEFAULT_QOS, +}; const DEFAULT_QOS: QoS = QoS { rate: 1000000000, @@ -61,192 +24,166 @@ const DEFAULT_QOS: QoS = QoS { reorder_packets: false, }; -const DEFAULT_FLOW: Flow = Flow { - ip: 0, - protocol: 0, - port_min: 0, - port_max: 0, -}; - -const DEFAULT_LINK: SyntheticLink = SyntheticLink { - ingress: DEFAULT_QOS, - egress: DEFAULT_QOS, -}; - -const DEFAULT_NAMED_FLOW: SyntheticFlow = SyntheticFlow { +const DEFAULT_SYNTHETIC_FLOW: SyntheticFlow = SyntheticFlow { label: String::new(), flow: DEFAULT_FLOW, - link: DEFAULT_LINK, + link: DEFAULT_SYNTHETIC_LINK, }; -pub struct NetworkConfig { - config: SyntheticNetwork, -} - -impl NetworkConfig { - pub const fn new() -> Self { - NetworkConfig { - config: SyntheticNetwork { - default_link: SyntheticLink { - ingress: DEFAULT_QOS, - egress: DEFAULT_QOS, - }, - flows: Vec::new(), - }, - } - } - - pub fn link(&mut self, link: NetworkLink) -> &mut Self { - self.config.default_link = link.link; - self - } - - pub fn add_flow(&mut self, flow: NetworkFlow) -> &mut Self { - self.config.flows.push(flow.flow); - self - } +const DEFAULT_FLOW: Flow = Flow { + ip: IpPattern::All, + protocol: Protocol::All, + port_range: PortRange(0..=0), +}; - fn into_synthetic_network(&self) -> &SyntheticNetwork { - &self.config - } +#[derive(Serialize, Deserialize, Clone)] +pub struct SyntheticNetwork { + pub default_link: SyntheticLink, + pub flows: Vec, } -impl Default for NetworkConfig { +impl Default for SyntheticNetwork { fn default() -> Self { - NetworkConfig::new() + DEFAULT_SYNTHETIC_NETWORK } } -impl From for NetworkConfig { - fn from(synth_net: SyntheticNetwork) -> Self { - Self { config: synth_net } - } +#[derive(Serialize, Deserialize, Clone)] +pub struct SyntheticLink { + pub ingress: QoS, + pub egress: QoS, } -impl From for NetworkConfig { - fn from(value: SyntheticNetworkJson) -> Self { - NetworkConfig::from(value.0) +impl Default for SyntheticLink { + fn default() -> Self { + DEFAULT_SYNTHETIC_LINK } } -pub struct NetworkFlow { - flow: SyntheticFlow, +#[derive(Serialize, Deserialize, Clone)] +pub struct QoS { + pub rate: u64, + pub loss: f64, + pub latency: u64, + pub jitter: u64, + pub jitter_strength: f64, + pub reorder_packets: bool, } -impl NetworkFlow { - pub const fn new() -> Self { - NetworkFlow { - flow: DEFAULT_NAMED_FLOW, - } - } - - pub fn label(&mut self, label: String) -> &mut Self { - self.flow.label = label; - self - } - - pub fn ip(&mut self, ip: IpPattern) -> &mut Self { - let ip = match ip { - IpPattern::All => 0, - IpPattern::Ip(ip) => ip, - }; - self.flow.flow.ip = ip; - self +impl Default for QoS { + fn default() -> Self { + DEFAULT_QOS } +} - pub fn protocol(&mut self, protocol: Protocol) -> &mut Self { - let protocol_id = match protocol { - Protocol::Icmp => 1, - Protocol::Tcp => 6, - Protocol::Udp => 17, - Protocol::All => 0, - }; - self.flow.flow.protocol = protocol_id; - self - } +#[derive(Serialize, Deserialize, Clone)] +pub struct SyntheticFlow { + pub label: String, + pub flow: Flow, + pub link: SyntheticLink, +} - pub fn port_range(&mut self, port_range: RangeInclusive) -> &mut Self { - self.flow.flow.port_min = *port_range.start(); - self.flow.flow.port_max = *port_range.end(); - self +impl Default for SyntheticFlow { + fn default() -> Self { + DEFAULT_SYNTHETIC_FLOW } +} - pub fn link(&mut self, link: NetworkLink) -> &mut Self { - self.flow.link = link.link; - self - } +#[derive(Serialize, Deserialize, Clone)] +pub struct Flow { + pub ip: IpPattern, + pub protocol: Protocol, + #[serde(flatten)] + pub port_range: PortRange, } -impl Default for NetworkFlow { +impl Default for Flow { fn default() -> Self { - Self { - flow: DEFAULT_NAMED_FLOW, - } + DEFAULT_FLOW } } -pub enum IpPattern { - All, - Ip(u32), -} - +#[derive(Serialize_repr, Deserialize_repr, Clone)] +#[repr(u8)] pub enum Protocol { - Icmp, - Tcp, - Udp, - All, + Icmp = 1, + Tcp = 6, + Udp = 17, + All = 0, } -pub struct NetworkLink { - link: SyntheticLink, -} +#[derive(Serialize, Deserialize, Clone)] +#[serde(from = "PortRangeSerde", into = "PortRangeSerde")] +pub struct PortRange(RangeInclusive); -impl NetworkLink { - pub const fn new() -> Self { - NetworkLink { link: DEFAULT_LINK } +impl PortRange { + pub fn new(port_min: u16, port_max: u16) -> anyhow::Result { + if port_min > port_max { + bail!("port_min is larger than port_max"); + } + Ok(PortRange(port_min..=port_max)) } +} - pub fn ingress(&mut self, qos: NetworkQoS) -> &mut Self { - self.link.ingress = qos.qos; - self +impl Borrow> for PortRange { + fn borrow(&self) -> &RangeInclusive { + &self.0 } +} + +#[derive(Serialize, Deserialize, Clone)] +struct PortRangeSerde { + port_min: u16, + port_max: u16, +} - pub fn egress(&mut self, qos: NetworkQoS) -> &mut Self { - self.link.egress = qos.qos; - self +impl From for PortRange { + fn from(value: PortRangeSerde) -> Self { + PortRange(value.port_min..=value.port_max) } } -impl Default for NetworkLink { - fn default() -> Self { - Self { link: DEFAULT_LINK } +impl Into for PortRange { + fn into(self) -> PortRangeSerde { + PortRangeSerde { + port_min: *self.0.start(), + port_max: *self.0.end(), + } } } -pub struct NetworkQoS { - qos: QoS, +#[derive(Serialize, Deserialize, Clone)] +#[serde(from = "IpPatternSerde", into = "IpPatternSerde")] +pub enum IpPattern { + All, + Ip(u32), } -impl NetworkQoS { - pub const fn new() -> Self { - NetworkQoS { qos: DEFAULT_QOS } - } +#[derive(Serialize, Deserialize, Clone)] +struct IpPatternSerde(u32); - pub fn latency(&mut self, latency_milliseconds: u64) -> &mut Self { - self.qos.latency = latency_milliseconds; - self +impl From for IpPattern { + fn from(value: IpPatternSerde) -> Self { + match value.0 { + 0 => IpPattern::All, + ip => IpPattern::Ip(ip), + } } +} - pub fn rate(&mut self, rate: u64) -> &mut Self { - self.qos.rate = rate; - self +impl Into for IpPattern { + fn into(self) -> IpPatternSerde { + let ip = match self { + IpPattern::All => 0, + IpPattern::Ip(ip) => ip, + }; + IpPatternSerde(ip) } } -impl Default for NetworkQoS { - fn default() -> Self { - Self { qos: DEFAULT_QOS } - } +pub struct SyntheticNetworkClient { + client: Client, + url: String, } impl SyntheticNetworkClient { @@ -257,24 +194,13 @@ impl SyntheticNetworkClient { } } - pub async fn commit_config(&mut self, config: &NetworkConfig) -> anyhow::Result<()> { - let result = self - .client - .post(&self.url) - .json(&config.into_synthetic_network()) - .send() - .await; + pub async fn commit_config(&mut self, config: &SyntheticNetwork) -> anyhow::Result<()> { + let result = self.client.post(&self.url).json(config).send().await; Ok(result.map(|_| ())?) } - pub async fn load_config(&mut self) -> anyhow::Result { - let result = self - .client - .get(&self.url) - .send() - .await? - .json::() - .await; - Ok(result.map(NetworkConfig::from)?) + pub async fn load_config(&mut self) -> anyhow::Result { + let result = self.client.get(&self.url).send().await?; + Ok(result.json::().await?) } } diff --git a/scripts/synthetic-network/synthetic-link/src/main.rs b/scripts/synthetic-network/synthetic-link/src/main.rs index 3410f23923..d7febddeb6 100644 --- a/scripts/synthetic-network/synthetic-link/src/main.rs +++ b/scripts/synthetic-network/synthetic-link/src/main.rs @@ -1,6 +1,6 @@ use clap::{arg, Parser}; use log::info; -use synthetic_link::{SyntheticNetworkClient, SyntheticNetworkJson}; +use synthetic_link::{SyntheticNetwork, SyntheticNetworkClient}; #[derive(Parser, Debug)] struct Args { @@ -17,7 +17,7 @@ async fn main() { info!("reading SyntheticNetwork configuration from stdin"); let deserializer = serde_json::Deserializer::from_reader(std::io::stdin()); - let synth_net_config: SyntheticNetworkJson = deserializer + let synth_net_config: SyntheticNetwork = deserializer .into_iter() .next() .unwrap_or_else(|| panic!("no configuration on stdin")) From 75434a59211361ba1d4e80b1fd4913e2df1135fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Fri, 16 Dec 2022 10:36:18 +0100 Subject: [PATCH 11/39] missing synthetic-link in Cargo.toml --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index 36b4491e69..e99d70360d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,6 +18,7 @@ exclude = [ "fork-off", "benches/payout-stakers", "bin/cliain", + "scripts/synthetic-network/synthetic-link", ] [profile.release] From 415faf0b8a1d4d852aeb3ed250dc42bed2802488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Fri, 16 Dec 2022 11:00:00 +0100 Subject: [PATCH 12/39] e2e-tests/config.rs cleaned --- e2e-tests/src/config.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/e2e-tests/src/config.rs b/e2e-tests/src/config.rs index b3011092be..620946eb55 100644 --- a/e2e-tests/src/config.rs +++ b/e2e-tests/src/config.rs @@ -105,14 +105,12 @@ impl Config { } pub async fn create_signed_connections(&self) -> Vec { - let node = &self.node; - let accounts = get_validators_keys(self); - let mut result = Vec::new(); - for account in accounts { - let connection = SignedConnection::new(node.clone(), account).await; - result.push(connection); - } - result + futures::future::join_all( + get_validators_keys(self) + .into_iter() + .map(|account| async { SignedConnection::new(self.node.clone(), account).await }), + ) + .await } } From 1ac0792935304189535dc1f4299bb2f70614c988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Fri, 16 Dec 2022 12:25:12 +0100 Subject: [PATCH 13/39] Into -> From in synthetic-link --- .../synthetic-network/synthetic-link/src/lib.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/synthetic-network/synthetic-link/src/lib.rs b/scripts/synthetic-network/synthetic-link/src/lib.rs index f42934e78f..4eef87cb0b 100644 --- a/scripts/synthetic-network/synthetic-link/src/lib.rs +++ b/scripts/synthetic-network/synthetic-link/src/lib.rs @@ -143,11 +143,11 @@ impl From for PortRange { } } -impl Into for PortRange { - fn into(self) -> PortRangeSerde { +impl From for PortRangeSerde { + fn from(value: PortRange) -> Self { PortRangeSerde { - port_min: *self.0.start(), - port_max: *self.0.end(), + port_min: *value.0.start(), + port_max: *value.0.end(), } } } @@ -171,9 +171,9 @@ impl From for IpPattern { } } -impl Into for IpPattern { - fn into(self) -> IpPatternSerde { - let ip = match self { +impl From for IpPatternSerde { + fn from(value: IpPattern) -> Self { + let ip = match value { IpPattern::All => 0, IpPattern::Ip(ip) => ip, }; From 55f6f1482aad53a18eb8c1de377e2ff034049e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Fri, 16 Dec 2022 12:53:35 +0100 Subject: [PATCH 14/39] slightly cleaned code for synthetic-network --- e2e-tests/src/synthetic_network.rs | 9 ++++----- e2e-tests/src/test/high_latency.rs | 4 ++-- scripts/synthetic-network/synthetic-link/src/main.rs | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/e2e-tests/src/synthetic_network.rs b/e2e-tests/src/synthetic_network.rs index d7f4ed39c1..91925c3136 100644 --- a/e2e-tests/src/synthetic_network.rs +++ b/e2e-tests/src/synthetic_network.rs @@ -3,17 +3,16 @@ use synthetic_link::SyntheticNetworkClient; pub type Milliseconds = u64; -fn create_client(node_name: impl AsRef) -> SyntheticNetworkClient { - let synthetic_network_url = format!("http://{}:80/qos", node_name.as_ref()); +fn create_client(node_name: &str) -> SyntheticNetworkClient { + let synthetic_network_url = format!("http://{}:80/qos", node_name); info!("creating an http client for url {}", synthetic_network_url); SyntheticNetworkClient::new(synthetic_network_url) } -pub async fn set_out_latency(milliseconds: Milliseconds, node_name: impl AsRef) { +pub async fn set_out_latency(milliseconds: Milliseconds, node_name: &str) { info!( "setting out-latency of node {} to {}ms", - node_name.as_ref(), - milliseconds + node_name, milliseconds ); let mut client = create_client(node_name); let mut config = client diff --git a/e2e-tests/src/test/high_latency.rs b/e2e-tests/src/test/high_latency.rs index b68edea331..0ea20ea77c 100644 --- a/e2e-tests/src/test/high_latency.rs +++ b/e2e-tests/src/test/high_latency.rs @@ -26,7 +26,7 @@ pub async fn high_out_latency() -> anyhow::Result<()> { "setting out-latency of node {} to {}", validator, config.test_case_params.out_latency ); - set_out_latency(config.test_case_params.out_latency, validator).await; + set_out_latency(config.test_case_params.out_latency, &validator).await; } let mut max_session = 0; @@ -66,7 +66,7 @@ pub async fn no_quorum_without_high_out_latency() -> anyhow::Result<()> { "setting out-latency of node {} to {}", validator, config.test_case_params.out_latency ); - set_out_latency(config.test_case_params.out_latency, validator).await; + set_out_latency(config.test_case_params.out_latency, &validator).await; } let mut max_session = 0; diff --git a/scripts/synthetic-network/synthetic-link/src/main.rs b/scripts/synthetic-network/synthetic-link/src/main.rs index d7febddeb6..01f7a68924 100644 --- a/scripts/synthetic-network/synthetic-link/src/main.rs +++ b/scripts/synthetic-network/synthetic-link/src/main.rs @@ -27,7 +27,7 @@ async fn main() { info!("commiting configuration"); let mut synth_net_client = SyntheticNetworkClient::new(synth_net_url); synth_net_client - .commit_config(&synth_net_config.into()) + .commit_config(&synth_net_config) .await .unwrap_or_else(|e| panic!("failed to commit SyntheticNetwork configuration: {}", e)); info!("successfully committed new configuration"); From 26d1e5323ed6f37ce2d540a11a6475ecddf0eb6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Fri, 16 Dec 2022 19:21:10 +0100 Subject: [PATCH 15/39] added RUST_SRC_PATH in shell.nix for better support for IDEs --- shell.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shell.nix b/shell.nix index d21ea4d5ee..3705ecb61f 100644 --- a/shell.nix +++ b/shell.nix @@ -6,7 +6,7 @@ let nixpkgs = versions.nixpkgs; env = versions.stdenv; project = import ./default.nix ( buildOptions // { inherit versions; } ); - rust = nixpkgs.rust.override { + rust = versions.rustToolchain.rust.override { extensions = [ "rust-src" ]; }; nativeBuildInputs = [rust nixpkgs.cacert nixpkgs.openssl] ++ project.nativeBuildInputs; @@ -15,4 +15,5 @@ nixpkgs.mkShell.override { stdenv = env; } { inherit nativeBuildInputs; inherit (project) buildInputs shellHook; + RUST_SRC_PATH = "${versions.rustToolchain.rust-src}/lib/rustlib/src/rust/library/"; } From 08269ca5de4ec69bcf77c94b6e12fda7a67e1d93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Sat, 17 Dec 2022 12:27:00 +0100 Subject: [PATCH 16/39] slightly cleaned synthetic-link --- .../synthetic-link/src/lib.rs | 35 +++++++++++++------ 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/scripts/synthetic-network/synthetic-link/src/lib.rs b/scripts/synthetic-network/synthetic-link/src/lib.rs index 4eef87cb0b..5c4d411d7c 100644 --- a/scripts/synthetic-network/synthetic-link/src/lib.rs +++ b/scripts/synthetic-network/synthetic-link/src/lib.rs @@ -24,16 +24,10 @@ const DEFAULT_QOS: QoS = QoS { reorder_packets: false, }; -const DEFAULT_SYNTHETIC_FLOW: SyntheticFlow = SyntheticFlow { - label: String::new(), - flow: DEFAULT_FLOW, - link: DEFAULT_SYNTHETIC_LINK, -}; - const DEFAULT_FLOW: Flow = Flow { ip: IpPattern::All, protocol: Protocol::All, - port_range: PortRange(0..=0), + port_range: PortRange(0..=u16::MAX), }; #[derive(Serialize, Deserialize, Clone)] @@ -78,14 +72,33 @@ impl Default for QoS { #[derive(Serialize, Deserialize, Clone)] pub struct SyntheticFlow { - pub label: String, + label: String, pub flow: Flow, pub link: SyntheticLink, } -impl Default for SyntheticFlow { - fn default() -> Self { - DEFAULT_SYNTHETIC_FLOW +impl SyntheticFlow { + pub fn new(label: String) -> anyhow::Result { + if label.is_empty() { + bail!("`label` can't be an empty string"); + } + Ok(SyntheticFlow { + label, + flow: DEFAULT_FLOW, + link: DEFAULT_SYNTHETIC_LINK, + }) + } + + pub fn label(&self) -> &String { + &self.label + } + + pub fn set_label(&mut self, label: String) -> anyhow::Result<&mut Self> { + if label.is_empty() { + bail!("`label` can't be an empty string"); + } + self.label = label; + Ok(self) } } From 59461bb690da73a732363c0e3d87b9d2dba7db8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Sat, 17 Dec 2022 12:49:15 +0100 Subject: [PATCH 17/39] refactored synthetic-link: more types for ranged parameters --- .../synthetic-link/src/lib.rs | 63 +++++++++++++++---- 1 file changed, 51 insertions(+), 12 deletions(-) diff --git a/scripts/synthetic-network/synthetic-link/src/lib.rs b/scripts/synthetic-network/synthetic-link/src/lib.rs index 5c4d411d7c..07d10faead 100644 --- a/scripts/synthetic-network/synthetic-link/src/lib.rs +++ b/scripts/synthetic-network/synthetic-link/src/lib.rs @@ -17,17 +17,17 @@ const DEFAULT_SYNTHETIC_LINK: SyntheticLink = SyntheticLink { const DEFAULT_QOS: QoS = QoS { rate: 1000000000, - loss: 0.0, + loss: StrengthParam::zero(), latency: 0, jitter: 0, - jitter_strength: 0.0, + jitter_strength: StrengthParam::zero(), reorder_packets: false, }; const DEFAULT_FLOW: Flow = Flow { ip: IpPattern::All, protocol: Protocol::All, - port_range: PortRange(0..=u16::MAX), + port_range: PortRange::all(), }; #[derive(Serialize, Deserialize, Clone)] @@ -57,10 +57,10 @@ impl Default for SyntheticLink { #[derive(Serialize, Deserialize, Clone)] pub struct QoS { pub rate: u64, - pub loss: f64, + pub loss: StrengthParam, pub latency: u64, pub jitter: u64, - pub jitter_strength: f64, + pub jitter_strength: StrengthParam, pub reorder_packets: bool, } @@ -79,14 +79,13 @@ pub struct SyntheticFlow { impl SyntheticFlow { pub fn new(label: String) -> anyhow::Result { - if label.is_empty() { - bail!("`label` can't be an empty string"); - } - Ok(SyntheticFlow { - label, + let mut result = SyntheticFlow { + label: "label".to_string(), flow: DEFAULT_FLOW, link: DEFAULT_SYNTHETIC_LINK, - }) + }; + result.set_label(label)?; + Ok(result) } pub fn label(&self) -> &String { @@ -116,6 +115,42 @@ impl Default for Flow { } } +#[derive(Serialize, Deserialize, Clone)] +pub struct StrengthParam(f64); + +impl Default for StrengthParam { + fn default() -> Self { + Self(0.0) + } +} + +impl StrengthParam { + const fn zero() -> Self { + Self(0.0) + } + + pub fn new(value: f64) -> anyhow::Result { + let mut result = Self::default(); + result.set_value(value)?; + Ok(result) + } + + pub fn value(&self) -> f64 { + self.0 + } + + pub fn set_value(&mut self, value: f64) -> anyhow::Result<&mut Self> { + if value > 1.0 { + bail!("value shouldn't be larger than 1"); + } + if value < 0.0 { + bail!("value shouldn't be smaller than 0"); + } + self.0 = value; + Ok(self) + } +} + #[derive(Serialize_repr, Deserialize_repr, Clone)] #[repr(u8)] pub enum Protocol { @@ -130,11 +165,15 @@ pub enum Protocol { pub struct PortRange(RangeInclusive); impl PortRange { + pub const fn all() -> Self { + Self(0..=u16::MAX) + } + pub fn new(port_min: u16, port_max: u16) -> anyhow::Result { if port_min > port_max { bail!("port_min is larger than port_max"); } - Ok(PortRange(port_min..=port_max)) + Ok(Self(port_min..=port_max)) } } From 7bccc5df4be9e2d91c271e379a3ef6229fe0b9f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Mon, 19 Dec 2022 00:27:26 +0100 Subject: [PATCH 18/39] refactored synthetic-link lib --- .../synthetic-link/src/lib.rs | 52 +++++++++++-------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/scripts/synthetic-network/synthetic-link/src/lib.rs b/scripts/synthetic-network/synthetic-link/src/lib.rs index 07d10faead..f643c06f36 100644 --- a/scripts/synthetic-network/synthetic-link/src/lib.rs +++ b/scripts/synthetic-network/synthetic-link/src/lib.rs @@ -72,32 +72,18 @@ impl Default for QoS { #[derive(Serialize, Deserialize, Clone)] pub struct SyntheticFlow { - label: String, + pub label: NonEmptyString, pub flow: Flow, pub link: SyntheticLink, } impl SyntheticFlow { - pub fn new(label: String) -> anyhow::Result { - let mut result = SyntheticFlow { - label: "label".to_string(), + pub fn new(label: NonEmptyString) -> Self { + Self { + label, flow: DEFAULT_FLOW, link: DEFAULT_SYNTHETIC_LINK, - }; - result.set_label(label)?; - Ok(result) - } - - pub fn label(&self) -> &String { - &self.label - } - - pub fn set_label(&mut self, label: String) -> anyhow::Result<&mut Self> { - if label.is_empty() { - bail!("`label` can't be an empty string"); } - self.label = label; - Ok(self) } } @@ -115,6 +101,24 @@ impl Default for Flow { } } +#[derive(Serialize, Deserialize, Clone)] +pub struct NonEmptyString(String); + +impl NonEmptyString { + pub fn new(value: String) -> anyhow::Result { + if value.is_empty() { + bail!("'value' must be non-empty"); + } + Ok(Self(value)) + } +} + +impl AsRef for NonEmptyString { + fn as_ref(&self) -> &String { + &self.0 + } +} + #[derive(Serialize, Deserialize, Clone)] pub struct StrengthParam(f64); @@ -135,11 +139,7 @@ impl StrengthParam { Ok(result) } - pub fn value(&self) -> f64 { - self.0 - } - - pub fn set_value(&mut self, value: f64) -> anyhow::Result<&mut Self> { + fn set_value(&mut self, value: f64) -> anyhow::Result<&mut Self> { if value > 1.0 { bail!("value shouldn't be larger than 1"); } @@ -151,6 +151,12 @@ impl StrengthParam { } } +impl AsRef for StrengthParam { + fn as_ref(&self) -> &f64 { + &self.0 + } +} + #[derive(Serialize_repr, Deserialize_repr, Clone)] #[repr(u8)] pub enum Protocol { From 5eaaaf3ef796ac0efb8e2f6ad46d43fcb15525bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Mon, 19 Dec 2022 00:37:35 +0100 Subject: [PATCH 19/39] added code-docs to synthetic-link --- .../synthetic-link/Cargo.lock | 12 ++++++ .../synthetic-link/src/lib.rs | 42 +++++++++---------- 2 files changed, 33 insertions(+), 21 deletions(-) diff --git a/scripts/synthetic-network/synthetic-link/Cargo.lock b/scripts/synthetic-network/synthetic-link/Cargo.lock index 0f7701b053..c583cf2385 100644 --- a/scripts/synthetic-network/synthetic-link/Cargo.lock +++ b/scripts/synthetic-network/synthetic-link/Cargo.lock @@ -828,6 +828,17 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_repr" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fe39d9fbb0ebf5eb2c7cb7e2a47e4f462fad1379f1166b8ae49ad9eae89a7ca" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -902,6 +913,7 @@ dependencies = [ "reqwest", "serde", "serde_json", + "serde_repr", "tokio", ] diff --git a/scripts/synthetic-network/synthetic-link/src/lib.rs b/scripts/synthetic-network/synthetic-link/src/lib.rs index f643c06f36..99c83f46e2 100644 --- a/scripts/synthetic-network/synthetic-link/src/lib.rs +++ b/scripts/synthetic-network/synthetic-link/src/lib.rs @@ -1,4 +1,4 @@ -use std::{borrow::Borrow, ops::RangeInclusive}; +use std::ops::RangeInclusive; use anyhow::bail; use reqwest::Client; @@ -15,7 +15,7 @@ const DEFAULT_SYNTHETIC_LINK: SyntheticLink = SyntheticLink { egress: DEFAULT_QOS, }; -const DEFAULT_QOS: QoS = QoS { +const DEFAULT_QOS: QualityOfService = QualityOfService { rate: 1000000000, loss: StrengthParam::zero(), latency: 0, @@ -44,8 +44,8 @@ impl Default for SyntheticNetwork { #[derive(Serialize, Deserialize, Clone)] pub struct SyntheticLink { - pub ingress: QoS, - pub egress: QoS, + pub ingress: QualityOfService, + pub egress: QualityOfService, } impl Default for SyntheticLink { @@ -55,7 +55,7 @@ impl Default for SyntheticLink { } #[derive(Serialize, Deserialize, Clone)] -pub struct QoS { +pub struct QualityOfService { pub rate: u64, pub loss: StrengthParam, pub latency: u64, @@ -64,7 +64,7 @@ pub struct QoS { pub reorder_packets: bool, } -impl Default for QoS { +impl Default for QualityOfService { fn default() -> Self { DEFAULT_QOS } @@ -101,13 +101,15 @@ impl Default for Flow { } } +/// Simple wrapper for the `String` type representing only non-empty strings. #[derive(Serialize, Deserialize, Clone)] pub struct NonEmptyString(String); impl NonEmptyString { + /// Creates an instance of the NonEmptyString type. Bails if provided value `is_empty`. pub fn new(value: String) -> anyhow::Result { if value.is_empty() { - bail!("'value' must be non-empty"); + bail!("`value` must be non-empty"); } Ok(Self(value)) } @@ -119,6 +121,7 @@ impl AsRef for NonEmptyString { } } +/// Simple wrapper for the `f64` type representing number in range 0..=1. #[derive(Serialize, Deserialize, Clone)] pub struct StrengthParam(f64); @@ -129,25 +132,19 @@ impl Default for StrengthParam { } impl StrengthParam { - const fn zero() -> Self { - Self(0.0) - } - + /// Creates an instance of the `StrengthParam` type. Bails if provided value is not withing 0..=1 range. pub fn new(value: f64) -> anyhow::Result { - let mut result = Self::default(); - result.set_value(value)?; - Ok(result) - } - - fn set_value(&mut self, value: f64) -> anyhow::Result<&mut Self> { if value > 1.0 { bail!("value shouldn't be larger than 1"); } if value < 0.0 { bail!("value shouldn't be smaller than 0"); } - self.0 = value; - Ok(self) + Ok(Self(value)) + } + + const fn zero() -> Self { + Self(0.0) } } @@ -166,6 +163,7 @@ pub enum Protocol { All = 0, } +/// Simple wrapper for the `RangeInclusive); @@ -175,6 +173,7 @@ impl PortRange { Self(0..=u16::MAX) } + /// Creates an instance of the `PortRange` type. Bails if `port_min > port_max`. pub fn new(port_min: u16, port_max: u16) -> anyhow::Result { if port_min > port_max { bail!("port_min is larger than port_max"); @@ -183,8 +182,8 @@ impl PortRange { } } -impl Borrow> for PortRange { - fn borrow(&self) -> &RangeInclusive { +impl AsRef> for PortRange { + fn as_ref(&self) -> &RangeInclusive { &self.0 } } @@ -210,6 +209,7 @@ impl From for PortRangeSerde { } } +/// Custom type for representing IP patterns, namely `all addresses` or any other specific value. #[derive(Serialize, Deserialize, Clone)] #[serde(from = "IpPatternSerde", into = "IpPatternSerde")] pub enum IpPattern { From 86b03994978a1c72f404a1a19c5f3f613d2caeb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Mon, 19 Dec 2022 02:13:55 +0100 Subject: [PATCH 20/39] using try_from for PortRange in synthetic-lib for input validation --- scripts/synthetic-network/synthetic-link/src/lib.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/synthetic-network/synthetic-link/src/lib.rs b/scripts/synthetic-network/synthetic-link/src/lib.rs index 99c83f46e2..a9c914a2b1 100644 --- a/scripts/synthetic-network/synthetic-link/src/lib.rs +++ b/scripts/synthetic-network/synthetic-link/src/lib.rs @@ -165,7 +165,7 @@ pub enum Protocol { /// Simple wrapper for the `RangeInclusive); impl PortRange { @@ -176,7 +176,7 @@ impl PortRange { /// Creates an instance of the `PortRange` type. Bails if `port_min > port_max`. pub fn new(port_min: u16, port_max: u16) -> anyhow::Result { if port_min > port_max { - bail!("port_min is larger than port_max"); + bail!("`port_min` is larger than `port_max`"); } Ok(Self(port_min..=port_max)) } @@ -194,9 +194,11 @@ struct PortRangeSerde { port_max: u16, } -impl From for PortRange { - fn from(value: PortRangeSerde) -> Self { - PortRange(value.port_min..=value.port_max) +impl TryFrom for PortRange { + type Error = anyhow::Error; + + fn try_from(value: PortRangeSerde) -> Result { + Self::new(value.port_min, value.port_max) } } From 31c8cf5071ff716418d75c19db794fa51d9306a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Mon, 2 Jan 2023 17:35:57 +0100 Subject: [PATCH 21/39] missing deps after merge for synthetic-network --- Cargo.toml | 2 +- e2e-tests/Cargo.lock | 43 +++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f752671537..d772088611 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ exclude = [ "fork-off", "benches/payout-stakers", "bin/cliain", - "contracts/adder" + "contracts/adder", "scripts/synthetic-network/synthetic-link", ] diff --git a/e2e-tests/Cargo.lock b/e2e-tests/Cargo.lock index 9bdae5ac4b..0e9bd6f36b 100755 --- a/e2e-tests/Cargo.lock +++ b/e2e-tests/Cargo.lock @@ -54,8 +54,8 @@ dependencies = [ "aleph_client", "anyhow", "assert2", - "clap", - "env_logger", + "clap 3.2.23", + "env_logger 0.8.4", "frame-support", "frame-system", "futures", @@ -922,6 +922,19 @@ dependencies = [ "termcolor", ] +[[package]] +name = "env_logger" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +dependencies = [ + "humantime", + "is-terminal", + "log", + "regex", + "termcolor", +] + [[package]] name = "environmental" version = "1.1.4" @@ -3049,6 +3062,20 @@ dependencies = [ "semver", ] +[[package]] +name = "rustix" +version = "0.36.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4feacf7db682c6c329c4ede12649cd36ecab0f3be5b7d74e6a20304725db4549" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.42.0", +] + [[package]] name = "rustls" version = "0.20.7" @@ -3313,6 +3340,17 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_repr" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a5ec9fa74a20ebbe5d9ac23dac1fc96ba0ecfe9f50f2843b52e537b10fbcb4e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -4448,6 +4486,7 @@ dependencies = [ "reqwest", "serde", "serde_json", + "serde_repr", "tokio", ] From 8eb1410e3b28d5684afc4b00b79bc4fd260cadf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Tue, 3 Jan 2023 16:42:15 +0100 Subject: [PATCH 22/39] REVERT ME testing nightly pipeline --- .github/workflows/e2e-tests-main-devnet.yml | 70 +++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/.github/workflows/e2e-tests-main-devnet.yml b/.github/workflows/e2e-tests-main-devnet.yml index 839b64b956..3d697b34f6 100644 --- a/.github/workflows/e2e-tests-main-devnet.yml +++ b/.github/workflows/e2e-tests-main-devnet.yml @@ -99,6 +99,38 @@ jobs: uses: ./.github/actions/post-cache + build-synthetic-network-docker: + needs: [build-test-docker] + name: Build docker image with the test node artifact and support for synthetic-network + runs-on: ubuntu-20.04 + steps: + - name: Checkout source code + uses: actions/checkout@v2 + + - name: Download artifact with docker image for aleph-node + uses: actions/download-artifact@v2 + with: + name: aleph-test-docker + + - name: Load node docker image + shell: bash + run: docker load -i aleph-node.tar + + - name: Build test docker image + id: build-image + run: | + scripts/synthetic-network/build_synthetic-network.sh + docker save -o aleph-node.tar aleph-node:syntheticnet + + - name: Upload test docker image + uses: actions/upload-artifact@v2 + with: + name: aleph-test-synthetic-docker + path: aleph-node.tar + if-no-files-found: error + retention-days: 7 + + check-determinism: needs: [build-new-node] name: Verify runtime build determinism @@ -658,6 +690,42 @@ jobs: # run: | # ./scripts/catchup_version_upgrade_test.sh + + run-e2e-high-out-latency: + needs: [build-synthetic-network-docker, build-test-client] + name: Run high out-latency test + runs-on: ubuntu-20.04 + steps: + - name: Checkout source code + uses: actions/checkout@v2 + + - name: Run e2e test + uses: ./.github/actions/run-e2e-test + with: + test-case: high_out_latency + image-path: aleph-test-synthetic-docker + node-image: aleph-node:syntheticnet + compose-file: docker/docker-compose.synthetic-network.yml + timeout-minutes: 30 + + no_quorum_without_high_out_latency: + needs: [build-synthetic-network-docker, build-test-client] + name: Run high out-latency for every quorum + runs-on: ubuntu-20.04 + steps: + - name: Checkout source code + uses: actions/checkout@v2 + + - name: Run e2e test + uses: ./.github/actions/run-e2e-test + with: + test-case: no_quorum_without_high_out_latency + image-path: aleph-test-synthetic-docker + node-image: aleph-node:syntheticnet + compose-file: docker/docker-compose.synthetic-network.yml + timeout-minutes: 15 + + check-e2e-test-suite-completion: needs: [ run-e2e-finalization-test, @@ -687,6 +755,8 @@ jobs: run-e2e-adder-contract-test, # run-e2e-failing-version-upgrade, # run-e2e-version-upgrade-catchup, + run-e2e-high-out-latency, + no_quorum_without_high_out_latency, ] name: Check e2e test suite completion runs-on: ubuntu-20.04 From 98499c2966c5dd2824cfd5d3cb9d4d03529608d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Tue, 3 Jan 2023 17:42:58 +0100 Subject: [PATCH 23/39] fix after merge --- .github/scripts/run_e2e_test.sh | 4 ++++ e2e-tests/src/config.rs | 5 +++-- e2e-tests/src/test/high_latency.rs | 12 ++++++++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/scripts/run_e2e_test.sh b/.github/scripts/run_e2e_test.sh index 47dcdfa0d3..1e23eb5c76 100755 --- a/.github/scripts/run_e2e_test.sh +++ b/.github/scripts/run_e2e_test.sh @@ -116,6 +116,10 @@ if [[ -n "${ADDER:-}" ]]; then ARGS+=(-e "ADDER_METADATA=/contracts/adder/target/ink/metadata.json") fi +if [[ -n "${OUT_LATENCY:-}" ]]; then + ARGS+=(-e OUT_LATENCY) +fi + docker run -v "$(pwd)/contracts:/contracts" -v "$(pwd)/docker/data:/data" "${ARGS[@]}" aleph-e2e-client:latest exit $? diff --git a/e2e-tests/src/config.rs b/e2e-tests/src/config.rs index 17cd475fdc..c37663fd2e 100755 --- a/e2e-tests/src/config.rs +++ b/e2e-tests/src/config.rs @@ -27,6 +27,7 @@ static GLOBAL_CONFIG: Lazy = Lazy::new(|| { upgrade_finalization_wait_sessions: get_env("UPGRADE_FINALIZATION_WAIT_SESSIONS"), adder: get_env("ADDER"), adder_metadata: get_env("ADDER_METADATA"), + out_latency: get_env("OUT_LATENCY"), }, } }); @@ -34,7 +35,7 @@ static GLOBAL_CONFIG: Lazy = Lazy::new(|| { fn get_env(name: &str) -> Option where T: FromStr, - ::Err: std::fmt::Debug, + T::Err: std::fmt::Debug, { env::var(name).ok().map(|v| { v.parse() @@ -134,5 +135,5 @@ pub struct TestCaseParams { pub adder_metadata: Option, /// Milliseconds of network latency - pub out_latency: u64, + pub out_latency: Option, } diff --git a/e2e-tests/src/test/high_latency.rs b/e2e-tests/src/test/high_latency.rs index 0ea20ea77c..7465203513 100644 --- a/e2e-tests/src/test/high_latency.rs +++ b/e2e-tests/src/test/high_latency.rs @@ -8,9 +8,12 @@ use log::info; use crate::{config::setup_test, synthetic_network::set_out_latency}; +const OUT_LATENCY: u64 = 500; + #[tokio::test] pub async fn high_out_latency() -> anyhow::Result<()> { let config = setup_test(); + let out_latency = config.test_case_params.out_latency.unwrap_or(OUT_LATENCY); let connections = config.create_signed_connections().await; info!("waiting for at least session 3"); @@ -24,9 +27,9 @@ pub async fn high_out_latency() -> anyhow::Result<()> { for validator in config.validator_names() { info!( "setting out-latency of node {} to {}", - validator, config.test_case_params.out_latency + validator, out_latency ); - set_out_latency(config.test_case_params.out_latency, &validator).await; + set_out_latency(out_latency, &validator).await; } let mut max_session = 0; @@ -47,6 +50,7 @@ pub async fn high_out_latency() -> anyhow::Result<()> { #[tokio::test] pub async fn no_quorum_without_high_out_latency() -> anyhow::Result<()> { let config = setup_test(); + let out_latency = config.test_case_params.out_latency.unwrap_or(OUT_LATENCY); let connections = config.create_signed_connections().await; info!("waiting for at least session 3"); @@ -64,9 +68,9 @@ pub async fn no_quorum_without_high_out_latency() -> anyhow::Result<()> { { info!( "setting out-latency of node {} to {}", - validator, config.test_case_params.out_latency + validator, out_latency ); - set_out_latency(config.test_case_params.out_latency, &validator).await; + set_out_latency(out_latency, &validator).await; } let mut max_session = 0; From b991f75a1e87636a66839c061b7fb037473d531d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Tue, 3 Jan 2023 18:07:41 +0100 Subject: [PATCH 24/39] say no to install-protoc in github pipelines --- .github/workflows/build-and-push-cliain.yaml | 5 ----- .github/workflows/build-node-and-runtime.yml | 5 ----- ...build-send-postsync-hook-runtime-image.yml | 5 ----- .github/workflows/check-excluded-packages.yml | 5 ----- .github/workflows/e2e-tests-main-devnet.yml | 20 ------------------- .github/workflows/nightly-pipeline.yaml | 10 ---------- .github/workflows/unit_tests.yml | 5 ----- 7 files changed, 55 deletions(-) diff --git a/.github/workflows/build-and-push-cliain.yaml b/.github/workflows/build-and-push-cliain.yaml index 32a2f983eb..6db5757121 100644 --- a/.github/workflows/build-and-push-cliain.yaml +++ b/.github/workflows/build-and-push-cliain.yaml @@ -17,11 +17,6 @@ jobs: - name: Install Rust toolchain uses: actions-rs/toolchain@v1 - - name: Install Protoc - uses: arduino/setup-protoc@v1 - with: - version: '3.6.1' - - name: Cargo | Build release binary run: | cd ./bin/cliain && cargo build --release diff --git a/.github/workflows/build-node-and-runtime.yml b/.github/workflows/build-node-and-runtime.yml index 4c9d4597b1..dba82c98f2 100644 --- a/.github/workflows/build-node-and-runtime.yml +++ b/.github/workflows/build-node-and-runtime.yml @@ -33,11 +33,6 @@ jobs: - name: Install Rust toolchain uses: actions-rs/toolchain@v1 - - name: Install Protoc - uses: arduino/setup-protoc@v1 - with: - version: '3.6.1' - - name: Install WASM target run: rustup target add wasm32-unknown-unknown diff --git a/.github/workflows/build-send-postsync-hook-runtime-image.yml b/.github/workflows/build-send-postsync-hook-runtime-image.yml index e66e0093cf..8788e1a1bb 100644 --- a/.github/workflows/build-send-postsync-hook-runtime-image.yml +++ b/.github/workflows/build-send-postsync-hook-runtime-image.yml @@ -33,11 +33,6 @@ jobs: - name: Install rust toolchain uses: actions-rs/toolchain@v1 - - name: Install Protoc - uses: arduino/setup-protoc@v1 - with: - version: '3.6.1' - - name: Build binary run: | pushd bin/cliain/ diff --git a/.github/workflows/check-excluded-packages.yml b/.github/workflows/check-excluded-packages.yml index 202fb804be..bf8ee51f57 100644 --- a/.github/workflows/check-excluded-packages.yml +++ b/.github/workflows/check-excluded-packages.yml @@ -27,11 +27,6 @@ jobs: - name: Install rust toolchain uses: actions-rs/toolchain@v1 - - name: Install Protoc - uses: arduino/setup-protoc@v1 - with: - version: '3.6.1' - - name: Read excluded packages from Cargo.toml id: read_excluded uses: SebRollen/toml-action@v1.0.0 diff --git a/.github/workflows/e2e-tests-main-devnet.yml b/.github/workflows/e2e-tests-main-devnet.yml index 3d697b34f6..19b6d200f5 100644 --- a/.github/workflows/e2e-tests-main-devnet.yml +++ b/.github/workflows/e2e-tests-main-devnet.yml @@ -65,11 +65,6 @@ jobs: - name: Install Rust toolchain uses: actions-rs/toolchain@v1 - - name: Install Protoc - uses: arduino/setup-protoc@v1 - with: - version: '3.6.1' - - name: Restore cache uses: ./.github/actions/restore-cache with: @@ -144,11 +139,6 @@ jobs: - name: Install Rust Toolchain uses: actions-rs/toolchain@v1 - - name: Install Protoc - uses: arduino/setup-protoc@v1 - with: - version: '3.6.1' - - name: Install WASM target run: rustup target add wasm32-unknown-unknown @@ -182,11 +172,6 @@ jobs: - name: Install Rust Toolchain uses: actions-rs/toolchain@v1 - - name: Install Protoc - uses: arduino/setup-protoc@v1 - with: - version: '3.6.1' - - name: Restore cache uses: ./.github/actions/restore-cache with: @@ -906,11 +891,6 @@ jobs: - name: Install Rust toolchain uses: actions-rs/toolchain@v1 - - name: Install Protoc - uses: arduino/setup-protoc@v1 - with: - version: '3.6.1' - - name: Install WASM target run: rustup target add wasm32-unknown-unknown diff --git a/.github/workflows/nightly-pipeline.yaml b/.github/workflows/nightly-pipeline.yaml index 8dd294673f..2591b038da 100644 --- a/.github/workflows/nightly-pipeline.yaml +++ b/.github/workflows/nightly-pipeline.yaml @@ -87,11 +87,6 @@ jobs: - name: Install Rust toolchain uses: actions-rs/toolchain@v1 - - name: Install Protoc - uses: arduino/setup-protoc@v1 - with: - version: '3.6.1' - - name: Install WASM target run: rustup target add wasm32-unknown-unknown @@ -124,11 +119,6 @@ jobs: - name: Install Rust toolchain uses: actions-rs/toolchain@v1 - - name: Install Protoc - uses: arduino/setup-protoc@v1 - with: - version: '3.6.1' - - name: Restore cache uses: ./.github/actions/restore-cache with: diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 7e3431687a..867fd814e0 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -27,11 +27,6 @@ jobs: - name: Install Rust Toolchain uses: actions-rs/toolchain@v1 - - name: Install Protoc - uses: arduino/setup-protoc@v1 - with: - version: '3.6.1' - - name: Install clippy and fmt run: rustup component add clippy rustfmt From b2a6a9dffb9cc3f69a74242fe996bfb327d20d3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Tue, 3 Jan 2023 18:47:00 +0100 Subject: [PATCH 25/39] Revert "say no to install-protoc in github pipelines" This reverts commit b991f75a1e87636a66839c061b7fb037473d531d. --- .github/workflows/build-and-push-cliain.yaml | 5 +++++ .github/workflows/build-node-and-runtime.yml | 5 +++++ ...build-send-postsync-hook-runtime-image.yml | 5 +++++ .github/workflows/check-excluded-packages.yml | 5 +++++ .github/workflows/e2e-tests-main-devnet.yml | 20 +++++++++++++++++++ .github/workflows/nightly-pipeline.yaml | 10 ++++++++++ .github/workflows/unit_tests.yml | 5 +++++ 7 files changed, 55 insertions(+) diff --git a/.github/workflows/build-and-push-cliain.yaml b/.github/workflows/build-and-push-cliain.yaml index 6db5757121..32a2f983eb 100644 --- a/.github/workflows/build-and-push-cliain.yaml +++ b/.github/workflows/build-and-push-cliain.yaml @@ -17,6 +17,11 @@ jobs: - name: Install Rust toolchain uses: actions-rs/toolchain@v1 + - name: Install Protoc + uses: arduino/setup-protoc@v1 + with: + version: '3.6.1' + - name: Cargo | Build release binary run: | cd ./bin/cliain && cargo build --release diff --git a/.github/workflows/build-node-and-runtime.yml b/.github/workflows/build-node-and-runtime.yml index dba82c98f2..4c9d4597b1 100644 --- a/.github/workflows/build-node-and-runtime.yml +++ b/.github/workflows/build-node-and-runtime.yml @@ -33,6 +33,11 @@ jobs: - name: Install Rust toolchain uses: actions-rs/toolchain@v1 + - name: Install Protoc + uses: arduino/setup-protoc@v1 + with: + version: '3.6.1' + - name: Install WASM target run: rustup target add wasm32-unknown-unknown diff --git a/.github/workflows/build-send-postsync-hook-runtime-image.yml b/.github/workflows/build-send-postsync-hook-runtime-image.yml index 8788e1a1bb..e66e0093cf 100644 --- a/.github/workflows/build-send-postsync-hook-runtime-image.yml +++ b/.github/workflows/build-send-postsync-hook-runtime-image.yml @@ -33,6 +33,11 @@ jobs: - name: Install rust toolchain uses: actions-rs/toolchain@v1 + - name: Install Protoc + uses: arduino/setup-protoc@v1 + with: + version: '3.6.1' + - name: Build binary run: | pushd bin/cliain/ diff --git a/.github/workflows/check-excluded-packages.yml b/.github/workflows/check-excluded-packages.yml index bf8ee51f57..202fb804be 100644 --- a/.github/workflows/check-excluded-packages.yml +++ b/.github/workflows/check-excluded-packages.yml @@ -27,6 +27,11 @@ jobs: - name: Install rust toolchain uses: actions-rs/toolchain@v1 + - name: Install Protoc + uses: arduino/setup-protoc@v1 + with: + version: '3.6.1' + - name: Read excluded packages from Cargo.toml id: read_excluded uses: SebRollen/toml-action@v1.0.0 diff --git a/.github/workflows/e2e-tests-main-devnet.yml b/.github/workflows/e2e-tests-main-devnet.yml index 19b6d200f5..3d697b34f6 100644 --- a/.github/workflows/e2e-tests-main-devnet.yml +++ b/.github/workflows/e2e-tests-main-devnet.yml @@ -65,6 +65,11 @@ jobs: - name: Install Rust toolchain uses: actions-rs/toolchain@v1 + - name: Install Protoc + uses: arduino/setup-protoc@v1 + with: + version: '3.6.1' + - name: Restore cache uses: ./.github/actions/restore-cache with: @@ -139,6 +144,11 @@ jobs: - name: Install Rust Toolchain uses: actions-rs/toolchain@v1 + - name: Install Protoc + uses: arduino/setup-protoc@v1 + with: + version: '3.6.1' + - name: Install WASM target run: rustup target add wasm32-unknown-unknown @@ -172,6 +182,11 @@ jobs: - name: Install Rust Toolchain uses: actions-rs/toolchain@v1 + - name: Install Protoc + uses: arduino/setup-protoc@v1 + with: + version: '3.6.1' + - name: Restore cache uses: ./.github/actions/restore-cache with: @@ -891,6 +906,11 @@ jobs: - name: Install Rust toolchain uses: actions-rs/toolchain@v1 + - name: Install Protoc + uses: arduino/setup-protoc@v1 + with: + version: '3.6.1' + - name: Install WASM target run: rustup target add wasm32-unknown-unknown diff --git a/.github/workflows/nightly-pipeline.yaml b/.github/workflows/nightly-pipeline.yaml index 2591b038da..8dd294673f 100644 --- a/.github/workflows/nightly-pipeline.yaml +++ b/.github/workflows/nightly-pipeline.yaml @@ -87,6 +87,11 @@ jobs: - name: Install Rust toolchain uses: actions-rs/toolchain@v1 + - name: Install Protoc + uses: arduino/setup-protoc@v1 + with: + version: '3.6.1' + - name: Install WASM target run: rustup target add wasm32-unknown-unknown @@ -119,6 +124,11 @@ jobs: - name: Install Rust toolchain uses: actions-rs/toolchain@v1 + - name: Install Protoc + uses: arduino/setup-protoc@v1 + with: + version: '3.6.1' + - name: Restore cache uses: ./.github/actions/restore-cache with: diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 867fd814e0..7e3431687a 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -27,6 +27,11 @@ jobs: - name: Install Rust Toolchain uses: actions-rs/toolchain@v1 + - name: Install Protoc + uses: arduino/setup-protoc@v1 + with: + version: '3.6.1' + - name: Install clippy and fmt run: rustup component add clippy rustfmt From a0f76fb09a2c043576a6e5acd527c0c07b90687e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Tue, 3 Jan 2023 18:59:55 +0100 Subject: [PATCH 26/39] GITHUB_TOKEN for "Install Protoc" action --- .github/workflows/build-and-push-cliain.yaml | 7 ++++--- .github/workflows/build-node-and-runtime.yml | 1 + .../build-send-postsync-hook-runtime-image.yml | 9 +++++---- .github/workflows/check-excluded-packages.yml | 1 + .github/workflows/e2e-tests-main-devnet.yml | 12 ++++++++---- .github/workflows/nightly-pipeline.yaml | 2 ++ .github/workflows/unit_tests.yml | 3 ++- 7 files changed, 23 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-and-push-cliain.yaml b/.github/workflows/build-and-push-cliain.yaml index 32a2f983eb..ad77ef3cf5 100644 --- a/.github/workflows/build-and-push-cliain.yaml +++ b/.github/workflows/build-and-push-cliain.yaml @@ -21,6 +21,7 @@ jobs: uses: arduino/setup-protoc@v1 with: version: '3.6.1' + repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Cargo | Build release binary run: | @@ -29,18 +30,18 @@ jobs: - name: GIT | Get branch name and commit SHA id: get_branch uses: ./.github/actions/get-branch - + - name: Login to ECR uses: docker/login-action@v1 with: registry: public.ecr.aws username: ${{ secrets.AWS_MAINNET_ACCESS_KEY_ID }} password: ${{ secrets.AWS_MAINNET_SECRET_ACCESS_KEY }} - + - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@master - + - name: Build and push latest docker image id: build-image env: diff --git a/.github/workflows/build-node-and-runtime.yml b/.github/workflows/build-node-and-runtime.yml index 4c9d4597b1..32415adf90 100644 --- a/.github/workflows/build-node-and-runtime.yml +++ b/.github/workflows/build-node-and-runtime.yml @@ -37,6 +37,7 @@ jobs: uses: arduino/setup-protoc@v1 with: version: '3.6.1' + repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Install WASM target run: rustup target add wasm32-unknown-unknown diff --git a/.github/workflows/build-send-postsync-hook-runtime-image.yml b/.github/workflows/build-send-postsync-hook-runtime-image.yml index e66e0093cf..64485810a4 100644 --- a/.github/workflows/build-send-postsync-hook-runtime-image.yml +++ b/.github/workflows/build-send-postsync-hook-runtime-image.yml @@ -36,7 +36,8 @@ jobs: - name: Install Protoc uses: arduino/setup-protoc@v1 with: - version: '3.6.1' + version: '3.6.1' + repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Build binary run: | @@ -76,7 +77,7 @@ jobs: docker tag ${{ env.ECR_PUSH_IMAGE }} ${{ env.ECR_LATEST }} docker push ${{ env.ECR_LATEST }} - + - name: GIT | Checkout aleph-apps repo uses: actions/checkout@master with: @@ -89,8 +90,8 @@ jobs: with: kustomize-version: "3.8.6" - - name: Update postsync hook docker image - env: + - name: Update postsync hook docker image + env: RELEASE_IMAGE: public.ecr.aws/p6e8q1z1/runtime-update-hook:${{ steps.vars.outputs.sha_short }} REGIONS_AWS: 'eu-central-1' run: | diff --git a/.github/workflows/check-excluded-packages.yml b/.github/workflows/check-excluded-packages.yml index 202fb804be..9eeb954a4e 100644 --- a/.github/workflows/check-excluded-packages.yml +++ b/.github/workflows/check-excluded-packages.yml @@ -31,6 +31,7 @@ jobs: uses: arduino/setup-protoc@v1 with: version: '3.6.1' + repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Read excluded packages from Cargo.toml id: read_excluded diff --git a/.github/workflows/e2e-tests-main-devnet.yml b/.github/workflows/e2e-tests-main-devnet.yml index 3d697b34f6..6c66c51403 100644 --- a/.github/workflows/e2e-tests-main-devnet.yml +++ b/.github/workflows/e2e-tests-main-devnet.yml @@ -68,7 +68,8 @@ jobs: - name: Install Protoc uses: arduino/setup-protoc@v1 with: - version: '3.6.1' + version: '3.6.1' + repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Restore cache uses: ./.github/actions/restore-cache @@ -147,7 +148,8 @@ jobs: - name: Install Protoc uses: arduino/setup-protoc@v1 with: - version: '3.6.1' + version: '3.6.1' + repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Install WASM target run: rustup target add wasm32-unknown-unknown @@ -185,7 +187,8 @@ jobs: - name: Install Protoc uses: arduino/setup-protoc@v1 with: - version: '3.6.1' + version: '3.6.1' + repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Restore cache uses: ./.github/actions/restore-cache @@ -909,7 +912,8 @@ jobs: - name: Install Protoc uses: arduino/setup-protoc@v1 with: - version: '3.6.1' + version: '3.6.1' + repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Install WASM target run: rustup target add wasm32-unknown-unknown diff --git a/.github/workflows/nightly-pipeline.yaml b/.github/workflows/nightly-pipeline.yaml index 8dd294673f..0008358964 100644 --- a/.github/workflows/nightly-pipeline.yaml +++ b/.github/workflows/nightly-pipeline.yaml @@ -91,6 +91,7 @@ jobs: uses: arduino/setup-protoc@v1 with: version: '3.6.1' + repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Install WASM target run: rustup target add wasm32-unknown-unknown @@ -128,6 +129,7 @@ jobs: uses: arduino/setup-protoc@v1 with: version: '3.6.1' + repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Restore cache uses: ./.github/actions/restore-cache diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 7e3431687a..fa644dc1f2 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -30,7 +30,8 @@ jobs: - name: Install Protoc uses: arduino/setup-protoc@v1 with: - version: '3.6.1' + version: '3.6.1' + repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Install clippy and fmt run: rustup component add clippy rustfmt From 01d7b68c48094ddef4d38a565b34aaa3a942de8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Tue, 3 Jan 2023 19:25:00 +0100 Subject: [PATCH 27/39] reverted changed file permissions --- .github/actions/run-e2e-test/action.yml | 0 Cargo.toml | 0 aleph-client/src/waiting.rs | 0 e2e-tests/Cargo.lock | 0 e2e-tests/src/config.rs | 0 e2e-tests/src/test/mod.rs | 0 6 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 .github/actions/run-e2e-test/action.yml mode change 100755 => 100644 Cargo.toml mode change 100755 => 100644 aleph-client/src/waiting.rs mode change 100755 => 100644 e2e-tests/Cargo.lock mode change 100755 => 100644 e2e-tests/src/config.rs mode change 100755 => 100644 e2e-tests/src/test/mod.rs diff --git a/.github/actions/run-e2e-test/action.yml b/.github/actions/run-e2e-test/action.yml old mode 100755 new mode 100644 diff --git a/Cargo.toml b/Cargo.toml old mode 100755 new mode 100644 diff --git a/aleph-client/src/waiting.rs b/aleph-client/src/waiting.rs old mode 100755 new mode 100644 diff --git a/e2e-tests/Cargo.lock b/e2e-tests/Cargo.lock old mode 100755 new mode 100644 diff --git a/e2e-tests/src/config.rs b/e2e-tests/src/config.rs old mode 100755 new mode 100644 diff --git a/e2e-tests/src/test/mod.rs b/e2e-tests/src/test/mod.rs old mode 100755 new mode 100644 From 61e2f79a8b65f71031383bc56dfbf8aaf1c5e21c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Tue, 3 Jan 2023 19:36:19 +0100 Subject: [PATCH 28/39] reverted rust-toolchain file --- rust-toolchain | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain b/rust-toolchain index 1f1f6b18d9..c7c6217087 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2022-08-12 +nightly-2022-11-28 From ca97e85e4073fb3270532756f02333ede180732c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Tue, 3 Jan 2023 20:46:02 +0100 Subject: [PATCH 29/39] typo in description for PortRange --- scripts/synthetic-network/synthetic-link/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/synthetic-network/synthetic-link/src/lib.rs b/scripts/synthetic-network/synthetic-link/src/lib.rs index a9c914a2b1..ba5f5a5c96 100644 --- a/scripts/synthetic-network/synthetic-link/src/lib.rs +++ b/scripts/synthetic-network/synthetic-link/src/lib.rs @@ -163,7 +163,7 @@ pub enum Protocol { All = 0, } -/// Simple wrapper for the `RangeInclusive` type. #[derive(Serialize, Deserialize, Clone)] #[serde(try_from = "PortRangeSerde", into = "PortRangeSerde")] pub struct PortRange(RangeInclusive); From 03aa36ed4c65c521e5e70568a92139c86858ee99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Tue, 3 Jan 2023 20:47:03 +0100 Subject: [PATCH 30/39] e2e-tests: config.validator_names() uses validators_count --- e2e-tests/src/config.rs | 11 +++++------ e2e-tests/src/test/high_latency.rs | 1 - 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/e2e-tests/src/config.rs b/e2e-tests/src/config.rs index c37663fd2e..f2f4a64c1c 100644 --- a/e2e-tests/src/config.rs +++ b/e2e-tests/src/config.rs @@ -1,4 +1,4 @@ -use std::{env, str::FromStr}; +use std::{env, iter, str::FromStr}; use aleph_client::{RootConnection, SignedConnection}; use once_cell::sync::Lazy; @@ -85,11 +85,10 @@ impl Config { .unwrap() } - pub fn validator_names(&self) -> Vec { - ["Node0", "Node1", "Node2", "Node3", "Node4"] - .into_iter() - .map(|n| n.to_string()) - .collect() + pub fn validator_names<'a>(&'a self) -> impl 'a + Iterator { + (0..) + .take_while(|id| *id < self.validator_count) + .map(|id| format!("Node{}", id)) } /// Get a `SignedConnection` where the signer is the first validator. diff --git a/e2e-tests/src/test/high_latency.rs b/e2e-tests/src/test/high_latency.rs index 7465203513..d885722288 100644 --- a/e2e-tests/src/test/high_latency.rs +++ b/e2e-tests/src/test/high_latency.rs @@ -63,7 +63,6 @@ pub async fn no_quorum_without_high_out_latency() -> anyhow::Result<()> { info!("setting out-latency"); for validator in config .validator_names() - .into_iter() .take(((config.validator_count - 1) / 3 + 1) as usize) { info!( From d879c86e2649562851d5489ee438e90bedea2b7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Tue, 3 Jan 2023 20:47:57 +0100 Subject: [PATCH 31/39] e2e-tests: added description for the `latency` tests --- e2e-tests/src/test/high_latency.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/e2e-tests/src/test/high_latency.rs b/e2e-tests/src/test/high_latency.rs index d885722288..7b55e584e5 100644 --- a/e2e-tests/src/test/high_latency.rs +++ b/e2e-tests/src/test/high_latency.rs @@ -10,6 +10,9 @@ use crate::{config::setup_test, synthetic_network::set_out_latency}; const OUT_LATENCY: u64 = 500; +/// Test if nodes are able to proceed despite high latency. More precisely, it first awaits predefined number of sessions, sets +/// egress-latency for each node using same value (default is 500 milliseconds) and verifies if after it was able to proceed two +/// more sessions. #[tokio::test] pub async fn high_out_latency() -> anyhow::Result<()> { let config = setup_test(); @@ -47,6 +50,9 @@ pub async fn high_out_latency() -> anyhow::Result<()> { Ok(()) } +/// Test if nodes are able to proceed despite high latency, but set only for a subset of nodes. More precisely, it first awaits +/// predefined number of sessions, sets egress-latency for 1/3n of nodes using same value (default is 500 milliseconds) and +/// verifies if after it was able to proceed two more sessions. #[tokio::test] pub async fn no_quorum_without_high_out_latency() -> anyhow::Result<()> { let config = setup_test(); From 9a8e4050b49419e97db8c0c3d2a0b9275bd6d54e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Tue, 3 Jan 2023 20:49:43 +0100 Subject: [PATCH 32/39] shell.nix: added description for new ENV var RUST_SRC_PATH - it's for rust-analyzer --- shell.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/shell.nix b/shell.nix index 3705ecb61f..030d32db42 100644 --- a/shell.nix +++ b/shell.nix @@ -15,5 +15,6 @@ nixpkgs.mkShell.override { stdenv = env; } { inherit nativeBuildInputs; inherit (project) buildInputs shellHook; + # RUST_SRC_PATH might be needed by the `rust-analyzer` RUST_SRC_PATH = "${versions.rustToolchain.rust-src}/lib/rustlib/src/rust/library/"; } From f4a646b5cc6bcd7c87f5db92e338c39e00f59969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Wed, 4 Jan 2023 13:20:55 +0100 Subject: [PATCH 33/39] BACKUP: e2e-tests/config.rs with iterators --- e2e-tests/src/config.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/e2e-tests/src/config.rs b/e2e-tests/src/config.rs index f2f4a64c1c..234386b663 100644 --- a/e2e-tests/src/config.rs +++ b/e2e-tests/src/config.rs @@ -28,6 +28,9 @@ static GLOBAL_CONFIG: Lazy = Lazy::new(|| { adder: get_env("ADDER"), adder_metadata: get_env("ADDER_METADATA"), out_latency: get_env("OUT_LATENCY"), + synthetic_network_urls: env::var("SYNTHETIC_URLS") + .ok() + .map(|s| s.split(',').map(|s| s.to_string()).collect()), }, } }); @@ -91,6 +94,24 @@ impl Config { .map(|id| format!("Node{}", id)) } + pub fn synthetic_network_urls<'a>(&'a self) -> impl 'a + Iterator { + enum Either, B: Iterator> { + Left(A), + Right(B), + } + let mut either = match self.test_case_params.synthetic_network_urls { + Some(urls) => Either::Left(urls.into_iter()), + None => Either::Right( + self.validator_names() + .map(|node_name| format!("http://{}:80/qos", node_name)), + ), + }; + iter::from_fn(move || match &mut either { + Either::Left(a) => a.next(), + Either::Right(b) => b.next(), + }) + } + /// Get a `SignedConnection` where the signer is the first validator. pub async fn get_first_signed_connection(&self) -> SignedConnection { let node = &self.node; @@ -135,4 +156,7 @@ pub struct TestCaseParams { /// Milliseconds of network latency pub out_latency: Option, + + /// List of URLs for the configuration endpoints of the synthetic-network + pub synthetic_network_urls: Option>, } From 36287c9c87b62955e16cb6758d34e74403304445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Wed, 4 Jan 2023 13:27:43 +0100 Subject: [PATCH 34/39] new verion of the synthetic-network e2e-test that supports non-dockerized runs (urls) --- e2e-tests/src/config.rs | 31 ++++++++++++------------------ e2e-tests/src/synthetic_network.rs | 13 ++++--------- e2e-tests/src/test/high_latency.rs | 13 +++++++------ 3 files changed, 23 insertions(+), 34 deletions(-) diff --git a/e2e-tests/src/config.rs b/e2e-tests/src/config.rs index 234386b663..8bf525f495 100644 --- a/e2e-tests/src/config.rs +++ b/e2e-tests/src/config.rs @@ -1,4 +1,4 @@ -use std::{env, iter, str::FromStr}; +use std::{env, str::FromStr}; use aleph_client::{RootConnection, SignedConnection}; use once_cell::sync::Lazy; @@ -88,28 +88,21 @@ impl Config { .unwrap() } - pub fn validator_names<'a>(&'a self) -> impl 'a + Iterator { - (0..) - .take_while(|id| *id < self.validator_count) + pub fn validator_names<'a>(&'a self) -> Vec { + (0..self.validator_count) .map(|id| format!("Node{}", id)) + .collect() } - pub fn synthetic_network_urls<'a>(&'a self) -> impl 'a + Iterator { - enum Either, B: Iterator> { - Left(A), - Right(B), + pub fn synthetic_network_urls(&self) -> Vec { + match &self.test_case_params.synthetic_network_urls { + Some(urls) => urls.clone(), + None => self + .validator_names() + .into_iter() + .map(|node_name| format!("http://{}:80/qos", node_name)) + .collect(), } - let mut either = match self.test_case_params.synthetic_network_urls { - Some(urls) => Either::Left(urls.into_iter()), - None => Either::Right( - self.validator_names() - .map(|node_name| format!("http://{}:80/qos", node_name)), - ), - }; - iter::from_fn(move || match &mut either { - Either::Left(a) => a.next(), - Either::Right(b) => b.next(), - }) } /// Get a `SignedConnection` where the signer is the first validator. diff --git a/e2e-tests/src/synthetic_network.rs b/e2e-tests/src/synthetic_network.rs index 91925c3136..51692bc591 100644 --- a/e2e-tests/src/synthetic_network.rs +++ b/e2e-tests/src/synthetic_network.rs @@ -3,18 +3,13 @@ use synthetic_link::SyntheticNetworkClient; pub type Milliseconds = u64; -fn create_client(node_name: &str) -> SyntheticNetworkClient { - let synthetic_network_url = format!("http://{}:80/qos", node_name); - info!("creating an http client for url {}", synthetic_network_url); - SyntheticNetworkClient::new(synthetic_network_url) -} - -pub async fn set_out_latency(milliseconds: Milliseconds, node_name: &str) { +pub async fn set_out_latency(milliseconds: Milliseconds, synthetic_url: String) { info!( "setting out-latency of node {} to {}ms", - node_name, milliseconds + synthetic_url, milliseconds ); - let mut client = create_client(node_name); + info!("creating an http client for url {}", synthetic_url); + let mut client = SyntheticNetworkClient::new(synthetic_url); let mut config = client .load_config() .await diff --git a/e2e-tests/src/test/high_latency.rs b/e2e-tests/src/test/high_latency.rs index 7b55e584e5..716dbe9d50 100644 --- a/e2e-tests/src/test/high_latency.rs +++ b/e2e-tests/src/test/high_latency.rs @@ -27,12 +27,12 @@ pub async fn high_out_latency() -> anyhow::Result<()> { } info!("setting out-latency"); - for validator in config.validator_names() { + for synthetic_url in config.synthetic_network_urls() { info!( "setting out-latency of node {} to {}", - validator, out_latency + synthetic_url, out_latency ); - set_out_latency(out_latency, &validator).await; + set_out_latency(out_latency, synthetic_url).await; } let mut max_session = 0; @@ -67,15 +67,16 @@ pub async fn no_quorum_without_high_out_latency() -> anyhow::Result<()> { } info!("setting out-latency"); - for validator in config + for synthetic_url in config .validator_names() + .into_iter() .take(((config.validator_count - 1) / 3 + 1) as usize) { info!( "setting out-latency of node {} to {}", - validator, out_latency + synthetic_url, out_latency ); - set_out_latency(out_latency, &validator).await; + set_out_latency(out_latency, synthetic_url).await; } let mut max_session = 0; From fbd4c4df0932d4c06c42f21fef0ca6debf56c521 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Wed, 4 Jan 2023 15:25:42 +0100 Subject: [PATCH 35/39] fix for e2e-test `no_quorum_without_high_latency` - missing call for urls instead of names --- e2e-tests/src/test/high_latency.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e-tests/src/test/high_latency.rs b/e2e-tests/src/test/high_latency.rs index 716dbe9d50..e536cf4610 100644 --- a/e2e-tests/src/test/high_latency.rs +++ b/e2e-tests/src/test/high_latency.rs @@ -68,7 +68,7 @@ pub async fn no_quorum_without_high_out_latency() -> anyhow::Result<()> { info!("setting out-latency"); for synthetic_url in config - .validator_names() + .synthetic_network_urls() .into_iter() .take(((config.validator_count - 1) / 3 + 1) as usize) { From 4c0a55a975461a5df426a78c11ecc45e883e6796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Wed, 4 Jan 2023 16:12:27 +0100 Subject: [PATCH 36/39] extended README.md for the synthetic-network: how to run e2e-tests with synthetic-network locally --- scripts/synthetic-network/README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/scripts/synthetic-network/README.md b/scripts/synthetic-network/README.md index ce2897ea5a..836457f996 100644 --- a/scripts/synthetic-network/README.md +++ b/scripts/synthetic-network/README.md @@ -19,3 +19,23 @@ interact with its web-ui. Additionally, this folder contains an example .js script introducing API of the synthetic-network. You can use it by executing `run_script_for_synthetic-network.sh --script-path ./latency.js`. +# How to run e2e-tests that use synthetic-network + +All following commands are run from within root folder of this repository. + +```shell +# build aleph-node docker-image +# it assumes that aleph-node binary is stored at ./target/release/aleph-node +docker build -t aleph-node:latest -f docker/Dockerfile . + +# run synthetic-network with aleph-node using docker-compose +# by default, it should build for you a docker-image for synthetic-network +# consult its help for available options +./scripts/synthetic-network/run_consensus_synthetic-network.sh + +# run e2e-tests +cd e2e-tests +# set an ENV variable required by the e2e-test, namely a list of URLs for synthetic-network configuration endpoints +export SYNTHETIC_URLS="http://localhost:3000/qos,http://localhost:3001/qos,http://localhost:3002/qos,http://localhost:3003/qos,http://localhost:3004/qos" +cargo test latency +``` From 93eeb03835e97a9922fd0449c9f382cb747fdaa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Wed, 4 Jan 2023 17:16:15 +0100 Subject: [PATCH 37/39] renamed e2e-tests for high-out-latency with synthetic-network --- .github/workflows/e2e-tests-main-devnet.yml | 4 ++-- .github/workflows/nightly-pipeline.yaml | 8 ++++---- e2e-tests/src/test/high_latency.rs | 4 ++-- e2e-tests/src/test/mod.rs | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/e2e-tests-main-devnet.yml b/.github/workflows/e2e-tests-main-devnet.yml index 6c66c51403..cd70bbba29 100644 --- a/.github/workflows/e2e-tests-main-devnet.yml +++ b/.github/workflows/e2e-tests-main-devnet.yml @@ -705,7 +705,7 @@ jobs: - name: Run e2e test uses: ./.github/actions/run-e2e-test with: - test-case: high_out_latency + test-case: high_out_latency_for_all image-path: aleph-test-synthetic-docker node-image: aleph-node:syntheticnet compose-file: docker/docker-compose.synthetic-network.yml @@ -722,7 +722,7 @@ jobs: - name: Run e2e test uses: ./.github/actions/run-e2e-test with: - test-case: no_quorum_without_high_out_latency + test-case: high_out_latency_for_each_quorum image-path: aleph-test-synthetic-docker node-image: aleph-node:syntheticnet compose-file: docker/docker-compose.synthetic-network.yml diff --git a/.github/workflows/nightly-pipeline.yaml b/.github/workflows/nightly-pipeline.yaml index 0008358964..1bb39e9513 100644 --- a/.github/workflows/nightly-pipeline.yaml +++ b/.github/workflows/nightly-pipeline.yaml @@ -184,13 +184,13 @@ jobs: - name: Run e2e test uses: ./.github/actions/run-e2e-test with: - test-case: high_out_latency + test-case: high_out_latency_for_all image-path: aleph-test-synthetic-docker node-image: aleph-node:syntheticnet compose-file: docker/docker-compose.synthetic-network.yml timeout-minutes: 30 - no_quorum_without_high_out_latency: + run-e2e-no_quorum_without_high_out_latency: needs: [build-synthetic-network-docker, build-test-client] name: Run high out-latency for every quorum runs-on: ubuntu-20.04 @@ -201,7 +201,7 @@ jobs: - name: Run e2e test uses: ./.github/actions/run-e2e-test with: - test-case: no_quorum_without_high_out_latency + test-case: high_out_latency_for_each_quorum image-path: aleph-test-synthetic-docker node-image: aleph-node:syntheticnet compose-file: docker/docker-compose.synthetic-network.yml @@ -211,7 +211,7 @@ jobs: needs: [ run-e2e-authorities-are-staking, run-e2e-high-out-latency, - no_quorum_without_high_out_latency, + run-e2e-no_quorum_without_high_out_latency, ] name: Check e2e test suite completion runs-on: ubuntu-20.04 diff --git a/e2e-tests/src/test/high_latency.rs b/e2e-tests/src/test/high_latency.rs index e536cf4610..0c60b0bec8 100644 --- a/e2e-tests/src/test/high_latency.rs +++ b/e2e-tests/src/test/high_latency.rs @@ -14,7 +14,7 @@ const OUT_LATENCY: u64 = 500; /// egress-latency for each node using same value (default is 500 milliseconds) and verifies if after it was able to proceed two /// more sessions. #[tokio::test] -pub async fn high_out_latency() -> anyhow::Result<()> { +pub async fn high_out_latency_for_all() -> anyhow::Result<()> { let config = setup_test(); let out_latency = config.test_case_params.out_latency.unwrap_or(OUT_LATENCY); @@ -54,7 +54,7 @@ pub async fn high_out_latency() -> anyhow::Result<()> { /// predefined number of sessions, sets egress-latency for 1/3n of nodes using same value (default is 500 milliseconds) and /// verifies if after it was able to proceed two more sessions. #[tokio::test] -pub async fn no_quorum_without_high_out_latency() -> anyhow::Result<()> { +pub async fn high_out_latency_for_each_quorum() -> anyhow::Result<()> { let config = setup_test(); let out_latency = config.test_case_params.out_latency.unwrap_or(OUT_LATENCY); diff --git a/e2e-tests/src/test/mod.rs b/e2e-tests/src/test/mod.rs index 68716e2715..367ae28eda 100644 --- a/e2e-tests/src/test/mod.rs +++ b/e2e-tests/src/test/mod.rs @@ -6,7 +6,7 @@ pub use era_payout::era_payouts_calculated_correctly; pub use era_validators::era_validators; pub use fee::fee_calculation; pub use finalization::finalization; -pub use high_latency::high_out_latency; +pub use high_latency::{high_out_latency_for_all, high_out_latency_for_each_quorum}; pub use rewards::{ change_stake_and_force_new_era, disable_node, force_new_era, points_basic, points_stake_change, }; From 656af60f7c988c2bc3731db530c936e1c9253f2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Wed, 4 Jan 2023 17:32:53 +0100 Subject: [PATCH 38/39] renamed one of the e2e-tests pipelines in nightly for high-latency (synthetic-network) --- .github/workflows/nightly-pipeline.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly-pipeline.yaml b/.github/workflows/nightly-pipeline.yaml index 1bb39e9513..a426f97ffc 100644 --- a/.github/workflows/nightly-pipeline.yaml +++ b/.github/workflows/nightly-pipeline.yaml @@ -190,7 +190,7 @@ jobs: compose-file: docker/docker-compose.synthetic-network.yml timeout-minutes: 30 - run-e2e-no_quorum_without_high_out_latency: + run-e2e-no-quorum-without-high-out-latency: needs: [build-synthetic-network-docker, build-test-client] name: Run high out-latency for every quorum runs-on: ubuntu-20.04 @@ -211,7 +211,7 @@ jobs: needs: [ run-e2e-authorities-are-staking, run-e2e-high-out-latency, - run-e2e-no_quorum_without_high_out_latency, + run-e2e-no-quorum-without-high-out-latency, ] name: Check e2e test suite completion runs-on: ubuntu-20.04 From f79bdb08277dbb037d7f475ee8045d1d9c24dbdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lachowski?= Date: Wed, 4 Jan 2023 17:36:45 +0100 Subject: [PATCH 39/39] Revert "REVERT ME testing nightly pipeline" This reverts commit 8eb1410e3b28d5684afc4b00b79bc4fd260cadf2. --- .github/workflows/e2e-tests-main-devnet.yml | 70 --------------------- 1 file changed, 70 deletions(-) diff --git a/.github/workflows/e2e-tests-main-devnet.yml b/.github/workflows/e2e-tests-main-devnet.yml index cd70bbba29..70bb8fc8d9 100644 --- a/.github/workflows/e2e-tests-main-devnet.yml +++ b/.github/workflows/e2e-tests-main-devnet.yml @@ -100,38 +100,6 @@ jobs: uses: ./.github/actions/post-cache - build-synthetic-network-docker: - needs: [build-test-docker] - name: Build docker image with the test node artifact and support for synthetic-network - runs-on: ubuntu-20.04 - steps: - - name: Checkout source code - uses: actions/checkout@v2 - - - name: Download artifact with docker image for aleph-node - uses: actions/download-artifact@v2 - with: - name: aleph-test-docker - - - name: Load node docker image - shell: bash - run: docker load -i aleph-node.tar - - - name: Build test docker image - id: build-image - run: | - scripts/synthetic-network/build_synthetic-network.sh - docker save -o aleph-node.tar aleph-node:syntheticnet - - - name: Upload test docker image - uses: actions/upload-artifact@v2 - with: - name: aleph-test-synthetic-docker - path: aleph-node.tar - if-no-files-found: error - retention-days: 7 - - check-determinism: needs: [build-new-node] name: Verify runtime build determinism @@ -693,42 +661,6 @@ jobs: # run: | # ./scripts/catchup_version_upgrade_test.sh - - run-e2e-high-out-latency: - needs: [build-synthetic-network-docker, build-test-client] - name: Run high out-latency test - runs-on: ubuntu-20.04 - steps: - - name: Checkout source code - uses: actions/checkout@v2 - - - name: Run e2e test - uses: ./.github/actions/run-e2e-test - with: - test-case: high_out_latency_for_all - image-path: aleph-test-synthetic-docker - node-image: aleph-node:syntheticnet - compose-file: docker/docker-compose.synthetic-network.yml - timeout-minutes: 30 - - no_quorum_without_high_out_latency: - needs: [build-synthetic-network-docker, build-test-client] - name: Run high out-latency for every quorum - runs-on: ubuntu-20.04 - steps: - - name: Checkout source code - uses: actions/checkout@v2 - - - name: Run e2e test - uses: ./.github/actions/run-e2e-test - with: - test-case: high_out_latency_for_each_quorum - image-path: aleph-test-synthetic-docker - node-image: aleph-node:syntheticnet - compose-file: docker/docker-compose.synthetic-network.yml - timeout-minutes: 15 - - check-e2e-test-suite-completion: needs: [ run-e2e-finalization-test, @@ -758,8 +690,6 @@ jobs: run-e2e-adder-contract-test, # run-e2e-failing-version-upgrade, # run-e2e-version-upgrade-catchup, - run-e2e-high-out-latency, - no_quorum_without_high_out_latency, ] name: Check e2e test suite completion runs-on: ubuntu-20.04