Hi
So I’m trying to make sure I fully understand the current implementation of the force move protocol. I’ve been through the code, and this is what I understand. Could someone quickly scan this and see if I’ve got it right? I’m skipping some trivial validation stuff
forceMove()
Checks:
- The turnnum record on chain matches the supplied turnnum, and that the other data stored is blank (which implies no current challenge)
- The turnnum of the last supplied state is greater or equal to this
- that the state chain up to this point consists of valid state transitions and signatures
- that the challenger is one of the participants
Does:
- stores the hash of various data relating to the challenge, flagging the channel as being challenged
respond()
Checks:
- that a timeout hasn’t passed
- that the hash of the supplied challenge state matches what’s stored on chain
- that the proposed new state has a turnnum of strictly one greater than the challenge turnnum, and is signed by the participant who’s turn it is
- that it’s a valid transition to a new state
Does:
- clears the challenge, writing the turnnum of the challenge + 1 to the chain
refute()
Checks:
- that a timeout hasn’t passed
- that the hash of the supplied challenge state matches what’s stored on chain
- that a supplier turnnum is greater than the turnnum stored on chain
- that some data that represents a later state is signed by the participant that initiated the challenge
Does:
- clears the challenge, writing the turnnum of the challenge to the chain
repondWithAlternative()
Checks:
- that a timeout hasn’t passed
- that the hash of the supplied challenge state matches what’s stored on chain
- that a new state chain consists of valid state transitions, is correctly signed, and ends up with a final state with a turnnum exactly one greater than the one being challenged
Does:
- clears the challenge, writing the turnnum of the challenge + 1 to the chain
That correct?
Thanks, Jeremy