Browse Source

spec: merge rust-spec (#252)

pull/7804/head
Marko 4 years ago
committed by GitHub
parent
commit
b270ab8d15
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
84 changed files with 359 additions and 427 deletions
  1. +0
    -202
      rust-spec/lightclient/README.md
  2. +0
    -4
      rust-spec/lightclient/verification/verification.md
  3. +196
    -61
      spec/light-client/README.md
  4. +0
    -0
      spec/light-client/accountability/001indinv-apalache.csv
  5. +0
    -0
      spec/light-client/accountability/MC_n4_f1.tla
  6. +0
    -0
      spec/light-client/accountability/MC_n4_f2.tla
  7. +0
    -0
      spec/light-client/accountability/MC_n4_f2_amnesia.tla
  8. +0
    -0
      spec/light-client/accountability/MC_n4_f3.tla
  9. +0
    -0
      spec/light-client/accountability/MC_n5_f1.tla
  10. +0
    -0
      spec/light-client/accountability/MC_n5_f2.tla
  11. +0
    -0
      spec/light-client/accountability/MC_n6_f1.tla
  12. +8
    -2
      spec/light-client/accountability/README.md
  13. +18
    -19
      spec/light-client/accountability/Synopsis.md
  14. +0
    -0
      spec/light-client/accountability/TendermintAccDebug_004_draft.tla
  15. +0
    -0
      spec/light-client/accountability/TendermintAccInv_004_draft.tla
  16. +0
    -0
      spec/light-client/accountability/TendermintAccTrace_004_draft.tla
  17. +0
    -0
      spec/light-client/accountability/TendermintAcc_004_draft.tla
  18. +0
    -0
      spec/light-client/accountability/results/001indinv-apalache-mem-log.svg
  19. +0
    -0
      spec/light-client/accountability/results/001indinv-apalache-mem.svg
  20. +0
    -0
      spec/light-client/accountability/results/001indinv-apalache-ncells.svg
  21. +0
    -0
      spec/light-client/accountability/results/001indinv-apalache-nclauses.svg
  22. +0
    -1
      spec/light-client/accountability/results/001indinv-apalache-report.md
  23. +0
    -0
      spec/light-client/accountability/results/001indinv-apalache-time-log.svg
  24. +0
    -0
      spec/light-client/accountability/results/001indinv-apalache-time.svg
  25. +0
    -0
      spec/light-client/accountability/results/001indinv-apalache-unstable.csv
  26. +0
    -0
      spec/light-client/accountability/run.sh
  27. +0
    -0
      spec/light-client/attacks/Blockchain_003_draft.tla
  28. +0
    -0
      spec/light-client/attacks/Isolation_001_draft.tla
  29. +0
    -0
      spec/light-client/attacks/LCVerificationApi_003_draft.tla
  30. +0
    -0
      spec/light-client/attacks/MC_5_3.tla
  31. +41
    -37
      spec/light-client/attacks/isolate-attackers_001_draft.md
  32. +38
    -36
      spec/light-client/attacks/isolate-attackers_002_reviewed.md
  33. +0
    -0
      spec/light-client/attacks/notes-on-evidence-handling.md
  34. +0
    -3
      spec/light-client/detection.md
  35. +0
    -0
      spec/light-client/detection/004bmc-apalache-ok.csv
  36. +0
    -0
      spec/light-client/detection/005bmc-apalache-error.csv
  37. +0
    -0
      spec/light-client/detection/Blockchain_003_draft.tla
  38. +0
    -0
      spec/light-client/detection/LCD_MC3_3_faulty.tla
  39. +0
    -0
      spec/light-client/detection/LCD_MC3_4_faulty.tla
  40. +0
    -0
      spec/light-client/detection/LCD_MC4_4_faulty.tla
  41. +0
    -0
      spec/light-client/detection/LCD_MC5_5_faulty.tla
  42. +0
    -0
      spec/light-client/detection/LCDetector_003_draft.tla
  43. +0
    -0
      spec/light-client/detection/LCVerificationApi_003_draft.tla
  44. +6
    -0
      spec/light-client/detection/README.md
  45. +0
    -0
      spec/light-client/detection/detection_001_reviewed.md
  46. +16
    -21
      spec/light-client/detection/detection_003_reviewed.md
  47. +0
    -0
      spec/light-client/detection/discussions.md
  48. +0
    -0
      spec/light-client/detection/draft-functions.md
  49. +0
    -0
      spec/light-client/detection/req-ibc-detection.md
  50. +0
    -0
      spec/light-client/experiments.png
  51. +12
    -24
      spec/light-client/supervisor/supervisor_001_draft.md
  52. +0
    -0
      spec/light-client/supervisor/supervisor_001_draft.tla
  53. +0
    -0
      spec/light-client/verification/001bmc-apalache.csv
  54. +0
    -0
      spec/light-client/verification/002bmc-apalache-ok.csv
  55. +0
    -0
      spec/light-client/verification/003bmc-apalache-error.csv
  56. +0
    -0
      spec/light-client/verification/004bmc-apalache-ok.csv
  57. +0
    -0
      spec/light-client/verification/005bmc-apalache-error.csv
  58. +0
    -0
      spec/light-client/verification/Blockchain_002_draft.tla
  59. +0
    -0
      spec/light-client/verification/Blockchain_003_draft.tla
  60. +0
    -0
      spec/light-client/verification/Blockchain_A_1.tla
  61. +0
    -0
      spec/light-client/verification/LCVerificationApi_003_draft.tla
  62. +0
    -0
      spec/light-client/verification/Lightclient_002_draft.tla
  63. +0
    -0
      spec/light-client/verification/Lightclient_003_draft.tla
  64. +0
    -0
      spec/light-client/verification/Lightclient_A_1.tla
  65. +0
    -0
      spec/light-client/verification/MC4_3_correct.tla
  66. +0
    -0
      spec/light-client/verification/MC4_3_faulty.tla
  67. +0
    -0
      spec/light-client/verification/MC4_4_correct.tla
  68. +0
    -0
      spec/light-client/verification/MC4_4_correct_drifted.tla
  69. +0
    -0
      spec/light-client/verification/MC4_4_faulty.tla
  70. +0
    -0
      spec/light-client/verification/MC4_4_faulty_drifted.tla
  71. +0
    -0
      spec/light-client/verification/MC4_5_correct.tla
  72. +0
    -0
      spec/light-client/verification/MC4_5_faulty.tla
  73. +0
    -0
      spec/light-client/verification/MC4_6_faulty.tla
  74. +0
    -0
      spec/light-client/verification/MC4_7_faulty.tla
  75. +0
    -0
      spec/light-client/verification/MC5_5_correct.tla
  76. +0
    -0
      spec/light-client/verification/MC5_5_correct_peer_two_thirds_faulty.tla
  77. +0
    -0
      spec/light-client/verification/MC5_5_faulty.tla
  78. +0
    -0
      spec/light-client/verification/MC5_5_faulty_peer_two_thirds_faulty.tla
  79. +0
    -0
      spec/light-client/verification/MC5_7_faulty.tla
  80. +0
    -0
      spec/light-client/verification/MC7_5_faulty.tla
  81. +0
    -0
      spec/light-client/verification/MC7_7_faulty.tla
  82. +6
    -0
      spec/light-client/verification/README.md
  83. +2
    -3
      spec/light-client/verification/verification_001_published.md
  84. +16
    -14
      spec/light-client/verification/verification_002_draft.md

+ 0
- 202
rust-spec/lightclient/README.md View File

@ -1,202 +0,0 @@
# Light Client Specification
This directory contains work-in-progress English and TLA+ specifications for the Light Client
protocol. Implementations of the light client can be found in
[Rust](https://github.com/informalsystems/tendermint-rs/tree/master/light-client) and
[Go](https://github.com/tendermint/tendermint/tree/master/light).
Light clients are assumed to be initialized once from a trusted source
with a trusted header and validator set. The light client
protocol allows a client to then securely update its trusted state by requesting and
verifying a minimal set of data from a network of full nodes (at least one of which is correct).
The light client is decomposed into two main components:
- [Commit Verification](#Commit-Verification) - verify signed headers and associated validator
set changes from a single full node, called primary
- [Attack Detection](#Attack-Detection) - verify commits across multiple full nodes (called secondaries) and detect conflicts (ie. the existence of a lightclient attack)
In case a lightclient attack is detected, the lightclient submits evidence to a full node which is responsible for "accountability", that is, punishing attackers:
- [Accountability](#Accountability) - given evidence for an attack, compute a set of validators that are responsible for it.
## Commit Verification
The [English specification](verification/verification_001_published.md) describes the light client
commit verification problem in terms of the temporal properties
[LCV-DIST-SAFE.1](https://github.com/informalsystems/tendermint-rs/blob/master/docs/spec/lightclient/verification/verification_001_published.md#lcv-dist-safe1) and
[LCV-DIST-LIVE.1](https://github.com/informalsystems/tendermint-rs/blob/master/docs/spec/lightclient/verification/verification_001_published.md#lcv-dist-live1).
Commit verification is assumed to operate within the Tendermint Failure Model, where +2/3 of validators are correct for some time period and
validator sets can change arbitrarily at each height.
A light client protocol is also provided, including all checks that
need to be performed on headers, commits, and validator sets
to satisfy the temporal properties - so a light client can continuously
synchronize with a blockchain. Clients can skip possibly
many intermediate headers by exploiting overlap in trusted and untrusted validator sets.
When there is not enough overlap, a bisection routine can be used to find a
minimal set of headers that do provide the required overlap.
The [TLA+ specification ver. 001](verification/Lightclient_A_1.tla)
is a formal description of the
commit verification protocol executed by a client, including the safety and
termination, which can be model checked with Apalache.
A more detailed TLA+ specification of
[Light client verification ver. 003](verification/Lightclient_003_draft.tla)
is currently under peer review.
The `MC*.tla` files contain concrete parameters for the
[TLA+ specification](verification/Lightclient_A_1.tla), in order to do model checking.
For instance, [MC4_3_faulty.tla](verification/MC4_3_faulty.tla) contains the following parameters
for the nodes, heights, the trusting period, the clock drifts,
correctness of the primary node, and the ratio of the faulty processes:
```tla
AllNodes == {"n1", "n2", "n3", "n4"}
TRUSTED_HEIGHT == 1
TARGET_HEIGHT == 3
TRUSTING_PERIOD == 1400 \* the trusting period in some time units
CLOCK_DRIFT = 10 \* how much we assume the local clock is drifting
REAL_CLOCK_DRIFT = 3 \* how much the local clock is actually drifting
IS_PRIMARY_CORRECT == FALSE
FAULTY_RATIO == <<1, 3>> \* < 1 / 3 faulty validators
```
To run a complete set of experiments, clone [apalache](https://github.com/informalsystems/apalache) and [apalache-tests](https://github.com/informalsystems/apalache-tests) into a directory `$DIR` and run the following commands:
```sh
$DIR/apalache-tests/scripts/mk-run.py --memlimit 28 002bmc-apalache-ok.csv $DIR/apalache . out
./out/run-all.sh
```
After the experiments have finished, you can collect the logs by executing the following command:
```sh
cd ./out
$DIR/apalache-tests/scripts/parse-logs.py --human .
```
All lines in `results.csv` should report `Deadlock`, which means that the algorithm
has terminated and no invariant violation was found.
Similar to [002bmc-apalache-ok.csv](verification/002bmc-apalache-ok.csv),
file [003bmc-apalache-error.csv](verification/003bmc-apalache-error.csv) specifies
the set of experiments that should result in counterexamples:
```sh
$DIR/apalache-tests/scripts/mk-run.py --memlimit 28 003bmc-apalache-error.csv $DIR/apalache . out
./out/run-all.sh
```
All lines in `results.csv` should report `Error`.
The following table summarizes the experimental results for Light client verification
version 001. The TLA+ properties can be found in the
[TLA+ specification](verification/Lightclient_A_1.tla).
The experiments were run in an AWS instance equipped with 32GB
RAM and a 4-core Intel® Xeon® CPU E5-2686 v4 @ 2.30GHz CPU.
We write “✗=k” when a bug is reported at depth k, and “✓<=k” when
no bug is reported up to depth k.
![Experimental results](experiments.png)
The experimental results for version 003 are to be added.
## Attack Detection
The [English specification](detection/detection_003_reviewed.md)
defines light client attacks (and how they differ from blockchain
forks), and describes the problem of a light client detecting
these attacks by communicating with a network of full nodes,
where at least one is correct.
The specification also contains a detection protocol that checks
whether the header obtained from the primary via the verification
protocol matches corresponding headers provided by the secondaries.
If this is not the case, the protocol analyses the verification traces
of the involved full nodes
and generates
[evidence](detection/detection_003_reviewed.md#tmbc-lc-evidence-data1)
of misbehavior that can be submitted to a full node so that
the faulty validators can be punished.
The [TLA+ specification](detection/LCDetector_003_draft.tla)
is a formal description of the
detection protocol for two peers, including the safety and
termination, which can be model checked with Apalache.
The `LCD_MC*.tla` files contain concrete parameters for the
[TLA+ specification](detection/LCDetector_003_draft.tla),
in order to run the model checker.
For instance, [LCD_MC4_4_faulty.tla](detection/MC4_4_faulty.tla)
contains the following parameters
for the nodes, heights, the trusting period, the clock drifts,
correctness of the nodes, and the ratio of the faulty processes:
```tla
AllNodes == {"n1", "n2", "n3", "n4"}
TRUSTED_HEIGHT == 1
TARGET_HEIGHT == 3
TRUSTING_PERIOD == 1400 \* the trusting period in some time units
CLOCK_DRIFT = 10 \* how much we assume the local clock is drifting
REAL_CLOCK_DRIFT = 3 \* how much the local clock is actually drifting
IS_PRIMARY_CORRECT == FALSE
IS_SECONDARY_CORRECT == FALSE
FAULTY_RATIO == <<1, 3>> \* < 1 / 3 faulty validators
```
To run a complete set of experiments, clone [apalache](https://github.com/informalsystems/apalache) and [apalache-tests](https://github.com/informalsystems/apalache-tests) into a directory `$DIR` and run the following commands:
```sh
$DIR/apalache-tests/scripts/mk-run.py --memlimit 28 004bmc-apalache-ok.csv $DIR/apalache . out
./out/run-all.sh
```
After the experiments have finished, you can collect the logs by executing the following command:
```sh
cd ./out
$DIR/apalache-tests/scripts/parse-logs.py --human .
```
All lines in `results.csv` should report `Deadlock`, which means that the algorithm
has terminated and no invariant violation was found.
Similar to [004bmc-apalache-ok.csv](verification/004bmc-apalache-ok.csv),
file [005bmc-apalache-error.csv](verification/005bmc-apalache-error.csv) specifies
the set of experiments that should result in counterexamples:
```sh
$DIR/apalache-tests/scripts/mk-run.py --memlimit 28 005bmc-apalache-error.csv $DIR/apalache . out
./out/run-all.sh
```
All lines in `results.csv` should report `Error`.
The detailed experimental results are to be added soon.
## Accountability
The [English specification](attacks/isolate-attackers_002_reviewed.md)
defines the protocol that is executed on a full node upon receiving attack [evidence](detection/detection_003_reviewed.md#tmbc-lc-evidence-data1) from a lightclient. In particular, the protocol handles three types of attacks
- lunatic
- equivocation
- amnesia
We discussed in the [last part](attacks/isolate-attackers_002_reviewed.md#Part-III---Completeness) of the English specification
that the non-lunatic cases are defined by having the same validator set in the conflicting blocks. For these cases,
computer-aided analysis of [Tendermint Consensus in TLA+][tendermint-accountability] shows that equivocation and amnesia capture all non-lunatic attacks.
The [TLA+ specification](attacks/Isolation_001_draft.tla)
is a formal description of the
protocol, including the safety property, which can be model checked with Apalache.
Similar to the other specifications, [MC_5_3.tla](attacks/MC_5_3.tla) contains concrete parameters to run the model checker. The specification can be checked within seconds.
[tendermint-accountability]:
https://github.com/tendermint/spec/blob/master/rust-spec/tendermint-accountability/README.md

+ 0
- 4
rust-spec/lightclient/verification/verification.md View File

@ -1,4 +0,0 @@
We changed the naming convention and versioning of specifications.
See [verification_001_published.md](./verification_001_published.md)
for the file that used to be called `verification.md`. There are also newer
versions of this specification in this directory.

+ 196
- 61
spec/light-client/README.md View File

@ -5,66 +5,201 @@ parent:
order: 5
---
NOTE: This specification is under heavy development and is not yet complete nor
accurate.
# Light Client Specification
This directory contains work-in-progress English and TLA+ specifications for the Light Client
protocol. Implementations of the light client can be found in
[Rust](https://github.com/informalsystems/tendermint-rs/tree/master/light-client) and
[Go](https://github.com/tendermint/tendermint/tree/master/light).
## Contents
Light clients are assumed to be initialized once from a trusted source
with a trusted header and validator set. The light client
protocol allows a client to then securely update its trusted state by requesting and
verifying a minimal set of data from a network of full nodes (at least one of which is correct).
The light client is decomposed into two main components:
- [Commit Verification](#Commit-Verification) - verify signed headers and associated validator
set changes from a single full node, called primary
- [Attack Detection](#Attack-Detection) - verify commits across multiple full nodes (called secondaries) and detect conflicts (ie. the existence of a lightclient attack)
In case a lightclient attack is detected, the lightclient submits evidence to a full node which is responsible for "accountability", that is, punishing attackers:
- [Accountability](#Accountability) - given evidence for an attack, compute a set of validators that are responsible for it.
## Commit Verification
The [English specification](verification/verification_001_published.md) describes the light client
commit verification problem in terms of the temporal properties
[LCV-DIST-SAFE.1](https://github.com/informalsystems/tendermint-rs/blob/master/docs/spec/lightclient/verification/verification_001_published.md#lcv-dist-safe1) and
[LCV-DIST-LIVE.1](https://github.com/informalsystems/tendermint-rs/blob/master/docs/spec/lightclient/verification/verification_001_published.md#lcv-dist-live1).
Commit verification is assumed to operate within the Tendermint Failure Model, where +2/3 of validators are correct for some time period and
validator sets can change arbitrarily at each height.
A light client protocol is also provided, including all checks that
need to be performed on headers, commits, and validator sets
to satisfy the temporal properties - so a light client can continuously
synchronize with a blockchain. Clients can skip possibly
many intermediate headers by exploiting overlap in trusted and untrusted validator sets.
When there is not enough overlap, a bisection routine can be used to find a
minimal set of headers that do provide the required overlap.
The [TLA+ specification ver. 001](verification/Lightclient_A_1.tla)
is a formal description of the
commit verification protocol executed by a client, including the safety and
termination, which can be model checked with Apalache.
A more detailed TLA+ specification of
[Light client verification ver. 003](verification/Lightclient_003_draft.tla)
is currently under peer review.
The `MC*.tla` files contain concrete parameters for the
[TLA+ specification](verification/Lightclient_A_1.tla), in order to do model checking.
For instance, [MC4_3_faulty.tla](verification/MC4_3_faulty.tla) contains the following parameters
for the nodes, heights, the trusting period, the clock drifts,
correctness of the primary node, and the ratio of the faulty processes:
```tla
AllNodes == {"n1", "n2", "n3", "n4"}
TRUSTED_HEIGHT == 1
TARGET_HEIGHT == 3
TRUSTING_PERIOD == 1400 \* the trusting period in some time units
CLOCK_DRIFT = 10 \* how much we assume the local clock is drifting
REAL_CLOCK_DRIFT = 3 \* how much the local clock is actually drifting
IS_PRIMARY_CORRECT == FALSE
FAULTY_RATIO == <<1, 3>> \* < 1 / 3 faulty validators
```
To run a complete set of experiments, clone [apalache](https://github.com/informalsystems/apalache) and [apalache-tests](https://github.com/informalsystems/apalache-tests) into a directory `$DIR` and run the following commands:
```sh
$DIR/apalache-tests/scripts/mk-run.py --memlimit 28 002bmc-apalache-ok.csv $DIR/apalache . out
./out/run-all.sh
```
After the experiments have finished, you can collect the logs by executing the following command:
```sh
cd ./out
$DIR/apalache-tests/scripts/parse-logs.py --human .
```
All lines in `results.csv` should report `Deadlock`, which means that the algorithm
has terminated and no invariant violation was found.
Similar to [002bmc-apalache-ok.csv](verification/002bmc-apalache-ok.csv),
file [003bmc-apalache-error.csv](verification/003bmc-apalache-error.csv) specifies
the set of experiments that should result in counterexamples:
```sh
$DIR/apalache-tests/scripts/mk-run.py --memlimit 28 003bmc-apalache-error.csv $DIR/apalache . out
./out/run-all.sh
```
All lines in `results.csv` should report `Error`.
The following table summarizes the experimental results for Light client verification
version 001. The TLA+ properties can be found in the
[TLA+ specification](verification/Lightclient_A_1.tla).
The experiments were run in an AWS instance equipped with 32GB
RAM and a 4-core Intel® Xeon® CPU E5-2686 v4 @ 2.30GHz CPU.
We write “✗=k” when a bug is reported at depth k, and “✓<=k” when
no bug is reported up to depth k.
![Experimental results](experiments.png)
The experimental results for version 003 are to be added.
## Attack Detection
The [English specification](detection/detection_003_reviewed.md)
defines light client attacks (and how they differ from blockchain
forks), and describes the problem of a light client detecting
these attacks by communicating with a network of full nodes,
where at least one is correct.
The specification also contains a detection protocol that checks
whether the header obtained from the primary via the verification
protocol matches corresponding headers provided by the secondaries.
If this is not the case, the protocol analyses the verification traces
of the involved full nodes
and generates
[evidence](detection/detection_003_reviewed.md#tmbc-lc-evidence-data1)
of misbehavior that can be submitted to a full node so that
the faulty validators can be punished.
The [TLA+ specification](detection/LCDetector_003_draft.tla)
is a formal description of the
detection protocol for two peers, including the safety and
termination, which can be model checked with Apalache.
The `LCD_MC*.tla` files contain concrete parameters for the
[TLA+ specification](detection/LCDetector_003_draft.tla),
in order to run the model checker.
For instance, [LCD_MC4_4_faulty.tla](detection/MC4_4_faulty.tla)
contains the following parameters
for the nodes, heights, the trusting period, the clock drifts,
correctness of the nodes, and the ratio of the faulty processes:
```tla
AllNodes == {"n1", "n2", "n3", "n4"}
TRUSTED_HEIGHT == 1
TARGET_HEIGHT == 3
TRUSTING_PERIOD == 1400 \* the trusting period in some time units
CLOCK_DRIFT = 10 \* how much we assume the local clock is drifting
REAL_CLOCK_DRIFT = 3 \* how much the local clock is actually drifting
IS_PRIMARY_CORRECT == FALSE
IS_SECONDARY_CORRECT == FALSE
FAULTY_RATIO == <<1, 3>> \* < 1 / 3 faulty validators
```
To run a complete set of experiments, clone [apalache](https://github.com/informalsystems/apalache) and [apalache-tests](https://github.com/informalsystems/apalache-tests) into a directory `$DIR` and run the following commands:
```sh
$DIR/apalache-tests/scripts/mk-run.py --memlimit 28 004bmc-apalache-ok.csv $DIR/apalache . out
./out/run-all.sh
```
After the experiments have finished, you can collect the logs by executing the following command:
```sh
cd ./out
$DIR/apalache-tests/scripts/parse-logs.py --human .
```
All lines in `results.csv` should report `Deadlock`, which means that the algorithm
has terminated and no invariant violation was found.
- [Motivation](#motivation)
- [Structure](#structure)
- [Core Verification](./verification.md)
- [Fork Detection](./detection.md)
- [Fork Accountability](./accountability.md)
## Motivation
The Tendermint Light Client is motivated by the need for a light weight protocol
to sync with a Tendermint blockchain, with the least processing necessary to
securely verify a recent state. The protocol consists of managing trusted validator
sets and trusted block headers, and is based primarily on checking hashes
and verifying Tendermint commit signatures.
Motivating use cases include:
- Light Node: a daemon that syncs a blockchain to the latest committed header by making RPC requests to full nodes.
- State Sync: a reactor that syncs a blockchain to a recent committed state by making P2P requests to full nodes.
- IBC Client: an ABCI application library that syncs a blockchain to a recent committed header by receiving proof-carrying
transactions from "IBC relayers", who make RPC requests to full nodes on behalf of the IBC clients.
## Structure
### Components
The Tendermint Light Client consists of three primary components:
- [Core Verification](./verification.md): verifying hashes, signatures, and validator set changes
- [Fork Detection](./detection.md): talking to multiple peers to detect Byzantine behaviour
- [Fork Accountability](./accountability.md): analyzing Byzantine behaviour to hold validators accountable.
While every light client must perform core verification and fork detection
to achieve their prescribed security level, fork accountability is expected to
be done by full nodes and validators, and is thus more accurately a component of
the full node consensus protocol, though it is included here since it is
primarily concerned with providing security to light clients.
A schematic of the core verification and fork detection components in
a Light Node are depicted below. The schematic is quite similar for other use cases.
Note that fork accountability is not depicted, as it is the responsibility of the
full nodes.
![Light Client Diagram](./assets/light-node-image.png).
### Synchrony
Light clients are fundamentally synchronous protocols,
where security is restricted by the interval during which a validator can be punished
for Byzantine behaviour. We assume here that such intervals have fixed and known minimal duration
referred to commonly as a blockchain's Unbonding Period.
A secure light client must guarantee that all three components -
core verification, fork detection, and fork accountability -
each with their own synchrony assumptions and fault model, can execute
sequentially and to completion within the given Unbonding Period.
TODO: define all the synchrony parameters used in the protocol and their
relation to the Unbonding Period.
Similar to [004bmc-apalache-ok.csv](verification/004bmc-apalache-ok.csv),
file [005bmc-apalache-error.csv](verification/005bmc-apalache-error.csv) specifies
the set of experiments that should result in counterexamples:
```sh
$DIR/apalache-tests/scripts/mk-run.py --memlimit 28 005bmc-apalache-error.csv $DIR/apalache . out
./out/run-all.sh
```
All lines in `results.csv` should report `Error`.
The detailed experimental results are to be added soon.
## Accountability
The [English specification](attacks/isolate-attackers_002_reviewed.md)
defines the protocol that is executed on a full node upon receiving attack [evidence](detection/detection_003_reviewed.md#tmbc-lc-evidence-data1) from a lightclient. In particular, the protocol handles three types of attacks
- lunatic
- equivocation
- amnesia
We discussed in the [last part](attacks/isolate-attackers_002_reviewed.md#Part-III---Completeness) of the English specification
that the non-lunatic cases are defined by having the same validator set in the conflicting blocks. For these cases,
computer-aided analysis of [Tendermint Consensus in TLA+](./accountability/README.md) shows that equivocation and amnesia capture all non-lunatic attacks.
The [TLA+ specification](attacks/Isolation_001_draft.tla)
is a formal description of the
protocol, including the safety property, which can be model checked with Apalache.
Similar to the other specifications, [MC_5_3.tla](attacks/MC_5_3.tla) contains concrete parameters to run the model checker. The specification can be checked within seconds.
[tendermint-accountability](./accountability/README.md)

rust-spec/tendermint-accountability/001indinv-apalache.csv → spec/light-client/accountability/001indinv-apalache.csv View File


rust-spec/tendermint-accountability/MC_n4_f1.tla → spec/light-client/accountability/MC_n4_f1.tla View File


rust-spec/tendermint-accountability/MC_n4_f2.tla → spec/light-client/accountability/MC_n4_f2.tla View File


rust-spec/tendermint-accountability/MC_n4_f2_amnesia.tla → spec/light-client/accountability/MC_n4_f2_amnesia.tla View File


rust-spec/tendermint-accountability/MC_n4_f3.tla → spec/light-client/accountability/MC_n4_f3.tla View File


rust-spec/tendermint-accountability/MC_n5_f1.tla → spec/light-client/accountability/MC_n5_f1.tla View File


rust-spec/tendermint-accountability/MC_n5_f2.tla → spec/light-client/accountability/MC_n5_f2.tla View File


rust-spec/tendermint-accountability/MC_n6_f1.tla → spec/light-client/accountability/MC_n6_f1.tla View File


spec/light-client/accountability.md → spec/light-client/accountability/README.md View File


rust-spec/tendermint-accountability/README.md → spec/light-client/accountability/Synopsis.md View File


rust-spec/tendermint-accountability/TendermintAccDebug_004_draft.tla → spec/light-client/accountability/TendermintAccDebug_004_draft.tla View File


rust-spec/tendermint-accountability/TendermintAccInv_004_draft.tla → spec/light-client/accountability/TendermintAccInv_004_draft.tla View File


rust-spec/tendermint-accountability/TendermintAccTrace_004_draft.tla → spec/light-client/accountability/TendermintAccTrace_004_draft.tla View File


rust-spec/tendermint-accountability/TendermintAcc_004_draft.tla → spec/light-client/accountability/TendermintAcc_004_draft.tla View File


rust-spec/tendermint-accountability/results/001indinv-apalache-mem-log.svg → spec/light-client/accountability/results/001indinv-apalache-mem-log.svg View File


rust-spec/tendermint-accountability/results/001indinv-apalache-mem.svg → spec/light-client/accountability/results/001indinv-apalache-mem.svg View File


rust-spec/tendermint-accountability/results/001indinv-apalache-ncells.svg → spec/light-client/accountability/results/001indinv-apalache-ncells.svg View File


rust-spec/tendermint-accountability/results/001indinv-apalache-nclauses.svg → spec/light-client/accountability/results/001indinv-apalache-nclauses.svg View File


rust-spec/tendermint-accountability/results/001indinv-apalache-report.md → spec/light-client/accountability/results/001indinv-apalache-report.md View File


rust-spec/tendermint-accountability/results/001indinv-apalache-time-log.svg → spec/light-client/accountability/results/001indinv-apalache-time-log.svg View File


rust-spec/tendermint-accountability/results/001indinv-apalache-time.svg → spec/light-client/accountability/results/001indinv-apalache-time.svg View File


rust-spec/tendermint-accountability/results/001indinv-apalache-unstable.csv → spec/light-client/accountability/results/001indinv-apalache-unstable.csv View File


rust-spec/tendermint-accountability/run.sh → spec/light-client/accountability/run.sh View File


rust-spec/lightclient/attacks/Blockchain_003_draft.tla → spec/light-client/attacks/Blockchain_003_draft.tla View File


rust-spec/lightclient/attacks/Isolation_001_draft.tla → spec/light-client/attacks/Isolation_001_draft.tla View File


rust-spec/lightclient/attacks/LCVerificationApi_003_draft.tla → spec/light-client/attacks/LCVerificationApi_003_draft.tla View File


rust-spec/lightclient/attacks/MC_5_3.tla → spec/light-client/attacks/MC_5_3.tla View File


rust-spec/lightclient/attacks/isolate-attackers_001_draft.md → spec/light-client/attacks/isolate-attackers_001_draft.md View File


rust-spec/lightclient/attacks/isolate-attackers_002_reviewed.md → spec/light-client/attacks/isolate-attackers_002_reviewed.md View File


rust-spec/lightclient/attacks/notes-on-evidence-handling.md → spec/light-client/attacks/notes-on-evidence-handling.md View File


+ 0
- 3
spec/light-client/detection.md View File

@ -1,3 +0,0 @@
# Detection
TODO

rust-spec/lightclient/detection/004bmc-apalache-ok.csv → spec/light-client/detection/004bmc-apalache-ok.csv View File


rust-spec/lightclient/detection/005bmc-apalache-error.csv → spec/light-client/detection/005bmc-apalache-error.csv View File


rust-spec/lightclient/detection/Blockchain_003_draft.tla → spec/light-client/detection/Blockchain_003_draft.tla View File


rust-spec/lightclient/detection/LCD_MC3_3_faulty.tla → spec/light-client/detection/LCD_MC3_3_faulty.tla View File


rust-spec/lightclient/detection/LCD_MC3_4_faulty.tla → spec/light-client/detection/LCD_MC3_4_faulty.tla View File


rust-spec/lightclient/detection/LCD_MC4_4_faulty.tla → spec/light-client/detection/LCD_MC4_4_faulty.tla View File


rust-spec/lightclient/detection/LCD_MC5_5_faulty.tla → spec/light-client/detection/LCD_MC5_5_faulty.tla View File


rust-spec/lightclient/detection/LCDetector_003_draft.tla → spec/light-client/detection/LCDetector_003_draft.tla View File


rust-spec/lightclient/detection/LCVerificationApi_003_draft.tla → spec/light-client/detection/LCVerificationApi_003_draft.tla View File


rust-spec/lightclient/detection/README.md → spec/light-client/detection/README.md View File


rust-spec/lightclient/detection/detection_001_reviewed.md → spec/light-client/detection/detection_001_reviewed.md View File


rust-spec/lightclient/detection/detection_003_reviewed.md → spec/light-client/detection/detection_003_reviewed.md View File


rust-spec/lightclient/detection/discussions.md → spec/light-client/detection/discussions.md View File


rust-spec/lightclient/detection/draft-functions.md → spec/light-client/detection/draft-functions.md View File


rust-spec/lightclient/detection/req-ibc-detection.md → spec/light-client/detection/req-ibc-detection.md View File


rust-spec/lightclient/experiments.png → spec/light-client/experiments.png View File


rust-spec/lightclient/supervisor/supervisor_001_draft.md → spec/light-client/supervisor/supervisor_001_draft.md View File


rust-spec/lightclient/supervisor/supervisor_001_draft.tla → spec/light-client/supervisor/supervisor_001_draft.tla View File


rust-spec/lightclient/verification/001bmc-apalache.csv → spec/light-client/verification/001bmc-apalache.csv View File


rust-spec/lightclient/verification/002bmc-apalache-ok.csv → spec/light-client/verification/002bmc-apalache-ok.csv View File


rust-spec/lightclient/verification/003bmc-apalache-error.csv → spec/light-client/verification/003bmc-apalache-error.csv View File


rust-spec/lightclient/verification/004bmc-apalache-ok.csv → spec/light-client/verification/004bmc-apalache-ok.csv View File


rust-spec/lightclient/verification/005bmc-apalache-error.csv → spec/light-client/verification/005bmc-apalache-error.csv View File


rust-spec/lightclient/verification/Blockchain_002_draft.tla → spec/light-client/verification/Blockchain_002_draft.tla View File


rust-spec/lightclient/verification/Blockchain_003_draft.tla → spec/light-client/verification/Blockchain_003_draft.tla View File


rust-spec/lightclient/verification/Blockchain_A_1.tla → spec/light-client/verification/Blockchain_A_1.tla View File


rust-spec/lightclient/verification/LCVerificationApi_003_draft.tla → spec/light-client/verification/LCVerificationApi_003_draft.tla View File


rust-spec/lightclient/verification/Lightclient_002_draft.tla → spec/light-client/verification/Lightclient_002_draft.tla View File


rust-spec/lightclient/verification/Lightclient_003_draft.tla → spec/light-client/verification/Lightclient_003_draft.tla View File


rust-spec/lightclient/verification/Lightclient_A_1.tla → spec/light-client/verification/Lightclient_A_1.tla View File


rust-spec/lightclient/verification/MC4_3_correct.tla → spec/light-client/verification/MC4_3_correct.tla View File


rust-spec/lightclient/verification/MC4_3_faulty.tla → spec/light-client/verification/MC4_3_faulty.tla View File


rust-spec/lightclient/verification/MC4_4_correct.tla → spec/light-client/verification/MC4_4_correct.tla View File


rust-spec/lightclient/verification/MC4_4_correct_drifted.tla → spec/light-client/verification/MC4_4_correct_drifted.tla View File


rust-spec/lightclient/verification/MC4_4_faulty.tla → spec/light-client/verification/MC4_4_faulty.tla View File


rust-spec/lightclient/verification/MC4_4_faulty_drifted.tla → spec/light-client/verification/MC4_4_faulty_drifted.tla View File


rust-spec/lightclient/verification/MC4_5_correct.tla → spec/light-client/verification/MC4_5_correct.tla View File


rust-spec/lightclient/verification/MC4_5_faulty.tla → spec/light-client/verification/MC4_5_faulty.tla View File


rust-spec/lightclient/verification/MC4_6_faulty.tla → spec/light-client/verification/MC4_6_faulty.tla View File


rust-spec/lightclient/verification/MC4_7_faulty.tla → spec/light-client/verification/MC4_7_faulty.tla View File


rust-spec/lightclient/verification/MC5_5_correct.tla → spec/light-client/verification/MC5_5_correct.tla View File


rust-spec/lightclient/verification/MC5_5_correct_peer_two_thirds_faulty.tla → spec/light-client/verification/MC5_5_correct_peer_two_thirds_faulty.tla View File


rust-spec/lightclient/verification/MC5_5_faulty.tla → spec/light-client/verification/MC5_5_faulty.tla View File


rust-spec/lightclient/verification/MC5_5_faulty_peer_two_thirds_faulty.tla → spec/light-client/verification/MC5_5_faulty_peer_two_thirds_faulty.tla View File


rust-spec/lightclient/verification/MC5_7_faulty.tla → spec/light-client/verification/MC5_7_faulty.tla View File


rust-spec/lightclient/verification/MC7_5_faulty.tla → spec/light-client/verification/MC7_5_faulty.tla View File


rust-spec/lightclient/verification/MC7_7_faulty.tla → spec/light-client/verification/MC7_7_faulty.tla View File


spec/light-client/verification.md → spec/light-client/verification/README.md View File


rust-spec/lightclient/verification/verification_001_published.md → spec/light-client/verification/verification_001_published.md View File


rust-spec/lightclient/verification/verification_002_draft.md → spec/light-client/verification/verification_002_draft.md View File


Loading…
Cancel
Save