Skip to content

Replace OUR_MAX_HTLCS constant with a config knob #1990

Closed

Description

@TheBlueMatt

Basically what it says on the tin - add a new config knob and use it in place of OUR_MAX_HTLCS, writing an even TLV if its not 50 to break forwards compat.

Activity

  1. added this to the 0.0.115 milestone on Jan 26, 2023
  2. ariard commented on Jan 27, 2023

    @ariard

    The config knob should warn the post-anchor fee-bumping reserves should be scale in consequence (or we do that under the hood). And probably few other warnings.

  3. swilliamson5 commented on Mar 6, 2023

    @swilliamson5

    I'd like to help! I'll take this as a first issue. I'll need some guidance and I might also post in the Discord for help if needed.

  4. swilliamson5 commented on Mar 26, 2023

    @swilliamson5

    Sorry for the delay, working on trying to figure out how to properly test this. I'm relatively new to LDK and Lightning development so I could be in over my head here. Here's a code snippet for the "even TLV" change. Also, I added a new field to the Channel struct in channel.rs to replace the referenced constant where possible. Let me know if I am way off!

    write_tlv_fields!(writer, {
    ...
      (27, self.channel_keys_id, required),
      (28, Some(self.max_accepted_htlcs), option),
    });
    
  5. valentinewallace commented on Mar 27, 2023

    @valentinewallace
    Contributor

    Sorry for the delay, working on trying to figure out how to properly test this. I'm relatively new to LDK and Lightning development so I could be in over my head here. Here's a code snippet for the "even TLV" change. Also, I added a new field to the Channel struct in channel.rs to replace the referenced constant where possible. Let me know if I am way off!

    write_tlv_fields!(writer, {
    ...
      (27, self.channel_keys_id, required),
      (28, Some(self.max_accepted_htlcs), option),
    });
    

    You can write it as required and read it as an option, which is a bit more succinct, but what you have would work. Matt also mentioned in the top-level comment that it should only be written if it's not 50.

    But, this sounds like a fine start, feel free to open a draft PR and you can get feedback there :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions