Skip to content

Commit

Permalink
Update ICS 006 per @colinaxner changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cwgoes committed Oct 19, 2020
1 parent ade677a commit 128082e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Binary file modified spec.pdf
Binary file not shown.
13 changes: 10 additions & 3 deletions spec/ics-006-solo-machine-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Signatures are provided in the `Proof` field of client state verification functi

```typescript
interface Signature {
sig: []byte
data: []byte
timestamp: uint64
}
```
Expand Down Expand Up @@ -157,9 +157,16 @@ function checkMisbehaviourAndUpdateState(
h2 = misbehaviour.h2
pubkey = clientState.consensusState.publicKey
diversifier = clientState.consensusState.diversifier
timestamp = clientState.consensusState.timestamp
// assert that timestamp could have fooled the light client
assert(misbehaviour.h1.signature.timestamp >= timestamp)
assert(misbehaviour.h2.signature.timestamp >= timestamp)
// assert that signature data is different
assert(misbehaviour.h1.signature.data !== misbehaviour.h2.signature.data)
assert(checkSignature(pubkey, misbehaviour.sequence, diversifier, misbehaviour.h1.signature.sig))
assert(checkSignature(pubkey, misbehaviour.sequence, diversifier, misbehaviour.h2.signature.sig))
// assert that the signatures validate
assert(checkSignature(pubkey, misbehaviour.sequence, diversifier, misbehaviour.h1.signature.data))
assert(checkSignature(pubkey, misbehaviour.sequence, diversifier, misbehaviour.h2.signature.data))
// freeze the client
clientState.frozen = true
}
```
Expand Down

0 comments on commit 128082e

Please sign in to comment.