Skip to content

Commit 6e090f8

Browse files
committed
specs: Improvements to liveness checking specs
1 parent a3d3ae3 commit 6e090f8

File tree

1 file changed

+43
-11
lines changed

1 file changed

+43
-11
lines changed

specs/safe-liveness-checking.md

+43-11
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
- [Owner removal call flow](#owner-removal-call-flow)
1212
- [Shutdown](#shutdown)
1313
- [Security Properties](#security-properties)
14+
- [In the guard](#in-the-guard)
15+
- [In the module](#in-the-module)
1416
- [Interdependency between the guard and module](#interdependency-between-the-guard-and-module)
17+
- [Operational considerations](#operational-considerations)
18+
- [Manual validation of new owner liveness](#manual-validation-of-new-owner-liveness)
1519
- [Deploying the liveness checking system](#deploying-the-liveness-checking-system)
1620
- [Modify the liveness checking system](#modify-the-liveness-checking-system)
1721
- [Replacing the module](#replacing-the-module)
@@ -45,7 +49,18 @@ For implementing liveness checks a `LivenessGuard` is created which receives the
4549
each executed transaction, and tracks the latest time at which a transaction was signed by each
4650
signer. This time is made publicly available by calling a `lastLive(address)(Timestamp)` method.
4751

48-
Signers may also call the contract's `showLiveness()()` method directly in order to prove liveness.
52+
Owners are recorded in this mapping in one of 4 ways:
53+
54+
1. Upon deployment, the guard reads the current set of owners from the Safe contract.
55+
1. When a new owner is added to the safe. Similarly, when an owner is removed from the Safe, it's
56+
entry is deleted from the mapping.
57+
1. When a transaction is executed, the signatures on that transaction are passed to the guard and
58+
used to identify the signers. If more than the required number of signatures is provided, they
59+
are ignored.
60+
1. An owner may call the contract's `showLiveness()()` method directly in order to prove liveness.
61+
62+
Note that the first two methods do not require the owner to actually sign anything. However these mechanisms
63+
are necessary to prevent new owners from being removed before they have had a chance to show liveness.
4964

5065
### The liveness module
5166

@@ -85,25 +100,34 @@ sequenceDiagram
85100

86101
### Shutdown
87102

88-
In the unlikely event that the signer set (`N`) is reduced below the allowed threshold, then (and only then) is a
89-
shutdown mechanism activated which removes the existing signers, and hands control of the
90-
multisig over to a predetermined entity.
103+
In the unlikely event that the signer set (`N`) is reduced below the allowed minimum number of
104+
owners, then (and only then) is a shutdown mechanism activated which removes the existing
105+
signers, and hands control of the multisig over to a predetermined entity.
91106

92107
### Security Properties
93108

94109
The following security properties must be upheld:
95110

111+
#### In the guard
112+
96113
1. Signatures are assigned to the correct signer.
97114
1. Non-signers are unable to create a record of having signed.
98-
1. A signer cannot be censored or griefed such that their signing is not recorded.
99-
1. Signers may demonstrate liveness either by signing a transaction or by calling directly to the
115+
1. An owner cannot be censored or griefed such that their signing is not recorded.
116+
1. Owners may demonstrate liveness either by signing a transaction or by calling directly to the
100117
guard.
101-
1. The module only removes a signer if they have demonstrated liveness during the interval, or
102-
if necessary to convert the safe to a 1 of 1.
103-
1. The module sets the correct 75% threshold upon removing a signer.
118+
1. It must be impossible for the guard's `checkTransaction` or `checkAfterExecution` method to
119+
permanently revert given any calldata and the current state.
120+
1. The guard correctly handles updates to the owners list, such that new owners are recorded, and
121+
removed owners are deleted.
122+
1. An `ownersBefore` enumerable set variable is used to accomplish this, it must be emptied at
123+
the end of the `checkAfterExecution` call.
124+
125+
#### In the module
126+
104127
1. During a shutdown the module correctly removes all signers, and converts the safe to a 1 of 1.
105-
1. It must be impossible for the guard's checkTransaction or checkAfterExecution to permanently
106-
revert given any calldata and the current state.
128+
1. The module only removes an owner if they have not demonstrated liveness during the interval, or
129+
if enough other owners have been removed to activate the shutdown mechanism.
130+
1. The module correctly sets the Safe's threshold upon removing a signer.
107131

108132
Note: neither the module nor guard attempt to prevent a quorum of owners from removing either the liveness
109133
module or guard. There are legitimate reasons they might wish to do so. Moreover, if such a quorum
@@ -119,6 +143,14 @@ This means that the module can be removed or replaced without any affect on the
119143
The module however does have a dependency on the guard; if the guard is removed from the Safe, then
120144
the module will no longer be functional and calls to its `removeOwners` function will revert.
121145

146+
## Operational considerations
147+
148+
### Manual validation of new owner liveness
149+
150+
As [noted above](#the-liveness-guard) newly added owners are recorded in the guard without
151+
necessarily having signed a transaction. Off-chain validation of the liveness of an address must
152+
therefore be done prior to adding a new owner.
153+
122154
### Deploying the liveness checking system
123155

124156
[deploying]: #deploying-the-liveness-checking-system

0 commit comments

Comments
 (0)