smite-ir: add CreateFundingTransaction IR operation#90
Conversation
morehouse
left a comment
There was a problem hiding this comment.
Code looks good.
What's your vision for fitting CreateFundingTransaction into the funding flow?
I'm guessing we'll implement a BroadcastTx operation next that takes a FundingTransaction as an input? Does it make sense to have separate operations, or should we just combine into a single CreateAndBroadcastFundingTx? Or would it make sense to have a generic Transaction variable type instead of the more specific FundingTransaction?
| /// 1: `acceptor_funding_pubkey` (`Point`) | ||
| /// 2: `funding_satoshis` (`Amount`) | ||
| /// 3: `feerate_per_kw` (`FeeratePerKw`) | ||
| CreateFundingTransaction, |
There was a problem hiding this comment.
Nit: should we call it BuildFundingTransaction for consistency with similar operations?
There was a problem hiding this comment.
Hmm, actually I did not use Build* because we defined Build operations as Build: construct a BOLT message from inputs, so I thought using it here might be confusing. Since this is more of a compute operation, I thought of using Create* instead. But I'm fine with using Build* or maybe some other name if you'd prefer that
There was a problem hiding this comment.
Create* is fine with me as well for this category of operations. I don't think it matters much, as long as we establish a consistent pattern as we extend the IR.
So I was thinking we would have the following IR operations for the funding flow:
I mean, we can combine them, and initially I was thinking the same thing, but that would be less aligned with the LN flow, since there the broadcast happens only after I created
|
This all sounds good. My only concern is that we might miss out on some bugs if we always generate
We actually might need to extract the
No, I think your approach is better since it allows us to generate unexpected flows like broadcasting and mining out of order (before receiving
I like the idea of a |
Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
c43ff88 to
700ee19
Compare
Yes, I was thinking whether we can support this case in mutator? I think with this approach we can exercise a lot of different cases (including valid ones), which we currently are not covering. For example, right now we will always send the correct funding outpoint, but with this approach we could also exercise invalid outpoints. That would also allow us to use
Yep, I think for the funding flow we can proceed with the MVP approach, and in the future, if we need access to signatures, we can always add dedicated Another thing I wanted to discuss is the generator. I think for the funding flow, we might actually need to rename PS: I was thinking of opening an HTLC design/implementation plan issue so we can discuss extending the funding flow into normal channel operations, mainly around |
It's tricky -- raw-bytes mutation on the message itself isn't possible since we don't build the messages until runtime. So we need to enable mutators to instead change the individual input variables to the
SGTM
It might be worth having both -- I haven't thought too carefully about it, but it may also make sense to have individual generators for each funding flow message, and then have
Sounds good. |
This commit adds the
CreateFundingTransactionIR operation. For this, a newVariableType,FundingTransaction, has been added. This is required because we need the funding transaction after receiving the funding signed message so that we can broadcast the transaction and exchangechannel_readymessages