Skip to content

Instantly share code, notes, and snippets.

@ddustin
Created November 7, 2023 17:59
Show Gist options
  • Select an option

  • Save ddustin/8940eb4317acdfbaeba979dfbd48f0df to your computer and use it in GitHub Desktop.

Select an option

Save ddustin/8940eb4317acdfbaeba979dfbd48f0df to your computer and use it in GitHub Desktop.

IMMEDIATELY AFTER RECEIVING CHANNEL_REESTABLISH

  • Do we have any active inflight splices?
    • Yes:
      • does latest splice inflight have commit and remote sig?
        • Yes: continue
        • No: send next_funding txid of latest inflight candidate, then, continue
      • peer sends next_funding value of:
        • None: Have I sent splice tx signatures?
          • Yes: Have I received splice tx signatures?
            • Yes: send nothing
            • No: unilaterally close
          • No: Delete inflight (send nothing)
        • Same as our next_funding: resume splice negotiation (send commit and splice sig)
        • Same as our channel txid: error; unilaterally close
        • Any other value: error; unilaterally close
    • No: do not send any next_funding txid
      • peer sends next_funding value of:
        • Same as our channel txid
          • resend splice_locked at the completion of reestablish
        • Any other value
          • Ignore, do not resume splice (we have nothing inflight to resume)
@ddustin
Copy link
Author

ddustin commented Nov 8, 2023

I reviewed lightning/bolts@36c04c8 further and I think we can do it this way. My implementation was structured around "what are the conditions we should resume the splice" and this spec is more piecemeal in what is sent and leaves uncertainty on what is received. Had to do some restructuring but this works. So, happy to do it this way and be consistent with dual-funding.

The thing we do need to add is the resending of splice_locked when you receive next_funding_txid that matches your current channel_txid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment