go-nitro
go-nitro copied to clipboard
Protect against `isFinal` attack.
If a counterparty sends us an isFinal=true state, they can check out with that state at any time if they get all the countersignatures.
I think there are two protection mechanisms:
- Check all incoming states and refuse to countersign an
isFinal=truestate unless doing so under the context of running adirectdefundorvirtualdefundprotocol. - If we get such a state is some other context, follow the usual rules for closing a channel (as if receiving a
CloseChannelrequest). i.e. reject existing objective, spawn adirect/virtualdefundobjective.
https://docs.statechannels.org/protocol-tutorial/0070-finalizing-a-channel/#on-chain-calling-conclude