Skip to content

Milestone 4: Co-op Channel Closes #98

Description

@ekzyis

Fuzz scenario

PostChannelReadySetup: We want to fuzz starting with shutdown followed by closing_complete and closing_sig, so we need to have an open, ready channel and option_simple_close must have been negotiated during init exchange. Therefore, the scenario setup would be a modified or extended version of PostInitSetup which includes option_simple_close, opening a channel and waiting for channel_ready:

  Smite                         Target
    |                              |
    |----------- init ------------>|
    |    *option_simple_close*     |
    |<---------- init -------------|
    |    *option_simple_close*     |
    |                              |
    |-------- open_channel ------->|
    |<------ accept_channel -------|
    |------- funding_created ----->|
    |<------ funding_signed -------|
    |                              |
    |  [tx broadcast+mine blocks]  |
    |                              |
    |------- channel_ready ------->|
    |<------ channel_ready --------|
    |                              |
    |---------- ping ------------->|
    |<--------- pong --------------|
    |                              |
    +---------- SNAPSHOT ----------+

During fuzzing, a mutual close is negotiated with a shutdown exchange. Since there are no pending HTLCs, an exchange of closing_complete and closing_sig should immediately follow:

  Smite                         Target
    +---------- SNAPSHOT ----------+
    |                              |
    |---------- shutdown --------->|
    |<--------- shutdown ----------|
    |                              |
    |------ closing_complete ----->|
    |<----- closing_complete ------|
    |                              |
    |--------- closing_sig ------->|
    |<-------- closing_sig --------|

Advanced scenarios could fuzz additional exchanges of closing_complete+closing_sig messages to bump fees etc.

What's needed?

Setup

  • PostChannelReadySetup: see above

Messages

Operations

For funding flow:

For closing flow:

Generator

  • ChannelCloseGenerator:

emits instructions for channel close flow with:

  • CreateClosingTransaction
  • BuildClosingComplete
  • SendClosingComplete
  • RecvClosingSig

assumes option_simple_close was negotiated

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions