A TLA+ specification of the PirateShip consensus protocol. The model covers normal operation, view changes, Byzantine behavior, and crash faults, with safety properties checked by TLC.
pirateship.tlacontains the protocol specification.TLCpirateship.tlaadds TLC initialization and monitoring helpers.MCpirateship.tlaandMCpirateship*.cfgdefine exhaustive model checks.SIMpirateship.tlaandSIMpirateship*.cfgdefine randomized simulations.SIMpirateship.ipynbanalyzes simulation output.
Install Java, then download the
TLA+ tools and
Community Modules JARs
into the repository root as tla2tools.jar and CommunityModules-deps.jar.
Run an exhaustive crash-fault model check:
java -XX:+UseParallelGC -jar tla2tools.jar -workers auto \
-modelcheck MCpirateship.tla -config MCpirateshipCrash.cfgRun a randomized Byzantine-fault simulation:
java -Dtlc2.tool.Simulator.extendedStatistics=true \
-XX:+UseParallelGC -jar tla2tools.jar -workers auto \
-simulate SIMpirateship.tlaThe corresponding MCpirateship.cfg and SIMpirateshipCrash.cfg
configurations cover Byzantine model checking and crash-fault simulation.