fix: code review

This commit is contained in:
Richard Ramos 2023-07-31 14:36:36 -04:00
parent d241dad546
commit 4e7909b38b
No known key found for this signature in database
GPG Key ID: 1CE87DB518195760
5 changed files with 5 additions and 5 deletions

View File

@ -73,7 +73,7 @@ func rlnFlags() []cli.Flag {
Value: &options.RLNRelay.MembershipContractAddress,
},
},
&cli.IntFlag{
&cli.Int64Flag{
Name: "rln-relay-bandwidth-threshold",
Value: 0,
Usage: "Message rate in bytes/sec after which verification of proofs should happen. Use 0 to disable bandwidth rate limits",

View File

@ -44,7 +44,7 @@ type RLNRelayOptions struct {
ETHPrivateKey *ecdsa.PrivateKey
ETHClientAddress string
MembershipContractAddress common.Address
BandwidthThreshold int
BandwidthThreshold int64
}
// FilterOptions are settings used to enable filter protocol. This is a protocol

View File

@ -76,7 +76,7 @@ func (w *WakuNode) mountRlnRelay(ctx context.Context) error {
var limiter *rate.Limiter
if w.opts.rlnRelayBandwidthThreshold != 0 {
limiter = rate.NewLimiter(rate.Limit(w.opts.rlnRelayBandwidthThreshold), w.opts.rlnRelayBandwidthThreshold)
limiter = rate.NewLimiter(rate.Limit(w.opts.rlnRelayBandwidthThreshold), int(w.opts.rlnRelayBandwidthThreshold))
}
rlnRelay, err := rln.New(w.Relay(), groupManager, w.opts.rlnRelayPubsubTopic, w.opts.rlnRelayContentTopic, w.opts.rlnSpamHandler, limiter, w.timesource, w.log)

View File

@ -106,7 +106,7 @@ type WakuNodeParameters struct {
keystorePassword string
rlnMembershipContractAddress common.Address
rlnRegistrationHandler func(tx *types.Transaction)
rlnRelayBandwidthThreshold int
rlnRelayBandwidthThreshold int64
keepAliveInterval time.Duration

View File

@ -12,7 +12,7 @@ import (
)
// WithRLNBandwidthThreshold sets the message rate in bytes/sec after which verification of proofs should happen
func WithRLNBandwidthThreshold(rateLimit int) WakuNodeOption {
func WithRLNBandwidthThreshold(rateLimit int64) WakuNodeOption {
return func(params *WakuNodeParameters) error {
params.rlnRelayBandwidthThreshold = rateLimit
return nil