From a877d42be58e9bd9c8bec463e3838bbda4355a52 Mon Sep 17 00:00:00 2001 From: mjalalzai <33738574+MForensic@users.noreply.github.com> Date: Tue, 21 Mar 2023 00:24:34 -0700 Subject: [PATCH] timeout --- .idea/nomos-specs.iml | 6 ++++-- carnot/spec.md | 22 ++++++++++++++++------ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.idea/nomos-specs.iml b/.idea/nomos-specs.iml index 5e764c4..c8bfff0 100644 --- a/.idea/nomos-specs.iml +++ b/.idea/nomos-specs.iml @@ -2,8 +2,10 @@ - - + + + + \ No newline at end of file diff --git a/carnot/spec.md b/carnot/spec.md index c819133..e5c66aa 100644 --- a/carnot/spec.md +++ b/carnot/spec.md @@ -1,11 +1,12 @@ -# Carnot Specification -This is the pseudocode specification of the Carnot consensus algorithm. +Psuedocode specification of the Carnot consensus algorithm. In this specification we will omit any cryptographic material, block validity and proof checks. A real implementation is expected to check those before hitting this code. In addition, all types can be expected to have their invariants checked by the type contract, e.g. in an instance of type `Qc::Aggregate` the `high_qc` field is always the most recent qc among the aggregate qcs and the code can skip this check. 'Q:' is used to indicate unresolved questions. Notation is loosely based on CDDL. + + ## Messages A critical piece in the protocol, these are the different kind of messages used by participants during the protocol execution. * `Block`: propose a new block @@ -136,7 +137,16 @@ LATEST_COMMITTED_VIEW: View HIGH_COMMITTED_QC:Qc # This is not needed for consensus but actually helps a lot for any node fallen behind to catchup. COLLECTION: Q? ``` +```python +def member_of_internal_com(): + pass +def member_of_root(): + pass + +def member_of_leaf(): + pass +``` ## Available Functions The following functions are expected to be available to participants during the execution of the protocol: @@ -365,14 +375,14 @@ Func receive(newView) { ### Timeout ```python def timeout(): - if (member_of_internal_com() AND not member_of_root()) OR member_of_leaf: - let timeoutMsg = create_newView(CURRENT_VIEW,HIGH_QC,HIGH_COMMITTED_QC, TIMEOUT_QC) + if member_of_internal_com() and not member_of_root() or member_of_leaf(): + timeoutMsg = create_timeout(CURRENT_VIEW,HIGH_QC,HIGH_COMMITTED_QC, TIMEOUT_QC) send(timeoutMsg, parent_committee()) if member_of_root(): - let timeoutMsg = create_newView(CURRENT_VIEW,HIGH_QC,HIGH_COMMITTED_QC, TIMEOUT_QC) - send(timeoutMsg,root_committee()) # Need to be discussed. It can only be sent to the next leader but since the RB needs agreement to generate the seed for the leader+overlay, therefore newView is sent to the root_committee(). + timeoutMsg = create_timeout(CURRENT_VIEW,HIGH_QC,HIGH_COMMITTED_QC, TIMEOUT_QC) + send(timeoutMsg, root_committee()) # Need to be discussed. It can only be sent to the next leader but since the RB needs agreement to generate the seed for the leader+overlay, therefore newView is sent to the root_committee(). ```