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

sdk/state: expose state as an enumeration #233

Closed
acharb opened this issue Aug 11, 2021 · 3 comments · Fixed by #259
Closed

sdk/state: expose state as an enumeration #233

acharb opened this issue Aug 11, 2021 · 3 comments · Fixed by #259
Assignees

Comments

@acharb
Copy link
Contributor

acharb commented Aug 11, 2021

the channel needs a way to signal what the current close state is (eg. need to close, or in the middle of closing). This PR introduces a flag for that, but other channel state is inferred from the latest agreements. See if we can do something similar with that.

Also, we'll need to unify using the close state in code outside the ingest code, eg. when proposing/confirming a close, and when checking to see if we can propose/confirm new payments it should be checking against this.

@acharb
Copy link
Contributor Author

acharb commented Aug 12, 2021

an option is we could store on the channel the initiator escrow account sequence number. And then infer from that what the close state is.

eg. if it's the latestCloseAgreement declTx then were in CLOSING, if it's less than that but greater than our starting seqNum then we're in NEEDS_CLOSING

edit: this is what this PR is doing. After that is merged, this ticket will be to track that the validations of when allowed to propose/confirm close agreements is checking against this new close state

@leighmcculloch leighmcculloch changed the title sdk/state: adding close state sdk/state: add close state Aug 17, 2021
@acharb acharb self-assigned this Aug 17, 2021
@leighmcculloch leighmcculloch changed the title sdk/state: add close state sdk/state: expose state as an enumeration Aug 17, 2021
@leighmcculloch
Copy link
Contributor

I've renamed this issue to expose state as an enumeration. I think we need a single enum that captures what the known on-network state of the channel is. We can still develop close and open states separately then combine them. The state should only be affected by ingestion.

@acharb
Copy link
Contributor Author

acharb commented Aug 27, 2021

closing out this ticket of one enum to represent channel state in this PR #259.

And creating this ticket to track changing the validations to check against the channel state #261

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

Successfully merging a pull request may close this issue.

2 participants