github.com/ari-anchor/sei-tendermint@v0.0.0-20230519144642-dc826b7b56bb/spec/consensus/proposer-based-timestamp/tla/MC_PBT.tla (about) 1 ----------------------------- MODULE MC_PBT ------------------------------- 2 CONSTANT 3 \* @type: ROUND -> PROCESS; 4 Proposer 5 6 VARIABLES 7 \* @type: PROCESS -> ROUND; 8 round, \* a process round number 9 \* @type: PROCESS -> STEP; 10 step, \* a process step 11 \* @type: PROCESS -> DECISION; 12 decision, \* process decision 13 \* @type: PROCESS -> VALUE; 14 lockedValue, \* a locked value 15 \* @type: PROCESS -> ROUND; 16 lockedRound, \* a locked round 17 \* @type: PROCESS -> PROPOSAL; 18 validValue, \* a valid value 19 \* @type: PROCESS -> ROUND; 20 validRound \* a valid round 21 22 \* time-related variables 23 VARIABLES 24 \* @type: PROCESS -> TIME; 25 localClock, \* a process local clock: Corr -> Ticks 26 \* @type: TIME; 27 realTime \* a reference Newtonian real time 28 29 \* book-keeping variables 30 VARIABLES 31 \* @type: ROUND -> Set(PROPMESSAGE); 32 msgsPropose, \* PROPOSE messages broadcast in the system, Rounds -> Messages 33 \* @type: ROUND -> Set(PREMESSAGE); 34 msgsPrevote, \* PREVOTE messages broadcast in the system, Rounds -> Messages 35 \* @type: ROUND -> Set(PREMESSAGE); 36 msgsPrecommit, \* PRECOMMIT messages broadcast in the system, Rounds -> Messages 37 \* @type: Set(MESSAGE); 38 evidence, \* the messages that were used by the correct processes to make transitions 39 \* @type: ACTION; 40 action, \* we use this variable to see which action was taken 41 \* @type: PROCESS -> Set(PROPMESSAGE); 42 receivedTimelyProposal, \* used to keep track when a process receives a timely VALUE message 43 \* @type: <<ROUND,PROCESS>> -> TIME; 44 inspectedProposal \* used to keep track when a process tries to receive a message 45 46 \* Invariant support 47 VARIABLES 48 \* @type: ROUND -> TIME; 49 beginRound, \* the minimum of the local clocks at the time any process entered a new round 50 \* @type: PROCESS -> TIME; 51 endConsensus, \* the local time when a decision is made 52 \* @type: ROUND -> TIME; 53 lastBeginRound, \* the maximum of the local clocks in each round 54 \* @type: ROUND -> TIME; 55 proposalTime, \* the real time when a proposer proposes in a round 56 \* @type: ROUND -> TIME; 57 proposalReceivedTime \* the real time when a correct process first receives a proposal message in a round 58 59 60 INSTANCE TendermintPBT_002_draft WITH 61 Corr <- {"c1", "c2"}, 62 Faulty <- {"f3", "f4"}, 63 N <- 4, 64 T <- 1, 65 ValidValues <- { "v0", "v1" }, 66 InvalidValues <- {"v2"}, 67 MaxRound <- 5, 68 MaxTimestamp <- 10, 69 MinTimestamp <- 2, 70 Delay <- 2, 71 Precision <- 2 72 73 \* run Apalache with --cinit=CInit 74 CInit == \* the proposer is arbitrary -- works for safety 75 Proposer \in [Rounds -> AllProcs] 76 77 =============================================================================