Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
durch committed Oct 7, 2024
1 parent a773160 commit 30f8fe0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion common/mixnode-common/src/packet_processor/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ pub enum MixProcessingError {
#[error("the received packet was set to use the very old and very much deprecated 'VPN' mode")]
ReceivedOldTypeVpnPacket,

#[error("failed to process received sphinx packet: {0}")]
#[error("failed to process received Nym packet: {0}")]
NymPacketProcessingError(#[from] PacketProcessingError),
}
2 changes: 1 addition & 1 deletion mixnode/src/node/listener/connection_handler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl ConnectionHandler {
// however, if it was a forward hop, we still need to delay it
nanos!("handle_received_packet", {
self.packet_processor
.node_stats_update_sender
.node_stats_update_sender()
.report_received();
match process_received_packet(framed_sphinx_packet, self.packet_processor().inner()) {
Err(err) => debug!("We failed to process received sphinx packet - {err}"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ use nym_sphinx::framing::processing::{process_framed_packet, MixProcessingResult

// PacketProcessor contains all data required to correctly unwrap and forward sphinx packets
#[derive(Clone)]
pub struct PacketProcessor {
pub(crate) struct PacketProcessor {
/// Responsible for performing unwrapping
pub inner_processor: SphinxPacketProcessor,
inner_processor: SphinxPacketProcessor,

/// Responsible for updating metrics data
pub node_stats_update_sender: node_statistics::UpdateSender,
node_stats_update_sender: node_statistics::UpdateSender,
}

impl PacketProcessor {
Expand All @@ -32,6 +32,10 @@ impl PacketProcessor {
pub fn inner(&self) -> &SphinxPacketProcessor {
&self.inner_processor
}

pub fn node_stats_update_sender(&self) -> &node_statistics::UpdateSender {
&self.node_stats_update_sender
}
}

pub fn process_received_packet(
Expand Down

0 comments on commit 30f8fe0

Please sign in to comment.