From 446fc5aa22dcc63160469b9a8e26e888d67ab688 Mon Sep 17 00:00:00 2001 From: ThetaSinner Date: Fri, 6 Sep 2024 17:52:11 +0100 Subject: [PATCH 1/4] Improve countersigning scenario --- Cargo.lock | 2 + bindings/trycp_runner/src/common.rs | 2 +- conductor-config-ci.yaml | 3 + scenarios/two_party_countersigning/Cargo.toml | 2 + .../two_party_countersigning/src/main.rs | 318 +++++++++++------- 5 files changed, 209 insertions(+), 118 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 228c736a..8f8deee7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4918,6 +4918,8 @@ dependencies = [ "anyhow", "countersigning_integrity", "happ_builder", + "holo_hash", + "holochain_serialized_bytes", "holochain_types", "log", "rand 0.8.5", diff --git a/bindings/trycp_runner/src/common.rs b/bindings/trycp_runner/src/common.rs index 4bdd8102..682f87b4 100644 --- a/bindings/trycp_runner/src/common.rs +++ b/bindings/trycp_runner/src/common.rs @@ -315,7 +315,7 @@ where let agent_name = agent_name.clone(); async move { let logs = client - .download_logs(agent_name, Some(Duration::from_secs(180))) + .download_logs(agent_name, Some(Duration::from_secs(10 * 60))) .await .context("Failed to download logs")?; Ok(logs) diff --git a/conductor-config-ci.yaml b/conductor-config-ci.yaml index 213fd207..bdf2e045 100644 --- a/conductor-config-ci.yaml +++ b/conductor-config-ci.yaml @@ -1,3 +1,6 @@ +dpki: + dna_path: ~ + no_dpki: true network: network_type: quic_bootstrap transport_pool: diff --git a/scenarios/two_party_countersigning/Cargo.toml b/scenarios/two_party_countersigning/Cargo.toml index a1d8624c..403f4765 100644 --- a/scenarios/two_party_countersigning/Cargo.toml +++ b/scenarios/two_party_countersigning/Cargo.toml @@ -12,6 +12,8 @@ log = { workspace = true } rmp-serde = { workspace = true } holochain_types = { workspace = true } +holo_hash = { workspace = true } +holochain_serialized_bytes = { workspace = true } trycp_wind_tunnel_runner = { workspace = true } countersigning_integrity = { workspace = true } diff --git a/scenarios/two_party_countersigning/src/main.rs b/scenarios/two_party_countersigning/src/main.rs index 2d83884a..b4f95860 100644 --- a/scenarios/two_party_countersigning/src/main.rs +++ b/scenarios/two_party_countersigning/src/main.rs @@ -1,6 +1,8 @@ use anyhow::Context; use countersigning_integrity::Signals; -use holochain_types::prelude::{AgentPubKey, CellId, EntryHash, PreflightResponse}; +use holochain_types::prelude::{ + AgentPubKey, CellId, EntryHash, PreflightRequest, PreflightResponse, +}; use holochain_types::signal::{Signal, SystemSignal}; use rand::seq::SliceRandom; use rand::thread_rng; @@ -117,132 +119,109 @@ fn agent_behaviour_initiate( let new_peers = ctx .runner_context() .executor() - .execute_in_place( - async move { - match initiate_with_peers { - None => { - // No more agents available to call, get a new list. - // This is also the initial condition. - let response = client - .call_zome( - app_port, - cell_id.clone(), - "countersigning", - "list_participants", - (), - None, - ) - .await - .context("Failed to list participants")?; - let mut new_peer_list = response.decode::>().map_err(|e| anyhow::anyhow!("Decoding failure: {:?}", e))?; - new_peer_list.shuffle(&mut thread_rng()); - - // Pause to let Holochain receive more agent links if none are found yet. - if new_peer_list.is_empty() { - tokio::time::sleep(Duration::from_millis(100)).await; - } - - Ok(new_peer_list) + .execute_in_place(async move { + match initiate_with_peers { + None => { + // No more agents available to call, get a new list. + // This is also the initial condition. + let response = client + .call_zome( + app_port, + cell_id.clone(), + "countersigning", + "list_participants", + (), + None, + ) + .await + .context("Failed to list participants")?; + let mut new_peer_list = response + .decode::>() + .map_err(|e| anyhow::anyhow!("Decoding failure: {:?}", e))?; + new_peer_list.shuffle(&mut thread_rng()); + + // Pause to let Holochain receive more agent links if none are found yet. + if new_peer_list.is_empty() { + tokio::time::sleep(Duration::from_millis(100)).await; } - Some(agent_pub_key) => { - log::debug!("Initiating a countersigning session with agent {:?}", agent_pub_key); - let start = Instant::now(); - let initiated = initiated.fetch_add(1, std::sync::atomic::Ordering::Acquire); - reporter.add_custom( - ReportMetric::new("countersigning_session_initiated") - .with_tag("agent", agent_name.clone()) - .with_field("value", initiated as u64), - ); + Ok(new_peer_list) + } + Some(agent_pub_key) => { + log::debug!( + "Initiating a countersigning session with agent {:?}", + agent_pub_key + ); - // Start a countersigning session with the next agent in the list. - let response = client - .call_zome( - app_port, - cell_id.clone(), - "countersigning", - "start_two_party", - agent_pub_key.clone(), - // This should be fairly quick, can increase this if it causes problems - None, + let start = Instant::now(); + let initiated = initiated.fetch_add(1, std::sync::atomic::Ordering::Acquire); + reporter.add_custom( + ReportMetric::new("countersigning_session_initiated") + .with_tag("agent", agent_name.clone()) + .with_field("value", initiated as u64), + ); + + // Start a countersigning session with the next agent in the list. + let response = client + .call_zome( + app_port, + cell_id.clone(), + "countersigning", + "start_two_party", + agent_pub_key.clone(), + // This should be fairly quick, can increase this if it causes problems + None, + ) + .await + .with_context(|| { + format!( + "Failed to start a new countersigning session: {:?}", + agent_pub_key ) - .await - .with_context(|| { - format!("Failed to start a new countersigning session: {:?}", agent_pub_key) - })?; + })?; - let my_preflight_response: PreflightResponse = response.decode().map_err(|e| anyhow::anyhow!("Decoding failure: {:?}", e))?; + let my_preflight_response: PreflightResponse = response + .decode() + .map_err(|e| anyhow::anyhow!("Decoding failure: {:?}", e))?; - let session_times = my_preflight_response.request.session_times.clone(); - let session_timeout = Instant::now().add(Duration::from_millis( - (session_times.end.as_millis() - session_times.start.as_millis()) as u64, - )); - loop { - // Now listen for a signal from the remote with their acceptance - let signal = tokio::time::timeout_at(session_timeout, client.recv_signal()).await.with_context(|| format!("Agent [{agent_pub_key:?}] did not respond to the countersigning request in time, abandoning"))?; - - match signal { - Some(signal) => { - let signal = match rmp_serde::decode::from_slice::(&signal.data).map_err(|e| anyhow::anyhow!("Decoding failure, appears to not be a signal: {:?}", e))? { - Signal::App { - signal, - .. - } => signal, - _ => { - log::debug!("Received a signal that is not an app signal, listening for other signals."); - continue; - } - }; - - let other_response = match signal.clone().into_inner().decode::() { - Ok(Signals::Response(response)) if response.request.app_entry_hash == my_preflight_response.request.app_entry_hash => response, - Ok(_) => { - log::debug!("Received a signal that is not a response for this countersigning session, listening for other signals."); - continue; - } - Err(_) => { - // Must be resilient to unexpected signals, somebody else might try to initiate with us while we're already - // working with another peer. - log::debug!("Got an unexpected signal, will try again. {:?}", signal); - continue; - } - }; - - log::debug!("The other party [{:?}] has accepted the countersigning session.", agent_pub_key); - - let retry_count = complete_session(client.clone(), app_port, cell_id.clone(), my_preflight_response, other_response, session_timeout).await.context("Initiator failed to complete session")?; - - let elapsed = start.elapsed(); - - log::debug!("Completed the countersigning session with agent {:?}", agent_pub_key); - - let initiated_success = initiated_success.fetch_add(1, std::sync::atomic::Ordering::Acquire); - reporter.add_custom( - ReportMetric::new("countersigning_session_initiated_success") - .with_tag("agent", agent_name.clone()) - .with_field("retries", retry_count as u64) - .with_field("value", initiated_success as u64), - ); - reporter.add_custom( - ReportMetric::new("countersigning_session_initiated_duration") - .with_tag("agent", agent_name) - .with_field("value", elapsed.as_secs_f64()), - ); - - break; - } - None => { - log::warn!("No signal received, problem with the remote? Will try again."); - } - } - } + let session_times = my_preflight_response.request.session_times.clone(); + let session_timeout = Instant::now().add(Duration::from_millis( + (session_times.end.as_millis() - session_times.start.as_millis()) as u64, + )); - // Add no new agents, that should only happen when we exhaust the list. - Ok(Vec::with_capacity(0)) + match run_initiated_session( + client.clone(), + my_preflight_response, + session_timeout, + agent_pub_key, + agent_name.clone(), + cell_id.clone(), + app_port, + start, + initiated_success.clone(), + reporter, + ) + .await + { + Ok(_) => { + // Completed successfully + } + Err(e) => { + log::warn!( + "Failed to run initiated session, waiting for it to time out: {:?}", + e + ); + + // TODO this can be replaced with listening for the abandoned signal + tokio::time::sleep_until(session_timeout).await; + } } + + // Add no new agents, that should only happen when we exhaust the list. + Ok(Vec::with_capacity(0)) } } - )?; + })?; ctx.get_mut() .scenario_values @@ -252,6 +231,102 @@ fn agent_behaviour_initiate( Ok(()) } +#[allow(clippy::too_many_arguments)] +async fn run_initiated_session( + client: TryCPClient, + my_preflight_response: PreflightResponse, + session_timeout: Instant, + agent_pub_key: AgentPubKey, + agent_name: String, + cell_id: CellId, + app_port: u16, + start: Instant, + initiated_success: Arc, + reporter: Arc, +) -> anyhow::Result<()> { + loop { + // Now listen for a signal from the remote with their acceptance + let signal = tokio::time::timeout_at(session_timeout, client.recv_signal()).await.with_context(|| format!("Agent [{agent_pub_key:?}] did not respond to the countersigning request in time, abandoning"))?; + + match signal { + Some(signal) => { + let signal = match rmp_serde::decode::from_slice::(&signal.data).map_err( + |e| anyhow::anyhow!("Decoding failure, appears to not be a signal: {:?}", e), + )? { + Signal::App { signal, .. } => signal, + _ => { + log::debug!("Received a signal that is not an app signal, listening for other signals."); + continue; + } + }; + + let other_response = match signal.clone().into_inner().decode::() { + Ok(Signals::Response(response)) + if session_fingerprint(response.request())? + == session_fingerprint(my_preflight_response.request())? => + { + response + } + Ok(_) => { + log::debug!("Received a signal that is not a response for this countersigning session, listening for other signals."); + continue; + } + Err(_) => { + // Must be resilient to unexpected signals, somebody else might try to initiate with us while we're already + // working with another peer. + log::debug!("Got an unexpected signal, will try again. {:?}", signal); + continue; + } + }; + + log::debug!( + "The other party [{:?}] has accepted the countersigning session.", + agent_pub_key + ); + + let retry_count = complete_session( + client.clone(), + app_port, + cell_id.clone(), + my_preflight_response, + other_response, + session_timeout, + ) + .await + .context("Initiator failed to complete session")?; + + let elapsed = start.elapsed(); + + log::debug!( + "Completed the countersigning session with agent {:?}", + agent_pub_key + ); + + let initiated_success = + initiated_success.fetch_add(1, std::sync::atomic::Ordering::Acquire); + reporter.add_custom( + ReportMetric::new("countersigning_session_initiated_success") + .with_tag("agent", agent_name.clone()) + .with_field("retries", retry_count as u64) + .with_field("value", initiated_success as u64), + ); + reporter.add_custom( + ReportMetric::new("countersigning_session_initiated_duration") + .with_tag("agent", agent_name) + .with_field("value", elapsed.as_secs_f64()), + ); + + break; + } + None => { + log::warn!("No signal received, problem with the remote? Will try again."); + } + } + } + + Ok(()) +} + fn agent_behaviour_participate( ctx: &mut AgentContext>, ) -> HookResult { @@ -488,6 +563,15 @@ async fn complete_session( Ok(retry_count) } +fn session_fingerprint(preflight_request: &PreflightRequest) -> anyhow::Result> { + let hash = holo_hash::encode::blake2b_256( + &holochain_serialized_bytes::encode(preflight_request) + .context("Failed to serialize preflight request")?, + ); + + Ok(hash) +} + async fn await_countersigning_success( client: TryCPClient, session_entry_hash: EntryHash, From 73b36e91f825567c04259005d18de25ee3c1f722 Mon Sep 17 00:00:00 2001 From: ThetaSinner Date: Mon, 30 Sep 2024 15:53:28 +0100 Subject: [PATCH 2/4] Handle countersigning signals and update metrics + dashboard --- conductor-config-ci.yaml | 10 +- conductor-config.yaml | 11 + .../templates/dashboards/countersigning.json | 2 +- .../two_party_countersigning/src/main.rs | 259 ++++++++++-------- 4 files changed, 167 insertions(+), 115 deletions(-) diff --git a/conductor-config-ci.yaml b/conductor-config-ci.yaml index bdf2e045..d4d5a908 100644 --- a/conductor-config-ci.yaml +++ b/conductor-config-ci.yaml @@ -1,9 +1,17 @@ +danger_generate_throwaway_device_seed: true dpki: dna_path: ~ - no_dpki: true + network_seed: wind-tunnel-test + allow_throwaway_random_dpki_agent_key: true + no_dpki: false network: network_type: quic_bootstrap transport_pool: - type: webrtc signal_url: "ws://localhost:4423" bootstrap_service: "http://localhost:4422" +tuning_params: + countersigning_resolution_retry_delay: + secs: 10 + nanos: 0 + countersigning_resolution_retry_limit: 5 diff --git a/conductor-config.yaml b/conductor-config.yaml index 7f5576d3..d973c1da 100644 --- a/conductor-config.yaml +++ b/conductor-config.yaml @@ -1,6 +1,17 @@ +danger_generate_throwaway_device_seed: true +dpki: + dna_path: ~ + network_seed: wind-tunnel-test + allow_throwaway_random_dpki_agent_key: true + no_dpki: false network: network_type: quic_bootstrap transport_pool: - type: webrtc signal_url: "wss://sbd.holo.host" bootstrap_service: "https://bootstrap.holo.host" +tuning_params: + countersigning_resolution_retry_delay: + secs: 10 + nanos: 0 + countersigning_resolution_retry_limit: 5 diff --git a/influx/templates/dashboards/countersigning.json b/influx/templates/dashboards/countersigning.json index eb53d33a..4e6e0f85 100644 --- a/influx/templates/dashboards/countersigning.json +++ b/influx/templates/dashboards/countersigning.json @@ -1 +1 @@ -[{"apiVersion":"influxdata.com/v2alpha1","kind":"Dashboard","metadata":{"name":"dreamy-cray-276001"},"spec":{"charts":[{"axes":[{"base":"10","name":"x","scale":"linear"},{"base":"10","name":"y","scale":"linear"}],"colorizeRows":true,"colors":[{"id":"KUTtqo_3thkHsXMmw8AAx","name":"Color Blind Friendly - Light","type":"scale","hex":"#FFFFFF"},{"id":"746gR03rdZ6XitWhLnBQ0","name":"Color Blind Friendly - Light","type":"scale","hex":"#E69F00"},{"id":"d51OBsEuj4XCsSSy4IXGi","name":"Color Blind Friendly - Light","type":"scale","hex":"#56B4E9"},{"id":"tmIUeSU3NKTKKhnQBhAqk","name":"Color Blind Friendly - Light","type":"scale","hex":"#009E73"},{"id":"s7VBZJDbJbHxPVJZ48XHd","name":"Color Blind Friendly - Light","type":"scale","hex":"#F0E442"},{"id":"P72-bQCsx8W1i6Z1miSWn","name":"Color Blind Friendly - Light","type":"scale","hex":"#0072B2"},{"id":"EZdhHDCFyiqI8aqjRRAaa","name":"Color Blind Friendly - Light","type":"scale","hex":"#D55E00"},{"id":"TBqjw60qQwNkbVslVTBy0","name":"Color Blind Friendly - Light","type":"scale","hex":"#CC79A7"}],"geom":"line","height":4,"hoverDimension":"auto","kind":"Xy","legendColorizeRows":true,"legendOpacity":1,"legendOrientationThreshold":100000000,"name":"Initiated sessions","opacity":1,"orientationThreshold":100000000,"position":"overlaid","queries":[{"query":"from(bucket: \"windtunnel\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"wt.custom.countersigning_session_initiated\")\n |> filter(fn: (r) => r[\"run_id\"] == v.RunId)\n |> group(columns: [\"agent\"], mode:\"by\")\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")"}],"staticLegend":{"colorizeRows":true,"opacity":1,"orientationThreshold":100000000,"widthRatio":1},"width":4,"widthRatio":1,"xCol":"_time","yCol":"_value"},{"axes":[{"base":"10","name":"x","scale":"linear"},{"base":"10","label":"Duration","name":"y","scale":"linear","suffix":"s"}],"colorizeRows":true,"colors":[{"id":"KUTtqo_3thkHsXMmw8AAx","name":"Color Blind Friendly - Light","type":"scale","hex":"#FFFFFF"},{"id":"746gR03rdZ6XitWhLnBQ0","name":"Color Blind Friendly - Light","type":"scale","hex":"#E69F00"},{"id":"d51OBsEuj4XCsSSy4IXGi","name":"Color Blind Friendly - Light","type":"scale","hex":"#56B4E9"},{"id":"tmIUeSU3NKTKKhnQBhAqk","name":"Color Blind Friendly - Light","type":"scale","hex":"#009E73"},{"id":"s7VBZJDbJbHxPVJZ48XHd","name":"Color Blind Friendly - Light","type":"scale","hex":"#F0E442"},{"id":"P72-bQCsx8W1i6Z1miSWn","name":"Color Blind Friendly - Light","type":"scale","hex":"#0072B2"},{"id":"EZdhHDCFyiqI8aqjRRAaa","name":"Color Blind Friendly - Light","type":"scale","hex":"#D55E00"},{"id":"TBqjw60qQwNkbVslVTBy0","name":"Color Blind Friendly - Light","type":"scale","hex":"#CC79A7"}],"geom":"line","height":4,"hoverDimension":"auto","kind":"Xy","legendColorizeRows":true,"legendOpacity":1,"legendOrientationThreshold":100000000,"name":"Successful initiated session duration","opacity":1,"orientationThreshold":100000000,"position":"overlaid","queries":[{"query":"from(bucket: \"windtunnel\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"wt.custom.countersigning_session_initiated_duration\")\n |> filter(fn: (r) => r[\"run_id\"] == v.RunId)\n |> group(columns: [\"agent\"], mode:\"by\")\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")"}],"staticLegend":{"colorizeRows":true,"opacity":1,"orientationThreshold":100000000,"widthRatio":1},"width":12,"widthRatio":1,"xCol":"_time","yCol":"_value","yPos":4},{"axes":[{"base":"10","name":"x","scale":"linear"},{"base":"10","name":"y","scale":"linear"}],"colorizeRows":true,"colors":[{"id":"KUTtqo_3thkHsXMmw8AAx","name":"Color Blind Friendly - Light","type":"scale","hex":"#FFFFFF"},{"id":"746gR03rdZ6XitWhLnBQ0","name":"Color Blind Friendly - Light","type":"scale","hex":"#E69F00"},{"id":"d51OBsEuj4XCsSSy4IXGi","name":"Color Blind Friendly - Light","type":"scale","hex":"#56B4E9"},{"id":"tmIUeSU3NKTKKhnQBhAqk","name":"Color Blind Friendly - Light","type":"scale","hex":"#009E73"},{"id":"s7VBZJDbJbHxPVJZ48XHd","name":"Color Blind Friendly - Light","type":"scale","hex":"#F0E442"},{"id":"P72-bQCsx8W1i6Z1miSWn","name":"Color Blind Friendly - Light","type":"scale","hex":"#0072B2"},{"id":"EZdhHDCFyiqI8aqjRRAaa","name":"Color Blind Friendly - Light","type":"scale","hex":"#D55E00"},{"id":"TBqjw60qQwNkbVslVTBy0","name":"Color Blind Friendly - Light","type":"scale","hex":"#CC79A7"}],"geom":"line","height":4,"hoverDimension":"auto","kind":"Xy","legendColorizeRows":true,"legendOpacity":1,"legendOrientationThreshold":100000000,"name":"Accepted sessions","opacity":1,"orientationThreshold":100000000,"position":"overlaid","queries":[{"query":"from(bucket: \"windtunnel\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"wt.custom.countersigning_session_accepted\")\n |> filter(fn: (r) => r[\"run_id\"] == v.RunId)\n |> group(columns: [\"agent\"], mode:\"by\")\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")"}],"staticLegend":{"colorizeRows":true,"opacity":1,"orientationThreshold":100000000,"widthRatio":1},"width":4,"widthRatio":1,"xCol":"_time","yCol":"_value","yPos":8},{"axes":[{"base":"10","name":"x","scale":"linear"},{"base":"10","label":"Duration","name":"y","scale":"linear","suffix":"s"}],"colorizeRows":true,"colors":[{"id":"KUTtqo_3thkHsXMmw8AAx","name":"Color Blind Friendly - Light","type":"scale","hex":"#FFFFFF"},{"id":"746gR03rdZ6XitWhLnBQ0","name":"Color Blind Friendly - Light","type":"scale","hex":"#E69F00"},{"id":"d51OBsEuj4XCsSSy4IXGi","name":"Color Blind Friendly - Light","type":"scale","hex":"#56B4E9"},{"id":"tmIUeSU3NKTKKhnQBhAqk","name":"Color Blind Friendly - Light","type":"scale","hex":"#009E73"},{"id":"s7VBZJDbJbHxPVJZ48XHd","name":"Color Blind Friendly - Light","type":"scale","hex":"#F0E442"},{"id":"P72-bQCsx8W1i6Z1miSWn","name":"Color Blind Friendly - Light","type":"scale","hex":"#0072B2"},{"id":"EZdhHDCFyiqI8aqjRRAaa","name":"Color Blind Friendly - Light","type":"scale","hex":"#D55E00"},{"id":"TBqjw60qQwNkbVslVTBy0","name":"Color Blind Friendly - Light","type":"scale","hex":"#CC79A7"}],"geom":"line","height":4,"hoverDimension":"auto","kind":"Xy","legendColorizeRows":true,"legendOpacity":1,"legendOrientationThreshold":100000000,"name":"Successful accepted session duration","opacity":1,"orientationThreshold":100000000,"position":"overlaid","queries":[{"query":"from(bucket: \"windtunnel\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"wt.custom.countersigning_session_accepted_duration\")\n |> filter(fn: (r) => r[\"run_id\"] == v.RunId)\n |> group(columns: [\"agent\"], mode:\"by\")\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")"}],"staticLegend":{"colorizeRows":true,"opacity":1,"orientationThreshold":100000000,"widthRatio":1},"width":12,"widthRatio":1,"xCol":"_time","yCol":"_value","yPos":12},{"axes":[{"base":"10","name":"x","scale":"linear"},{"base":"10","name":"y","scale":"linear"}],"colorizeRows":true,"colors":[{"id":"KUTtqo_3thkHsXMmw8AAx","name":"Color Blind Friendly - Light","type":"scale","hex":"#FFFFFF"},{"id":"746gR03rdZ6XitWhLnBQ0","name":"Color Blind Friendly - Light","type":"scale","hex":"#E69F00"},{"id":"d51OBsEuj4XCsSSy4IXGi","name":"Color Blind Friendly - Light","type":"scale","hex":"#56B4E9"},{"id":"tmIUeSU3NKTKKhnQBhAqk","name":"Color Blind Friendly - Light","type":"scale","hex":"#009E73"},{"id":"s7VBZJDbJbHxPVJZ48XHd","name":"Color Blind Friendly - Light","type":"scale","hex":"#F0E442"},{"id":"P72-bQCsx8W1i6Z1miSWn","name":"Color Blind Friendly - Light","type":"scale","hex":"#0072B2"},{"id":"EZdhHDCFyiqI8aqjRRAaa","name":"Color Blind Friendly - Light","type":"scale","hex":"#D55E00"},{"id":"TBqjw60qQwNkbVslVTBy0","name":"Color Blind Friendly - Light","type":"scale","hex":"#CC79A7"}],"geom":"line","height":4,"hoverDimension":"auto","kind":"Xy","legendColorizeRows":true,"legendOpacity":1,"legendOrientationThreshold":100000000,"name":"Successful initiated sessions","opacity":1,"orientationThreshold":100000000,"position":"overlaid","queries":[{"query":"from(bucket: \"windtunnel\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"wt.custom.countersigning_session_initiated_success\")\n |> filter(fn: (r) => r[\"run_id\"] == v.RunId)\n |> group(columns: [\"agent\"], mode:\"by\") \n |> filter(fn: (r) => r[\"_field\"] == \"value\")\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")"}],"staticLegend":{"colorizeRows":true,"opacity":1,"orientationThreshold":100000000,"widthRatio":1},"width":4,"widthRatio":1,"xCol":"_time","xPos":4,"yCol":"_value"},{"axes":[{"base":"10","name":"x","scale":"linear"},{"base":"10","name":"y","scale":"linear"}],"colorizeRows":true,"colors":[{"id":"KUTtqo_3thkHsXMmw8AAx","name":"Color Blind Friendly - Light","type":"scale","hex":"#FFFFFF"},{"id":"746gR03rdZ6XitWhLnBQ0","name":"Color Blind Friendly - Light","type":"scale","hex":"#E69F00"},{"id":"d51OBsEuj4XCsSSy4IXGi","name":"Color Blind Friendly - Light","type":"scale","hex":"#56B4E9"},{"id":"tmIUeSU3NKTKKhnQBhAqk","name":"Color Blind Friendly - Light","type":"scale","hex":"#009E73"},{"id":"s7VBZJDbJbHxPVJZ48XHd","name":"Color Blind Friendly - Light","type":"scale","hex":"#F0E442"},{"id":"P72-bQCsx8W1i6Z1miSWn","name":"Color Blind Friendly - Light","type":"scale","hex":"#0072B2"},{"id":"EZdhHDCFyiqI8aqjRRAaa","name":"Color Blind Friendly - Light","type":"scale","hex":"#D55E00"},{"id":"TBqjw60qQwNkbVslVTBy0","name":"Color Blind Friendly - Light","type":"scale","hex":"#CC79A7"}],"geom":"line","height":4,"hoverDimension":"auto","kind":"Xy","legendColorizeRows":true,"legendOpacity":1,"legendOrientationThreshold":100000000,"name":"Successful accepted sessions","opacity":1,"orientationThreshold":100000000,"position":"overlaid","queries":[{"query":"from(bucket: \"windtunnel\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"wt.custom.countersigning_session_accepted_success\")\n |> filter(fn: (r) => r[\"run_id\"] == v.RunId)\n |> group(columns: [\"agent\"], mode:\"by\")\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")"}],"staticLegend":{"colorizeRows":true,"opacity":1,"orientationThreshold":100000000,"widthRatio":1},"width":4,"widthRatio":1,"xCol":"_time","xPos":4,"yCol":"_value","yPos":8},{"axes":[{"base":"10","name":"x","scale":"linear"},{"base":"10","name":"y","scale":"linear"}],"colorizeRows":true,"colors":[{"id":"KUTtqo_3thkHsXMmw8AAx","name":"Color Blind Friendly - Light","type":"scale","hex":"#FFFFFF"},{"id":"746gR03rdZ6XitWhLnBQ0","name":"Color Blind Friendly - Light","type":"scale","hex":"#E69F00"},{"id":"d51OBsEuj4XCsSSy4IXGi","name":"Color Blind Friendly - Light","type":"scale","hex":"#56B4E9"},{"id":"tmIUeSU3NKTKKhnQBhAqk","name":"Color Blind Friendly - Light","type":"scale","hex":"#009E73"},{"id":"s7VBZJDbJbHxPVJZ48XHd","name":"Color Blind Friendly - Light","type":"scale","hex":"#F0E442"},{"id":"P72-bQCsx8W1i6Z1miSWn","name":"Color Blind Friendly - Light","type":"scale","hex":"#0072B2"},{"id":"EZdhHDCFyiqI8aqjRRAaa","name":"Color Blind Friendly - Light","type":"scale","hex":"#D55E00"},{"id":"TBqjw60qQwNkbVslVTBy0","name":"Color Blind Friendly - Light","type":"scale","hex":"#CC79A7"}],"geom":"line","height":4,"hoverDimension":"auto","kind":"Xy","legendColorizeRows":true,"legendOpacity":1,"legendOrientationThreshold":100000000,"name":"Failed initiated sessions","opacity":1,"orientationThreshold":100000000,"position":"overlaid","queries":[{"query":"Initiated = from(bucket: \"windtunnel\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"wt.custom.countersigning_session_initiated\")\n |> filter(fn: (r) => r[\"run_id\"] == v.RunId)\n |> group(columns: [\"agent\"], mode:\"by\")\n\nSucceeded = from(bucket: \"windtunnel\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"wt.custom.countersigning_session_initiated_success\")\n |> filter(fn: (r) => r[\"run_id\"] == v.RunId)\n |> group(columns: [\"agent\"], mode:\"by\")\n\nunion(tables: [Initiated, Succeeded])\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> difference()\n |> yield(name: \"difference\")"}],"staticLegend":{"colorizeRows":true,"opacity":1,"orientationThreshold":100000000,"widthRatio":1},"width":4,"widthRatio":1,"xCol":"_time","xPos":8,"yCol":"_value"},{"axes":[{"base":"10","name":"x","scale":"linear"},{"base":"10","name":"y","scale":"linear"}],"colorizeRows":true,"colors":[{"id":"KUTtqo_3thkHsXMmw8AAx","name":"Color Blind Friendly - Light","type":"scale","hex":"#FFFFFF"},{"id":"746gR03rdZ6XitWhLnBQ0","name":"Color Blind Friendly - Light","type":"scale","hex":"#E69F00"},{"id":"d51OBsEuj4XCsSSy4IXGi","name":"Color Blind Friendly - Light","type":"scale","hex":"#56B4E9"},{"id":"tmIUeSU3NKTKKhnQBhAqk","name":"Color Blind Friendly - Light","type":"scale","hex":"#009E73"},{"id":"s7VBZJDbJbHxPVJZ48XHd","name":"Color Blind Friendly - Light","type":"scale","hex":"#F0E442"},{"id":"P72-bQCsx8W1i6Z1miSWn","name":"Color Blind Friendly - Light","type":"scale","hex":"#0072B2"},{"id":"EZdhHDCFyiqI8aqjRRAaa","name":"Color Blind Friendly - Light","type":"scale","hex":"#D55E00"},{"id":"TBqjw60qQwNkbVslVTBy0","name":"Color Blind Friendly - Light","type":"scale","hex":"#CC79A7"}],"geom":"line","height":4,"hoverDimension":"auto","kind":"Xy","legendColorizeRows":true,"legendOpacity":1,"legendOrientationThreshold":100000000,"name":"Failed accepted sessions","opacity":1,"orientationThreshold":100000000,"position":"overlaid","queries":[{"query":"accepted = from(bucket: \"windtunnel\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"wt.custom.countersigning_session_accepted\")\n |> filter(fn: (r) => r[\"run_id\"] == v.RunId)\n |> group(columns: [\"agent\"], mode:\"by\")\n\nsucceeded = from(bucket: \"windtunnel\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"wt.custom.countersigning_session_accepted_success\")\n |> filter(fn: (r) => r[\"run_id\"] == v.RunId)\n |> group(columns: [\"agent\"], mode:\"by\")\n\nunion(tables: [accepted, succeeded])\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> difference()\n |> yield(name: \"difference\")"}],"staticLegend":{"colorizeRows":true,"opacity":1,"orientationThreshold":100000000,"widthRatio":1},"width":4,"widthRatio":1,"xCol":"_time","xPos":8,"yCol":"_value","yPos":8}],"description":"Generic charts for countersigning scenarios","name":"Countersigning"}}] \ No newline at end of file +[{"apiVersion":"influxdata.com/v2alpha1","kind":"Dashboard","metadata":{"name":"sharp-einstein-dda001"},"spec":{"charts":[{"axes":[{"base":"10","name":"x","scale":"linear"},{"base":"10","name":"y","scale":"linear"}],"colorizeRows":true,"colors":[{"id":"KUTtqo_3thkHsXMmw8AAx","name":"Color Blind Friendly - Light","type":"scale","hex":"#FFFFFF"},{"id":"746gR03rdZ6XitWhLnBQ0","name":"Color Blind Friendly - Light","type":"scale","hex":"#E69F00"},{"id":"d51OBsEuj4XCsSSy4IXGi","name":"Color Blind Friendly - Light","type":"scale","hex":"#56B4E9"},{"id":"tmIUeSU3NKTKKhnQBhAqk","name":"Color Blind Friendly - Light","type":"scale","hex":"#009E73"},{"id":"s7VBZJDbJbHxPVJZ48XHd","name":"Color Blind Friendly - Light","type":"scale","hex":"#F0E442"},{"id":"P72-bQCsx8W1i6Z1miSWn","name":"Color Blind Friendly - Light","type":"scale","hex":"#0072B2"},{"id":"EZdhHDCFyiqI8aqjRRAaa","name":"Color Blind Friendly - Light","type":"scale","hex":"#D55E00"},{"id":"TBqjw60qQwNkbVslVTBy0","name":"Color Blind Friendly - Light","type":"scale","hex":"#CC79A7"}],"geom":"line","height":4,"hoverDimension":"auto","kind":"Xy","legendColorizeRows":true,"legendOpacity":1,"legendOrientationThreshold":100000000,"name":"Initiated: session count","opacity":1,"orientationThreshold":100000000,"position":"overlaid","queries":[{"query":"from(bucket: \"windtunnel\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"wt.custom.countersigning_session_initiated\")\n |> filter(fn: (r) => r[\"run_id\"] == v.RunId)\n |> group(columns: [\"agent\"], mode:\"by\")\n |> yield(name: \"value\")"}],"staticLegend":{"colorizeRows":true,"opacity":1,"orientationThreshold":100000000,"widthRatio":1},"width":4,"widthRatio":1,"xCol":"_time","yCol":"_value"},{"axes":[{"base":"10","name":"x","scale":"linear"},{"base":"10","label":"Duration","name":"y","scale":"linear","suffix":"s"}],"colorizeRows":true,"colors":[{"id":"KUTtqo_3thkHsXMmw8AAx","name":"Color Blind Friendly - Light","type":"scale","hex":"#FFFFFF"},{"id":"746gR03rdZ6XitWhLnBQ0","name":"Color Blind Friendly - Light","type":"scale","hex":"#E69F00"},{"id":"d51OBsEuj4XCsSSy4IXGi","name":"Color Blind Friendly - Light","type":"scale","hex":"#56B4E9"},{"id":"tmIUeSU3NKTKKhnQBhAqk","name":"Color Blind Friendly - Light","type":"scale","hex":"#009E73"},{"id":"s7VBZJDbJbHxPVJZ48XHd","name":"Color Blind Friendly - Light","type":"scale","hex":"#F0E442"},{"id":"P72-bQCsx8W1i6Z1miSWn","name":"Color Blind Friendly - Light","type":"scale","hex":"#0072B2"},{"id":"EZdhHDCFyiqI8aqjRRAaa","name":"Color Blind Friendly - Light","type":"scale","hex":"#D55E00"},{"id":"TBqjw60qQwNkbVslVTBy0","name":"Color Blind Friendly - Light","type":"scale","hex":"#CC79A7"}],"geom":"line","height":4,"hoverDimension":"auto","kind":"Xy","legendColorizeRows":true,"legendOpacity":1,"legendOrientationThreshold":100000000,"name":"Initiated: success duration","opacity":1,"orientationThreshold":100000000,"position":"overlaid","queries":[{"query":"from(bucket: \"windtunnel\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"wt.custom.countersigning_session_initiated_duration\")\n |> filter(fn: (r) => r[\"run_id\"] == v.RunId)\n |> filter(fn: (r) => r[\"failed\"] == \"false\")\n |> group(columns: [\"agent\"], mode:\"by\")\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")"}],"staticLegend":{"colorizeRows":true,"opacity":1,"orientationThreshold":100000000,"widthRatio":1},"width":6,"widthRatio":1,"xCol":"_time","yCol":"_value","yPos":4},{"axes":[{"base":"10","name":"x","scale":"linear"},{"base":"10","name":"y","scale":"linear"}],"colorizeRows":true,"colors":[{"id":"KUTtqo_3thkHsXMmw8AAx","name":"Color Blind Friendly - Light","type":"scale","hex":"#FFFFFF"},{"id":"746gR03rdZ6XitWhLnBQ0","name":"Color Blind Friendly - Light","type":"scale","hex":"#E69F00"},{"id":"d51OBsEuj4XCsSSy4IXGi","name":"Color Blind Friendly - Light","type":"scale","hex":"#56B4E9"},{"id":"tmIUeSU3NKTKKhnQBhAqk","name":"Color Blind Friendly - Light","type":"scale","hex":"#009E73"},{"id":"s7VBZJDbJbHxPVJZ48XHd","name":"Color Blind Friendly - Light","type":"scale","hex":"#F0E442"},{"id":"P72-bQCsx8W1i6Z1miSWn","name":"Color Blind Friendly - Light","type":"scale","hex":"#0072B2"},{"id":"EZdhHDCFyiqI8aqjRRAaa","name":"Color Blind Friendly - Light","type":"scale","hex":"#D55E00"},{"id":"TBqjw60qQwNkbVslVTBy0","name":"Color Blind Friendly - Light","type":"scale","hex":"#CC79A7"}],"geom":"line","height":4,"hoverDimension":"auto","kind":"Xy","legendColorizeRows":true,"legendOpacity":1,"legendOrientationThreshold":100000000,"name":"Accepted: session count","opacity":1,"orientationThreshold":100000000,"position":"overlaid","queries":[{"query":"from(bucket: \"windtunnel\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"wt.custom.countersigning_session_accepted\")\n |> filter(fn: (r) => r[\"run_id\"] == v.RunId)\n |> group(columns: [\"agent\"], mode:\"by\")\n |> yield(name: \"value\")"}],"staticLegend":{"colorizeRows":true,"opacity":1,"orientationThreshold":100000000,"widthRatio":1},"width":4,"widthRatio":1,"xCol":"_time","yCol":"_value","yPos":8},{"axes":[{"base":"10","name":"x","scale":"linear"},{"base":"10","label":"Duration","name":"y","scale":"linear","suffix":"s"}],"colorizeRows":true,"colors":[{"id":"KUTtqo_3thkHsXMmw8AAx","name":"Color Blind Friendly - Light","type":"scale","hex":"#FFFFFF"},{"id":"746gR03rdZ6XitWhLnBQ0","name":"Color Blind Friendly - Light","type":"scale","hex":"#E69F00"},{"id":"d51OBsEuj4XCsSSy4IXGi","name":"Color Blind Friendly - Light","type":"scale","hex":"#56B4E9"},{"id":"tmIUeSU3NKTKKhnQBhAqk","name":"Color Blind Friendly - Light","type":"scale","hex":"#009E73"},{"id":"s7VBZJDbJbHxPVJZ48XHd","name":"Color Blind Friendly - Light","type":"scale","hex":"#F0E442"},{"id":"P72-bQCsx8W1i6Z1miSWn","name":"Color Blind Friendly - Light","type":"scale","hex":"#0072B2"},{"id":"EZdhHDCFyiqI8aqjRRAaa","name":"Color Blind Friendly - Light","type":"scale","hex":"#D55E00"},{"id":"TBqjw60qQwNkbVslVTBy0","name":"Color Blind Friendly - Light","type":"scale","hex":"#CC79A7"}],"geom":"line","height":4,"hoverDimension":"auto","kind":"Xy","legendColorizeRows":true,"legendOpacity":1,"legendOrientationThreshold":100000000,"name":"Accepted: Success duration","opacity":1,"orientationThreshold":100000000,"position":"overlaid","queries":[{"query":"from(bucket: \"windtunnel\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"wt.custom.countersigning_session_accepted_duration\")\n |> filter(fn: (r) => r[\"run_id\"] == v.RunId)\n |> filter(fn: (r) => r[\"failed\"] == \"false\")\n |> group(columns: [\"agent\"], mode:\"by\")\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")"}],"staticLegend":{"colorizeRows":true,"opacity":1,"orientationThreshold":100000000,"widthRatio":1},"width":6,"widthRatio":1,"xCol":"_time","yCol":"_value","yPos":12},{"axes":[{"base":"10","name":"x","scale":"linear"},{"base":"10","name":"y","scale":"linear"}],"colorizeRows":true,"colors":[{"id":"KUTtqo_3thkHsXMmw8AAx","name":"Color Blind Friendly - Light","type":"scale","hex":"#FFFFFF"},{"id":"746gR03rdZ6XitWhLnBQ0","name":"Color Blind Friendly - Light","type":"scale","hex":"#E69F00"},{"id":"d51OBsEuj4XCsSSy4IXGi","name":"Color Blind Friendly - Light","type":"scale","hex":"#56B4E9"},{"id":"tmIUeSU3NKTKKhnQBhAqk","name":"Color Blind Friendly - Light","type":"scale","hex":"#009E73"},{"id":"s7VBZJDbJbHxPVJZ48XHd","name":"Color Blind Friendly - Light","type":"scale","hex":"#F0E442"},{"id":"P72-bQCsx8W1i6Z1miSWn","name":"Color Blind Friendly - Light","type":"scale","hex":"#0072B2"},{"id":"EZdhHDCFyiqI8aqjRRAaa","name":"Color Blind Friendly - Light","type":"scale","hex":"#D55E00"},{"id":"TBqjw60qQwNkbVslVTBy0","name":"Color Blind Friendly - Light","type":"scale","hex":"#CC79A7"}],"geom":"line","height":4,"hoverDimension":"auto","kind":"Xy","legendColorizeRows":true,"legendOpacity":1,"legendOrientationThreshold":100000000,"name":"Initiated: Success count","opacity":1,"orientationThreshold":100000000,"position":"overlaid","queries":[{"query":"from(bucket: \"windtunnel\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"wt.custom.countersigning_session_initiated_success\")\n |> filter(fn: (r) => r[\"run_id\"] == v.RunId)\n |> group(columns: [\"agent\"], mode:\"by\") \n |> filter(fn: (r) => r[\"_field\"] == \"value\")\n |> yield(name: \"value\")"}],"staticLegend":{"colorizeRows":true,"opacity":1,"orientationThreshold":100000000,"widthRatio":1},"width":4,"widthRatio":1,"xCol":"_time","xPos":4,"yCol":"_value"},{"axes":[{"base":"10","name":"x","scale":"linear"},{"base":"10","name":"y","scale":"linear"}],"colorizeRows":true,"colors":[{"id":"KUTtqo_3thkHsXMmw8AAx","name":"Color Blind Friendly - Light","type":"scale","hex":"#FFFFFF"},{"id":"746gR03rdZ6XitWhLnBQ0","name":"Color Blind Friendly - Light","type":"scale","hex":"#E69F00"},{"id":"d51OBsEuj4XCsSSy4IXGi","name":"Color Blind Friendly - Light","type":"scale","hex":"#56B4E9"},{"id":"tmIUeSU3NKTKKhnQBhAqk","name":"Color Blind Friendly - Light","type":"scale","hex":"#009E73"},{"id":"s7VBZJDbJbHxPVJZ48XHd","name":"Color Blind Friendly - Light","type":"scale","hex":"#F0E442"},{"id":"P72-bQCsx8W1i6Z1miSWn","name":"Color Blind Friendly - Light","type":"scale","hex":"#0072B2"},{"id":"EZdhHDCFyiqI8aqjRRAaa","name":"Color Blind Friendly - Light","type":"scale","hex":"#D55E00"},{"id":"TBqjw60qQwNkbVslVTBy0","name":"Color Blind Friendly - Light","type":"scale","hex":"#CC79A7"}],"geom":"line","height":4,"hoverDimension":"auto","kind":"Xy","legendColorizeRows":true,"legendOpacity":1,"legendOrientationThreshold":100000000,"name":"Accepted: success count","opacity":1,"orientationThreshold":100000000,"position":"overlaid","queries":[{"query":"from(bucket: \"windtunnel\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"wt.custom.countersigning_session_accepted_success\")\n |> filter(fn: (r) => r[\"run_id\"] == v.RunId)\n |> group(columns: [\"agent\"], mode:\"by\")\n |> yield(name: \"value\")"}],"staticLegend":{"colorizeRows":true,"opacity":1,"orientationThreshold":100000000,"widthRatio":1},"width":4,"widthRatio":1,"xCol":"_time","xPos":4,"yCol":"_value","yPos":8},{"axes":[{"base":"10","name":"x","scale":"linear"},{"base":"10","label":"Duration","name":"y","scale":"linear","suffix":"s"}],"colorizeRows":true,"colors":[{"id":"KUTtqo_3thkHsXMmw8AAx","name":"Color Blind Friendly - Light","type":"scale","hex":"#FFFFFF"},{"id":"746gR03rdZ6XitWhLnBQ0","name":"Color Blind Friendly - Light","type":"scale","hex":"#E69F00"},{"id":"d51OBsEuj4XCsSSy4IXGi","name":"Color Blind Friendly - Light","type":"scale","hex":"#56B4E9"},{"id":"tmIUeSU3NKTKKhnQBhAqk","name":"Color Blind Friendly - Light","type":"scale","hex":"#009E73"},{"id":"s7VBZJDbJbHxPVJZ48XHd","name":"Color Blind Friendly - Light","type":"scale","hex":"#F0E442"},{"id":"P72-bQCsx8W1i6Z1miSWn","name":"Color Blind Friendly - Light","type":"scale","hex":"#0072B2"},{"id":"EZdhHDCFyiqI8aqjRRAaa","name":"Color Blind Friendly - Light","type":"scale","hex":"#D55E00"},{"id":"TBqjw60qQwNkbVslVTBy0","name":"Color Blind Friendly - Light","type":"scale","hex":"#CC79A7"}],"geom":"line","height":4,"hoverDimension":"auto","kind":"Xy","legendColorizeRows":true,"legendOpacity":1,"legendOrientationThreshold":100000000,"name":"Initiated: failure duration","opacity":1,"orientationThreshold":100000000,"position":"overlaid","queries":[{"query":"from(bucket: \"windtunnel\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"wt.custom.countersigning_session_initiated_duration\")\n |> filter(fn: (r) => r[\"run_id\"] == v.RunId)\n |> filter(fn: (r) => r[\"failed\"] == \"true\")\n |> group(columns: [\"agent\"], mode:\"by\")\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")"}],"staticLegend":{"colorizeRows":true,"opacity":1,"orientationThreshold":100000000,"widthRatio":1},"width":6,"widthRatio":1,"xCol":"_time","xPos":6,"yCol":"_value","yPos":4},{"axes":[{"base":"10","name":"x","scale":"linear"},{"base":"10","label":"Duration","name":"y","scale":"linear","suffix":"s"}],"colorizeRows":true,"colors":[{"id":"KUTtqo_3thkHsXMmw8AAx","name":"Color Blind Friendly - Light","type":"scale","hex":"#FFFFFF"},{"id":"746gR03rdZ6XitWhLnBQ0","name":"Color Blind Friendly - Light","type":"scale","hex":"#E69F00"},{"id":"d51OBsEuj4XCsSSy4IXGi","name":"Color Blind Friendly - Light","type":"scale","hex":"#56B4E9"},{"id":"tmIUeSU3NKTKKhnQBhAqk","name":"Color Blind Friendly - Light","type":"scale","hex":"#009E73"},{"id":"s7VBZJDbJbHxPVJZ48XHd","name":"Color Blind Friendly - Light","type":"scale","hex":"#F0E442"},{"id":"P72-bQCsx8W1i6Z1miSWn","name":"Color Blind Friendly - Light","type":"scale","hex":"#0072B2"},{"id":"EZdhHDCFyiqI8aqjRRAaa","name":"Color Blind Friendly - Light","type":"scale","hex":"#D55E00"},{"id":"TBqjw60qQwNkbVslVTBy0","name":"Color Blind Friendly - Light","type":"scale","hex":"#CC79A7"}],"geom":"line","height":4,"hoverDimension":"auto","kind":"Xy","legendColorizeRows":true,"legendOpacity":1,"legendOrientationThreshold":100000000,"name":"Accepted: Failed duration","opacity":1,"orientationThreshold":100000000,"position":"overlaid","queries":[{"query":"from(bucket: \"windtunnel\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"wt.custom.countersigning_session_accepted_duration\")\n |> filter(fn: (r) => r[\"run_id\"] == v.RunId)\n |> filter(fn: (r) => r[\"failed\"] == \"true\")\n |> group(columns: [\"agent\"], mode:\"by\")\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")"}],"staticLegend":{"colorizeRows":true,"opacity":1,"orientationThreshold":100000000,"widthRatio":1},"width":6,"widthRatio":1,"xCol":"_time","xPos":6,"yCol":"_value","yPos":12},{"axes":[{"base":"10","name":"x","scale":"linear"},{"base":"10","name":"y","scale":"linear"}],"colorizeRows":true,"colors":[{"id":"KUTtqo_3thkHsXMmw8AAx","name":"Color Blind Friendly - Light","type":"scale","hex":"#FFFFFF"},{"id":"746gR03rdZ6XitWhLnBQ0","name":"Color Blind Friendly - Light","type":"scale","hex":"#E69F00"},{"id":"d51OBsEuj4XCsSSy4IXGi","name":"Color Blind Friendly - Light","type":"scale","hex":"#56B4E9"},{"id":"tmIUeSU3NKTKKhnQBhAqk","name":"Color Blind Friendly - Light","type":"scale","hex":"#009E73"},{"id":"s7VBZJDbJbHxPVJZ48XHd","name":"Color Blind Friendly - Light","type":"scale","hex":"#F0E442"},{"id":"P72-bQCsx8W1i6Z1miSWn","name":"Color Blind Friendly - Light","type":"scale","hex":"#0072B2"},{"id":"EZdhHDCFyiqI8aqjRRAaa","name":"Color Blind Friendly - Light","type":"scale","hex":"#D55E00"},{"id":"TBqjw60qQwNkbVslVTBy0","name":"Color Blind Friendly - Light","type":"scale","hex":"#CC79A7"}],"geom":"line","height":4,"hoverDimension":"auto","kind":"Xy","legendColorizeRows":true,"legendOpacity":1,"legendOrientationThreshold":100000000,"name":"Initated: Failure count","opacity":1,"orientationThreshold":100000000,"position":"overlaid","queries":[{"query":"from(bucket: \"windtunnel\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"wt.custom.countersigning_session_initiated_failure\")\n |> filter(fn: (r) => r[\"run_id\"] == v.RunId)\n |> group(columns: [\"agent\"], mode:\"by\")\n |> filter(fn: (r) => r[\"_field\"] == \"value\")\n |> yield(name: \"value\")"}],"staticLegend":{"colorizeRows":true,"opacity":1,"orientationThreshold":100000000,"widthRatio":1},"width":4,"widthRatio":1,"xCol":"_time","xPos":8,"yCol":"_value"},{"axes":[{"base":"10","name":"x","scale":"linear"},{"base":"10","name":"y","scale":"linear"}],"colorizeRows":true,"colors":[{"id":"KUTtqo_3thkHsXMmw8AAx","name":"Color Blind Friendly - Light","type":"scale","hex":"#FFFFFF"},{"id":"746gR03rdZ6XitWhLnBQ0","name":"Color Blind Friendly - Light","type":"scale","hex":"#E69F00"},{"id":"d51OBsEuj4XCsSSy4IXGi","name":"Color Blind Friendly - Light","type":"scale","hex":"#56B4E9"},{"id":"tmIUeSU3NKTKKhnQBhAqk","name":"Color Blind Friendly - Light","type":"scale","hex":"#009E73"},{"id":"s7VBZJDbJbHxPVJZ48XHd","name":"Color Blind Friendly - Light","type":"scale","hex":"#F0E442"},{"id":"P72-bQCsx8W1i6Z1miSWn","name":"Color Blind Friendly - Light","type":"scale","hex":"#0072B2"},{"id":"EZdhHDCFyiqI8aqjRRAaa","name":"Color Blind Friendly - Light","type":"scale","hex":"#D55E00"},{"id":"TBqjw60qQwNkbVslVTBy0","name":"Color Blind Friendly - Light","type":"scale","hex":"#CC79A7"}],"geom":"line","height":4,"hoverDimension":"auto","kind":"Xy","legendColorizeRows":true,"legendOpacity":1,"legendOrientationThreshold":100000000,"name":"Accepted: failed count","opacity":1,"orientationThreshold":100000000,"position":"overlaid","queries":[{"query":"from(bucket: \"windtunnel\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"wt.custom.countersigning_session_accepted_failure\")\n |> filter(fn: (r) => r[\"run_id\"] == v.RunId)\n |> group(columns: [\"agent\"], mode:\"by\")\n |> filter(fn: (r) => r[\"_field\"] == \"value\")\n |> yield(name: \"value\")"}],"staticLegend":{"colorizeRows":true,"opacity":1,"orientationThreshold":100000000,"widthRatio":1},"width":4,"widthRatio":1,"xPos":8,"yPos":8}],"description":"Generic charts for countersigning scenarios","name":"Countersigning"}}] \ No newline at end of file diff --git a/scenarios/two_party_countersigning/src/main.rs b/scenarios/two_party_countersigning/src/main.rs index b4f95860..a94026a4 100644 --- a/scenarios/two_party_countersigning/src/main.rs +++ b/scenarios/two_party_countersigning/src/main.rs @@ -1,8 +1,6 @@ use anyhow::Context; -use countersigning_integrity::Signals; -use holochain_types::prelude::{ - AgentPubKey, CellId, EntryHash, PreflightRequest, PreflightResponse, -}; +use countersigning_integrity::{AcceptedRequest, Signals}; +use holochain_types::prelude::{AgentPubKey, CellId, EntryHash, PreflightResponse}; use holochain_types::signal::{Signal, SystemSignal}; use rand::seq::SliceRandom; use rand::thread_rng; @@ -21,6 +19,7 @@ pub struct ScenarioValues { initiate_with_peers: Vec, session_attempts: Arc, session_successes: Arc, + session_failures: Arc, } impl UserValuesConstraint for ScenarioValues {} @@ -115,6 +114,7 @@ fn agent_behaviour_initiate( let agent_name = ctx.agent_name().to_string(); let initiated = ctx.get().scenario_values.session_attempts.clone(); let initiated_success = ctx.get().scenario_values.session_successes.clone(); + let initiated_failure = ctx.get().scenario_values.session_failures.clone(); let new_peers = ctx .runner_context() @@ -193,27 +193,57 @@ fn agent_behaviour_initiate( client.clone(), my_preflight_response, session_timeout, - agent_pub_key, - agent_name.clone(), + agent_pub_key.clone(), cell_id.clone(), app_port, - start, - initiated_success.clone(), - reporter, ) .await { - Ok(_) => { - // Completed successfully + Ok(retry_count) => { + let elapsed = start.elapsed(); + + log::debug!( + "Completed countersigning session with agent {:?}", + agent_pub_key + ); + + let initiated_success = initiated_success + .fetch_add(1, std::sync::atomic::Ordering::Acquire); + reporter.add_custom( + ReportMetric::new("countersigning_session_initiated_success") + .with_tag("agent", agent_name.clone()) + .with_tag("retries", retry_count as u64) + .with_field("value", (initiated_success + 1) as u64), + ); + reporter.add_custom( + ReportMetric::new("countersigning_session_initiated_duration") + .with_tag("agent", agent_name) + .with_tag("failed", false) + .with_field("value", elapsed.as_secs_f64()), + ); } Err(e) => { + let elapsed = start.elapsed(); + log::warn!( - "Failed to run initiated session, waiting for it to time out: {:?}", + "Failed countersigning session with agent {:?}: {:?}", + agent_pub_key, e ); - // TODO this can be replaced with listening for the abandoned signal - tokio::time::sleep_until(session_timeout).await; + let initiated_failure = initiated_failure + .fetch_add(1, std::sync::atomic::Ordering::Acquire); + reporter.add_custom( + ReportMetric::new("countersigning_session_initiated_failure") + .with_tag("agent", agent_name.clone()) + .with_field("value", (initiated_failure + 1) as u64), + ); + reporter.add_custom( + ReportMetric::new("countersigning_session_initiated_duration") + .with_tag("agent", agent_name) + .with_tag("failed", true) + .with_field("value", elapsed.as_secs_f64()), + ); } } @@ -231,19 +261,14 @@ fn agent_behaviour_initiate( Ok(()) } -#[allow(clippy::too_many_arguments)] async fn run_initiated_session( client: TryCPClient, my_preflight_response: PreflightResponse, session_timeout: Instant, agent_pub_key: AgentPubKey, - agent_name: String, cell_id: CellId, app_port: u16, - start: Instant, - initiated_success: Arc, - reporter: Arc, -) -> anyhow::Result<()> { +) -> anyhow::Result { loop { // Now listen for a signal from the remote with their acceptance let signal = tokio::time::timeout_at(session_timeout, client.recv_signal()).await.with_context(|| format!("Agent [{agent_pub_key:?}] did not respond to the countersigning request in time, abandoning"))?; @@ -262,8 +287,8 @@ async fn run_initiated_session( let other_response = match signal.clone().into_inner().decode::() { Ok(Signals::Response(response)) - if session_fingerprint(response.request())? - == session_fingerprint(my_preflight_response.request())? => + if response.request().fingerprint()? + == my_preflight_response.request().fingerprint()? => { response } @@ -272,8 +297,8 @@ async fn run_initiated_session( continue; } Err(_) => { - // Must be resilient to unexpected signals, somebody else might try to initiate with us while we're already - // working with another peer. + // We shouldn't really be getting signals that don't decode but choosing to + // filter them out here. log::debug!("Got an unexpected signal, will try again. {:?}", signal); continue; } @@ -284,7 +309,7 @@ async fn run_initiated_session( agent_pub_key ); - let retry_count = complete_session( + return complete_session( client.clone(), app_port, cell_id.clone(), @@ -292,39 +317,13 @@ async fn run_initiated_session( other_response, session_timeout, ) - .await - .context("Initiator failed to complete session")?; - - let elapsed = start.elapsed(); - - log::debug!( - "Completed the countersigning session with agent {:?}", - agent_pub_key - ); - - let initiated_success = - initiated_success.fetch_add(1, std::sync::atomic::Ordering::Acquire); - reporter.add_custom( - ReportMetric::new("countersigning_session_initiated_success") - .with_tag("agent", agent_name.clone()) - .with_field("retries", retry_count as u64) - .with_field("value", initiated_success as u64), - ); - reporter.add_custom( - ReportMetric::new("countersigning_session_initiated_duration") - .with_tag("agent", agent_name) - .with_field("value", elapsed.as_secs_f64()), - ); - - break; + .await; } None => { log::warn!("No signal received, problem with the remote? Will try again."); } } } - - Ok(()) } fn agent_behaviour_participate( @@ -339,6 +338,7 @@ fn agent_behaviour_participate( let agent_name = ctx.agent_name().to_string(); let accepted = ctx.get().scenario_values.session_attempts.clone(); let accepted_success = ctx.get().scenario_values.session_successes.clone(); + let accepted_failure = ctx.get().scenario_values.session_failures.clone(); ctx.runner_context().executor().execute_in_place( async move { @@ -390,45 +390,48 @@ fn agent_behaviour_participate( (session_times.end.as_millis() - session_times.start.as_millis()) as u64, )); - log::debug!("Another party has initiated a countersigning session."); - - let response = client.call_zome( - app_port, - cell_id.clone(), - "countersigning", - "accept_two_party", - request.preflight_request, - None, - ).await?; - - log::debug!("Accepted the incoming session, proceeding to commit."); + match run_accepted_session(client, request, session_timeout, cell_id, app_port).await { + Ok(retry_count) => { + let elapsed = start.elapsed(); + + log::debug!("Completed countersigning session with the initiating party."); + + let accepted_success = accepted_success.fetch_add(1, std::sync::atomic::Ordering::Acquire); + reporter.add_custom( + ReportMetric::new("countersigning_session_accepted_success") + .with_tag("agent", agent_name.clone()) + .with_tag("retries", retry_count as u64) + .with_field("value", (accepted_success + 1) as u64), + ); + reporter.add_custom( + ReportMetric::new("countersigning_session_accepted_duration") + .with_tag("agent", agent_name) + .with_tag("failed", false) + .with_field("value", elapsed.as_secs_f64()), + ); + }, + Err(e) => { + let elapsed = start.elapsed(); - let my_accept_response: PreflightResponse = response.decode().map_err(|e| anyhow::anyhow!("Decoding failure: {:?}", e))?; + log::warn!("Failed countersigning session with the initiating party: {:?}", e); - let retry_count = match complete_session(client.clone(), app_port, cell_id.clone(), request.preflight_response, my_accept_response, session_timeout).await { - Ok(retry_count) => retry_count, - Err(e) => { // If we got a fatal error rather than a successful session, wait for the session to expire before trying again tokio::time::sleep_until(session_timeout).await; - return Err(e).context("Acceptor failed to complete session"); + + let accepted_failure = accepted_failure.fetch_add(1, std::sync::atomic::Ordering::Acquire); + reporter.add_custom( + ReportMetric::new("countersigning_session_accepted_failure") + .with_tag("agent", agent_name.clone()) + .with_field("value", (accepted_failure + 1) as u64), + ); + reporter.add_custom( + ReportMetric::new("countersigning_session_accepted_duration") + .with_tag("agent", agent_name) + .with_tag("failed", true) + .with_field("value", elapsed.as_secs_f64()), + ); } }; - let elapsed = start.elapsed(); - - log::debug!("Completed the countersigning session with the initiating party."); - - let accepted_success = accepted_success.fetch_add(1, std::sync::atomic::Ordering::Acquire); - reporter.add_custom( - ReportMetric::new("countersigning_session_accepted_success") - .with_tag("agent", agent_name.clone()) - .with_field("retries", retry_count as u64) - .with_field("value", accepted_success as u64), - ); - reporter.add_custom( - ReportMetric::new("countersigning_session_accepted_duration") - .with_tag("agent", agent_name) - .with_field("value", elapsed.as_secs_f64()), - ); break; } @@ -445,15 +448,54 @@ fn agent_behaviour_participate( Ok(()) } +async fn run_accepted_session( + client: TryCPClient, + request: AcceptedRequest, + session_timeout: Instant, + cell_id: CellId, + app_port: u16, +) -> anyhow::Result { + log::debug!("Another party has initiated a countersigning session."); + + let response = client + .call_zome( + app_port, + cell_id.clone(), + "countersigning", + "accept_two_party", + request.preflight_request, + None, + ) + .await?; + + log::debug!("Accepted the incoming session, proceeding to commit."); + + let my_accept_response: PreflightResponse = response + .decode() + .map_err(|e| anyhow::anyhow!("Decoding failure: {:?}", e))?; + + complete_session( + client.clone(), + app_port, + cell_id.clone(), + request.preflight_response, + my_accept_response, + session_timeout, + ) + .await +} + fn agent_teardown( ctx: &mut AgentContext>, ) -> HookResult { + log::debug!("Downloading logs for agent {}", ctx.agent_name()); if let Err(e) = dump_logs(ctx) { log::warn!("Failed to dump logs: {:?}", e); } // Best effort to remove data and cleanup. // You should comment out this line if you want to examine the result of the scenario run! + log::debug!("Resetting TryCP remote from agent {}", ctx.agent_name()); let _ = reset_trycp_remote(ctx); // Alternatively, you can just shut down the remote conductor instead of shutting it down and removing data. @@ -495,13 +537,16 @@ async fn complete_session( } Err(e) => { if Instant::now() > session_timeout { + // We haven't been able to commit our entry by the end of the countersigning + // session time, so we should abandon the attempt. This is safe because we + // haven't published a signature. return Err(e).context(format!( "Abandoning commit attempt because the session timed out on attempt {}", i )); } else if e .chain() - .any(|e| e.to_string().contains("was not found on the DHT")) + .any(|e| e.to_string().contains("DepMissingFromDht")) { // Skip logging this message, it's what we're expecting to take some time in this retry loop } else if e.chain().any(|e| { @@ -527,25 +572,11 @@ async fn complete_session( match await_countersigning_success( client.clone(), initiate_preflight_response.request.app_entry_hash, - session_timeout, ) .await { Ok(_) => {} Err(e) => { - // Try to force unlock the chain - client - .call_zome( - app_port, - cell_id.clone(), - "countersigning", - "create_anything", - (), - None, - ) - .await - .ok(); - return Err(e).with_context(|| { format!( "Session between [{:?}] did not complete within the session time", @@ -555,7 +586,7 @@ async fn complete_session( } } - log::info!( + log::debug!( "Completed countersigning session with retry count: {}", retry_count ); @@ -563,22 +594,14 @@ async fn complete_session( Ok(retry_count) } -fn session_fingerprint(preflight_request: &PreflightRequest) -> anyhow::Result> { - let hash = holo_hash::encode::blake2b_256( - &holochain_serialized_bytes::encode(preflight_request) - .context("Failed to serialize preflight request")?, - ); - - Ok(hash) -} - async fn await_countersigning_success( client: TryCPClient, session_entry_hash: EntryHash, - session_timeout: Instant, ) -> HookResult { loop { - let signal = tokio::time::timeout_at(session_timeout, client.recv_signal()).await?; + // Note that we don't expect the session timeout here. We will wait for Holochain to + // make a decision and not assume that the session is resolved at the end time. + let signal = client.recv_signal().await; match signal { Some(signal) => { match rmp_serde::decode::from_slice::(&signal.data).map_err(|e| { @@ -591,10 +614,20 @@ async fn await_countersigning_success( break; } Signal::System(SystemSignal::SuccessfulCountersigning(_)) => { - // This shouldn't happen because the scenario should only be running one at a time. There's a bug if this log message shows up. + // This shouldn't happen because only one countersigning session can be active at a time. There's a bug if this log message shows up. log::warn!("Received a successful countersigning signal for a different session, listening for other signals."); continue; } + Signal::System(SystemSignal::AbandonedCountersigning(eh)) + if eh == session_entry_hash => + { + return Err(anyhow::anyhow!("Countersigning session was abandoned")); + } + Signal::System(SystemSignal::AbandonedCountersigning(_)) => { + // This shouldn't happen because only one countersigning session can be active at a time. There's a bug if this log message shows up. + log::warn!("Received an abandoned countersigning signal for a different session, listening for other signals."); + continue; + } // Note that this might include other initiations. Since we will ignore the signal here, the initiator will have to wait for the timeout. signal => { log::debug!("Received a signal that is not a successful countersigning signal, listening for other signals. {:?}", signal); From 0457d6df3056ce5f4f66f5099d9b9e9d2c83e818 Mon Sep 17 00:00:00 2001 From: ThetaSinner Date: Mon, 30 Sep 2024 16:17:09 +0100 Subject: [PATCH 3/4] Run with DPKI disabled --- conductor-config-ci.yaml | 10 +++++++--- conductor-config.yaml | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/conductor-config-ci.yaml b/conductor-config-ci.yaml index d4d5a908..b6e2335f 100644 --- a/conductor-config-ci.yaml +++ b/conductor-config-ci.yaml @@ -1,9 +1,13 @@ -danger_generate_throwaway_device_seed: true +#danger_generate_throwaway_device_seed: true +#dpki: +# dna_path: ~ +# network_seed: wind-tunnel-test +# allow_throwaway_random_dpki_agent_key: true +# no_dpki: false dpki: dna_path: ~ network_seed: wind-tunnel-test - allow_throwaway_random_dpki_agent_key: true - no_dpki: false + no_dpki: true network: network_type: quic_bootstrap transport_pool: diff --git a/conductor-config.yaml b/conductor-config.yaml index d973c1da..66bd3e34 100644 --- a/conductor-config.yaml +++ b/conductor-config.yaml @@ -1,9 +1,13 @@ -danger_generate_throwaway_device_seed: true +#danger_generate_throwaway_device_seed: true +#dpki: +# dna_path: ~ +# network_seed: wind-tunnel-test +# allow_throwaway_random_dpki_agent_key: true +# no_dpki: false dpki: dna_path: ~ network_seed: wind-tunnel-test - allow_throwaway_random_dpki_agent_key: true - no_dpki: false + no_dpki: true network: network_type: quic_bootstrap transport_pool: From fb6877cc69236f85ec40b6685a7cc3897b562fb0 Mon Sep 17 00:00:00 2001 From: ThetaSinner Date: Tue, 1 Oct 2024 13:51:12 +0100 Subject: [PATCH 4/4] Review changes --- Cargo.lock | 2 -- scenarios/two_party_countersigning/Cargo.toml | 2 -- scenarios/two_party_countersigning/src/main.rs | 16 ++++++++-------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8f8deee7..228c736a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4918,8 +4918,6 @@ dependencies = [ "anyhow", "countersigning_integrity", "happ_builder", - "holo_hash", - "holochain_serialized_bytes", "holochain_types", "log", "rand 0.8.5", diff --git a/scenarios/two_party_countersigning/Cargo.toml b/scenarios/two_party_countersigning/Cargo.toml index 403f4765..a1d8624c 100644 --- a/scenarios/two_party_countersigning/Cargo.toml +++ b/scenarios/two_party_countersigning/Cargo.toml @@ -12,8 +12,6 @@ log = { workspace = true } rmp-serde = { workspace = true } holochain_types = { workspace = true } -holo_hash = { workspace = true } -holochain_serialized_bytes = { workspace = true } trycp_wind_tunnel_runner = { workspace = true } countersigning_integrity = { workspace = true } diff --git a/scenarios/two_party_countersigning/src/main.rs b/scenarios/two_party_countersigning/src/main.rs index a94026a4..530fe74a 100644 --- a/scenarios/two_party_countersigning/src/main.rs +++ b/scenarios/two_party_countersigning/src/main.rs @@ -154,7 +154,7 @@ fn agent_behaviour_initiate( ); let start = Instant::now(); - let initiated = initiated.fetch_add(1, std::sync::atomic::Ordering::Acquire); + let initiated = initiated.fetch_add(1, std::sync::atomic::Ordering::Relaxed); reporter.add_custom( ReportMetric::new("countersigning_session_initiated") .with_tag("agent", agent_name.clone()) @@ -208,7 +208,7 @@ fn agent_behaviour_initiate( ); let initiated_success = initiated_success - .fetch_add(1, std::sync::atomic::Ordering::Acquire); + .fetch_add(1, std::sync::atomic::Ordering::Relaxed); reporter.add_custom( ReportMetric::new("countersigning_session_initiated_success") .with_tag("agent", agent_name.clone()) @@ -232,7 +232,7 @@ fn agent_behaviour_initiate( ); let initiated_failure = initiated_failure - .fetch_add(1, std::sync::atomic::Ordering::Acquire); + .fetch_add(1, std::sync::atomic::Ordering::Relaxed); reporter.add_custom( ReportMetric::new("countersigning_session_initiated_failure") .with_tag("agent", agent_name.clone()) @@ -376,7 +376,7 @@ fn agent_behaviour_participate( }; let start = Instant::now(); - let accepted = accepted.fetch_add(1, std::sync::atomic::Ordering::Acquire); + let accepted = accepted.fetch_add(1, std::sync::atomic::Ordering::Relaxed); reporter.add_custom( ReportMetric::new("countersigning_session_accepted") .with_tag("agent", agent_name.clone()) @@ -396,7 +396,7 @@ fn agent_behaviour_participate( log::debug!("Completed countersigning session with the initiating party."); - let accepted_success = accepted_success.fetch_add(1, std::sync::atomic::Ordering::Acquire); + let accepted_success = accepted_success.fetch_add(1, std::sync::atomic::Ordering::Relaxed); reporter.add_custom( ReportMetric::new("countersigning_session_accepted_success") .with_tag("agent", agent_name.clone()) @@ -418,7 +418,7 @@ fn agent_behaviour_participate( // If we got a fatal error rather than a successful session, wait for the session to expire before trying again tokio::time::sleep_until(session_timeout).await; - let accepted_failure = accepted_failure.fetch_add(1, std::sync::atomic::Ordering::Acquire); + let accepted_failure = accepted_failure.fetch_add(1, std::sync::atomic::Ordering::Relaxed); reporter.add_custom( ReportMetric::new("countersigning_session_accepted_failure") .with_tag("agent", agent_name.clone()) @@ -615,7 +615,7 @@ async fn await_countersigning_success( } Signal::System(SystemSignal::SuccessfulCountersigning(_)) => { // This shouldn't happen because only one countersigning session can be active at a time. There's a bug if this log message shows up. - log::warn!("Received a successful countersigning signal for a different session, listening for other signals."); + log::error!("Received a successful countersigning signal for a different session, listening for other signals."); continue; } Signal::System(SystemSignal::AbandonedCountersigning(eh)) @@ -625,7 +625,7 @@ async fn await_countersigning_success( } Signal::System(SystemSignal::AbandonedCountersigning(_)) => { // This shouldn't happen because only one countersigning session can be active at a time. There's a bug if this log message shows up. - log::warn!("Received an abandoned countersigning signal for a different session, listening for other signals."); + log::error!("Received an abandoned countersigning signal for a different session, listening for other signals."); continue; } // Note that this might include other initiations. Since we will ignore the signal here, the initiator will have to wait for the timeout.