Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specification of ForceMove to exhibit safety. #2

Open
wants to merge 66 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
27af4a2
Update .gitignore
andrewgordstewart Aug 23, 2019
2d5b1c3
wip
andrewgordstewart Aug 23, 2019
2271340
wip
andrewgordstewart Aug 23, 2019
64879ff
wip
andrewgordstewart Aug 23, 2019
634542a
wip
andrewgordstewart Aug 23, 2019
ef59a33
wip
andrewgordstewart Aug 23, 2019
bf63d04
wip
andrewgordstewart Aug 23, 2019
3bf6583
wip
andrewgordstewart Aug 26, 2019
2fffcc2
Use channel mode language from documentation
andrewgordstewart Aug 26, 2019
c8f9ab7
Write out checks and effects that contract functions have
andrewgordstewart Aug 26, 2019
4828143
Start sketching out processes
andrewgordstewart Aug 27, 2019
c7dcd41
Refactor macros to use commitments
andrewgordstewart Aug 27, 2019
18bc1fc
Archie -> Alice
andrewgordstewart Aug 27, 2019
5efcba1
Remove histories
andrewgordstewart Aug 27, 2019
d76fde9
Update comment
andrewgordstewart Aug 27, 2019
7da9175
Processes loop
andrewgordstewart Aug 27, 2019
270f6fd
Fix a few things
andrewgordstewart Aug 27, 2019
579ad1d
Define the checks
andrewgordstewart Aug 28, 2019
8fd151f
Eve can force-move. Start to write alice's responses
andrewgordstewart Aug 28, 2019
fdbf652
Add signer to challenges (and channel, when in CHALLENGE Mode)
andrewgordstewart Aug 28, 2019
2ac20ac
Alice refutes properly. She finalizes the channel when she cannot cle…
andrewgordstewart Aug 28, 2019
5e47ded
Fix ProgressesChannel
andrewgordstewart Aug 28, 2019
1dc630b
Store challenge on channel rather than update turn number
andrewgordstewart Aug 28, 2019
fb57dfa
Correct turn number checks
andrewgordstewart Aug 28, 2019
854d5e5
Minimal spec exhibiting force-move protocol issue
andrewgordstewart Aug 28, 2019
36a0567
Always store a challenge
andrewgordstewart Aug 29, 2019
cf05bcc
Add EveCanTakeAction
andrewgordstewart Aug 29, 2019
89143eb
Channel has one turn number per participant
andrewgordstewart Aug 30, 2019
6469cf4
Update some definitions
andrewgordstewart Sep 3, 2019
79bab9c
Alice can defend against arbitrary forceMoves
andrewgordstewart Sep 3, 2019
ff673c2
Add property which is violated if Eve front-runs Alice's challenge
andrewgordstewart Sep 3, 2019
44f15dc
Rename property in anticipation of other front-runs
andrewgordstewart Sep 5, 2019
0b09c32
WIP: Eve calls Refute and RespondWithMove
andrewgordstewart Sep 6, 2019
586eea4
wip
andrewgordstewart Sep 9, 2019
30105c5
wip
andrewgordstewart Sep 9, 2019
2026b90
wip: Eve can instantly mine transactions
andrewgordstewart Sep 9, 2019
93038f6
Add effect that can exhibit infinite griefing
andrewgordstewart Sep 9, 2019
2bdb120
Alice submits refutes
andrewgordstewart Sep 9, 2019
2839037
Simplify alice's process
andrewgordstewart Sep 9, 2019
bbb2c76
Alice submits respond transactions
andrewgordstewart Sep 9, 2019
f0de039
Eve responds
andrewgordstewart Sep 9, 2019
2583999
Eve only responds when challenge is ongoing
andrewgordstewart Sep 10, 2019
a3690b5
Add invariant to verify that Eve can grieve
andrewgordstewart Sep 10, 2019
c53bbe9
Eve can refute
andrewgordstewart Sep 10, 2019
133d179
Update comments
andrewgordstewart Sep 10, 2019
1141296
Add property that verifies that Alice cannot directly submit transact…
andrewgordstewart Sep 10, 2019
7f75b1b
Add EveCannotFrontRun property and clarify numForces variable
andrewgordstewart Sep 10, 2019
1543e1d
Clean up spec
andrewgordstewart Sep 10, 2019
4139c89
Refute checks that the challenge signer signed the state submitted
andrewgordstewart Sep 10, 2019
bc3c169
Clarify Eve's refute ability
andrewgordstewart Sep 10, 2019
eb8f0b0
Eve can sleep
andrewgordstewart Sep 10, 2019
66b3877
Alice does not directly modify channel state
andrewgordstewart Sep 10, 2019
f5bc0a9
Remove timeout "transactions"
andrewgordstewart Sep 10, 2019
216dd0c
Remove FINALIZE mode
andrewgordstewart Sep 10, 2019
f6e314c
Remove unused model values
andrewgordstewart Sep 10, 2019
b9933fe
Add success configuration
andrewgordstewart Sep 10, 2019
b1fcaed
Add configuration to exhibit how Eve can front run Alice
andrewgordstewart Sep 11, 2019
4a8d45e
Add some models
andrewgordstewart Sep 11, 2019
8c42a50
Add explanation of the specification
andrewgordstewart Sep 11, 2019
a2f8b06
Tidy up spec a bit
andrewgordstewart Sep 11, 2019
8d3a689
Remove extraneous skip
andrewgordstewart Sep 11, 2019
64800a2
Add TurnNumberIncrements
andrewgordstewart Sep 11, 2019
4eda118
Tidy up model definitions
andrewgordstewart Sep 11, 2019
9d6f283
Add FiveParticipants model
andrewgordstewart Sep 11, 2019
b36a9db
Add compiled spec.
andrewgordstewart Sep 11, 2019
b2936d4
AlicesIDX is an algorithm variable
andrewgordstewart Sep 11, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# The tla+ toolbox creates a .toolbox folder for each specification you create
# While this folder does contain model details, which we potentially want to check
# in, it also contains a lot of other files, so we ignore it for the moment
*.toolbox/
*.toolbox/

# The tlatex utility produces auxilliary files when compiling the spec
*.aux
*.dvi
*.log
*.old
*.tex
15 changes: 15 additions & 0 deletions ForceMove/EveCannotFrontRun.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CONSTANT
NULL = NULL
StartingTurnNumber <- const_StartingTurnNumber
NumParticipants <- const_NumParticipants
AlicesIDX <- const_AlicesIDX
Nat <- def_ov_Nat

SPECIFICATION
Spec

INVARIANT
TypeOK

PROPERTY
EveCannotFrontRun
8 changes: 8 additions & 0 deletions ForceMove/FiveParticipants.tla
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---- MODULE FiveParticipants ----
EXTENDS ForceMove, TLC

const_StartingTurnNumber == 6
const_NumParticipants == 5
const_AlicesIDX == 3
def_ov_Nat == 0..15
=============================================================================
Binary file added ForceMove/ForceMove.pdf
Binary file not shown.
480 changes: 480 additions & 0 deletions ForceMove/ForceMove.tla

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions ForceMove/Success.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
CONSTANT
NULL = NULL
StartingTurnNumber <- const_StartingTurnNumber
NumParticipants <- const_NumParticipants
AlicesIDX <- const_AlicesIDX
Nat <- def_ov_Nat

SPECIFICATION
Spec

INVARIANT
TypeOK

PROPERTY
Termination
AliceCanProgressChannel
AliceMustSubmitTransactions
TurnNumberIncrements
8 changes: 8 additions & 0 deletions ForceMove/ThreeParticipants.tla
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---- MODULE ThreeParticipants ----
EXTENDS ForceMove, TLC

const_StartingTurnNumber == 5
const_NumParticipants == 3
const_AlicesIDX == 3
def_ov_Nat == 0..20
=============================================================================
8 changes: 8 additions & 0 deletions ForceMove/TwoParticipants.tla
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---- MODULE TwoParticipants ----
EXTENDS ForceMove, TLC

const_StartingTurnNumber == 5
const_NumParticipants == 2
const_AlicesIDX == 2
def_ov_Nat == 0..20
=============================================================================
8 changes: 8 additions & 0 deletions ForceMove/TwoParticipantsLongHistory.tla
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---- MODULE TwoParticipantsLongHistory ----
EXTENDS ForceMove, TLC

const_StartingTurnNumber == 31
const_NumParticipants == 2
const_AlicesIDX == 2
def_ov_Nat == 0..64
=============================================================================
20 changes: 20 additions & 0 deletions ForceMove/Utils.tla
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
------------------------------- MODULE Utils -------------------------------
EXTENDS Integers
ChannelMode == [
OPEN |-> "OPEN",
CHALLENGE |-> "CHALLENGE"
]

TX_Type == [
FORCE_MOVE |-> "FORCE_MOVE",
REFUTE |-> "REFUTE",
RESPOND |-> "RESPOND"
]

Range(f) == { f[x] : x \in DOMAIN f }
Maximum(a,b) == IF a > b THEN a ELSE b

=============================================================================
\* Modification History
\* Last modified Tue Sep 10 18:36:13 MDT 2019 by andrewstewart
\* Created Tue Sep 10 18:35:45 MDT 2019 by andrewstewart