mirror of
https://github.com/logos-co/nomos-simulations.git
synced 2025-01-27 10:54:48 +00:00
Add logging for data messages
This commit is contained in:
parent
6bc6193e7a
commit
77fa6ae289
@ -243,6 +243,11 @@ impl Node for MixNode {
|
|||||||
if let Poll::Ready(Some(_)) = pin!(&mut self.data_msg_lottery_interval).poll_next(&mut cx) {
|
if let Poll::Ready(Some(_)) = pin!(&mut self.data_msg_lottery_interval).poll_next(&mut cx) {
|
||||||
if self.data_msg_lottery.run() {
|
if self.data_msg_lottery.run() {
|
||||||
let payload = self.build_message_payload();
|
let payload = self.build_message_payload();
|
||||||
|
tracing::info!(
|
||||||
|
"Publishing message: node:{}, payload:{:?}",
|
||||||
|
self.id,
|
||||||
|
payload
|
||||||
|
);
|
||||||
let message = self.crypto_processor.wrap_message(&payload).unwrap();
|
let message = self.crypto_processor.wrap_message(&payload).unwrap();
|
||||||
self.persistent_sender.send(message).unwrap();
|
self.persistent_sender.send(message).unwrap();
|
||||||
}
|
}
|
||||||
@ -251,7 +256,6 @@ impl Node for MixNode {
|
|||||||
// TODO: Generate cover message with probability
|
// TODO: Generate cover message with probability
|
||||||
|
|
||||||
for message in self.receive() {
|
for message in self.receive() {
|
||||||
// println!(">>>>> Node {}, message: {message:?}", self.id);
|
|
||||||
self.forward(message.clone());
|
self.forward(message.clone());
|
||||||
self.blend_sender.send(message.0).unwrap();
|
self.blend_sender.send(message.0).unwrap();
|
||||||
}
|
}
|
||||||
@ -262,8 +266,12 @@ impl Node for MixNode {
|
|||||||
MixOutgoingMessage::Outbound(msg) => {
|
MixOutgoingMessage::Outbound(msg) => {
|
||||||
self.persistent_sender.send(msg).unwrap();
|
self.persistent_sender.send(msg).unwrap();
|
||||||
}
|
}
|
||||||
MixOutgoingMessage::FullyUnwrapped(_) => {
|
MixOutgoingMessage::FullyUnwrapped(payload) => {
|
||||||
println!("fully unwrapped message: Node:{}", self.id);
|
tracing::info!(
|
||||||
|
"Fully unwrapped message: node:{}, payload:{:?}",
|
||||||
|
self.id,
|
||||||
|
payload,
|
||||||
|
);
|
||||||
self.state.num_messages_broadcasted += 1;
|
self.state.num_messages_broadcasted += 1;
|
||||||
//TODO: create a tracing event
|
//TODO: create a tracing event
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user