From f1ae5a394b4fc7cd962f0c57e9583fb6afaf6aad Mon Sep 17 00:00:00 2001 From: wirednkod Date: Mon, 26 Jun 2023 20:01:57 +0300 Subject: [PATCH 01/25] Add params for delay in k8s --- .../k8s/resources/serviceResource.ts | 19 +++++++++++++++++-- .../src/providers/k8s/resources/types.ts | 8 ++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/javascript/packages/orchestrator/src/providers/k8s/resources/serviceResource.ts b/javascript/packages/orchestrator/src/providers/k8s/resources/serviceResource.ts index 8b2ee4647..85c9be346 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/resources/serviceResource.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/resources/serviceResource.ts @@ -8,7 +8,7 @@ import { RPC_HTTP_PORT, RPC_WS_PORT, } from "../../../constants"; -import { PodSpec, ServiceSpec } from "./types"; +import { DelayInterface, PodSpec, ServiceSpec } from "./types"; export class ServiceResource { constructor(private readonly podSpec: PodSpec) {} @@ -16,8 +16,21 @@ export class ServiceResource { public generateSpec() { const ports = this.generatePorts(); const name = this.podSpec.metadata.name; + const delay = this.podSpec.spec?.delay; - return this.generateServiceSpec(name, ports); + if (delay?.latency.slice(-2) !== "ms") { + throw Error( + "Latency value should include the 'ms' indicator (e.g. '100ms')", + ); + } + + if (delay?.jitter.slice(-2) !== "ms") { + throw Error( + "Jitter value should include the 'ms' indicator (e.g. '100ms')", + ); + } + + return this.generateServiceSpec(name, ports, delay); } private shouldExposeJaegerPorts(): boolean { @@ -89,6 +102,7 @@ export class ServiceResource { private generateServiceSpec( name: string, ports: ServiceSpec["spec"]["ports"], + delay?: DelayInterface, ): ServiceSpec { return { apiVersion: "v1", @@ -97,6 +111,7 @@ export class ServiceResource { spec: { selector: { "app.kubernetes.io/instance": name }, ports, + delay, }, }; } diff --git a/javascript/packages/orchestrator/src/providers/k8s/resources/types.ts b/javascript/packages/orchestrator/src/providers/k8s/resources/types.ts index e76c0b429..f283ffa50 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/resources/types.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/resources/types.ts @@ -53,6 +53,7 @@ export interface InnerPodSpec { runAsUser: number; runAsGroup: number; }; + delay?: DelayInterface; } export interface PodSpec { @@ -80,5 +81,12 @@ export interface ServiceSpec { port: number; targetPort: number; }[]; + delay?: DelayInterface; }; } + +export interface DelayInterface { + latency: string; + correlation: string; + jitter: string; +} From bd0aac26373f4e59b8954064bbadc22901a92c29 Mon Sep 17 00:00:00 2001 From: wirednkod Date: Tue, 27 Jun 2023 19:11:34 +0300 Subject: [PATCH 02/25] Add ChaosService --- .../providers/k8s/dynResourceDefinition.ts | 4 +- .../k8s/resources/serviceResource.ts | 43 +++++++++++++------ .../src/providers/k8s/resources/types.ts | 19 +++++++- 3 files changed, 50 insertions(+), 16 deletions(-) diff --git a/javascript/packages/orchestrator/src/providers/k8s/dynResourceDefinition.ts b/javascript/packages/orchestrator/src/providers/k8s/dynResourceDefinition.ts index ea73002cc..d431c3271 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/dynResourceDefinition.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/dynResourceDefinition.ts @@ -4,7 +4,7 @@ import { TMP_DONE, WAIT_UNTIL_SCRIPT_SUFIX } from "../../constants"; import { Network } from "../../network"; import { Node, ZombieRole } from "../../types"; import { BootNodeResource, NodeResource, ServiceResource } from "./resources"; -import { PodSpec, ServiceSpec } from "./resources/types"; +import { ChaosSpec, PodSpec, ServiceSpec } from "./resources/types"; export async function genBootnodeDef( namespace: string, @@ -22,7 +22,7 @@ export async function genNodeDef( return nodeResource.generateSpec(); } -export function genServiceDef(podSpec: PodSpec): ServiceSpec { +export function genServiceDef(podSpec: PodSpec): ServiceSpec | ChaosSpec { const serviceResource = new ServiceResource(podSpec); return serviceResource.generateSpec(); } diff --git a/javascript/packages/orchestrator/src/providers/k8s/resources/serviceResource.ts b/javascript/packages/orchestrator/src/providers/k8s/resources/serviceResource.ts index 85c9be346..43da7450f 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/resources/serviceResource.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/resources/serviceResource.ts @@ -8,7 +8,7 @@ import { RPC_HTTP_PORT, RPC_WS_PORT, } from "../../../constants"; -import { DelayInterface, PodSpec, ServiceSpec } from "./types"; +import { ChaosSpec, DelayInterface, PodSpec, ServiceSpec } from "./types"; export class ServiceResource { constructor(private readonly podSpec: PodSpec) {} @@ -18,19 +18,21 @@ export class ServiceResource { const name = this.podSpec.metadata.name; const delay = this.podSpec.spec?.delay; - if (delay?.latency.slice(-2) !== "ms") { - throw Error( - "Latency value should include the 'ms' indicator (e.g. '100ms')", - ); - } + if (delay) { + if (delay?.latency.slice(-2) !== "ms") { + throw Error( + "Latency value should include the 'ms' indicator (e.g. '100ms')", + ); + } - if (delay?.jitter.slice(-2) !== "ms") { - throw Error( - "Jitter value should include the 'ms' indicator (e.g. '100ms')", - ); + if (delay && delay?.jitter.slice(-2) !== "ms") { + throw Error( + "Jitter value should include the 'ms' indicator (e.g. '100ms')", + ); + } + return this.generateChaosSpec(name, ports, delay); } - - return this.generateServiceSpec(name, ports, delay); + return this.generateServiceSpec(name, ports); } private shouldExposeJaegerPorts(): boolean { @@ -102,12 +104,27 @@ export class ServiceResource { private generateServiceSpec( name: string, ports: ServiceSpec["spec"]["ports"], - delay?: DelayInterface, ): ServiceSpec { return { apiVersion: "v1", kind: "Service", metadata: { name }, + spec: { + selector: { "app.kubernetes.io/instance": name }, + ports, + }, + }; + } + + private generateChaosSpec( + name: string, + ports: ChaosSpec["spec"]["ports"], + delay: DelayInterface, + ): ChaosSpec { + return { + apiVersion: "chaos-mesh.org/v1alpha1", + kind: "NetworkChaos", + metadata: { name }, spec: { selector: { "app.kubernetes.io/instance": name }, ports, diff --git a/javascript/packages/orchestrator/src/providers/k8s/resources/types.ts b/javascript/packages/orchestrator/src/providers/k8s/resources/types.ts index f283ffa50..7aed82ddb 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/resources/types.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/resources/types.ts @@ -81,7 +81,24 @@ export interface ServiceSpec { port: number; targetPort: number; }[]; - delay?: DelayInterface; + }; +} + +export interface ChaosSpec { + apiVersion: "chaos-mesh.org/v1alpha1"; + kind: "NetworkChaos"; + metadata: { name: string }; + spec: { + selector: { + [key: string]: string; // namespaces or pod + }; + ports: { + name: string; + protocol: "TCP" | "UDP"; + port: number; + targetPort: number; + }[]; + delay: DelayInterface; }; } From fecdac059dc06773b5ea325b33cb68a2f43b2d90 Mon Sep 17 00:00:00 2001 From: wirednkod Date: Tue, 27 Jun 2023 19:25:00 +0300 Subject: [PATCH 03/25] Move ChaosSpec to ChaosResource file --- .../providers/k8s/dynResourceDefinition.ts | 16 ++- .../providers/k8s/resources/chaosResource.ts | 117 ++++++++++++++++++ .../src/providers/k8s/resources/index.ts | 1 + .../k8s/resources/serviceResource.ts | 35 +----- 4 files changed, 132 insertions(+), 37 deletions(-) create mode 100644 javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts diff --git a/javascript/packages/orchestrator/src/providers/k8s/dynResourceDefinition.ts b/javascript/packages/orchestrator/src/providers/k8s/dynResourceDefinition.ts index d431c3271..19f0c5bcf 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/dynResourceDefinition.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/dynResourceDefinition.ts @@ -3,7 +3,12 @@ import { getUniqueName } from "../../configGenerator"; import { TMP_DONE, WAIT_UNTIL_SCRIPT_SUFIX } from "../../constants"; import { Network } from "../../network"; import { Node, ZombieRole } from "../../types"; -import { BootNodeResource, NodeResource, ServiceResource } from "./resources"; +import { + BootNodeResource, + ChaosResource, + NodeResource, + ServiceResource, +} from "./resources"; import { ChaosSpec, PodSpec, ServiceSpec } from "./resources/types"; export async function genBootnodeDef( @@ -23,8 +28,13 @@ export async function genNodeDef( } export function genServiceDef(podSpec: PodSpec): ServiceSpec | ChaosSpec { - const serviceResource = new ServiceResource(podSpec); - return serviceResource.generateSpec(); + let resource: ServiceResource | ChaosResource; + if (podSpec.spec.delay) { + resource = new ChaosResource(podSpec); + resource.generateSpec(); + } + resource = new ServiceResource(podSpec); + return resource.generateSpec(); } export function replaceNetworkRef(podDef: any, network: Network) { diff --git a/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts b/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts new file mode 100644 index 000000000..4b4f2a410 --- /dev/null +++ b/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts @@ -0,0 +1,117 @@ +import { + JAEGER_AGENT_SERVE_CONFIGS_PORT, + JAEGER_AGENT_THRIFT_BINARY_PORT, + JAEGER_AGENT_THRIFT_COMPACT_PORT, + JAEGER_AGENT_ZIPKIN_COMPACT_PORT, + P2P_PORT, + PROMETHEUS_PORT, + RPC_HTTP_PORT, + RPC_WS_PORT, +} from "../../../constants"; +import { ChaosSpec, DelayInterface, PodSpec, ServiceSpec } from "./types"; + +export class ChaosResource { + constructor(private readonly podSpec: PodSpec) {} + + public generateSpec() { + const ports = this.generatePorts(); + const name = this.podSpec.metadata.name; + const delay = this.podSpec.spec.delay!; + + if (delay.latency.slice(-2) !== "ms") { + throw Error( + "Latency value should include the 'ms' indicator (e.g. '100ms')", + ); + } + + if (delay?.jitter.slice(-2) !== "ms") { + throw Error( + "Jitter value should include the 'ms' indicator (e.g. '100ms')", + ); + } + return this.generateChaosSpec(name, ports, delay); + } + + private shouldExposeJaegerPorts(): boolean { + return this.podSpec.spec.containers.some( + (container) => container.name === "jaeger-agent", + ); + } + + private generatePorts(): ServiceSpec["spec"]["ports"] { + let ports: ServiceSpec["spec"]["ports"] = [ + { + name: "prometheus", + protocol: "TCP", + port: PROMETHEUS_PORT, + targetPort: PROMETHEUS_PORT, + }, + { + name: "rpc-http", + protocol: "TCP", + port: RPC_HTTP_PORT, + targetPort: RPC_HTTP_PORT, + }, + { + name: "rpc-ws", + protocol: "TCP", + port: RPC_WS_PORT, + targetPort: RPC_WS_PORT, + }, + { + name: "p2p", + protocol: "TCP", + port: P2P_PORT, + targetPort: P2P_PORT, + }, + ]; + + if (this.shouldExposeJaegerPorts()) { + ports = ports.concat([ + { + name: "jaeger-agent-zipkin-compact", + protocol: "UDP", + port: JAEGER_AGENT_ZIPKIN_COMPACT_PORT, + targetPort: JAEGER_AGENT_ZIPKIN_COMPACT_PORT, + }, + { + name: "jaeger-agent-serve-configs", + protocol: "TCP", + port: JAEGER_AGENT_SERVE_CONFIGS_PORT, + targetPort: JAEGER_AGENT_SERVE_CONFIGS_PORT, + }, + { + name: "jaeger-agent-thrift-compact", + protocol: "UDP", + port: JAEGER_AGENT_THRIFT_COMPACT_PORT, + targetPort: JAEGER_AGENT_THRIFT_COMPACT_PORT, + }, + { + name: "jaeger-agent-thrift-binary", + protocol: "UDP", + port: JAEGER_AGENT_THRIFT_BINARY_PORT, + targetPort: JAEGER_AGENT_THRIFT_BINARY_PORT, + }, + ]); + } + + return ports; + } + + private generateChaosSpec( + name: string, + ports: ChaosSpec["spec"]["ports"], + delay: DelayInterface, + ): ChaosSpec { + return { + apiVersion: "chaos-mesh.org/v1alpha1", + kind: "NetworkChaos", + metadata: { name }, + spec: { + selector: { "app.kubernetes.io/instance": name }, + ports, + delay, + }, + }; + } +} diff --git a/javascript/packages/orchestrator/src/providers/k8s/resources/index.ts b/javascript/packages/orchestrator/src/providers/k8s/resources/index.ts index 1a2cc8caf..a4dfd548e 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/resources/index.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/resources/index.ts @@ -1,3 +1,4 @@ export { BootNodeResource } from "./bootNodeResource"; +export { ChaosResource } from "./chaosResource"; export { NodeResource } from "./nodeResource"; export { ServiceResource } from "./serviceResource"; diff --git a/javascript/packages/orchestrator/src/providers/k8s/resources/serviceResource.ts b/javascript/packages/orchestrator/src/providers/k8s/resources/serviceResource.ts index 43da7450f..9c9b5a214 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/resources/serviceResource.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/resources/serviceResource.ts @@ -8,7 +8,7 @@ import { RPC_HTTP_PORT, RPC_WS_PORT, } from "../../../constants"; -import { ChaosSpec, DelayInterface, PodSpec, ServiceSpec } from "./types"; +import { PodSpec, ServiceSpec } from "./types"; export class ServiceResource { constructor(private readonly podSpec: PodSpec) {} @@ -16,22 +16,6 @@ export class ServiceResource { public generateSpec() { const ports = this.generatePorts(); const name = this.podSpec.metadata.name; - const delay = this.podSpec.spec?.delay; - - if (delay) { - if (delay?.latency.slice(-2) !== "ms") { - throw Error( - "Latency value should include the 'ms' indicator (e.g. '100ms')", - ); - } - - if (delay && delay?.jitter.slice(-2) !== "ms") { - throw Error( - "Jitter value should include the 'ms' indicator (e.g. '100ms')", - ); - } - return this.generateChaosSpec(name, ports, delay); - } return this.generateServiceSpec(name, ports); } @@ -115,21 +99,4 @@ export class ServiceResource { }, }; } - - private generateChaosSpec( - name: string, - ports: ChaosSpec["spec"]["ports"], - delay: DelayInterface, - ): ChaosSpec { - return { - apiVersion: "chaos-mesh.org/v1alpha1", - kind: "NetworkChaos", - metadata: { name }, - spec: { - selector: { "app.kubernetes.io/instance": name }, - ports, - delay, - }, - }; - } } From 7e0fe12af56bc7e07b1dad22194d417cd8ce6ebc Mon Sep 17 00:00:00 2001 From: wirednkod Date: Fri, 7 Jul 2023 16:32:43 +0300 Subject: [PATCH 04/25] tmp --- .../providers/k8s/dynResourceDefinition.ts | 14 +++++------ .../src/providers/k8s/kubeClient.ts | 6 ++--- .../providers/k8s/resources/chaosResource.ts | 6 ++--- .../src/providers/k8s/resources/types.ts | 25 +++++++++++-------- .../src/providers/native/chainSpec.ts | 2 ++ .../orchestrator/src/test-runner/index.ts | 4 +++ javascript/packages/orchestrator/src/types.ts | 9 +++++++ 7 files changed, 43 insertions(+), 23 deletions(-) diff --git a/javascript/packages/orchestrator/src/providers/k8s/dynResourceDefinition.ts b/javascript/packages/orchestrator/src/providers/k8s/dynResourceDefinition.ts index 19f0c5bcf..c421a5ea2 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/dynResourceDefinition.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/dynResourceDefinition.ts @@ -27,13 +27,13 @@ export async function genNodeDef( return nodeResource.generateSpec(); } -export function genServiceDef(podSpec: PodSpec): ServiceSpec | ChaosSpec { - let resource: ServiceResource | ChaosResource; - if (podSpec.spec.delay) { - resource = new ChaosResource(podSpec); - resource.generateSpec(); - } - resource = new ServiceResource(podSpec); +export function genChaosDef(podSpec: PodSpec): ChaosSpec { + const resource = new ChaosResource(podSpec); + return resource.generateSpec(); +} + +export function genServiceDef(podSpec: PodSpec): ServiceSpec { + const resource = new ServiceResource(podSpec); return resource.generateSpec(); } diff --git a/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts b/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts index babbabd9a..a9a607869 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts @@ -25,7 +25,7 @@ import { RunCommandResponse, setClient, } from "../client"; -import { genServiceDef } from "./dynResourceDefinition"; +import { genChaosDef, genServiceDef } from "./dynResourceDefinition"; const fs = require("fs").promises; const debug = require("debug")("zombie::kube::client"); @@ -141,8 +141,8 @@ export class KubeClient extends Client { await this.createResource(podDef, true); if (podDef.metadata.labels["zombie-role"] !== ZombieRole.Temp) { - const serviceDef = genServiceDef(podDef); - await this.createResource(serviceDef, true); + const genFn = podDef.spec.delay ? genChaosDef : genServiceDef; + await this.createResource(genFn(podDef)); } await this.waitTransferContainerReady(name); diff --git a/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts b/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts index 4b4f2a410..3ab3bffcf 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts @@ -8,7 +8,7 @@ import { RPC_HTTP_PORT, RPC_WS_PORT, } from "../../../constants"; -import { ChaosSpec, DelayInterface, PodSpec, ServiceSpec } from "./types"; +import { BadNetworkSettings, ChaosSpec, PodSpec, ServiceSpec } from "./types"; export class ChaosResource { constructor(private readonly podSpec: PodSpec) {} @@ -101,14 +101,14 @@ export class ChaosResource { private generateChaosSpec( name: string, ports: ChaosSpec["spec"]["ports"], - delay: DelayInterface, + delay: BadNetworkSettings, ): ChaosSpec { return { apiVersion: "chaos-mesh.org/v1alpha1", kind: "NetworkChaos", metadata: { name }, spec: { - selector: { "app.kubernetes.io/instance": name }, + selector: { namespaces: name }, ports, delay, }, diff --git a/javascript/packages/orchestrator/src/providers/k8s/resources/types.ts b/javascript/packages/orchestrator/src/providers/k8s/resources/types.ts index 7aed82ddb..cce464d84 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/resources/types.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/resources/types.ts @@ -1,4 +1,9 @@ -import { envVars, Resources, ZombieRoleLabel } from "../../../types"; +import { + BadNetworkSettings, + envVars, + Resources, + ZombieRoleLabel, +} from "../../../types"; type ContainerResource = Resources["resources"]; @@ -53,7 +58,7 @@ export interface InnerPodSpec { runAsUser: number; runAsGroup: number; }; - delay?: DelayInterface; + delay?: BadNetworkSettings; } export interface PodSpec { @@ -89,21 +94,21 @@ export interface ChaosSpec { kind: "NetworkChaos"; metadata: { name: string }; spec: { - selector: { - [key: string]: string; // namespaces or pod - }; + selector: SelectorTypeNS | SelectorTypePods; ports: { name: string; protocol: "TCP" | "UDP"; port: number; targetPort: number; }[]; - delay: DelayInterface; + delay: BadNetworkSettings; }; } -export interface DelayInterface { - latency: string; - correlation: string; - jitter: string; +interface SelectorTypeNS { + namespaces: string; +} + +interface SelectorTypePods { + pods: string; } diff --git a/javascript/packages/orchestrator/src/providers/native/chainSpec.ts b/javascript/packages/orchestrator/src/providers/native/chainSpec.ts index f05cd0530..a03156db6 100644 --- a/javascript/packages/orchestrator/src/providers/native/chainSpec.ts +++ b/javascript/packages/orchestrator/src/providers/native/chainSpec.ts @@ -21,6 +21,8 @@ export async function setupChainSpec( // 1: User provide the file (we DON'T expect the raw file) // 2: User provide the chainSpecCommand (without the --raw option) const client = getClient(); + + console.log("0000000000000 ", chainConfig); if (chainConfig.chainSpecPath) { // copy file to temp to use await fsPromises.copyFile(chainConfig.chainSpecPath, chainFullPath); diff --git a/javascript/packages/orchestrator/src/test-runner/index.ts b/javascript/packages/orchestrator/src/test-runner/index.ts index 2f92647a3..dcdd69a51 100644 --- a/javascript/packages/orchestrator/src/test-runner/index.ts +++ b/javascript/packages/orchestrator/src/test-runner/index.ts @@ -49,6 +49,8 @@ export async function run( ? testDef.network : path.resolve(configBasePath, testDef.network); + console.log("networkConfigFilePath", networkConfigFilePath); + const config: LaunchConfig = readNetworkConfig(networkConfigFilePath); // set the provider @@ -83,6 +85,8 @@ export async function run( const suite = Suite.create(mocha.suite, suiteName); suite.beforeAll("launching", async function () { + console.log("config: ", config); + const launchTimeout = config.settings?.timeout || 500; this.timeout(launchTimeout * 1000); try { diff --git a/javascript/packages/orchestrator/src/types.ts b/javascript/packages/orchestrator/src/types.ts index e48230a1e..99e11c7a2 100644 --- a/javascript/packages/orchestrator/src/types.ts +++ b/javascript/packages/orchestrator/src/types.ts @@ -37,6 +37,7 @@ export interface Settings { backchannel?: boolean; // only used in k8s at the moment, spawn a backchannel instance image_pull_policy?: "IfNotPresent" | "Never" | "Always"; local_ip?: string; // ip used for expose local services (rpc/metrics/monitors) + bad_network_global_settings?: BadNetworkSettings; } export interface RelayChainConfig { @@ -57,6 +58,7 @@ export interface RelayChainConfig { node_groups?: NodeGroupConfig[]; total_node_in_groups?: number; genesis?: JSON | ObjectJSON; + bad_network_settings?: BadNetworkSettings; } export interface NodeConfig { @@ -117,6 +119,7 @@ export interface ParachainConfig { collators?: NodeConfig[]; collator_groups?: NodeGroupConfig[]; genesis?: JSON | ObjectJSON; + bad_network_settings?: BadNetworkSettings; } export interface HrmpChannelsConfig { @@ -358,3 +361,9 @@ export enum SubstrateCliArgsVersion { V0 = 0, V1 = 1, } + +export interface BadNetworkSettings { + latency: string; + correlation: string; + jitter: string; +} From f543032a48bbd68c1099ec070c4ca73c37c6490e Mon Sep 17 00:00:00 2001 From: wirednkod Date: Fri, 7 Jul 2023 16:33:06 +0300 Subject: [PATCH 05/25] tmp --- Cargo.lock | 2048 +---------------------- examples/0004-big-network-w-delay.toml | 29 + examples/0004-big-network-w-delay.zndsl | 11 + 3 files changed, 121 insertions(+), 1967 deletions(-) create mode 100644 examples/0004-big-network-w-delay.toml create mode 100644 examples/0004-big-network-w-delay.zndsl diff --git a/Cargo.lock b/Cargo.lock index 547942b45..4846e45c5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,51 +2,12 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -dependencies = [ - "lazy_static", - "regex", -] - -[[package]] -name = "addr2line" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" -dependencies = [ - "gimli", -] - [[package]] name = "adler" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "ahash" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom 0.2.7", - "once_cell", - "version_check", -] - -[[package]] -name = "aho-corasick" -version = "0.7.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" -dependencies = [ - "memchr", -] - [[package]] name = "alloc-no-stdlib" version = "2.0.4" @@ -62,21 +23,6 @@ dependencies = [ "alloc-no-stdlib", ] -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - [[package]] name = "ansi_term" version = "0.12.1" @@ -86,36 +32,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "anyhow" -version = "1.0.71" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" - -[[package]] -name = "array-bytes" -version = "4.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6" - -[[package]] -name = "arrayref" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" - -[[package]] -name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - [[package]] name = "async-compression" version = "0.3.14" @@ -147,7 +63,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi 0.1.19", + "hermit-abi", "libc", "winapi", ] @@ -166,7 +82,7 @@ checksum = "6b4e96976b2022b23b2199168ff9b281e9ddc1aa795607d5cb7146868ca5c101" dependencies = [ "async-trait", "base64", - "bitflags 1.3.2", + "bitflags", "bytes", "futures-util", "http", @@ -203,30 +119,9 @@ dependencies = [ "tower", "tower-http", "tracing", - "tracing-subscriber 0.3.15", -] - -[[package]] -name = "backtrace" -version = "0.3.68" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" -dependencies = [ - "addr2line", - "cc", - "cfg-if 1.0.0", - "libc", - "miniz_oxide 0.7.1", - "object", - "rustc-demangle", + "tracing-subscriber", ] -[[package]] -name = "base58" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" - [[package]] name = "base64" version = "0.13.0" @@ -239,52 +134,13 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "bitflags" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" - -[[package]] -name = "bitvec" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - -[[package]] -name = "blake2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" -dependencies = [ - "digest 0.10.3", -] - -[[package]] -name = "block-buffer" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" -dependencies = [ - "block-padding", - "byte-tools", - "byteorder", - "generic-array 0.12.4", -] - [[package]] name = "block-buffer" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "generic-array 0.14.6", + "generic-array", ] [[package]] @@ -293,16 +149,7 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" dependencies = [ - "generic-array 0.14.6", -] - -[[package]] -name = "block-padding" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" -dependencies = [ - "byte-tools", + "generic-array", ] [[package]] @@ -332,18 +179,6 @@ version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" -[[package]] -name = "byte-slice-cast" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" - -[[package]] -name = "byte-tools" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" - [[package]] name = "byteorder" version = "1.4.3" @@ -356,36 +191,12 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" -[[package]] -name = "cc" -version = "1.0.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "chrono" -version = "0.4.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "num-traits", - "winapi", -] - [[package]] name = "clap" version = "3.2.20" @@ -393,10 +204,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b71c3ce99b7611011217b366d923f1d0a7e07a92bb2dbf1e84508c673ca3bd" dependencies = [ "atty", - "bitflags 1.3.2", + "bitflags", "clap_derive", "clap_lex", - "indexmap 1.9.1", + "indexmap", "once_cell", "strsim", "termcolor", @@ -425,22 +236,6 @@ dependencies = [ "os_str_bytes", ] -[[package]] -name = "console_error_panic_hook" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" -dependencies = [ - "cfg-if 1.0.0", - "wasm-bindgen", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" - [[package]] name = "cpufeatures" version = "0.2.5" @@ -456,98 +251,26 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - [[package]] name = "crypto-common" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array 0.14.6", + "generic-array", "typenum", ] -[[package]] -name = "crypto-mac" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" -dependencies = [ - "generic-array 0.14.6", - "subtle", -] - -[[package]] -name = "crypto-mac" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" -dependencies = [ - "generic-array 0.14.6", - "subtle", -] - -[[package]] -name = "curve25519-dalek" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9b85542f99a2dfa2a1b8e192662741c9859a846b296bef1c92ef9b58b5a216" -dependencies = [ - "byteorder", - "digest 0.8.1", - "rand_core 0.5.1", - "subtle", - "zeroize", -] - -[[package]] -name = "curve25519-dalek" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" -dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", - "subtle", - "zeroize", -] - -[[package]] -name = "derive_more" -version = "0.99.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.99", -] - -[[package]] -name = "digest" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" -dependencies = [ - "generic-array 0.12.4", -] - [[package]] name = "digest" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.14.6", + "generic-array", ] [[package]] @@ -558,15 +281,8 @@ checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" dependencies = [ "block-buffer 0.10.3", "crypto-common", - "subtle", ] -[[package]] -name = "downcast-rs" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" - [[package]] name = "dsl-parser-wrapper" version = "0.1.10" @@ -576,117 +292,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "dyn-clonable" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e9232f0e607a262ceb9bd5141a3dfb3e4db6994b31989bbfd845878cba59fd4" -dependencies = [ - "dyn-clonable-impl", - "dyn-clone", -] - -[[package]] -name = "dyn-clonable-impl" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.99", -] - -[[package]] -name = "dyn-clone" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30" - -[[package]] -name = "ed25519-zebra" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" -dependencies = [ - "curve25519-dalek 3.2.0", - "hashbrown 0.12.3", - "hex", - "rand_core 0.6.4", - "sha2 0.9.9", - "zeroize", -] - -[[package]] -name = "either" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" - -[[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 = "equivalent" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88bffebc5d80432c9b140ee17875ff173a8ab62faad5b257da912bd2f6c1c0a1" - -[[package]] -name = "errno" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys 0.48.0", -] - -[[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 = "fake-simd" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" - -[[package]] -name = "fixed-hash" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" -dependencies = [ - "byteorder", - "rand 0.8.5", - "rustc-hex", - "static_assertions", -] - [[package]] name = "flate2" version = "1.0.24" @@ -694,7 +299,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" dependencies = [ "crc32fast", - "miniz_oxide 0.5.4", + "miniz_oxide", ] [[package]] @@ -718,39 +323,6 @@ version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64db3e262960f0662f43a6366788d5f10f7f244b8f7d7d987f560baf5ded5c50" -[[package]] -name = "funder" -version = "0.1.0" -dependencies = [ - "env_logger", - "futures", - "getrandom 0.2.7", - "log", - "serde_json", - "sp-core", - "sp-runtime", - "tokio", -] - -[[package]] -name = "funder-wrapper" -version = "0.1.0" -dependencies = [ - "console_error_panic_hook", - "funder", - "serde_json", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-bindgen-test", - "wee_alloc", -] - -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - [[package]] name = "futures" version = "0.3.24" @@ -791,7 +363,6 @@ dependencies = [ "futures-core", "futures-task", "futures-util", - "num_cpus", ] [[package]] @@ -843,34 +414,12 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.12.4" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" dependencies = [ "typenum", -] - -[[package]] -name = "generic-array" -version = "0.14.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if 1.0.0", - "js-sys", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", - "wasm-bindgen", + "version_check", ] [[package]] @@ -879,32 +428,9 @@ version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ - "cfg-if 1.0.0", - "js-sys", + "cfg-if", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "wasm-bindgen", -] - -[[package]] -name = "gimli" -version = "0.27.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" - -[[package]] -name = "hash-db" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" - -[[package]] -name = "hash256-std-hasher" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" -dependencies = [ - "crunchy", + "wasi", ] [[package]] @@ -912,15 +438,6 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash", -] - -[[package]] -name = "hashbrown" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" [[package]] name = "heck" @@ -937,49 +454,6 @@ dependencies = [ "libc", ] -[[package]] -name = "hermit-abi" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hmac" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" -dependencies = [ - "crypto-mac 0.8.0", - "digest 0.9.0", -] - -[[package]] -name = "hmac" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" -dependencies = [ - "crypto-mac 0.11.1", - "digest 0.9.0", -] - -[[package]] -name = "hmac-drbg" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" -dependencies = [ - "digest 0.9.0", - "generic-array 0.14.6", - "hmac 0.8.1", -] - [[package]] name = "http" version = "0.2.8" @@ -1014,12 +488,6 @@ 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.20" @@ -1043,29 +511,6 @@ dependencies = [ "want", ] -[[package]] -name = "iana-time-zone" -version = "0.1.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - [[package]] name = "idna" version = "0.3.0" @@ -1076,35 +521,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "impl-codec" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" -dependencies = [ - "parity-scale-codec", -] - -[[package]] -name = "impl-serde" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" -dependencies = [ - "serde", -] - -[[package]] -name = "impl-trait-for-tuples" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.99", -] - [[package]] name = "indexmap" version = "1.9.1" @@ -1112,37 +528,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ "autocfg", - "hashbrown 0.12.3", -] - -[[package]] -name = "indexmap" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" -dependencies = [ - "equivalent", - "hashbrown 0.14.0", -] - -[[package]] -name = "integer-sqrt" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" -dependencies = [ - "num-traits", -] - -[[package]] -name = "is-terminal" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24fddda5af7e54bf7da53067d6e802dbcc381d0a8eef629df528e3ebf68755cb" -dependencies = [ - "hermit-abi 0.3.1", - "rustix", - "windows-sys 0.48.0", + "hashbrown", ] [[package]] @@ -1151,24 +537,6 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" -[[package]] -name = "js-sys" -version = "0.3.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "keccak" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" -dependencies = [ - "cpufeatures", -] - [[package]] name = "lazy_static" version = "1.4.0" @@ -1181,66 +549,6 @@ version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" -[[package]] -name = "libm" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" - -[[package]] -name = "libsecp256k1" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1" -dependencies = [ - "arrayref", - "base64", - "digest 0.9.0", - "hmac-drbg", - "libsecp256k1-core", - "libsecp256k1-gen-ecmult", - "libsecp256k1-gen-genmult", - "rand 0.8.5", - "serde", - "sha2 0.9.9", - "typenum", -] - -[[package]] -name = "libsecp256k1-core" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" -dependencies = [ - "crunchy", - "digest 0.9.0", - "subtle", -] - -[[package]] -name = "libsecp256k1-gen-ecmult" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" -dependencies = [ - "libsecp256k1-core", -] - -[[package]] -name = "libsecp256k1-gen-genmult" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" -dependencies = [ - "libsecp256k1-core", -] - -[[package]] -name = "linux-raw-sys" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" - [[package]] name = "lock_api" version = "0.4.9" @@ -1257,25 +565,7 @@ version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "lru" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6e8aaa3f231bb4bd57b84b2d5dc3ae7f350265df8aa96492e0bc394a1571909" -dependencies = [ - "hashbrown 0.12.3", -] - -[[package]] -name = "matchers" -version = "0.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" -dependencies = [ - "regex-automata", + "cfg-if", ] [[package]] @@ -1299,35 +589,6 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" -[[package]] -name = "memory-db" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ac11bb793c28fa095b7554466f53b3a60a2cd002afdac01bcf135cbd73a269" -dependencies = [ - "hash-db", - "hashbrown 0.12.3", - "parity-util-mem", -] - -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - -[[package]] -name = "merlin" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e261cf0f8b3c42ded9f7d2bb59dea03aa52bc8a1cbc7482f9fc3fd1229d3b42" -dependencies = [ - "byteorder", - "keccak", - "rand_core 0.5.1", - "zeroize", -] - [[package]] name = "mime" version = "0.3.16" @@ -1343,15 +604,6 @@ dependencies = [ "adler", ] -[[package]] -name = "miniz_oxide" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" -dependencies = [ - "adler", -] - [[package]] name = "mio" version = "0.8.4" @@ -1360,99 +612,26 @@ checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" dependencies = [ "libc", "log", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys 0.36.1", ] -[[package]] -name = "nohash-hasher" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" - -[[package]] -name = "num-bigint" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-format" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" -dependencies = [ - "arrayvec 0.7.4", - "itoa", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" -dependencies = [ - "autocfg", - "num-bigint", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - [[package]] name = "num_cpus" version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" dependencies = [ - "hermit-abi 0.1.19", + "hermit-abi", "libc", ] -[[package]] -name = "object" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" -dependencies = [ - "memchr", -] - [[package]] name = "once_cell" version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" -[[package]] -name = "opaque-debug" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" - [[package]] name = "opaque-debug" version = "0.3.0" @@ -1466,81 +645,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" [[package]] -name = "parity-scale-codec" -version = "3.6.2" +name = "parking_lot" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7467bc45fea3d77e829a4df331b9e969e2ec6a4dcd4e126e660f8509b40a475" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ - "arrayvec 0.7.4", - "bitvec", - "byte-slice-cast", - "bytes", - "impl-trait-for-tuples", - "parity-scale-codec-derive", - "serde", + "lock_api", + "parking_lot_core", ] [[package]] -name = "parity-scale-codec-derive" -version = "3.6.2" +name = "parking_lot_core" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9de611934c78014c455793552d0bf7d65a58211179c49996fde925aa667c38" +checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 1.0.99", -] - -[[package]] -name = "parity-util-mem" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d32c34f4f5ca7f9196001c0aba5a1f9a5a12382c8944b8b0f90233282d1e8f8" -dependencies = [ - "cfg-if 1.0.0", - "hashbrown 0.12.3", - "impl-trait-for-tuples", - "parity-util-mem-derive", - "parking_lot", - "primitive-types", - "winapi", -] - -[[package]] -name = "parity-util-mem-derive" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f557c32c6d268a07c921471619c0295f5efad3a0e76d4f97a05c091a51d110b2" -dependencies = [ - "proc-macro2", - "syn 1.0.99", - "synstructure", -] - -[[package]] -name = "parity-wasm" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" - -[[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.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" -dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall", "smallvec", @@ -1560,30 +680,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "paste" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" - -[[package]] -name = "pbkdf2" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd" -dependencies = [ - "crypto-mac 0.8.0", -] - -[[package]] -name = "pbkdf2" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" -dependencies = [ - "crypto-mac 0.11.1", -] - [[package]] name = "percent-encoding" version = "2.2.0" @@ -1672,29 +768,6 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" -[[package]] -name = "primitive-types" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" -dependencies = [ - "fixed-hash", - "impl-codec", - "impl-serde", - "scale-info", - "uint", -] - -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit", -] - [[package]] name = "proc-macro-error" version = "1.0.4" @@ -1737,26 +810,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc", - "rand_pcg", -] - [[package]] name = "rand" version = "0.8.5" @@ -1764,18 +817,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", + "rand_chacha", + "rand_core", ] [[package]] @@ -1785,16 +828,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", + "rand_core", ] [[package]] @@ -1803,25 +837,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.7", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "rand_pcg" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" -dependencies = [ - "rand_core 0.5.1", + "getrandom", ] [[package]] @@ -1830,27 +846,7 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "ref-cast" -version = "1.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43faa91b1c8b36841ee70e97188a869d37ae21759da6846d4be66de5bf7b12c" -dependencies = [ - "ref-cast-impl", -] - -[[package]] -name = "ref-cast-impl" -version = "1.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2275aab483050ab2a7364c1a46604865ee7d6906684e08db0f090acf74f9e7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.22", + "bitflags", ] [[package]] @@ -1859,8 +855,6 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" dependencies = [ - "aho-corasick", - "memchr", "regex-syntax", ] @@ -1879,129 +873,18 @@ version = "0.6.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" -[[package]] -name = "rustc-demangle" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustc-hex" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" - -[[package]] -name = "rustix" -version = "0.38.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc6396159432b5c8490d4e301d8c705f61860b8b6c863bf79942ce5401968f3" -dependencies = [ - "bitflags 2.3.3", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.48.0", -] - [[package]] name = "ryu" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" -[[package]] -name = "scale-info" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad560913365790f17cbf12479491169f01b9d46d29cfc7422bf8c64bdc61b731" -dependencies = [ - "bitvec", - "cfg-if 1.0.0", - "derive_more", - "parity-scale-codec", - "scale-info-derive", -] - -[[package]] -name = "scale-info-derive" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19df9bd9ace6cc2fe19387c96ce677e823e07d017ceed253e7bb3d1d1bd9c73b" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 1.0.99", -] - -[[package]] -name = "schnorrkel" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "021b403afe70d81eea68f6ea12f6b3c9588e5d536a94c3bf80f15e7faa267862" -dependencies = [ - "arrayref", - "arrayvec 0.5.2", - "curve25519-dalek 2.1.3", - "getrandom 0.1.16", - "merlin", - "rand 0.7.3", - "rand_core 0.5.1", - "sha2 0.8.2", - "subtle", - "zeroize", -] - -[[package]] -name = "scoped-tls" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" - [[package]] name = "scopeguard" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" -[[package]] -name = "sdk" -version = "0.1.0" - -[[package]] -name = "secp256k1" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" -dependencies = [ - "secp256k1-sys", -] - -[[package]] -name = "secp256k1-sys" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83080e2c2fc1006e625be82e5d1eb6a43b7fd9578b617fcc55814daf286bba4b" -dependencies = [ - "cc", -] - -[[package]] -name = "secrecy" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" -dependencies = [ - "zeroize", -] - [[package]] name = "serde" version = "1.0.164" @@ -2041,503 +924,82 @@ checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sha-1" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.9.0", - "opaque-debug 0.3.0", -] - -[[package]] -name = "sha-1" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" -dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.10.3", -] - -[[package]] -name = "sha2" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" -dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug 0.2.3", -] - -[[package]] -name = "sha2" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.9.0", - "opaque-debug 0.3.0", -] - -[[package]] -name = "sha2" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9db03534dff993187064c4e0c05a5708d2a9728ace9a8959b77bedf415dac5" -dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.10.3", -] - -[[package]] -name = "sha3" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaedf34ed289ea47c2b741bb72e5357a209512d67bcd4bda44359e5bf0470f56" -dependencies = [ - "digest 0.10.3", - "keccak", -] - -[[package]] -name = "sharded-slab" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" -dependencies = [ - "lazy_static", -] - -[[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.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" - -[[package]] -name = "socket2" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "sp-application-crypto" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a70f8245ad75c773c43e46d16e81adb62290d37cd07efcde6cef06d93235e5" -dependencies = [ - "parity-scale-codec", - "scale-info", - "serde", - "sp-core", - "sp-io", - "sp-std", -] - -[[package]] -name = "sp-arithmetic" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3856b3e912f0a7a1332f1642b5fd3c2e76476e894c656538d32c004698690157" -dependencies = [ - "integer-sqrt", - "num-traits", - "parity-scale-codec", - "scale-info", - "serde", - "sp-debug-derive", - "sp-std", - "static_assertions", -] - -[[package]] -name = "sp-core" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88c78530907dbf7949af928d0ce88b485067389201b6d9b468074b1924f209f0" -dependencies = [ - "array-bytes", - "base58", - "bitflags 1.3.2", - "blake2", - "byteorder", - "dyn-clonable", - "ed25519-zebra", - "futures", - "hash-db", - "hash256-std-hasher", - "impl-serde", - "lazy_static", - "libsecp256k1", - "log", - "merlin", - "num-traits", - "parity-scale-codec", - "parking_lot", - "primitive-types", - "rand 0.7.3", - "regex", - "scale-info", - "schnorrkel", - "secp256k1", - "secrecy", - "serde", - "sp-core-hashing", - "sp-debug-derive", - "sp-externalities", - "sp-runtime-interface", - "sp-std", - "sp-storage", - "ss58-registry", - "substrate-bip39", - "thiserror", - "tiny-bip39", - "wasmi", - "zeroize", -] - -[[package]] -name = "sp-core-hashing" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49b9d1daa6aebfc144729b630885e91df92ff00560490ec065a56cb538e8895a" -dependencies = [ - "blake2", - "byteorder", - "digest 0.10.3", - "sha2 0.10.5", - "sha3", - "sp-std", - "twox-hash", -] - -[[package]] -name = "sp-debug-derive" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9ba7352773b96a4aa57e903447f841c6bc26e8c798377db6e7eb332346454" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.99", -] - -[[package]] -name = "sp-externalities" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef739442230f49d88ece41259e5d886d6b8bc0f4197ef7f1585c39c762ce7ef2" -dependencies = [ - "environmental", - "parity-scale-codec", - "sp-std", - "sp-storage", -] - -[[package]] -name = "sp-io" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6280bd3643354f7ff0b2abd36c687745455779231a7a86d90945608f0d4924c4" -dependencies = [ - "bytes", - "futures", - "hash-db", - "libsecp256k1", - "log", - "parity-scale-codec", - "parking_lot", - "secp256k1", - "sp-core", - "sp-externalities", - "sp-keystore", - "sp-runtime-interface", - "sp-state-machine", - "sp-std", - "sp-tracing", - "sp-trie", - "sp-wasm-interface", - "tracing", - "tracing-core", -] - -[[package]] -name = "sp-keystore" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44bec4f0d036b6993c14bbee4216781f21275e5c201e43e45fed4a434bf0e5a" -dependencies = [ - "async-trait", - "futures", - "merlin", - "parity-scale-codec", - "parking_lot", - "schnorrkel", - "sp-core", - "sp-externalities", - "thiserror", -] - -[[package]] -name = "sp-panic-handler" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97549ec99cb289db2a9f5c656b6880f7c90097135e1ca6c6ae4fe5694232e526" -dependencies = [ - "backtrace", - "lazy_static", - "regex", -] - -[[package]] -name = "sp-runtime" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0edfc5c54c2b31d2f0cf904d472a0bff7125c0c2a2e2330507842e56f9a27444" -dependencies = [ - "either", - "hash256-std-hasher", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "parity-util-mem", - "paste", - "rand 0.7.3", - "scale-info", - "serde", - "sp-application-crypto", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-std", - "sp-weights", -] - -[[package]] -name = "sp-runtime-interface" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b886a5d34400b0e0c12d389e3bb48b7a93d651cddf7e248124b81fe64c339251" -dependencies = [ - "bytes", - "impl-trait-for-tuples", - "parity-scale-codec", - "primitive-types", - "sp-externalities", - "sp-runtime-interface-proc-macro", - "sp-std", - "sp-storage", - "sp-tracing", - "sp-wasm-interface", - "static_assertions", -] - -[[package]] -name = "sp-runtime-interface-proc-macro" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a157f1ce0108b9b87f87e826726049d9b6253318b74410c814be7fc2af416b51" -dependencies = [ - "Inflector", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 1.0.99", -] - -[[package]] -name = "sp-state-machine" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5c2d97ad69011d34ca257f0383532b80096d53f889f5894ae2b24a211bec66f" -dependencies = [ - "hash-db", - "log", - "num-traits", - "parity-scale-codec", - "parking_lot", - "rand 0.7.3", - "smallvec", - "sp-core", - "sp-externalities", - "sp-panic-handler", - "sp-std", - "sp-trie", - "thiserror", - "tracing", - "trie-root", -] - -[[package]] -name = "sp-std" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3fd4c1d304be101e6ebbafd3d4be9a37b320c970ef4e8df188b16873981c93" - -[[package]] -name = "sp-storage" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb987ed2e4d7d870170a225083ea962f2a359d75cdf76935d5ed8d91bee912d9" -dependencies = [ - "impl-serde", - "parity-scale-codec", - "ref-cast", - "serde", - "sp-debug-derive", - "sp-std", -] - -[[package]] -name = "sp-tracing" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e761df87dc940d87720939de8f976d1fc0657e523886ae0d7bf3f7e2e2f0abb6" -dependencies = [ - "parity-scale-codec", - "sp-std", - "tracing", - "tracing-core", - "tracing-subscriber 0.2.25", + "ryu", + "serde", ] [[package]] -name = "sp-trie" -version = "7.0.0" +name = "sha-1" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f4f48c887e90050537e399d2d8b6ee82787ebec0fe46e4880b42cab0c2d5ba6" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" dependencies = [ - "ahash", - "hash-db", - "hashbrown 0.12.3", - "lazy_static", - "lru", - "memory-db", - "nohash-hasher", - "parity-scale-codec", - "parking_lot", - "scale-info", - "sp-core", - "sp-std", - "thiserror", - "tracing", - "trie-db", - "trie-root", + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", ] [[package]] -name = "sp-wasm-interface" -version = "7.0.0" +name = "sha-1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f43c40afab6ecac20505907631c929957ed636b7af8795984649bbaa6ff38c3" +checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" dependencies = [ - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "sp-std", - "wasmi", + "cfg-if", + "cpufeatures", + "digest 0.10.3", ] [[package]] -name = "sp-weights" -version = "4.0.0" +name = "sharded-slab" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c671673133b30e6ab6d88139b06adcdaec5aa06548abe0e155a0c830b592793b" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" dependencies = [ - "impl-trait-for-tuples", - "parity-scale-codec", - "scale-info", - "serde", - "smallvec", - "sp-arithmetic", - "sp-core", - "sp-debug-derive", - "sp-std", + "lazy_static", ] [[package]] -name = "ss58-registry" -version = "1.40.0" +name = "signal-hook-registry" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47a8ad42e5fc72d5b1eb104a5546937eaf39843499948bb666d6e93c62423b" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" dependencies = [ - "Inflector", - "num-format", - "proc-macro2", - "quote", - "serde", - "serde_json", - "unicode-xid", + "libc", ] [[package]] -name = "static_assertions" -version = "1.1.0" +name = "slab" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] [[package]] -name = "strsim" -version = "0.10.0" +name = "smallvec" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" [[package]] -name = "substrate-bip39" -version = "0.4.4" +name = "socket2" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49eee6965196b32f882dd2ee85a92b1dbead41b04e53907f269de3b0dc04733c" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" dependencies = [ - "hmac 0.11.0", - "pbkdf2 0.8.0", - "schnorrkel", - "sha2 0.9.9", - "zeroize", + "libc", + "winapi", ] [[package]] -name = "subtle" -version = "2.4.1" +name = "strsim" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" @@ -2567,24 +1029,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20518fe4a4c9acf048008599e464deb21beeae3d3578418951a189c235a7a9a8" -[[package]] -name = "synstructure" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.99", - "unicode-xid", -] - -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - [[package]] name = "termcolor" version = "1.1.3" @@ -2629,25 +1073,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "tiny-bip39" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc59cb9dfc85bb312c3a78fd6aa8a8582e310b0fa885d5bb877f6dcc601839d" -dependencies = [ - "anyhow", - "hmac 0.8.1", - "once_cell", - "pbkdf2 0.4.0", - "rand 0.7.3", - "rustc-hash", - "sha2 0.9.9", - "thiserror", - "unicode-normalization", - "wasm-bindgen", - "zeroize", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -2745,23 +1170,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "toml_datetime" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" - -[[package]] -name = "toml_edit" -version = "0.19.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266f016b7f039eec8a1a80dfe6156b633d208b9fccca5e4db1d6775b0c4e34a7" -dependencies = [ - "indexmap 2.0.0", - "toml_datetime", - "winnow", -] - [[package]] name = "tower" version = "0.4.13" @@ -2817,7 +1225,7 @@ version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "log", "pin-project-lite", "tracing-attributes", @@ -2856,38 +1264,6 @@ dependencies = [ "tracing-core", ] -[[package]] -name = "tracing-serde" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" -dependencies = [ - "serde", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" -dependencies = [ - "ansi_term", - "chrono", - "lazy_static", - "matchers 0.0.1", - "regex", - "serde", - "serde_json", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log", - "tracing-serde", -] - [[package]] name = "tracing-subscriber" version = "0.3.15" @@ -2895,7 +1271,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60db860322da191b40952ad9affe65ea23e7dd6a5c442c2c42865810c6ab8e6b" dependencies = [ "ansi_term", - "matchers 0.1.0", + "matchers", "once_cell", "regex", "sharded-slab", @@ -2906,28 +1282,6 @@ dependencies = [ "tracing-log", ] -[[package]] -name = "trie-db" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "004e1e8f92535694b4cb1444dc5a8073ecf0815e3357f729638b9f8fc4062908" -dependencies = [ - "hash-db", - "hashbrown 0.12.3", - "log", - "rustc-hex", - "smallvec", -] - -[[package]] -name = "trie-root" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a36c5ca3911ed3c9a5416ee6c679042064b93fc637ded67e25f92e68d783891" -dependencies = [ - "hash-db", -] - [[package]] name = "try-lock" version = "0.2.3" @@ -2946,25 +1300,13 @@ dependencies = [ "http", "httparse", "log", - "rand 0.8.5", + "rand", "sha-1 0.9.8", "thiserror", "url", "utf-8", ] -[[package]] -name = "twox-hash" -version = "1.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" -dependencies = [ - "cfg-if 1.0.0", - "digest 0.10.3", - "rand 0.8.5", - "static_assertions", -] - [[package]] name = "typenum" version = "1.15.0" @@ -2977,18 +1319,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" -[[package]] -name = "uint" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" -dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions", -] - [[package]] name = "unicode-bidi" version = "0.3.8" @@ -3010,12 +1340,6 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - [[package]] name = "url" version = "2.3.1" @@ -3055,12 +1379,6 @@ dependencies = [ "try-lock", ] -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -3073,7 +1391,7 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] @@ -3092,18 +1410,6 @@ dependencies = [ "wasm-bindgen-shared", ] -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" -dependencies = [ - "cfg-if 1.0.0", - "js-sys", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "wasm-bindgen-macro" version = "0.2.87" @@ -3133,85 +1439,6 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" -[[package]] -name = "wasm-bindgen-test" -version = "0.3.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e6e302a7ea94f83a6d09e78e7dc7d9ca7b186bc2829c24a22d0753efd680671" -dependencies = [ - "console_error_panic_hook", - "js-sys", - "scoped-tls", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-bindgen-test-macro", -] - -[[package]] -name = "wasm-bindgen-test-macro" -version = "0.3.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecb993dd8c836930ed130e020e77d9b2e65dd0fbab1b67c790b0f5d80b11a575" -dependencies = [ - "proc-macro2", - "quote", -] - -[[package]] -name = "wasmi" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06c326c93fbf86419608361a2c925a31754cf109da1b8b55737070b4d6669422" -dependencies = [ - "parity-wasm", - "wasmi-validation", - "wasmi_core", -] - -[[package]] -name = "wasmi-validation" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ff416ad1ff0c42e5a926ed5d5fab74c0f098749aa0ad8b2a34b982ce0e867b" -dependencies = [ - "parity-wasm", -] - -[[package]] -name = "wasmi_core" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d20cb3c59b788653d99541c646c561c9dd26506f25c0cebfe810659c54c6d7" -dependencies = [ - "downcast-rs", - "libm", - "memory_units", - "num-rational", - "num-traits", -] - -[[package]] -name = "web-sys" -version = "0.3.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "winapi" version = "0.3.9" @@ -3243,15 +1470,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-sys" version = "0.36.1" @@ -3271,51 +1489,21 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ - "windows_aarch64_gnullvm 0.42.0", + "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 0.42.0", + "windows_x86_64_gnullvm", "windows_x86_64_msvc 0.42.0", ] -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.48.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" -dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.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_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" - [[package]] name = "windows_aarch64_msvc" version = "0.36.1" @@ -3328,12 +1516,6 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" - [[package]] name = "windows_i686_gnu" version = "0.36.1" @@ -3346,12 +1528,6 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" -[[package]] -name = "windows_i686_gnu" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" - [[package]] name = "windows_i686_msvc" version = "0.36.1" @@ -3364,12 +1540,6 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" -[[package]] -name = "windows_i686_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" - [[package]] name = "windows_x86_64_gnu" version = "0.36.1" @@ -3382,24 +1552,12 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" - [[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_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" - [[package]] name = "windows_x86_64_msvc" version = "0.36.1" @@ -3411,47 +1569,3 @@ name = "windows_x86_64_msvc" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" - -[[package]] -name = "winnow" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0ace3845f0d96209f0375e6d367e3eb87eb65d27d445bdc9f1843a26f39448" -dependencies = [ - "memchr", -] - -[[package]] -name = "wyz" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" -dependencies = [ - "tap", -] - -[[package]] -name = "zeroize" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.22", -] diff --git a/examples/0004-big-network-w-delay.toml b/examples/0004-big-network-w-delay.toml new file mode 100644 index 000000000..c60e62877 --- /dev/null +++ b/examples/0004-big-network-w-delay.toml @@ -0,0 +1,29 @@ +[settings] +global_delay = "yes" +timeout = 666 + +[relaychain] +default_image = "docker.io/parity/polkadot:latest" +default_command = "polkadot" +default_args = [ "-lparachain=debug" ] + +chain = "rococo-local" + + [[relaychain.node_groups]] + name = "a" + args = [ "-lparachain=debug", "--database=paritydb-experimental" ] + count = 5 + + [[relaychain.node_groups]] + name = "b" + count = 5 + +[[parachains]] +id = 100 + + [[parachains.collator_groups]] + count = 2 + [parachains.collator_groups.collator] + name = "collator" + command = "polkadot-parachain" + image = "docker.io/parity/polkadot-parachain:latest" \ No newline at end of file diff --git a/examples/0004-big-network-w-delay.zndsl b/examples/0004-big-network-w-delay.zndsl new file mode 100644 index 000000000..c8efdc986 --- /dev/null +++ b/examples/0004-big-network-w-delay.zndsl @@ -0,0 +1,11 @@ +Description: Big Network test +Network: ./0004-big-network-w-delay.toml +Creds: config + +# metrics +a: reports node_roles is 4 +b: reports sub_libp2p_is_major_syncing is 0 + +## test the block height - (or minus) finalised block +a: reports block height minus finalised block is lower than 10 within 20 seconds +b: reports block height - finalised block is lower than 10 within 20 seconds \ No newline at end of file From f1481f6c368b92bb7868f84a8f09979b875b5f86 Mon Sep 17 00:00:00 2001 From: wirednkod Date: Fri, 14 Jul 2023 13:41:40 +0300 Subject: [PATCH 06/25] Fix selector --- .../src/providers/k8s/resources/chaosResource.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts b/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts index 3ab3bffcf..d1703b50a 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts @@ -8,7 +8,9 @@ import { RPC_HTTP_PORT, RPC_WS_PORT, } from "../../../constants"; -import { BadNetworkSettings, ChaosSpec, PodSpec, ServiceSpec } from "./types"; +import { ChaosSpec, PodSpec, ServiceSpec } from "./types"; + +import { BadNetworkSettings } from "../../../types"; export class ChaosResource { constructor(private readonly podSpec: PodSpec) {} @@ -108,7 +110,7 @@ export class ChaosResource { kind: "NetworkChaos", metadata: { name }, spec: { - selector: { namespaces: name }, + selector: { pods: name }, ports, delay, }, From c8f7c4123522e7ca314bd72a32fa421c86679b28 Mon Sep 17 00:00:00 2001 From: wirednkod Date: Fri, 14 Jul 2023 15:48:37 +0300 Subject: [PATCH 07/25] Address comments --- .../src/providers/k8s/kubeClient.ts | 7 +- .../providers/k8s/resources/chaosResource.ts | 77 +------------------ .../src/providers/k8s/resources/types.ts | 6 -- 3 files changed, 7 insertions(+), 83 deletions(-) diff --git a/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts b/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts index a9a607869..c22e43b03 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts @@ -141,8 +141,11 @@ export class KubeClient extends Client { await this.createResource(podDef, true); if (podDef.metadata.labels["zombie-role"] !== ZombieRole.Temp) { - const genFn = podDef.spec.delay ? genChaosDef : genServiceDef; - await this.createResource(genFn(podDef)); + const serviceDef = genServiceDef(podDef); + await this.createResource(serviceDef, true); + if (podDef.spec.delay) { + await this.createResource(genChaosDef(podDef), true); + } } await this.waitTransferContainerReady(name); diff --git a/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts b/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts index d1703b50a..03164795f 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts @@ -1,14 +1,4 @@ -import { - JAEGER_AGENT_SERVE_CONFIGS_PORT, - JAEGER_AGENT_THRIFT_BINARY_PORT, - JAEGER_AGENT_THRIFT_COMPACT_PORT, - JAEGER_AGENT_ZIPKIN_COMPACT_PORT, - P2P_PORT, - PROMETHEUS_PORT, - RPC_HTTP_PORT, - RPC_WS_PORT, -} from "../../../constants"; -import { ChaosSpec, PodSpec, ServiceSpec } from "./types"; +import { ChaosSpec, PodSpec } from "./types"; import { BadNetworkSettings } from "../../../types"; @@ -16,7 +6,6 @@ export class ChaosResource { constructor(private readonly podSpec: PodSpec) {} public generateSpec() { - const ports = this.generatePorts(); const name = this.podSpec.metadata.name; const delay = this.podSpec.spec.delay!; @@ -31,7 +20,7 @@ export class ChaosResource { "Jitter value should include the 'ms' indicator (e.g. '100ms')", ); } - return this.generateChaosSpec(name, ports, delay); + return this.generateChaosSpec(name, delay); } private shouldExposeJaegerPorts(): boolean { @@ -40,69 +29,8 @@ export class ChaosResource { ); } - private generatePorts(): ServiceSpec["spec"]["ports"] { - let ports: ServiceSpec["spec"]["ports"] = [ - { - name: "prometheus", - protocol: "TCP", - port: PROMETHEUS_PORT, - targetPort: PROMETHEUS_PORT, - }, - { - name: "rpc-http", - protocol: "TCP", - port: RPC_HTTP_PORT, - targetPort: RPC_HTTP_PORT, - }, - { - name: "rpc-ws", - protocol: "TCP", - port: RPC_WS_PORT, - targetPort: RPC_WS_PORT, - }, - { - name: "p2p", - protocol: "TCP", - port: P2P_PORT, - targetPort: P2P_PORT, - }, - ]; - - if (this.shouldExposeJaegerPorts()) { - ports = ports.concat([ - { - name: "jaeger-agent-zipkin-compact", - protocol: "UDP", - port: JAEGER_AGENT_ZIPKIN_COMPACT_PORT, - targetPort: JAEGER_AGENT_ZIPKIN_COMPACT_PORT, - }, - { - name: "jaeger-agent-serve-configs", - protocol: "TCP", - port: JAEGER_AGENT_SERVE_CONFIGS_PORT, - targetPort: JAEGER_AGENT_SERVE_CONFIGS_PORT, - }, - { - name: "jaeger-agent-thrift-compact", - protocol: "UDP", - port: JAEGER_AGENT_THRIFT_COMPACT_PORT, - targetPort: JAEGER_AGENT_THRIFT_COMPACT_PORT, - }, - { - name: "jaeger-agent-thrift-binary", - protocol: "UDP", - port: JAEGER_AGENT_THRIFT_BINARY_PORT, - targetPort: JAEGER_AGENT_THRIFT_BINARY_PORT, - }, - ]); - } - - return ports; - } - private generateChaosSpec( name: string, - ports: ChaosSpec["spec"]["ports"], delay: BadNetworkSettings, ): ChaosSpec { return { @@ -111,7 +39,6 @@ export class ChaosResource { metadata: { name }, spec: { selector: { pods: name }, - ports, delay, }, }; diff --git a/javascript/packages/orchestrator/src/providers/k8s/resources/types.ts b/javascript/packages/orchestrator/src/providers/k8s/resources/types.ts index cce464d84..27968dc51 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/resources/types.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/resources/types.ts @@ -95,12 +95,6 @@ export interface ChaosSpec { metadata: { name: string }; spec: { selector: SelectorTypeNS | SelectorTypePods; - ports: { - name: string; - protocol: "TCP" | "UDP"; - port: number; - targetPort: number; - }[]; delay: BadNetworkSettings; }; } From c53900c4cdcd4598301fe8511e2d2c5a215dada8 Mon Sep 17 00:00:00 2001 From: wirednkod Date: Fri, 28 Jul 2023 21:17:37 +0300 Subject: [PATCH 08/25] Remove logs --- .../packages/orchestrator/src/providers/native/chainSpec.ts | 1 - javascript/packages/orchestrator/src/test-runner/index.ts | 4 ---- 2 files changed, 5 deletions(-) diff --git a/javascript/packages/orchestrator/src/providers/native/chainSpec.ts b/javascript/packages/orchestrator/src/providers/native/chainSpec.ts index a03156db6..b7682e463 100644 --- a/javascript/packages/orchestrator/src/providers/native/chainSpec.ts +++ b/javascript/packages/orchestrator/src/providers/native/chainSpec.ts @@ -22,7 +22,6 @@ export async function setupChainSpec( // 2: User provide the chainSpecCommand (without the --raw option) const client = getClient(); - console.log("0000000000000 ", chainConfig); if (chainConfig.chainSpecPath) { // copy file to temp to use await fsPromises.copyFile(chainConfig.chainSpecPath, chainFullPath); diff --git a/javascript/packages/orchestrator/src/test-runner/index.ts b/javascript/packages/orchestrator/src/test-runner/index.ts index dcdd69a51..2f92647a3 100644 --- a/javascript/packages/orchestrator/src/test-runner/index.ts +++ b/javascript/packages/orchestrator/src/test-runner/index.ts @@ -49,8 +49,6 @@ export async function run( ? testDef.network : path.resolve(configBasePath, testDef.network); - console.log("networkConfigFilePath", networkConfigFilePath); - const config: LaunchConfig = readNetworkConfig(networkConfigFilePath); // set the provider @@ -85,8 +83,6 @@ export async function run( const suite = Suite.create(mocha.suite, suiteName); suite.beforeAll("launching", async function () { - console.log("config: ", config); - const launchTimeout = config.settings?.timeout || 500; this.timeout(launchTimeout * 1000); try { From 107498a286c354940bd9370cae5663e41d364611 Mon Sep 17 00:00:00 2001 From: Nikos Kontakis Date: Tue, 15 Aug 2023 17:05:35 +0300 Subject: [PATCH 09/25] minor fix --- ...4-big-network-w-delay.toml => 0005-big-network-w-delay.toml} | 1 - ...big-network-w-delay.zndsl => 0005-big-network-w-delay.zndsl} | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) rename examples/{0004-big-network-w-delay.toml => 0005-big-network-w-delay.toml} (96%) rename examples/{0004-big-network-w-delay.zndsl => 0005-big-network-w-delay.zndsl} (89%) diff --git a/examples/0004-big-network-w-delay.toml b/examples/0005-big-network-w-delay.toml similarity index 96% rename from examples/0004-big-network-w-delay.toml rename to examples/0005-big-network-w-delay.toml index c60e62877..c538b2a3e 100644 --- a/examples/0004-big-network-w-delay.toml +++ b/examples/0005-big-network-w-delay.toml @@ -1,5 +1,4 @@ [settings] -global_delay = "yes" timeout = 666 [relaychain] diff --git a/examples/0004-big-network-w-delay.zndsl b/examples/0005-big-network-w-delay.zndsl similarity index 89% rename from examples/0004-big-network-w-delay.zndsl rename to examples/0005-big-network-w-delay.zndsl index c8efdc986..d18b1fcc6 100644 --- a/examples/0004-big-network-w-delay.zndsl +++ b/examples/0005-big-network-w-delay.zndsl @@ -1,5 +1,5 @@ Description: Big Network test -Network: ./0004-big-network-w-delay.toml +Network: ./0005-big-network-w-delay.toml Creds: config # metrics From 113c8ffe313505a4f7c1ddea64de319f2cdd8154 Mon Sep 17 00:00:00 2001 From: Nikos Kontakis Date: Tue, 15 Aug 2023 17:27:56 +0300 Subject: [PATCH 10/25] minor correctoions on chaosResource --- .../providers/k8s/resources/chaosResource.ts | 36 ++++++++----------- .../src/providers/k8s/resources/types.ts | 6 ++-- javascript/packages/orchestrator/src/types.ts | 8 ++--- 3 files changed, 22 insertions(+), 28 deletions(-) diff --git a/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts b/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts index 03164795f..0a6e0becf 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts @@ -1,45 +1,39 @@ import { ChaosSpec, PodSpec } from "./types"; -import { BadNetworkSettings } from "../../../types"; +import { DelayNetworkSettings } from "../../../types"; export class ChaosResource { - constructor(private readonly podSpec: PodSpec) {} + name: string | undefined; + delay: DelayNetworkSettings | undefined; - public generateSpec() { - const name = this.podSpec.metadata.name; - const delay = this.podSpec.spec.delay!; + constructor(private readonly podSpec: PodSpec) { + this.name = this.podSpec.metadata.name; + this.delay = this.podSpec.spec.delay!; + } - if (delay.latency.slice(-2) !== "ms") { + public generateSpec() { + if (this.delay!.latency.slice(-2) !== "ms") { throw Error( "Latency value should include the 'ms' indicator (e.g. '100ms')", ); } - if (delay?.jitter.slice(-2) !== "ms") { + if (this.delay?.jitter.slice(-2) !== "ms") { throw Error( "Jitter value should include the 'ms' indicator (e.g. '100ms')", ); } - return this.generateChaosSpec(name, delay); - } - - private shouldExposeJaegerPorts(): boolean { - return this.podSpec.spec.containers.some( - (container) => container.name === "jaeger-agent", - ); + return this.generateChaosSpec(); } - private generateChaosSpec( - name: string, - delay: BadNetworkSettings, - ): ChaosSpec { + private generateChaosSpec(): ChaosSpec { return { apiVersion: "chaos-mesh.org/v1alpha1", kind: "NetworkChaos", - metadata: { name }, + metadata: { name: this.name! }, spec: { - selector: { pods: name }, - delay, + selector: { pods: this.name! }, + delay: this.delay!, }, }; } diff --git a/javascript/packages/orchestrator/src/providers/k8s/resources/types.ts b/javascript/packages/orchestrator/src/providers/k8s/resources/types.ts index 27968dc51..4218f2fe9 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/resources/types.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/resources/types.ts @@ -1,5 +1,5 @@ import { - BadNetworkSettings, + DelayNetworkSettings, envVars, Resources, ZombieRoleLabel, @@ -58,7 +58,7 @@ export interface InnerPodSpec { runAsUser: number; runAsGroup: number; }; - delay?: BadNetworkSettings; + delay?: DelayNetworkSettings; } export interface PodSpec { @@ -95,7 +95,7 @@ export interface ChaosSpec { metadata: { name: string }; spec: { selector: SelectorTypeNS | SelectorTypePods; - delay: BadNetworkSettings; + delay: DelayNetworkSettings; }; } diff --git a/javascript/packages/orchestrator/src/types.ts b/javascript/packages/orchestrator/src/types.ts index 99e11c7a2..22f894690 100644 --- a/javascript/packages/orchestrator/src/types.ts +++ b/javascript/packages/orchestrator/src/types.ts @@ -37,7 +37,7 @@ export interface Settings { backchannel?: boolean; // only used in k8s at the moment, spawn a backchannel instance image_pull_policy?: "IfNotPresent" | "Never" | "Always"; local_ip?: string; // ip used for expose local services (rpc/metrics/monitors) - bad_network_global_settings?: BadNetworkSettings; + bad_network_global_settings?: DelayNetworkSettings; } export interface RelayChainConfig { @@ -58,7 +58,7 @@ export interface RelayChainConfig { node_groups?: NodeGroupConfig[]; total_node_in_groups?: number; genesis?: JSON | ObjectJSON; - bad_network_settings?: BadNetworkSettings; + bad_network_settings?: DelayNetworkSettings; } export interface NodeConfig { @@ -119,7 +119,7 @@ export interface ParachainConfig { collators?: NodeConfig[]; collator_groups?: NodeGroupConfig[]; genesis?: JSON | ObjectJSON; - bad_network_settings?: BadNetworkSettings; + bad_network_settings?: DelayNetworkSettings; } export interface HrmpChannelsConfig { @@ -362,7 +362,7 @@ export enum SubstrateCliArgsVersion { V1 = 1, } -export interface BadNetworkSettings { +export interface DelayNetworkSettings { latency: string; correlation: string; jitter: string; From dfdd337ee066dc62efb83b22c2d4de79976a2d33 Mon Sep 17 00:00:00 2001 From: Javier Viola Date: Tue, 15 Aug 2023 11:52:16 -0300 Subject: [PATCH 11/25] add delay to example --- examples/0005-big-network-w-delay.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/0005-big-network-w-delay.toml b/examples/0005-big-network-w-delay.toml index c538b2a3e..7f45ca8ee 100644 --- a/examples/0005-big-network-w-delay.toml +++ b/examples/0005-big-network-w-delay.toml @@ -5,6 +5,8 @@ timeout = 666 default_image = "docker.io/parity/polkadot:latest" default_command = "polkadot" default_args = [ "-lparachain=debug" ] +[default_delay_network_settings] + latency = "10ms" chain = "rococo-local" From 804df95022ca1ad75d2bb6ad2abea0aadbbfc1b7 Mon Sep 17 00:00:00 2001 From: Javier Viola Date: Tue, 15 Aug 2023 11:53:07 -0300 Subject: [PATCH 12/25] add logic to set the delay config at `node` level in the networkSpec --- .../packages/orchestrator/src/configGenerator.ts | 4 ++++ javascript/packages/orchestrator/src/types.ts | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/javascript/packages/orchestrator/src/configGenerator.ts b/javascript/packages/orchestrator/src/configGenerator.ts index 82adc0594..3cbf0a281 100644 --- a/javascript/packages/orchestrator/src/configGenerator.ts +++ b/javascript/packages/orchestrator/src/configGenerator.ts @@ -129,6 +129,7 @@ export async function generateNetworkSpec( defaultPrometheusPrefix: config.relaychain.default_prometheus_prefix || DEFAULT_PROMETHEUS_PREFIX, + delayNetworkSettings: config.relaychain.default_delay_network_settings || config.settings?.global_delay_network_global_settings }, parachains: [], }; @@ -183,6 +184,7 @@ export async function generateNetworkSpec( } const relayChainBootnodes: string[] = []; + for (const node of config.relaychain.nodes || []) { const nodeSetup = await getNodeFromConfig( networkSpec, @@ -556,6 +558,7 @@ async function getCollatorNodeFromConfig( prometheusPrefix: parachain.prometheus_prefix || networkSpec.relaychain.defaultPrometheusPrefix, + delayNetworkSettings: collatorConfig.delay_network_settings || parachain.default_delay_network_settings || networkSpec.settings.delayNetworkSettings, }; if (group) node.group = group; @@ -636,6 +639,7 @@ async function getNodeFromConfig( p2pCertHash: node.p2p_cert_hash, prometheusPrefix: node.prometheus_prefix || networkSpec.relaychain.defaultPrometheusPrefix, + delayNetworkSettings: node.delay_network_settings || networkSpec.relaychain.delayNetworkSettings }; if (group) nodeSetup.group = group; diff --git a/javascript/packages/orchestrator/src/types.ts b/javascript/packages/orchestrator/src/types.ts index 22f894690..5c4d38fc2 100644 --- a/javascript/packages/orchestrator/src/types.ts +++ b/javascript/packages/orchestrator/src/types.ts @@ -37,7 +37,7 @@ export interface Settings { backchannel?: boolean; // only used in k8s at the moment, spawn a backchannel instance image_pull_policy?: "IfNotPresent" | "Never" | "Always"; local_ip?: string; // ip used for expose local services (rpc/metrics/monitors) - bad_network_global_settings?: DelayNetworkSettings; + global_delay_network_global_settings?: DelayNetworkSettings; } export interface RelayChainConfig { @@ -58,7 +58,7 @@ export interface RelayChainConfig { node_groups?: NodeGroupConfig[]; total_node_in_groups?: number; genesis?: JSON | ObjectJSON; - bad_network_settings?: DelayNetworkSettings; + default_delay_network_settings?: DelayNetworkSettings; } export interface NodeConfig { @@ -83,6 +83,7 @@ export interface NodeConfig { db_snapshot?: string; p2p_cert_hash?: string; // libp2p certhash to use with webrtc transport. substrate_cli_args_version?: SubstrateCliArgsVersion; + delay_network_settings?: DelayNetworkSettings; } export interface NodeGroupConfig { @@ -97,6 +98,7 @@ export interface NodeGroupConfig { db_snapshot?: string; prometheus_prefix?: string; substrate_cli_args_version?: SubstrateCliArgsVersion; + delay_network_settings?: DelayNetworkSettings; } export interface ParachainConfig { @@ -119,7 +121,7 @@ export interface ParachainConfig { collators?: NodeConfig[]; collator_groups?: NodeGroupConfig[]; genesis?: JSON | ObjectJSON; - bad_network_settings?: DelayNetworkSettings; + default_delay_network_settings?: DelayNetworkSettings; } export interface HrmpChannelsConfig { @@ -147,6 +149,7 @@ export interface ComputedNetwork { overrides: Override[]; genesis?: JSON | ObjectJSON; defaultResources?: Resources; + delayNetworkSettings?: DelayNetworkSettings; }; parachains: Parachain[]; types: any; @@ -196,6 +199,7 @@ export interface Node { p2pPort: number; }; substrateCliArgsVersion?: SubstrateCliArgsVersion; + delayNetworkSettings?: DelayNetworkSettings; } export interface Collator { @@ -230,6 +234,7 @@ export interface Parachain { balance?: number; collators: Node[]; genesis?: JSON | ObjectJSON; + delayNetworkSettings?: DelayNetworkSettings; } export interface envVars { From 48bebbc18a5179c8e505ac4d58a6e40b13a88254 Mon Sep 17 00:00:00 2001 From: Nikos Kontakis Date: Tue, 22 Aug 2023 19:43:57 +0300 Subject: [PATCH 13/25] temporary update test --- examples/0005-big-network-w-delay.toml | 27 ++++++++++++++++--------- examples/0005-big-network-w-delay.zndsl | 8 ++------ examples/delay_check.sh | 8 ++++++++ 3 files changed, 27 insertions(+), 16 deletions(-) create mode 100755 examples/delay_check.sh diff --git a/examples/0005-big-network-w-delay.toml b/examples/0005-big-network-w-delay.toml index 7f45ca8ee..6fcaf20ae 100644 --- a/examples/0005-big-network-w-delay.toml +++ b/examples/0005-big-network-w-delay.toml @@ -6,18 +6,21 @@ default_image = "docker.io/parity/polkadot:latest" default_command = "polkadot" default_args = [ "-lparachain=debug" ] [default_delay_network_settings] - latency = "10ms" - + latency = "200ms" + chain = "rococo-local" - [[relaychain.node_groups]] - name = "a" - args = [ "-lparachain=debug", "--database=paritydb-experimental" ] - count = 5 + [[relaychain.nodes]] + name = "alice" + validator = true + [[delay_network_settings]] + latency = "200ms" + - [[relaychain.node_groups]] - name = "b" - count = 5 + [[relaychain.nodes]] + name = "bob" + validator = true + [[parachains]] id = 100 @@ -27,4 +30,8 @@ id = 100 [parachains.collator_groups.collator] name = "collator" command = "polkadot-parachain" - image = "docker.io/parity/polkadot-parachain:latest" \ No newline at end of file + image = "docker.io/parity/polkadot-parachain:latest" + [[delay_network_settings]] + latency = "4000ms" + jitter = "4000ms" + correlation = "4000ms" \ No newline at end of file diff --git a/examples/0005-big-network-w-delay.zndsl b/examples/0005-big-network-w-delay.zndsl index d18b1fcc6..4f50a2692 100644 --- a/examples/0005-big-network-w-delay.zndsl +++ b/examples/0005-big-network-w-delay.zndsl @@ -3,9 +3,5 @@ Network: ./0005-big-network-w-delay.toml Creds: config # metrics -a: reports node_roles is 4 -b: reports sub_libp2p_is_major_syncing is 0 - -## test the block height - (or minus) finalised block -a: reports block height minus finalised block is lower than 10 within 20 seconds -b: reports block height - finalised block is lower than 10 within 20 seconds \ No newline at end of file +alice: run ./delay_check.sh within 30 seconds +bob: run ./delay_check.sh within 30 seconds \ No newline at end of file diff --git a/examples/delay_check.sh b/examples/delay_check.sh new file mode 100755 index 000000000..1af3b79c1 --- /dev/null +++ b/examples/delay_check.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +ping -q -c 2 8.8.8.8 | tail -1 | awk -F "/" '{print $5}' +ping -q -c 2 8.8.8.8 | tail -1 | awk -F "/" '{print $5}' +ping -q -c 2 8.8.8.8 | tail -1 | awk -F "/" '{print $5}' +ping -q -c 2 8.8.8.8 | tail -1 | awk -F "/" '{print $5}' +ping -q -c 2 8.8.8.8 | tail -1 | awk -F "/" '{print $5}' +ping -q -c 2 8.8.8.8 | tail -1 | awk -F "/" '{print $5}' From 2a1d7d1bbe2142e8211cb568159a836bfca92c8f Mon Sep 17 00:00:00 2001 From: Javier Viola Date: Wed, 23 Aug 2023 14:58:37 -0300 Subject: [PATCH 14/25] refactor gen Chaos resource --- .../orchestrator/src/providers/client.ts | 2 + .../providers/k8s/dynResourceDefinition.ts | 6 +-- .../src/providers/k8s/kubeClient.ts | 14 +++++-- .../providers/k8s/resources/chaosResource.ts | 41 +++++++++++++------ .../src/providers/k8s/resources/types.ts | 8 +++- .../src/providers/native/nativeClient.ts | 3 +- .../src/providers/podman/podmanClient.ts | 2 + .../packages/orchestrator/src/sharedTypes.ts | 4 +- .../packages/orchestrator/src/spawner.ts | 1 + 9 files changed, 57 insertions(+), 24 deletions(-) diff --git a/javascript/packages/orchestrator/src/providers/client.ts b/javascript/packages/orchestrator/src/providers/client.ts index ccf557be9..ddb338a7a 100644 --- a/javascript/packages/orchestrator/src/providers/client.ts +++ b/javascript/packages/orchestrator/src/providers/client.ts @@ -1,3 +1,4 @@ +import { DelayNetworkSettings } from "../sharedTypes"; import { fileMap } from "../types"; export interface RunCommandResponse { @@ -73,6 +74,7 @@ export abstract class Client { keystore?: string, chainSpecId?: string, dbSnapshot?: string, + delay?: DelayNetworkSettings, ): Promise; abstract copyFileFromPod( identifier: string, diff --git a/javascript/packages/orchestrator/src/providers/k8s/dynResourceDefinition.ts b/javascript/packages/orchestrator/src/providers/k8s/dynResourceDefinition.ts index d6d7e3df4..5b1dbbbc7 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/dynResourceDefinition.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/dynResourceDefinition.ts @@ -2,7 +2,7 @@ import { getRandomPort, getSha256 } from "@zombienet/utils"; import { getUniqueName } from "../../configGenerator"; import { TMP_DONE, WAIT_UNTIL_SCRIPT_SUFIX } from "../../constants"; import { Network } from "../../network"; -import { Node, ZombieRole } from "../../sharedTypes"; +import { DelayNetworkSettings, Node, ZombieRole } from "../../sharedTypes"; import { BootNodeResource, ChaosResource, @@ -27,8 +27,8 @@ export async function genNodeDef( return nodeResource.generateSpec(); } -export function genChaosDef(podSpec: PodSpec): ChaosSpec { - const resource = new ChaosResource(podSpec); +export function genChaosDef(name: string, namespace: string, delay: DelayNetworkSettings): ChaosSpec { + const resource = new ChaosResource(name, namespace, delay); return resource.generateSpec(); } diff --git a/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts b/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts index f5388b78c..e75366c09 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts @@ -27,6 +27,7 @@ import { setClient, } from "../client"; import { genChaosDef, genServiceDef } from "./dynResourceDefinition"; +import { DelayNetworkSettings } from "../../sharedTypes"; const fs = require("fs").promises; const debug = require("debug")("zombie::kube::client"); @@ -113,6 +114,7 @@ export class KubeClient extends Client { keystore?: string, chainSpecId?: string, dbSnapshot?: string, + delay?: DelayNetworkSettings ): Promise { const name = podDef.metadata.name; writeLocalJsonFile(this.tmpDir, `${name}.json`, podDef); @@ -143,10 +145,8 @@ export class KubeClient extends Client { await this.createResource(podDef, true); if (podDef.metadata.labels["zombie-role"] !== ZombieRole.Temp) { const serviceDef = genServiceDef(podDef); + writeLocalJsonFile(this.tmpDir, `${name}-service.json`, serviceDef); await this.createResource(serviceDef, true); - if (podDef.spec.delay) { - await this.createResource(genChaosDef(podDef), true); - } } await this.waitTransferContainerReady(name); @@ -222,6 +222,14 @@ export class KubeClient extends Client { await this.putLocalMagicFile(name); await this.waitPodReady(name); + + if (podDef.metadata.labels["zombie-role"] !== ZombieRole.Temp && delay) { + const chaosDef = genChaosDef(name, this.namespace, delay); + writeLocalJsonFile(this.tmpDir, `${name}-chaos.json`, chaosDef); + await this.createResource(chaosDef, true); + } + + logTable = new CreateLogTable({ colWidths: [20, 100], }); diff --git a/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts b/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts index 7ab5c6883..9ecc10838 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts @@ -1,28 +1,37 @@ -import { ChaosSpec, PodSpec } from "./types"; +import { ChaosSpec } from "./types"; import { DelayNetworkSettings } from "../../../sharedTypes"; export class ChaosResource { - name: string | undefined; - delay: DelayNetworkSettings | undefined; - - constructor(private readonly podSpec: PodSpec) { - this.name = this.podSpec.metadata.name; - this.delay = this.podSpec.spec.delay!; - } + constructor( + protected readonly name: string, + protected readonly namespace: string, + protected readonly delay: DelayNetworkSettings + ){} public generateSpec() { - if (this.delay!.latency.slice(-2) !== "ms") { + if (this.delay.latency.slice(-2) !== "ms") { throw Error( "Latency value should include the 'ms' indicator (e.g. '100ms')", ); } - if (this.delay?.jitter.slice(-2) !== "ms") { + if (this.delay.jitter && this.delay.jitter.slice(-2) !== "ms") { throw Error( "Jitter value should include the 'ms' indicator (e.g. '100ms')", ); } + + if (this.delay.correlation) { + const correlation = parseFloat(this.delay.correlation); + if(Number.isNaN(correlation)) { + throw Error( + "Correlation value should parseable as Float by k8s api (e.g. '100')", + ); + } else { + this.delay.correlation = correlation.toString(); + } + } return this.generateChaosSpec(); } @@ -30,10 +39,16 @@ export class ChaosResource { return { apiVersion: "chaos-mesh.org/v1alpha1", kind: "NetworkChaos", - metadata: { name: this.name! }, + metadata: { name: this.name }, spec: { - selector: { pods: this.name! }, - delay: this.delay!, + mode: "all", + action: "delay", + selector: { + pods: { + [this.namespace]: [ this.name ] + } + }, + delay: this.delay, }, }; } diff --git a/javascript/packages/orchestrator/src/providers/k8s/resources/types.ts b/javascript/packages/orchestrator/src/providers/k8s/resources/types.ts index 531a5ffb8..5f0d58d0c 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/resources/types.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/resources/types.ts @@ -94,15 +94,19 @@ export interface ChaosSpec { kind: "NetworkChaos"; metadata: { name: string }; spec: { + mode: "all", + action: "delay" selector: SelectorTypeNS | SelectorTypePods; delay: DelayNetworkSettings; }; } interface SelectorTypeNS { - namespaces: string; + namespaces: string[]; } interface SelectorTypePods { - pods: string; + pods: { + [namespace: string]: string[] + }; } diff --git a/javascript/packages/orchestrator/src/providers/native/nativeClient.ts b/javascript/packages/orchestrator/src/providers/native/nativeClient.ts index c2ab6eb6d..d7319eab0 100644 --- a/javascript/packages/orchestrator/src/providers/native/nativeClient.ts +++ b/javascript/packages/orchestrator/src/providers/native/nativeClient.ts @@ -18,7 +18,7 @@ import { P2P_PORT, } from "../../constants"; import { fileMap } from "../../types"; -import { ZombieRole } from "../../sharedTypes"; +import { DelayNetworkSettings, ZombieRole } from "../../sharedTypes"; import { Client, RunCommandOptions, @@ -260,6 +260,7 @@ export class NativeClient extends Client { keystore: string, chainSpecId: string, dbSnapshot?: string, + delay?: DelayNetworkSettings, ): Promise { const name = podDef.metadata.name; debug(JSON.stringify(podDef, null, 4)); diff --git a/javascript/packages/orchestrator/src/providers/podman/podmanClient.ts b/javascript/packages/orchestrator/src/providers/podman/podmanClient.ts index d92539066..dd2f85ed3 100644 --- a/javascript/packages/orchestrator/src/providers/podman/podmanClient.ts +++ b/javascript/packages/orchestrator/src/providers/podman/podmanClient.ts @@ -30,6 +30,7 @@ import { genTempoDef, getIntrospectorDef, } from "./dynResourceDefinition"; +import { DelayNetworkSettings } from "../../sharedTypes"; const fs = require("fs").promises; const debug = require("debug")("zombie::podman::client"); @@ -356,6 +357,7 @@ export class PodmanClient extends Client { keystore?: string, chainSpecId?: string, dbSnapshot?: string, + delay?: DelayNetworkSettings, ): Promise { const name = podDef.metadata.name; diff --git a/javascript/packages/orchestrator/src/sharedTypes.ts b/javascript/packages/orchestrator/src/sharedTypes.ts index 98f4678a5..ef1c937e3 100644 --- a/javascript/packages/orchestrator/src/sharedTypes.ts +++ b/javascript/packages/orchestrator/src/sharedTypes.ts @@ -149,6 +149,6 @@ export interface CommonParachainConfig { export interface DelayNetworkSettings { latency: string; - correlation: string; - jitter: string; + correlation?: string; // should be parseable as float by k8s + jitter?: string; } diff --git a/javascript/packages/orchestrator/src/spawner.ts b/javascript/packages/orchestrator/src/spawner.ts index d604edf22..d4d244671 100644 --- a/javascript/packages/orchestrator/src/spawner.ts +++ b/javascript/packages/orchestrator/src/spawner.ts @@ -103,6 +103,7 @@ export const spawnNode = async ( keystoreLocalDir, parachainSpecId || network.chainId, node.dbSnapshot, + node.delayNetworkSettings ); const [nodeIp, nodePort] = await client.getNodeInfo(podDef.metadata.name); From ae8bc6936072276236bd7743c8b568a74989cf2a Mon Sep 17 00:00:00 2001 From: Nikos Kontakis Date: Wed, 23 Aug 2023 21:18:16 +0300 Subject: [PATCH 15/25] fmt --- .../src/providers/k8s/dynResourceDefinition.ts | 6 +++++- .../orchestrator/src/providers/k8s/kubeClient.ts | 6 ++---- .../src/providers/k8s/resources/chaosResource.ts | 10 +++++----- .../orchestrator/src/providers/k8s/resources/types.ts | 6 +++--- .../orchestrator/src/providers/native/nativeClient.ts | 1 + .../orchestrator/src/providers/podman/podmanClient.ts | 1 + javascript/packages/orchestrator/src/spawner.ts | 2 +- 7 files changed, 18 insertions(+), 14 deletions(-) diff --git a/javascript/packages/orchestrator/src/providers/k8s/dynResourceDefinition.ts b/javascript/packages/orchestrator/src/providers/k8s/dynResourceDefinition.ts index 5b1dbbbc7..2b1380e94 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/dynResourceDefinition.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/dynResourceDefinition.ts @@ -27,7 +27,11 @@ export async function genNodeDef( return nodeResource.generateSpec(); } -export function genChaosDef(name: string, namespace: string, delay: DelayNetworkSettings): ChaosSpec { +export function genChaosDef( + name: string, + namespace: string, + delay: DelayNetworkSettings, +): ChaosSpec { const resource = new ChaosResource(name, namespace, delay); return resource.generateSpec(); } diff --git a/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts b/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts index e75366c09..486c03247 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts @@ -19,7 +19,7 @@ import { TRANSFER_CONTAINER_WAIT_LOG, } from "../../constants"; import { fileMap } from "../../types"; -import { ZombieRole } from "../../sharedTypes"; +import { ZombieRole, DelayNetworkSettings } from "../../sharedTypes"; import { Client, RunCommandOptions, @@ -27,7 +27,6 @@ import { setClient, } from "../client"; import { genChaosDef, genServiceDef } from "./dynResourceDefinition"; -import { DelayNetworkSettings } from "../../sharedTypes"; const fs = require("fs").promises; const debug = require("debug")("zombie::kube::client"); @@ -114,7 +113,7 @@ export class KubeClient extends Client { keystore?: string, chainSpecId?: string, dbSnapshot?: string, - delay?: DelayNetworkSettings + delay?: DelayNetworkSettings, ): Promise { const name = podDef.metadata.name; writeLocalJsonFile(this.tmpDir, `${name}.json`, podDef); @@ -229,7 +228,6 @@ export class KubeClient extends Client { await this.createResource(chaosDef, true); } - logTable = new CreateLogTable({ colWidths: [20, 100], }); diff --git a/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts b/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts index 9ecc10838..b522a8fbc 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts @@ -6,8 +6,8 @@ export class ChaosResource { constructor( protected readonly name: string, protected readonly namespace: string, - protected readonly delay: DelayNetworkSettings - ){} + protected readonly delay: DelayNetworkSettings, + ) {} public generateSpec() { if (this.delay.latency.slice(-2) !== "ms") { @@ -24,7 +24,7 @@ export class ChaosResource { if (this.delay.correlation) { const correlation = parseFloat(this.delay.correlation); - if(Number.isNaN(correlation)) { + if (Number.isNaN(correlation)) { throw Error( "Correlation value should parseable as Float by k8s api (e.g. '100')", ); @@ -45,8 +45,8 @@ export class ChaosResource { action: "delay", selector: { pods: { - [this.namespace]: [ this.name ] - } + [this.namespace]: [this.name], + }, }, delay: this.delay, }, diff --git a/javascript/packages/orchestrator/src/providers/k8s/resources/types.ts b/javascript/packages/orchestrator/src/providers/k8s/resources/types.ts index 5f0d58d0c..2a5086201 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/resources/types.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/resources/types.ts @@ -94,8 +94,8 @@ export interface ChaosSpec { kind: "NetworkChaos"; metadata: { name: string }; spec: { - mode: "all", - action: "delay" + mode: "all"; + action: "delay"; selector: SelectorTypeNS | SelectorTypePods; delay: DelayNetworkSettings; }; @@ -107,6 +107,6 @@ interface SelectorTypeNS { interface SelectorTypePods { pods: { - [namespace: string]: string[] + [namespace: string]: string[]; }; } diff --git a/javascript/packages/orchestrator/src/providers/native/nativeClient.ts b/javascript/packages/orchestrator/src/providers/native/nativeClient.ts index d7319eab0..bfe25fc4b 100644 --- a/javascript/packages/orchestrator/src/providers/native/nativeClient.ts +++ b/javascript/packages/orchestrator/src/providers/native/nativeClient.ts @@ -260,6 +260,7 @@ export class NativeClient extends Client { keystore: string, chainSpecId: string, dbSnapshot?: string, + // eslint-disable-next-line @typescript-eslint/no-unused-vars delay?: DelayNetworkSettings, ): Promise { const name = podDef.metadata.name; diff --git a/javascript/packages/orchestrator/src/providers/podman/podmanClient.ts b/javascript/packages/orchestrator/src/providers/podman/podmanClient.ts index dd2f85ed3..382d80500 100644 --- a/javascript/packages/orchestrator/src/providers/podman/podmanClient.ts +++ b/javascript/packages/orchestrator/src/providers/podman/podmanClient.ts @@ -357,6 +357,7 @@ export class PodmanClient extends Client { keystore?: string, chainSpecId?: string, dbSnapshot?: string, + // eslint-disable-next-line @typescript-eslint/no-unused-vars delay?: DelayNetworkSettings, ): Promise { const name = podDef.metadata.name; diff --git a/javascript/packages/orchestrator/src/spawner.ts b/javascript/packages/orchestrator/src/spawner.ts index d4d244671..0a3a512c3 100644 --- a/javascript/packages/orchestrator/src/spawner.ts +++ b/javascript/packages/orchestrator/src/spawner.ts @@ -103,7 +103,7 @@ export const spawnNode = async ( keystoreLocalDir, parachainSpecId || network.chainId, node.dbSnapshot, - node.delayNetworkSettings + node.delayNetworkSettings, ); const [nodeIp, nodePort] = await client.getNodeInfo(podDef.metadata.name); From 6d784b1508f751ccc13b7d0d2efffc03dc268bb1 Mon Sep 17 00:00:00 2001 From: Nikos Kontakis Date: Wed, 23 Aug 2023 21:20:33 +0300 Subject: [PATCH 16/25] Fix words --- .../orchestrator/src/providers/k8s/resources/chaosResource.ts | 2 +- javascript/packages/orchestrator/src/sharedTypes.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts b/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts index b522a8fbc..0b34b9642 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts @@ -26,7 +26,7 @@ export class ChaosResource { const correlation = parseFloat(this.delay.correlation); if (Number.isNaN(correlation)) { throw Error( - "Correlation value should parseable as Float by k8s api (e.g. '100')", + "Correlation value should able to be parsed as Float by k8s api (e.g. '100')", ); } else { this.delay.correlation = correlation.toString(); diff --git a/javascript/packages/orchestrator/src/sharedTypes.ts b/javascript/packages/orchestrator/src/sharedTypes.ts index ef1c937e3..e72219638 100644 --- a/javascript/packages/orchestrator/src/sharedTypes.ts +++ b/javascript/packages/orchestrator/src/sharedTypes.ts @@ -149,6 +149,6 @@ export interface CommonParachainConfig { export interface DelayNetworkSettings { latency: string; - correlation?: string; // should be parseable as float by k8s + correlation?: string; // should be parsable as float by k8s jitter?: string; } From 09194855d61ab0feb915b7c7e68f7b679f1ca6ca Mon Sep 17 00:00:00 2001 From: Nikos Kontakis Date: Wed, 23 Aug 2023 21:22:54 +0300 Subject: [PATCH 17/25] Fix words --- .../orchestrator/src/providers/k8s/resources/chaosResource.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts b/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts index 0b34b9642..d6ff3b8f0 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts @@ -26,7 +26,7 @@ export class ChaosResource { const correlation = parseFloat(this.delay.correlation); if (Number.isNaN(correlation)) { throw Error( - "Correlation value should able to be parsed as Float by k8s api (e.g. '100')", + "Correlation value should parsable as Float by k8s api (e.g. '100')", ); } else { this.delay.correlation = correlation.toString(); From 6ff975fa66f7fc80a2bf80ce3e67fafe09c84a4b Mon Sep 17 00:00:00 2001 From: Javier Viola Date: Wed, 23 Aug 2023 15:00:01 -0300 Subject: [PATCH 18/25] fix example chaos delay --- examples/0005-big-network-w-delay.toml | 29 +++++++++++--------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/examples/0005-big-network-w-delay.toml b/examples/0005-big-network-w-delay.toml index 6fcaf20ae..9249701b2 100644 --- a/examples/0005-big-network-w-delay.toml +++ b/examples/0005-big-network-w-delay.toml @@ -5,33 +5,28 @@ timeout = 666 default_image = "docker.io/parity/polkadot:latest" default_command = "polkadot" default_args = [ "-lparachain=debug" ] -[default_delay_network_settings] - latency = "200ms" - chain = "rococo-local" +[relaychain.default_delay_network_settings] + latency = "200ms" [[relaychain.nodes]] name = "alice" - validator = true - [[delay_network_settings]] - latency = "200ms" - + [relaychain.nodes.delay_network_settings] + latency = "1000ms" + [[relaychain.nodes]] name = "bob" - validator = true - + [[parachains]] id = 100 - [[parachains.collator_groups]] - count = 2 - [parachains.collator_groups.collator] - name = "collator" - command = "polkadot-parachain" - image = "docker.io/parity/polkadot-parachain:latest" - [[delay_network_settings]] + [parachains.collator] + name = "collator01" + image = "docker.io/parity/polkadot-parachain:latest" + command = "polkadot-parachain" + [parachains.collator.delay_network_settings] latency = "4000ms" jitter = "4000ms" - correlation = "4000ms" \ No newline at end of file + correlation = "100" \ No newline at end of file From 409e590b662ae63d230c6e4f4b1358ca8948c273 Mon Sep 17 00:00:00 2001 From: Javier Viola Date: Wed, 23 Aug 2023 15:03:52 -0300 Subject: [PATCH 19/25] fmt --- .../packages/orchestrator/src/providers/native/nativeClient.ts | 2 +- .../packages/orchestrator/src/providers/podman/podmanClient.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/javascript/packages/orchestrator/src/providers/native/nativeClient.ts b/javascript/packages/orchestrator/src/providers/native/nativeClient.ts index bfe25fc4b..bcb5c2de9 100644 --- a/javascript/packages/orchestrator/src/providers/native/nativeClient.ts +++ b/javascript/packages/orchestrator/src/providers/native/nativeClient.ts @@ -17,8 +17,8 @@ import { LOCALHOST, P2P_PORT, } from "../../constants"; -import { fileMap } from "../../types"; import { DelayNetworkSettings, ZombieRole } from "../../sharedTypes"; +import { fileMap } from "../../types"; import { Client, RunCommandOptions, diff --git a/javascript/packages/orchestrator/src/providers/podman/podmanClient.ts b/javascript/packages/orchestrator/src/providers/podman/podmanClient.ts index 382d80500..6d89e0208 100644 --- a/javascript/packages/orchestrator/src/providers/podman/podmanClient.ts +++ b/javascript/packages/orchestrator/src/providers/podman/podmanClient.ts @@ -17,6 +17,7 @@ import { P2P_PORT, PROMETHEUS_PORT, } from "../../constants"; +import { DelayNetworkSettings } from "../../sharedTypes"; import { fileMap } from "../../types"; import { Client, @@ -30,7 +31,6 @@ import { genTempoDef, getIntrospectorDef, } from "./dynResourceDefinition"; -import { DelayNetworkSettings } from "../../sharedTypes"; const fs = require("fs").promises; const debug = require("debug")("zombie::podman::client"); From b8733d1b303b78bf8d08c99be1d28af30011640d Mon Sep 17 00:00:00 2001 From: Javier Viola Date: Fri, 25 Aug 2023 11:50:22 -0300 Subject: [PATCH 20/25] default correlation --- .../orchestrator/src/providers/k8s/resources/chaosResource.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts b/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts index d6ff3b8f0..e5fdf2ac0 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts @@ -31,6 +31,9 @@ export class ChaosResource { } else { this.delay.correlation = correlation.toString(); } + } else { + // set default correlation (100) + this.delay.correlation = "100"; } return this.generateChaosSpec(); } From dd6f6276e47441a837c0681880262d25bca1760a Mon Sep 17 00:00:00 2001 From: Javier Viola Date: Fri, 25 Aug 2023 12:22:27 -0300 Subject: [PATCH 21/25] add chaos test --- .gitlab-ci.yml | 10 ++++++++++ tests/chaos/0001-delay.toml | 29 +++++++++++++++++++++++++++++ tests/chaos/0001-delay.zndsl | 9 +++++++++ tests/chaos/delay_check.sh | 12 ++++++++++++ 4 files changed, 60 insertions(+) create mode 100644 tests/chaos/0001-delay.toml create mode 100644 tests/chaos/0001-delay.zndsl create mode 100755 tests/chaos/delay_check.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c2aee82cd..4ad7eacc3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -281,3 +281,13 @@ db-snapshot: - /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh --local-dir="${LOCAL_DIR}" --test="0013-db-snapshot.zndsl" + +chaos-delay: + extends: + - .zombienet-common + variables: + LOCAL_DIR: "/builds/parity/mirrors/zombienet/tests/chaos" + script: + - /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh + --local-dir="${LOCAL_DIR}" + --test="0001-delay.zndsl" \ No newline at end of file diff --git a/tests/chaos/0001-delay.toml b/tests/chaos/0001-delay.toml new file mode 100644 index 000000000..22198a23b --- /dev/null +++ b/tests/chaos/0001-delay.toml @@ -0,0 +1,29 @@ +[relaychain] +default_image = "docker.io/parity/polkadot:latest" +default_command = "polkadot" +default_args = [ "-lparachain=debug" ] +chain = "rococo-local" +[relaychain.default_delay_network_settings] + latency = "200ms" + + [[relaychain.nodes]] + name = "alice" + [relaychain.nodes.delay_network_settings] + latency = "1000ms" + + + [[relaychain.nodes]] + name = "bob" + + +[[parachains]] +id = 100 + + [parachains.collator] + name = "collator01" + image = "docker.io/parity/polkadot-parachain:latest" + command = "polkadot-parachain" + [parachains.collator.delay_network_settings] + latency = "4000ms" + jitter = "4000ms" + correlation = "100" \ No newline at end of file diff --git a/tests/chaos/0001-delay.zndsl b/tests/chaos/0001-delay.zndsl new file mode 100644 index 000000000..ad180c383 --- /dev/null +++ b/tests/chaos/0001-delay.zndsl @@ -0,0 +1,9 @@ +Description: Chaos-Network test (k8s only) +Network: ./0001-delay.toml +Creds: config + +# metrics +# alice to bob take at least 2s +alice: run ./delay_check.sh with "bob,9615,2" within 30 seconds +# bob to alice take at least 1s +bob: run ./delay_check.sh within 30 seconds \ No newline at end of file diff --git a/tests/chaos/delay_check.sh b/tests/chaos/delay_check.sh new file mode 100755 index 000000000..2bda452f1 --- /dev/null +++ b/tests/chaos/delay_check.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +POD=$1 +PORT=$2 # 9615 for prometheus +DELAY=$3 +TAKE=$(/cfg/curl -w "%{time_connect}" -so /dev/null http://$POD:$PORT/ |awk -F "." '{print $1}') +if [[ $TAKE -ge $DELAY ]]; then + exit 0; +fi + +# Take less that the expected delay +exit 1 From fd1d55cadbb465af7eb0d8da9fced86a6dddffb8 Mon Sep 17 00:00:00 2001 From: Javier Viola Date: Mon, 28 Aug 2023 18:35:02 -0300 Subject: [PATCH 22/25] typo --- .../orchestrator/src/providers/k8s/resources/chaosResource.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts b/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts index e5fdf2ac0..8bcb09cbb 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/resources/chaosResource.ts @@ -26,7 +26,7 @@ export class ChaosResource { const correlation = parseFloat(this.delay.correlation); if (Number.isNaN(correlation)) { throw Error( - "Correlation value should parsable as Float by k8s api (e.g. '100')", + "Correlation value should be parsable as Float by k8s api (e.g. '100')", ); } else { this.delay.correlation = correlation.toString(); From 1a7557454a48663dc5851baadf5b61a6c9057343 Mon Sep 17 00:00:00 2001 From: Javier Viola Date: Thu, 31 Aug 2023 21:12:34 -0300 Subject: [PATCH 23/25] refactor: inject chaos after network spawn --- .../packages/orchestrator/src/orchestrator.ts | 16 ++++++++++++- .../orchestrator/src/providers/client.ts | 3 ++- .../orchestrator/src/providers/k8s/index.ts | 2 ++ .../src/providers/k8s/kubeClient.ts | 24 +++++++++++++------ .../src/providers/native/nativeClient.ts | 5 ++-- .../src/providers/podman/podmanClient.ts | 5 ++-- .../packages/orchestrator/src/spawner.ts | 1 - javascript/packages/utils/src/fs.ts | 2 +- 8 files changed, 43 insertions(+), 15 deletions(-) diff --git a/javascript/packages/orchestrator/src/orchestrator.ts b/javascript/packages/orchestrator/src/orchestrator.ts index c810e7fe0..252e2e1dd 100644 --- a/javascript/packages/orchestrator/src/orchestrator.ts +++ b/javascript/packages/orchestrator/src/orchestrator.ts @@ -97,7 +97,7 @@ export async function start( debug(JSON.stringify(networkSpec, null, 4)); - const { initClient, setupChainSpec, getChainSpecRaw } = getProvider( + const { initClient, setupChainSpec, getChainSpecRaw, genChaosDef } = getProvider( networkSpec.settings.provider, ); @@ -370,6 +370,17 @@ export async function start( local_ip: networkSpec.settings.local_ip, }; + // Calculate chaos before start spawning the nodes + let chaosSpecs: any[] = []; + // network chaos is ONLY available in k8s for now + if (client.providerName === "kubernetes") { + const nodes = networkSpec.relaychain.nodes.concat(networkSpec.parachains.map(para => para.collators).flat()); + nodes.reduce((memo, node) => { + if(node.delayNetworkSettings) memo.push(genChaosDef(node.name, namespace, node.delayNetworkSettings)); + return memo; + }, chaosSpecs); + } + const firstNode = networkSpec.relaychain.nodes.shift(); if (firstNode) { const nodeMultiAddress = await spawnNode( @@ -502,6 +513,9 @@ export async function start( await verifyNodes(network); + // inject chaos to the running network + if(chaosSpecs.length > 0) await client.injectChaos(chaosSpecs); + // cleanup global timeout network.launched = true; clearTimeout(timeoutTimer); diff --git a/javascript/packages/orchestrator/src/providers/client.ts b/javascript/packages/orchestrator/src/providers/client.ts index ddb338a7a..8f7d5e07c 100644 --- a/javascript/packages/orchestrator/src/providers/client.ts +++ b/javascript/packages/orchestrator/src/providers/client.ts @@ -74,7 +74,7 @@ export abstract class Client { keystore?: string, chainSpecId?: string, dbSnapshot?: string, - delay?: DelayNetworkSettings, + //delay?: DelayNetworkSettings, ): Promise; abstract copyFileFromPod( identifier: string, @@ -103,6 +103,7 @@ export abstract class Client { abstract spawnIntrospector(wsUri: string): Promise; abstract validateAccess(): Promise; abstract getLogsCommand(name: string): string; + abstract injectChaos(chaosSpecs: any[]): Promise; } let client: Client; diff --git a/javascript/packages/orchestrator/src/providers/k8s/index.ts b/javascript/packages/orchestrator/src/providers/k8s/index.ts index 392f3507a..ad13bb7c5 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/index.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/index.ts @@ -3,6 +3,7 @@ import { genBootnodeDef, genNodeDef, replaceNetworkRef, + genChaosDef, } from "./dynResourceDefinition"; import { KubeClient, initClient } from "./kubeClient"; import { getCliArgsVersion } from "./substrateCliArgsHelper"; @@ -16,4 +17,5 @@ export const provider = { getChainSpecRaw, replaceNetworkRef, getCliArgsVersion, + genChaosDef }; diff --git a/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts b/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts index 486c03247..8d6cd8f36 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts @@ -26,7 +26,7 @@ import { RunCommandResponse, setClient, } from "../client"; -import { genChaosDef, genServiceDef } from "./dynResourceDefinition"; +import { genServiceDef } from "./dynResourceDefinition"; const fs = require("fs").promises; const debug = require("debug")("zombie::kube::client"); @@ -113,7 +113,6 @@ export class KubeClient extends Client { keystore?: string, chainSpecId?: string, dbSnapshot?: string, - delay?: DelayNetworkSettings, ): Promise { const name = podDef.metadata.name; writeLocalJsonFile(this.tmpDir, `${name}.json`, podDef); @@ -222,11 +221,11 @@ export class KubeClient extends Client { await this.putLocalMagicFile(name); await this.waitPodReady(name); - if (podDef.metadata.labels["zombie-role"] !== ZombieRole.Temp && delay) { - const chaosDef = genChaosDef(name, this.namespace, delay); - writeLocalJsonFile(this.tmpDir, `${name}-chaos.json`, chaosDef); - await this.createResource(chaosDef, true); - } + // if (podDef.metadata.labels["zombie-role"] !== ZombieRole.Temp && delay) { + // const chaosDef = genChaosDef(name, this.namespace, delay); + // writeLocalJsonFile(this.tmpDir, `${name}-chaos.json`, chaosDef); + // await this.createResource(chaosDef, true); + // } logTable = new CreateLogTable({ colWidths: [20, 100], @@ -888,4 +887,15 @@ export class KubeClient extends Client { getLogsCommand(name: string): string { return `kubectl logs -f ${name} -c ${name} -n ${this.namespace}`; } + + async injectChaos(chaosSpecs: any[]) { + let merged = { + "apiVersion": "v1", + "kind": "List", + "items": chaosSpecs + }; + + writeLocalJsonFile(this.tmpDir, `merged-chaos.json`, merged); + await this.createResource(merged, true); + } } diff --git a/javascript/packages/orchestrator/src/providers/native/nativeClient.ts b/javascript/packages/orchestrator/src/providers/native/nativeClient.ts index bcb5c2de9..cae3120e3 100644 --- a/javascript/packages/orchestrator/src/providers/native/nativeClient.ts +++ b/javascript/packages/orchestrator/src/providers/native/nativeClient.ts @@ -260,8 +260,6 @@ export class NativeClient extends Client { keystore: string, chainSpecId: string, dbSnapshot?: string, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - delay?: DelayNetworkSettings, ): Promise { const name = podDef.metadata.name; debug(JSON.stringify(podDef, null, 4)); @@ -485,4 +483,7 @@ export class NativeClient extends Client { getLogsCommand(name: string): string { return `tail -f ${this.tmpDir}/${name}.log`; } + + // NOOP + async injectChaos(chaosSpecs: any[]) {}; } diff --git a/javascript/packages/orchestrator/src/providers/podman/podmanClient.ts b/javascript/packages/orchestrator/src/providers/podman/podmanClient.ts index 6d89e0208..dd4366ea7 100644 --- a/javascript/packages/orchestrator/src/providers/podman/podmanClient.ts +++ b/javascript/packages/orchestrator/src/providers/podman/podmanClient.ts @@ -357,8 +357,6 @@ export class PodmanClient extends Client { keystore?: string, chainSpecId?: string, dbSnapshot?: string, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - delay?: DelayNetworkSettings, ): Promise { const name = podDef.metadata.name; @@ -542,4 +540,7 @@ export class PodmanClient extends Client { getLogsCommand(name: string): string { return `podman logs -f ${name}_pod-${name}`; } + + // NOOP + async injectChaos(chaosSpecs: any[]) {}; } diff --git a/javascript/packages/orchestrator/src/spawner.ts b/javascript/packages/orchestrator/src/spawner.ts index 0a3a512c3..d604edf22 100644 --- a/javascript/packages/orchestrator/src/spawner.ts +++ b/javascript/packages/orchestrator/src/spawner.ts @@ -103,7 +103,6 @@ export const spawnNode = async ( keystoreLocalDir, parachainSpecId || network.chainId, node.dbSnapshot, - node.delayNetworkSettings, ); const [nodeIp, nodePort] = await client.getNodeInfo(podDef.metadata.name); diff --git a/javascript/packages/utils/src/fs.ts b/javascript/packages/utils/src/fs.ts index e0128f550..a3768b8a9 100644 --- a/javascript/packages/utils/src/fs.ts +++ b/javascript/packages/utils/src/fs.ts @@ -11,7 +11,7 @@ import { LaunchConfig } from "./types"; export interface LocalJsonFileContentIF { apiVersion: string; kind: string; - metadata: { + metadata?: { name: string; }; } From bc2847055062a7046af40aaf1da6756038e4c2e1 Mon Sep 17 00:00:00 2001 From: Javier Viola Date: Fri, 1 Sep 2023 08:32:07 -0300 Subject: [PATCH 24/25] fmt --- .../packages/orchestrator/src/orchestrator.ts | 18 +++++++++++------- .../orchestrator/src/providers/client.ts | 4 +--- .../orchestrator/src/providers/k8s/index.ts | 2 +- .../src/providers/k8s/kubeClient.ts | 10 +++++----- .../src/providers/native/nativeClient.ts | 5 +++-- .../src/providers/podman/podmanClient.ts | 4 ++-- 6 files changed, 23 insertions(+), 20 deletions(-) diff --git a/javascript/packages/orchestrator/src/orchestrator.ts b/javascript/packages/orchestrator/src/orchestrator.ts index 252e2e1dd..76ebd5072 100644 --- a/javascript/packages/orchestrator/src/orchestrator.ts +++ b/javascript/packages/orchestrator/src/orchestrator.ts @@ -97,9 +97,8 @@ export async function start( debug(JSON.stringify(networkSpec, null, 4)); - const { initClient, setupChainSpec, getChainSpecRaw, genChaosDef } = getProvider( - networkSpec.settings.provider, - ); + const { initClient, setupChainSpec, getChainSpecRaw, genChaosDef } = + getProvider(networkSpec.settings.provider); // global timeout to spin the network const timeoutTimer = setTimeout(() => { @@ -371,12 +370,17 @@ export async function start( }; // Calculate chaos before start spawning the nodes - let chaosSpecs: any[] = []; + const chaosSpecs: any[] = []; // network chaos is ONLY available in k8s for now if (client.providerName === "kubernetes") { - const nodes = networkSpec.relaychain.nodes.concat(networkSpec.parachains.map(para => para.collators).flat()); + const nodes = networkSpec.relaychain.nodes.concat( + networkSpec.parachains.map((para) => para.collators).flat(), + ); nodes.reduce((memo, node) => { - if(node.delayNetworkSettings) memo.push(genChaosDef(node.name, namespace, node.delayNetworkSettings)); + if (node.delayNetworkSettings) + memo.push( + genChaosDef(node.name, namespace, node.delayNetworkSettings), + ); return memo; }, chaosSpecs); } @@ -514,7 +518,7 @@ export async function start( await verifyNodes(network); // inject chaos to the running network - if(chaosSpecs.length > 0) await client.injectChaos(chaosSpecs); + if (chaosSpecs.length > 0) await client.injectChaos(chaosSpecs); // cleanup global timeout network.launched = true; diff --git a/javascript/packages/orchestrator/src/providers/client.ts b/javascript/packages/orchestrator/src/providers/client.ts index 8f7d5e07c..f6c7e4c59 100644 --- a/javascript/packages/orchestrator/src/providers/client.ts +++ b/javascript/packages/orchestrator/src/providers/client.ts @@ -1,4 +1,3 @@ -import { DelayNetworkSettings } from "../sharedTypes"; import { fileMap } from "../types"; export interface RunCommandResponse { @@ -73,8 +72,7 @@ export abstract class Client { filesToCopy?: fileMap[], keystore?: string, chainSpecId?: string, - dbSnapshot?: string, - //delay?: DelayNetworkSettings, + dbSnapshot?: string, //delay?: DelayNetworkSettings, ): Promise; abstract copyFileFromPod( identifier: string, diff --git a/javascript/packages/orchestrator/src/providers/k8s/index.ts b/javascript/packages/orchestrator/src/providers/k8s/index.ts index ad13bb7c5..237144014 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/index.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/index.ts @@ -17,5 +17,5 @@ export const provider = { getChainSpecRaw, replaceNetworkRef, getCliArgsVersion, - genChaosDef + genChaosDef, }; diff --git a/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts b/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts index 8d6cd8f36..042784116 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts @@ -19,7 +19,7 @@ import { TRANSFER_CONTAINER_WAIT_LOG, } from "../../constants"; import { fileMap } from "../../types"; -import { ZombieRole, DelayNetworkSettings } from "../../sharedTypes"; +import { ZombieRole } from "../../sharedTypes"; import { Client, RunCommandOptions, @@ -889,10 +889,10 @@ export class KubeClient extends Client { } async injectChaos(chaosSpecs: any[]) { - let merged = { - "apiVersion": "v1", - "kind": "List", - "items": chaosSpecs + const merged = { + apiVersion: "v1", + kind: "List", + items: chaosSpecs, }; writeLocalJsonFile(this.tmpDir, `merged-chaos.json`, merged); diff --git a/javascript/packages/orchestrator/src/providers/native/nativeClient.ts b/javascript/packages/orchestrator/src/providers/native/nativeClient.ts index cae3120e3..0e001a92e 100644 --- a/javascript/packages/orchestrator/src/providers/native/nativeClient.ts +++ b/javascript/packages/orchestrator/src/providers/native/nativeClient.ts @@ -17,7 +17,7 @@ import { LOCALHOST, P2P_PORT, } from "../../constants"; -import { DelayNetworkSettings, ZombieRole } from "../../sharedTypes"; +import { ZombieRole } from "../../sharedTypes"; import { fileMap } from "../../types"; import { Client, @@ -485,5 +485,6 @@ export class NativeClient extends Client { } // NOOP - async injectChaos(chaosSpecs: any[]) {}; + // eslint-disable-next-line + async injectChaos(_chaosSpecs: any[]) {} } diff --git a/javascript/packages/orchestrator/src/providers/podman/podmanClient.ts b/javascript/packages/orchestrator/src/providers/podman/podmanClient.ts index dd4366ea7..5c07e2875 100644 --- a/javascript/packages/orchestrator/src/providers/podman/podmanClient.ts +++ b/javascript/packages/orchestrator/src/providers/podman/podmanClient.ts @@ -17,7 +17,6 @@ import { P2P_PORT, PROMETHEUS_PORT, } from "../../constants"; -import { DelayNetworkSettings } from "../../sharedTypes"; import { fileMap } from "../../types"; import { Client, @@ -542,5 +541,6 @@ export class PodmanClient extends Client { } // NOOP - async injectChaos(chaosSpecs: any[]) {}; + // eslint-disable-next-line + async injectChaos(_chaosSpecs: any[]) {} } From 2efa59acfd5d2c4597d9ddffa83f0d4490f40ff9 Mon Sep 17 00:00:00 2001 From: Javier Viola Date: Fri, 1 Sep 2023 09:48:09 -0300 Subject: [PATCH 25/25] remove commented code --- .../packages/orchestrator/src/providers/k8s/kubeClient.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts b/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts index 042784116..6ee97915b 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts @@ -221,12 +221,6 @@ export class KubeClient extends Client { await this.putLocalMagicFile(name); await this.waitPodReady(name); - // if (podDef.metadata.labels["zombie-role"] !== ZombieRole.Temp && delay) { - // const chaosDef = genChaosDef(name, this.namespace, delay); - // writeLocalJsonFile(this.tmpDir, `${name}-chaos.json`, chaosDef); - // await this.createResource(chaosDef, true); - // } - logTable = new CreateLogTable({ colWidths: [20, 100], });