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

Unclear specification of adjudication methods

Open matthiasgeihs opened this issue 3 years ago • 1 comments

Location

package client package channel

Problem

At the moment it is not clearly specified whether the adjudicator methods should wait for the correct phase before on-chain calls are made.

  • For example, Channel.ForceUpdate is designed such that it ensures the channel registration, but it does not wait for the dispute period to be over.
  • Another example is Channel.Withdraw. It enforces the registration of a channel in the dispute case, but it does not wait until the channel can be concluded.

Currently, it is implicitly in the responsibility of the chain backends to ensure the correct waiting period. However, this is not clearly specified and it could better be done consistently in the core client.

Proposal

Ensure that Channel.ForceUpdate and Channel.Withdraw wait until the corresponding phase is reached before sending the call to the Adjudicator.

matthiasgeihs avatar Aug 02 '22 19:08 matthiasgeihs

Side node: As the MockBackend used for testing the core does not use proper time out logic yet, these things are easily missed in the core client tests. We should implement the timeout logic for events emitted by the Mock Backend Subscription.

matthiasgeihs avatar Aug 02 '22 19:08 matthiasgeihs