Skip to content

Commit

Permalink
Merge pull request #2818 from AleoHQ/temporary/disable-prop
Browse files Browse the repository at this point in the history
Disable propagation on solutions until transmission storage updates
  • Loading branch information
howardwu authored Nov 1, 2023
2 parents 62b7977 + 96e0b7d commit db2e597
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
7 changes: 4 additions & 3 deletions node/consensus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,10 @@ impl<N: Network> Consensus<N> {
}
// Add the solution to the memory pool.
trace!("Received unconfirmed solution '{}' in the queue", fmt_id(solution_id));
if self.solutions_queue.lock().insert(solution_id, solution).is_some() {
bail!("Solution '{}' exists in the memory pool", fmt_id(solution_id));
}
// TODO (howardwu) - Attention, this is being disabled temporarily until transmission storage is updated.
// if self.solutions_queue.lock().insert(solution_id, solution).is_some() {
// bail!("Solution '{}' exists in the memory pool", fmt_id(solution_id));
// }
}

// If the memory pool of this node is full, return early.
Expand Down
23 changes: 12 additions & 11 deletions node/src/validator/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,18 +235,19 @@ impl<N: Network, C: ConsensusStorage<N>> Inbound<N> for Validator<N, C> {
/// Propagates the unconfirmed solution to all connected validators.
async fn unconfirmed_solution(
&self,
peer_ip: SocketAddr,
serialized: UnconfirmedSolution<N>,
solution: ProverSolution<N>,
_peer_ip: SocketAddr,
_serialized: UnconfirmedSolution<N>,
_solution: ProverSolution<N>,
) -> bool {
// Add the unconfirmed solution to the memory pool.
if let Err(error) = self.consensus.add_unconfirmed_solution(solution).await {
trace!("[UnconfirmedSolution] {error}");
return true; // Maintain the connection.
}
let message = Message::UnconfirmedSolution(serialized);
// Propagate the "UnconfirmedSolution" to the connected validators.
self.propagate_to_validators(message, &[peer_ip]);
// TODO (howardwu) - Attention, this is being disabled temporarily until transmission storage is updated.
// // Add the unconfirmed solution to the memory pool.
// if let Err(error) = self.consensus.add_unconfirmed_solution(solution).await {
// trace!("[UnconfirmedSolution] {error}");
// return true; // Maintain the connection.
// }
// let message = Message::UnconfirmedSolution(serialized);
// // Propagate the "UnconfirmedSolution" to the connected validators.
// self.propagate_to_validators(message, &[peer_ip]);
true
}

Expand Down

0 comments on commit db2e597

Please sign in to comment.