Skip to content

Commit

Permalink
fix: updating tla+ readme (#443)
Browse files Browse the repository at this point in the history
  • Loading branch information
b00f authored Apr 4, 2023
1 parent a8c6be9 commit a80bfb5
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions consensus/spec/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
The specification of Pactus consensus algorithm.
More info can be found here:
https://pactus.org/learn/consensus/consensus-mechanism.html
# Consensus specification

This folder contains the consensus specification for the Pactus blockchain,
which is based on the TLA+ formal language.
The specification defines the consensus algorithm used by the blockchain.

More info can be found [here](https://pactus.org/learn/consensus/specification/)

## Model checking

To run the model checker, you will need to download and install the [TLA+ Toolbox](https://lamport.azurewebsites.net/tla/toolbox.html),
which includes the TLC model checker. Follow the steps below to run the TLC model checker:

- Add the `Pactus_Liveness.tla` spec to your TLA+ Toolbox project.
- Create a new model and specify the temporal formula as `LiveSpec`.
- Specify the invariants formula as `TypeOK`.
- Specify the properties formula as `Success`.
- Since we are checking for liveness, add the `Constraint` formula as the "State Constraint".
- Define the required constants:
- `NumFaulty`: the number of faulty nodes (e.g. 1)
- `MaxHeight`: the maximum height of the system (e.g. 2)
- `MaxRound`: the maximum round of the consensus algorithm (e.g. 2)
- Run the TLC checker to check the correctness of the specification.

0 comments on commit a80bfb5

Please sign in to comment.