lightninglabs / lightninglabs/taproot-assets
tapfeatures: make negotiated-chan-cfg required
- Dominant language
- Go
- Stars
- 525
- Forks
- 150
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 31
Description
(N.b., entirely Fable-generated.)
#2278 introduced the negotiated-chan-cfg aux channel feature bit (bits 4/5). When both peers signal it, the initial (height zero) commitment of an asset channel is derived from the negotiated local and remote channel configs (dust limit, CSV delay), as handed to the aux funding controller by lnd (lightningnetwork/lnd#10804). Peers that don't signal it fall back to the old derivation from zeroed configs, so channels can still be opened with older versions.
The bit is currently advertised as optional. Phase 2 is to flip it to required, at which point the zeroed-config fallback (and the funding-time inconsistency it preserves for old-peer channels) is retired.
Steps
- Advertise NegotiatedChanCfgRequired instead of NegotiatedChanCfgOptional in ourFeatures().
- Peers that don't signal the feature are then rejected at init by checkRequiredBits; the funding-time check in applyNegotiatedChanCfg (ErrNegotiatedChanCfgRequired) remains as a second line of defence.
- Update TestNegotiatedChanCfgFeature, which pins the optional advertisement.
- Consider removing the config-zeroing fallback in applyNegotiatedChanCfg, which becomes unreachable.
- Release notes entry: peers on v0.8.x and earlier can no longer open asset channels with (or connect to) v0.10 nodes.
Compatibility
v0.9.0 nodes advertise the bit as optional, so only pre-v0.9.0 peers are affected by the rejection.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with ourFeatures() and trace the negotiated-chan-cfg feature handling through checkRequiredBits and applyNegotiatedChanCfg. Update TestNegotiatedChanCfgFeature to cover the required advertisement, verify the obsolete config-zeroing fallback is unreachable or removable, and add the compatibility note to the release notes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 70/100