go-perun icon indicating copy to clipboard operation
go-perun copied to clipboard

Risk of conflicting channel states

Open matthiasgeihs opened this issue 3 years ago • 0 comments

Location

Package client

Problem

Consider the situation where two clients propose an update to each other at the same time. The following will happen:

  1. Clients will have locked their channel before sending update proposal.
  2. Clients receive update from other client, but need to wait until channel unlocked.
  3. Update proposal lock will eventually time out and be released.
  4. Update proposal will now be processed.
  5. Potentially both clients could now accept the update from the other client, and thereby end up in conflicting states.

Proposal

We must be able to detect the situation where we are signing a state with the same version but different content. In this case, we should probably reject signing. This can be done in channel/machine.go; fn machine.Sig. If such a situation arises, we probably want to settle the channel afterwards, as we will probably not be able to continue updating the state.

In the future, we can also look for how to resolve the situation with a dedicated protocol. For example, we could raise the detected inconsistency and engage in a protocol that decides with which state to continue.

matthiasgeihs avatar Oct 14 '22 09:10 matthiasgeihs