smite-ir: implement FundedChannelAnnouncementGenerator - #193
Conversation
ebc052b to
6cf5ef5
Compare
Generate a channel_announcement whose bitcoin keys and short_channel_id come from a real confirmed 2-of-2 P2WSH funding output, so the message can pass the on-chain UTXO validation performed by CLN and LND.
6cf5ef5 to
80aa097
Compare
FundedChannelAnnouncementGenerator
NishantBansal2003
left a comment
There was a problem hiding this comment.
I think we should update the existing channel announcement generator to only create, broadcast, and mine the tx, and then use that SCID only. Otherwise, there isn't much difference between the two, and we can always test all the other cases with the current set of mutators. WDYT?
Also, does it make sense to include a full gossip generator that creates a fully funded channel announcement, followed by a node announcement and then a channel update for it?
i think Keeping both generators preserves cheap bogus-SCID testing without block-mining overhead.
Yes, worth doing - |
Generates programs that send
channel_announcementmessages whose bitcoin keys andshort_channel_idcome from a real confirmed 2-of-2 P2WSH funding output, so they can pass the on-chain UTXO validation performed by CLN and LND.#155 resolved the
short_channel_idhalf of this, but nothing ever emitted the operation, andChannelAnnouncementGeneratorpicks its bitcoin keys withgenerate_fresh, unrelated to any funding output. Deriving the funding pubkeys from the announced private keys closes the gap. No new operations are needed, sinceDerivePoint,CreateFundingTransaction,BroadcastTransaction,MineBlocks, andLookupShortChannelIdalready compose.ChannelAnnouncementGeneratoris left alone, mirroring the existingOpenChannelGenerator/FundingFlowGeneratorsplit.CreateFundingTransactionaborts the whole program when coin selection fails, so folding the funding sequence into the existing generator would make everychannel_announcementcontingent on it and cost us the cheap path that always sends.funding_satoshisandfeerate_per_kware emitted directly instead of picked, sincegenerate_fresh(Amount)draws from the full u64 range and exceedsMAX_MONEYabout 99.99% of the time, which aborts nearly every program before the announcement is built.OperationParamMutatorcan still widen both.FundingFlowGeneratorpicks those same two values and has the same exposure, which seems worth a follow-up.Tested with unit tests covering the ordering of the funding sequence, that each announced bitcoin key is the one behind the corresponding funding pubkey, and that the generated amounts stay in range. Not yet fuzzed against the targets; I'll follow up with coverage once I've run a campaign.
Ref: #71