Bugfix/verloc fixes and adjustments (#618)
* Using new display trait for identity key * Establishing verloc connection with timeout * Further decrease in log severity * Writing echo packets with timeout * Sender formatting * ConnectionWriteTimeout error definition * Writing verloc results in chunks * Added run started and run finished fields to verloc * Reordered the fields * Storing the timestamps as options to indicate run in progress
This commit is contained in:
committed by
GitHub
parent
0dcb046576
commit
93e9dc5c1e
@@ -1,4 +1,4 @@
|
||||
use mixnode_common::rtt_measurement::{AtomicVerlocResult, Verloc};
|
||||
use mixnode_common::rtt_measurement::{AtomicVerlocResult, VerlocResult};
|
||||
use rocket::State;
|
||||
use rocket_contrib::json::Json;
|
||||
|
||||
@@ -17,7 +17,7 @@ impl VerlocState {
|
||||
/// Provides verifiable location (verloc) measurements for this mixnode - a list of the
|
||||
/// round-trip times, in milliseconds, for all other mixnodes that this node knows about.
|
||||
#[get("/verloc")]
|
||||
pub(crate) async fn verloc(state: State<'_, VerlocState>) -> Json<Vec<Verloc>> {
|
||||
pub(crate) async fn verloc(state: State<'_, VerlocState>) -> Json<VerlocResult> {
|
||||
// since it's impossible to get a mutable reference to the state, we can't cache any results outside the lock : (
|
||||
Json(state.shared.clone_data().await)
|
||||
}
|
||||
|
||||
@@ -144,6 +144,7 @@ impl MixNode {
|
||||
let config = rtt_measurement::ConfigBuilder::new()
|
||||
.listening_address(listening_address)
|
||||
.packets_per_node(self.config.get_measurement_packets_per_node())
|
||||
.connection_timeout(self.config.get_measurement_connection_timeout())
|
||||
.packet_timeout(self.config.get_measurement_packet_timeout())
|
||||
.delay_between_packets(self.config.get_measurement_delay_between_packets())
|
||||
.tested_nodes_batch_size(self.config.get_measurement_tested_nodes_batch_size())
|
||||
|
||||
Reference in New Issue
Block a user