From 37741364e4ac2abe07ed6ba87487ca765b4689b2 Mon Sep 17 00:00:00 2001 From: mjalalzai <33738574+MForensic@users.noreply.github.com> Date: Tue, 4 Apr 2023 18:09:29 -0700 Subject: [PATCH] Make sure view changes are incrementally done in ascending order. --- carnot/carnot.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/carnot/carnot.py b/carnot/carnot.py index ca400d9..fd080ff 100644 --- a/carnot/carnot.py +++ b/carnot/carnot.py @@ -325,9 +325,10 @@ class Carnot: self.broadcast(block) def local_timeout(self, new_overlay: Overlay): + # This condition makes sure a node waits for timeout_qc from root committee to change it's view. + assert (is_sequential_ascending(self.current_view, self.local_high_qc.view) or + is_sequential_ascending(self.current_view, self.last_timeout_view_qc.view)) self.increment_voted_view(self.current_view) - assert (is_sequential_ascending(self.current_view,self.local_high_qc.view) or - is_sequential_ascending(self.current_view,self.last_timeout_view_qc.view)) if self.overlay.member_of_root_committee(self.id) or self.overlay.child_of_root_committee(self.id): timeout_msg: Timeout = Timeout(