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

Settling after finalization through ForceUpdate

Open leandro-ro opened this issue 2 years ago • 2 comments

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.

leandro-ro avatar Mar 23 '22 14:03 leandro-ro

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.

matthiasgeihs avatar Mar 28 '22 13:03 matthiasgeihs

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

matthiasgeihs avatar Jun 24 '22 06:06 matthiasgeihs