You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
2.0 KiB

  1. # Fast Sync Subprotocol Specification
  2. This directory contains English and TLA+ specifications for the FastSync
  3. protocol as it is currently implemented in the Tendermint Core codebase.
  4. ## English Specification
  5. The [English Specification](fastsync.md) provides a detailed description of the
  6. fast sync problem and the properties a correct protocol must satisfy. It also
  7. includes a detailed description of the protocol as currently implemented in Go,
  8. and an anlaysis of the implementation with respect to the properties.
  9. It was found that the current implementation does not satisfy certain
  10. properties, and is therefore not a correct solution to the fast sync problem.
  11. The issue discovered holds for all previous implementations of the protocol. A
  12. fix is described which is straight forward to implement.
  13. ## TLA+ Specification
  14. Two TLA+ specifications are provided: a high level [specification
  15. of the protocol](fastsync.tla) and a low level [specification of the scheduler
  16. component of the implementation](scheduler.tla). Both specifications contain
  17. properties that may be checked by the TLC model checker, though only for small
  18. values of the relevant parameters.
  19. We will continue to refine these specifications in our research work,
  20. to deduplicate
  21. the redundancies between them, improve their utility to researchers and
  22. engineers, and to improve their verifiability. For now, they provide a complete
  23. description of the fast sync protocol in TLA+; especially the
  24. [scheduler.tla](scheduler.tla), which maps very closely to the current
  25. implementation of the [scheduler in Go](https://github.com/tendermint/tendermint/blob/master/blockchain/v2/scheduler.go).
  26. The [scheduler.tla](scheduler.tla) can be model checked in TLC with the following
  27. parameters:
  28. - Constants:
  29. - numRequests <- 2
  30. - PeerIDs <- 0..2
  31. - ultimateHeight <- 3
  32. - Invariants:
  33. - TypeOK
  34. - Properties:
  35. - TerminationWhenNoAdvance
  36. - TerminationGoodPeers
  37. - TerminationAllCases
  38. - Proofs that properties are not vacuously true:
  39. - TerminationGoodPeersPre
  40. - TerminationAllCases
  41. - SchedulerIncreasePre