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

circuitv2: add a relay option to disable limits #2125

Merged
merged 1 commit into from
Feb 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions p2p/protocol/circuitv2/relay/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ func WithLimit(limit *RelayLimit) Option {
}
}

// WithInfiniteLimits is a Relay option that disables limits.
func WithInfiniteLimits() Option {
Comment on lines +21 to +22
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// WithInfiniteLimits is a Relay option that disables limits.
func WithInfiniteLimits() Option {
// WithInfiniteLimits is a Relay option that disables limits.
// Enabling this option doesn't apply any filter for which protocols can be used.
func WithInfiniteLimits() Option {

Would it be valuable to add this additional comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not the relay that limits the protocols, this is entirely a decision that the two endpoints using the relay make.

return func(r *Relay) error {
r.rc.Limit = nil
return nil
}
}

// WithACL is a Relay option that supplies an ACLFilter for access control.
func WithACL(acl ACLFilter) Option {
return func(r *Relay) error {
Expand Down