Open leandro-ro opened 2 years ago
When ForceUpdate returns, the channel machine may still be in phase Progressing
. Only the on-chain event will progress the machine into phase progressed
, but ForceUpdate doesn't wait for that.
The way we currently receive on-chain events is via the adjudicator subscription. There you can also listen for on-chain progression events. Does that solve the issue? @leandro-ro
Location
client/adjudicate.go
Problem
When a client is enforcing an update via
ForceUpdate
(e.g., finalizing the channel) and tries to settle directly after, there is no guarantee that the progressed on-chain state persisted in time and is taken over to the client's off-chain state. There is no way to wait for on-chain progression. Hence, there is a short mismatch between these states, leading to problems when trying to settle because the off-chain state may not be finalized yet. This could also be a problem for other (asynchronous) channel participants.Proposal
Let
ForceUpdate
return an object that the user can wait for if desired.