-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat(paych): add EnablePaymentChannelManager config option #13139
Conversation
Updated the CHANGELOG.md entry for EnablePaymentChannelManager feature with the actual PR number from the created pull request.
I think this is fine. Need some removals in CHANGELOG.md, 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. |
Odd DI errors assembling lotus:
In theory, |
Thanks for the guidance @rvagg! I found and fixed the issue. The problem was indeed a downstream dependency - the DI framework was having trouble with the field ordering in the config struct. SolutionThe fix was reordering the Status✅ Build now succeeds - no more missing The solution was simpler than expected - no changes to |
No, sadly, ordering in config isn't going to make a difference since it's loaded entirely first and then used later.
|
… 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. docs: add documentation for EnablePaymentChannelManager config option - Updated default-lotus-config.toml with proper documentation for the new EnablePaymentChannelManager option docs: update CHANGELOG.md with PR number filecoin-project#13139 Updated the CHANGELOG.md entry for EnablePaymentChannelManager feature with the actual PR number from the created pull request. fix: address reviewer feedback on CHANGELOG.md - Fix PR number reference from PR_NUMBER to 13139 - Remove unintended formatting changes as requested by reviewer feat(paych): fix gen-check docs: update config documentation after reordering EnablePaymentChannelManager field
f3578f1
to
4b216fa
Compare
OK, I figured it out. The real problem is that our So this is what I've done:
I also rebased on top of the current master and squashed all of the existing commits into one. |
…y 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. docs: add documentation for EnablePaymentChannelManager config option - Updated default-lotus-config.toml with proper documentation for the new EnablePaymentChannelManager option docs: update CHANGELOG.md with PR number filecoin-project#13139 Updated the CHANGELOG.md entry for EnablePaymentChannelManager feature with the actual PR number from the created pull request. fix: address reviewer feedback on CHANGELOG.md - Fix PR number reference from PR_NUMBER to 13139 - Remove unintended formatting changes as requested by reviewer feat(paych): fix gen-check docs: update config documentation after reordering EnablePaymentChannelManager field
fix(paych): add DisabledPaychAPI stub to return errors when external paych API is called fix(cfg): introduce PaymentChannels top-level config option fix(test): make integration tests work with paych disabled
943b7bb
to
71c40a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds a new EnablePaymentChannelManager
flag to the full node config to disable the payment channel manager by default and wires in a stubbed API when disabled.
- Introduce
PaymentChannelsConfig.EnablePaymentChannelManager
(default:false
) - Conditional DI in
builder_chain.go
to use eitherPaychImpl
orDisabledPaych
- Update docs, defaults, tests, and changelog
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
node/impl/paych/paych.go | Define PaychAPI interface, real and disabled implementations |
node/config/types.go | Add PaymentChannelsConfig struct with new boolean field |
node/config/doc_gen.go | Update doc-gen mappings for new section |
node/config/def.go | Set default EnablePaymentChannelManager: false |
node/builder_chain.go | Conditionally wire payment channel manager or stub |
itests/paych_cli_test.go | Enable flag in CLI tests |
itests/paych_api_test.go | Enable flag in API tests and add disabled-mode tests |
documentation/en/default-lotus-config.toml | Add default TOML snippet for [PaymentChannels] |
CHANGELOG.md | Add entry for new config option |
Comments suppressed due to low confidence (2)
node/config/doc_gen.go:357
- The "Type" entry for the PaymentChannels section uses "PaychConfig" but the actual struct is named "PaymentChannelsConfig". Update this for consistency in generated docs.
Type: "PaychConfig",
node/impl/paych/paych.go:18
- [nitpick] There is already a
PaychAPI
in thepaychmgr
package, which can be confusing. Consider renaming this interface (e.g.PaymentChannelAPI
orPaychHandler
) for clarity.
// PaychAPI is the external interface that Lotus provides for interacting with payment channels.
I've renamed the duplicate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to have to ask for another review of this from someone else since most of the changeset is now mine. But I think it's good to go, and it's in 3 clear commits that I think can be rebase-merged as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love this. Very clean and a great simplification of the lotus process. Thanks all for getting this done.
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.
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
EnablePaymentChannelManager
boolean field inFullNode
config structfalse
)node/builder_chain.go
to only wire payment channel services when enabledAdditional Info
EnablePaymentChannelManager: true
Checklist
Before you mark the PR ready for review, please make sure that: