Skip to content

feat(paych): add EnablePaymentChannelManager config option #13139

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

sumitvekariya
Copy link
Contributor

add EnablePaymentChannelManager config option to disable payment channel manager by default

This change introduces a new configuration option EnablePaymentChannelManager to control whether the payment channel manager is started on node startup.

  • Added EnablePaymentChannelManager boolean field to FullNode config struct
  • Set default value to false (disabled by default) since payment channels get minimal use on mainnet
  • Added conditional wiring in node/builder_chain.go to only start payment channel manager when config option is enabled
  • Updated config documentation with clear description of the option

This saves resources for light nodes and most full nodes that don't use payment channel functionality, while still allowing users to enable it when needed by setting EnablePaymentChannelManager: true in their config.

Related Issues

#12718

Proposed Changes

  • Config Addition: New EnablePaymentChannelManager boolean field in FullNode config struct
  • Default Behavior: Payment channel manager disabled by default (false)
  • Conditional Service Wiring: Modified dependency injection in node/builder_chain.go to only wire payment channel services when enabled
  • Documentation: Updated config auto-generated documentation
  • Changelog: Added entry to UNRELEASED section following contribution conventions

Additional Info

  • Backward Compatibility: Full backward compatibility maintained - users can enable payment channels by setting EnablePaymentChannelManager: true
  • Resource Savings: Eliminates unnecessary resource usage for nodes that don't use payment channels
  • Testing: All existing payment channel tests pass, config tests updated with new default

Checklist

Before you mark the PR ready for review, please make sure that:

… payment channel manager by default

This change introduces a new configuration option EnablePaymentChannelManager to control whether the payment channel manager is started on node startup.

- Added EnablePaymentChannelManager boolean field to FullNode config struct

- Set default value to false (disabled by default) since payment channels get minimal use on mainnet

- Added conditional wiring in node/builder_chain.go to only start payment channel manager when config option is enabled

- Updated config documentation with clear description of the option

This saves resources for light nodes and most full nodes that don't use payment channel functionality, while still allowing users to enable it when needed by setting EnablePaymentChannelManager: true in their config.
- Updated default-lotus-config.toml with proper documentation for the new EnablePaymentChannelManager option
@Copilot Copilot AI review requested due to automatic review settings May 24, 2025 17:08
@github-project-automation github-project-automation bot moved this to 📌 Triage in FilOz May 24, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new configuration option to control the initialization of the payment channel manager. It introduces the boolean field EnablePaymentChannelManager, sets its default value to false, and conditionally wires the payment channel components in the node builder based on this flag.

  • Added the EnablePaymentChannelManager field to the FullNode config struct.
  • Updated the default configuration, documentation, and dependency injection in the node builder.
  • Removed the unconditional wiring of payment channel services and replaced it with conditional wiring.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
node/config/types.go Added configuration field and documentation comments.
node/config/doc_gen.go Updated auto-generated documentation to include the new option.
node/config/def.go Set default value for the new EnablePaymentChannelManager field.
node/builder_chain.go Replaced unconditional wiring of payment channel components with conditional wiring based on the configuration flag.

Updated the CHANGELOG.md entry for EnablePaymentChannelManager feature with the actual PR number from the created pull request.
@@ -8,6 +8,7 @@
> * [CHANGELOG_1.2x.md](./documentation/changelog/CHANGELOG_1.2x.md) - v1.20.0 to v1.29.2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

too many edits in this file, please back out the 3 edits below line 11

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, removed all the 3 changes below line 11

@rvagg
Copy link
Member

rvagg commented May 26, 2025

I think this is fine. Need some removals in CHANGELOG.md, make gen is needed to get CI to run and I'd like to do some tests with this locally.

For the record, the thing that bothers me about the payment channel manager is that it actively listens to head changes and looks for messages that match its schema of things to act on. Mostly this is a very minor activity, hardly measurable. But it does become measurable when you're running in lite mode, pointing to a remote, where head change listening requires API calls. I ran into this problem when doing gateway rate limiting because the gateway is effectively a lite client. So I expect that test will fail here and need to be adjusted.

It's not a huge concern, this is just a minor cleanup and we're not removing payment channel functionality or touching anything on chain. We're just preventing a node participating in payment channels while this option is turned off but it can easily be turned on again if ever required.

…nce from PR_NUMBER to 13139 - Remove unintended formatting changes as requested by reviewer
@BigLep BigLep requested a review from rvagg May 27, 2025 06:09
@BigLep BigLep moved this from 📌 Triage to 🔎 Awaiting Review in FilOz May 27, 2025
@rvagg
Copy link
Member

rvagg commented Jun 12, 2025

Odd DI errors assembling lotus:

        	            	    missing type:
        	            	    	- *paychmgr.Manager (did you mean to Provide it?)

In theory, paychmgr.Manager shouldn't be needed with that chunk of code moved into a conditional in builder_chain.go, only this: Override(new(*paychmgr.Manager), modules.NewManager) and this: Override(HandlePaymentChannelManagerKey, modules.HandlePaychManager) should be caring about it as far as I can tell. So there must be some downstream dependency that depends on it indirectly. I'm just not seeing it. This will need some investigation and experimentation. @sumitvekariya you're welcome to tinker further with this to try and get to the bottom of it. The uber/fx framework (for DI / Direct Injection) we use in builder_chain.go is basically defining how to make the components and then it's up to the DI framework then uses that knowledge to piece together what it needs for a final Lotus instance. The error is suggesting that something still needs a *paychmgr.Manager but we've branched out the part where we tell it how to make one. So we need to figure out who needs it still.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🔎 Awaiting Review
Development

Successfully merging this pull request may close these issues.

3 participants