smite-ir: add CreateChannelConfig IR operation#103
Open
NishantBansal2003 wants to merge 1 commit into
Open
Conversation
This commit introduces a new compute operation, `CreateChannelConfig`, which constructs a `ChannelConfig` variable from static channel and party inputs. This `ChannelConfig` is then used by `BuildFundingCreated`. The main motivation for introducing `CreateChannelConfig` is to keep subsequent operations cleaner and avoid repeatedly passing many raw inputs. It also ensures that the exact same configuration used to build `funding_created` is later reused for verifying `funding_signed`, avoiding inconsistencies or false positives from reconstructing the config again during verification. From the mutator perspective, mutation coverage is effectively preserved, with mutations shifting from `BuildFundingCreated` to `CreateChannelConfig`. Since `ChannelConfig` becomes immutable after construction, it also guarantees stable inputs for later signature verification. Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
f9d64d1 to
ccadcf0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ref: #90 (comment)
Depends-on: #100
This commit introduces a new compute operation
CreateChannelConfig, which takes the static channel and party inputs and constructs a new variable typeChannelConfig. This will later be used as an input while constructing theBuildFundingCreatedmessage.Some reasons why I went with
CreateChannelConfigoperation in funding flow:BuildFundingCreatedcan now directly takeChannelConfiginstead of many raw inputs.funding_createddirectly from raw inputs is signature verification. Once we receivefunding_signed, we need the sameChannelConfigto verify the received signature. Reconstructing it again from raw inputs could lead to false positives if the reconstructed config differs from the original. By reusing the previously createdChannelConfig, verification stays consistent and avoids such issues.Some points worth mentioning are:
BuildFundingCreatedtoCreateChannelConfig. So I think we will still receive the same mutation coverage as before. After construction,ChannelConfigbecomes immutable, which helps preserve the exact configuration for later signature verification. Because of that, I do not think there is any real tradeoff from the mutator side.