smite: use BOLT 9 feature bitfield primitives - #192
Open
NishantBansal2003 wants to merge 10 commits into
Open
Conversation
Required when moving fee checks to accept_channel oracle where we wouldn't need to construct the whole channel state just to compute the cost. Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
Define `AcceptChannelOracle` and migrate existing `accept_channel` validation into it, consolidating BOLT 2 v1 channel establishment checks: - verify `temporary_channel_id` maps to a sent `open_channel` - validate funding amounts and channel type presence - check the opener can afford the proposed commitment feerate - detect reused `temporary_channel_id`s before `funding_created` The oracle brings together validation that was previously spread across `record_recv_accept_channel()`, `verify_funding_signed()` and implicit checks. Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
NishantBansal2003
force-pushed
the
bolt-feature
branch
from
August 8, 2026 09:08
10e9d2b to
e0edea8
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.
Depends-on: #185
Adds BOLT 9 feature primitives, which are useful in places where we need to query different features/bits in negotiated features, channel_type, etc, to proceed further. This will also be useful in the future when we add dual-fund support, and is already useful when working on the
accept_channeloracle, where we need to query supported features/channel_typeThis PR also aggregates all the existing feature-related utilities into a single
Featuresstruct. I've only added the features currently used by smite, we can add more as needed in the future.Currently, I've only updated the places that actually need to query Features. I haven't changed wire messages that still use
Vec<u8>for features, to avoid changing a lot of code without any immediate benefit. I think we can usefeatures.rsas a utility whenever we need to query or manipulateFeatures, while continuing to useVec<u8>for wire messages where we don't need to inspect the feature bits