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
Messages
Operations
For funding flow:
For closing flow:
Generator
emits instructions for channel close flow with:
CreateClosingTransaction
BuildClosingComplete
SendClosingComplete
RecvClosingSig
assumes option_simple_close was negotiated
References
Fuzz scenario
PostChannelReadySetup: We want to fuzz starting withshutdownfollowed byclosing_completeandclosing_sig, so we need to have an open, ready channel andoption_simple_closemust have been negotiated duringinitexchange. Therefore, the scenario setup would be a modified or extended version ofPostInitSetupwhich includesoption_simple_close, opening a channel and waiting forchannel_ready:During fuzzing, a mutual close is negotiated with a
shutdownexchange. Since there are no pending HTLCs, an exchange ofclosing_completeandclosing_sigshould immediately follow:Advanced scenarios could fuzz additional exchanges of
closing_complete+closing_sigmessages to bump fees etc.What's needed?
Setup
PostChannelReadySetup: see aboveMessages
initping,pong)open_channelaccept_channelfunding_createdfunding_signedchannel_readyshutdownclosing_complete(smite: addclosing_completecodec #105)closing_sig(smite: addclosing_sigcodec #109)Operations
For funding flow:
BuildOpenChannelSendOpenChannelRecvAcceptChannelCreateFundingTransactionBuildFundingCreated(smite-ir: implementBuildFundingCreatedandSendFundingCreatedoperation #120)SendFundingCreated(smite-ir: implementBuildFundingCreatedandSendFundingCreatedoperation #120)RecvFundingSignedSendChannelReadyRecvChannelReadyFor closing flow:
SendShutdown(smite-ir: add SendShutdown operation #162)RecvShutdown(smite-ir: add RecvShutdown operation #163)CreateClosingTransactionBuildClosingCompleteSendClosingCompleteRecvClosingSigBroadcastTransactionMineBlocksGenerator
ChannelCloseGenerator:emits instructions for channel close flow with:
CreateClosingTransactionBuildClosingCompleteSendClosingCompleteRecvClosingSigassumes
option_simple_closewas negotiatedReferences