Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
elliedavidson committed Jul 10, 2023
1 parent 5ecc17f commit 1aa598d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 29 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub mod types;

pub mod tasks;

use crate::tasks::da_filter;
use crate::tasks::committee_filter;
use crate::tasks::view_sync_filter;
use hotshot_task::task::FilterEvent;

Expand Down Expand Up @@ -877,7 +877,7 @@ where
task_runner,
internal_event_stream.clone(),
committee_exchange.clone(),
FilterEvent(Arc::new(da_filter)),
FilterEvent(Arc::new(committee_filter)),
)
.await;
let task_runner = add_network_task(
Expand Down
2 changes: 1 addition & 1 deletion src/tasks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ pub fn quorum_filter<
}
}

pub fn da_filter<
pub fn committee_filter<
TYPES: NodeType<ConsensusType = SequencingConsensus>,
I: NodeImplementation<
TYPES,
Expand Down
25 changes: 15 additions & 10 deletions task-impls/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,10 +452,16 @@ where
}
}
}
error!("Couldn't find DAC cert in certs, meaning we haven't received it yet for view {}", *self.cur_view);
error!(
"Couldn't find DAC cert in certs, meaning we haven't received it yet for view {}",
*self.cur_view
);
return false;
}
error!("Could not vote because we don't have a proposal yet for view {}", *self.cur_view);
error!(
"Could not vote because we don't have a proposal yet for view {}",
*self.cur_view
);
return false;
}

Expand Down Expand Up @@ -754,15 +760,14 @@ where
}
});

// Because we call the vote if able function above
// if let GeneralConsensusMessage::Vote(vote) = message {
// info!("Sending vote to next leader {:?}", vote);
// error!("Vote is {:?}", vote.current_view());
if let GeneralConsensusMessage::Vote(vote) = message {
info!("Sending vote to next leader {:?}", vote);
error!("Vote is {:?}", vote.current_view());

// self.event_stream
// .publish(SequencingHotShotEvent::QuorumVoteSend(vote))
// .await;
// };
self.event_stream
.publish(SequencingHotShotEvent::QuorumVoteSend(vote))
.await;
};
}
}
}
Expand Down
16 changes: 0 additions & 16 deletions task-impls/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,22 +254,6 @@ impl<
return None;
}

/// Filter network event.
pub fn filter(event: &SequencingHotShotEvent<TYPES, I>) -> bool {
match event {
SequencingHotShotEvent::QuorumProposalSend(_, _)
| SequencingHotShotEvent::QuorumVoteSend(_)
| SequencingHotShotEvent::DAProposalSend(_, _)
| SequencingHotShotEvent::DAVoteSend(_)
| SequencingHotShotEvent::ViewSyncVoteSend(_)
| SequencingHotShotEvent::ViewSyncCertificateSend(_, _)
| SequencingHotShotEvent::Shutdown
| SequencingHotShotEvent::ViewChange(_)
| SequencingHotShotEvent::TransactionSend(_) => true,

_ => false,
}
}
}

#[derive(Snafu, Debug)]
Expand Down

0 comments on commit 1aa598d

Please sign in to comment.