Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ChannelFeatures->ChannelType conversion #2753

Merged
merged 1 commit into from Sep 27, 2023

Conversation

pm47
Copy link
Member

@pm47 pm47 commented Sep 26, 2023

The ChannelFeatures->ChannelType conversion is problematic for the following reasons:

  • It creates an implicit bidirectional mapping between the two classes, which is illogical and error-prone because both directions must be kept in sync.
  • Not only must the conversions be kept in sync, it must also be stable over time.
  • From the spec p.o.v., the scope of ChannelType is really limited to channel opening negotiation, while we currently make it a permanent concept.
  • It has weird semantic side effects where we would check channel types in places where we really meant to check commitment formats.

The `ChannelFeatures`->`ChannelType` conversion is problematic for the following reasons:
- It creates an implicit bidirectional mapping between the two classes, which is illogical and error-prone because both directions must be kept in sync.
- Not only must the conversions be kept in sync, it must also be stable over time.
- From the spec p.o.v., the scope of `ChannelType` is really limited to channel opening negotiation, while we currently make it a permanent concept.
- It has weird semantic side effects where we would check channel types in places where we really meant to check commitment formats.
@pm47 pm47 requested a review from t-bast September 26, 2023 15:41
@codecov-commenter
Copy link

Codecov Report

Merging #2753 (3c8d906) into master (e3ba524) will increase coverage by 0.06%.
Report is 1 commits behind head on master.
The diff coverage is 100.00%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@            Coverage Diff             @@
##           master    #2753      +/-   ##
==========================================
+ Coverage   85.75%   85.82%   +0.06%     
==========================================
  Files         216      216              
  Lines       18061    18070       +9     
  Branches      743      756      +13     
==========================================
+ Hits        15488    15508      +20     
+ Misses       2573     2562      -11     
Files Coverage Δ
...r/acinq/eclair/blockchain/fee/OnChainFeeConf.scala 95.00% <ø> (-0.24%) ⬇️
...cala/fr/acinq/eclair/channel/ChannelFeatures.scala 100.00% <100.00%> (ø)
...in/scala/fr/acinq/eclair/channel/Commitments.scala 96.82% <100.00%> (+<0.01%) ⬆️
...c/main/scala/fr/acinq/eclair/channel/Helpers.scala 94.51% <100.00%> (+0.02%) ⬆️
...in/scala/fr/acinq/eclair/channel/fsm/Channel.scala 86.07% <100.00%> (+0.77%) ⬆️
...q/eclair/channel/fsm/ChannelOpenSingleFunded.scala 93.46% <100.00%> (ø)
...inq/eclair/channel/fund/InteractiveTxBuilder.scala 91.47% <100.00%> (+0.10%) ⬆️
...-core/src/main/scala/fr/acinq/eclair/io/Peer.scala 87.60% <100.00%> (ø)

... and 5 files with indirect coverage changes

@pm47 pm47 merged commit 5dfa0be into master Sep 27, 2023
1 check passed
@pm47 pm47 deleted the remove-channel-type-resolution branch September 27, 2023 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants