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

Split prefunded Channel into Inbound/Outbound channels #2077

Merged
merged 25 commits into from
Jun 16, 2023

Commits on Jun 14, 2023

  1. Move Channel fields into ChannelContext struct

    This is a first step for simplifying the channel state and introducing
    new unfunded channel types that hold similar state before being promoted
    to funded channels.
    
    Essentially, we want the outer `Channel` type (and upcoming channel types)
    to wrap the context so we can apply typestate patterns to the that wrapper
    while also deduplicating code for common state and other internal fields.
    dunxen committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    883afb3 View commit details
    Browse the repository at this point in the history
  2. Move Channel::opt_anchors to ChannelContext impl & move some util…

    … fns
    
    This is one of a series of commits to make sure methods are moved by
    chunks so they are easily reviewable in diffs. Unfortunately they are
    not purely move-only as fields need to be updated for things to
    compile, but these should be quite clear.
    dunxen committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    1503ebb View commit details
    Browse the repository at this point in the history
  3. Move Channel::get_update_time_counter and some other methods

    This is one of a series of commits to make sure methods are moved by
    chunks so they are easily reviewable in diffs. Unfortunately they are
    not purely move-only as fields need to be updated for things to
    compile, but these should be quite clear.
    
    This commit also uses these methods through the `context` field where
    needed for compilation and tests to pass due to the above change.
    dunxen committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    1ee0a66 View commit details
    Browse the repository at this point in the history
  4. Move Channel::channel_id and some other methods to ChannelContext

    … impl
    
    This is one of a series of commits to make sure methods are moved by
    chunks so they are easily reviewable in diffs. Unfortunately they are
    not purely move-only as fields need to be updated for things to
    compile, but these should be quite clear.
    
    This commit also uses the `context` field where needed for compilation
    and tests to pass due to the above change.
    dunxen committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    ede8324 View commit details
    Browse the repository at this point in the history
  5. Move Channel::build_commitment_transaction to ChannelContext impl

    This is one of a series of commits to make sure methods are moved by
    chunks so they are easily reviewable in diffs. Unfortunately they are
    not purely move-only as fields need to be updated for things to
    compile, but these should be quite clear.
    
    This commit also uses the `context` field where needed for compilation
    and tests to pass due to the above change.
    dunxen committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    497aeb0 View commit details
    Browse the repository at this point in the history
  6. Move Channel::build_holder_transaction_keys and some other methods

    This is one of a series of commits to make sure methods are moved by
    chunks so they are easily reviewable in diffs. Unfortunately they are
    not purely move-only as fields need to be updated for things to
    compile, but these should be quite clear.
    
    This commit also uses the `context` field where needed for compilation
    and tests to pass due to the above change.
    dunxen committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    0d739ee View commit details
    Browse the repository at this point in the history
  7. Move Channel::get_feerate_sat_per_1000_weight and other methods

    This is one of a series of commits to make sure methods are moved by
    chunks so they are easily reviewable in diffs. Unfortunately they are
    not purely move-only as fields to be updated for things to
    compile, but these should be quite clear.
    
    This commit also uses the `context` field where needed for compilation
    and tests to pass due to the above change.
    
    f s/tarcontext.get_/target_/
    dunxen committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    3ff94fa View commit details
    Browse the repository at this point in the history
  8. Prepare some methods for upcoming moves to ChannelContext

    To reduce interleaving in commits, we introduce a `context` variable
    in methods to be moved in upcoming commits so there is minimal change
    with the moves.
    dunxen committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    2774aa2 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    ed6a5bb View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    08ee72b View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    9f4e714 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    60706d6 View commit details
    Browse the repository at this point in the history
  13. Convert ChannelDetails::from_channel to `ChannelDetails::from_chann…

    …el_context`
    
    This rename and refactor is so that we can get channel details from a
    `ChannelContext` which is a common object to all channels.
    dunxen committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    25c1ad8 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    e3f0c55 View commit details
    Browse the repository at this point in the history
  15. Move channel constants up

    dunxen committed Jun 14, 2023
    Configuration menu
    Copy the full SHA
    1012526 View commit details
    Browse the repository at this point in the history

Commits on Jun 15, 2023

  1. Configuration menu
    Copy the full SHA
    883e056 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e6c2f04 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    baadeb7 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2ea27e0 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    4ad67cf View commit details
    Browse the repository at this point in the history
  6. Create and use methods for counting channels

    This commit also adds two new maps to `PeerState` for keeping track
    of `OutboundV1Channel`s and `InboundV1Channel`s so that further
    commits are a bit easier to review.
    dunxen committed Jun 15, 2023
    Configuration menu
    Copy the full SHA
    4b1e286 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    4a0cd5c View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    637e03a View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    8f93e2d View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    d957f36 View commit details
    Browse the repository at this point in the history