Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

sdk/state: add min and max observation periods #284

Open
leighmcculloch opened this issue Sep 2, 2021 · 0 comments
Open

sdk/state: add min and max observation periods #284

leighmcculloch opened this issue Sep 2, 2021 · 0 comments

Comments

@leighmcculloch
Copy link
Contributor

The open proposal is included in the open agreement proposal created by the initiator.
https://github.com/stellar/experimental-payment-channels/blob/99c2143a18ae5f389e85ffc488ed220b7d5348c5/sdk/state/open.go#L14-L16

The state.Channel accepts any open proposal regardless of its observation period.
https://github.com/stellar/experimental-payment-channels/blob/99c2143a18ae5f389e85ffc488ed220b7d5348c5/sdk/state/open.go#L228-L245

The channel should have a minimum observation period that represents the minimum time the participant needs to be able to observe changes in the network. Without this an initiator could cause a responder to agree to a channel that the responder is not capable of contesting an early close.

The channel should have a maximum observation period that represents the maximum time the participants is willing to lock up their assets. Without this an initiator could cause a responders assets to be locked up indefinitely.

The open expiry works similar to what we need for the observation period:

https://github.com/stellar/experimental-payment-channels/blob/99c2143a18ae5f389e85ffc488ed220b7d5348c5/sdk/state/state.go#L13-L15

https://github.com/stellar/experimental-payment-channels/blob/99c2143a18ae5f389e85ffc488ed220b7d5348c5/sdk/state/open.go#L239-L242

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants