From 2bae6ad7e109f90e2e0c10d4e18c43c3fe3b12df Mon Sep 17 00:00:00 2001 From: mjalalzai <33738574+MForensic@users.noreply.github.com> Date: Mon, 27 Mar 2023 09:43:14 -0700 Subject: [PATCH] updating try_to_commit_grand_parent to update last_committed_view --- carnot/spec.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/carnot/spec.md b/carnot/spec.md index 70a28e8..236cb91 100644 --- a/carnot/spec.md +++ b/carnot/spec.md @@ -202,7 +202,7 @@ def receive_block(block: Block): # current_view += 1 # reset_timer() increment_view_qc(block.qc) - if try_to_commit_grandparent(block) + ``` ##### Auxiliary functions @@ -237,11 +237,14 @@ def safe_block_qc (block: Block): def try_to_commit_grand_parent(block: Block): parent = block.parent() grand_parent = parent.parent() - return ( - parent.view == (grand_parent.view + 1) and + if (parent.view == (grand_parent.view + 1) and isinstance(block.qc, (StandardQc, )) and # Q: Is this necessary? Yes, this is very important for safety. isinstance(parent.qc, (StandardQc, )) # Q: Is this necessary? - ) + ): + LAST_COMMITTED_VIEW=grand_parent.view + return true + else: + return false # Update last_committed_view ? (Ans: Yes, last_committed_view has to be updated.) ```