Skip to content

Commit

Permalink
chore: set limit to 5000 to not choke eth1 node and start rln before …
Browse files Browse the repository at this point in the history
…relay
  • Loading branch information
richard-ramos committed Aug 24, 2023
1 parent 624fe1b commit ddb08ad
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
14 changes: 7 additions & 7 deletions waku/v2/node/wakunode2.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,13 @@ func (w *WakuNode) Start(ctx context.Context) error {
}
}

if w.opts.enableRLN {
err = w.startRlnRelay(ctx)
if err != nil {
return err
}
}

w.relay.SetHost(host)

if w.opts.enableRelay {
Expand Down Expand Up @@ -492,13 +499,6 @@ func (w *WakuNode) Start(ctx context.Context) error {
}
}

if w.opts.enableRLN {
err = w.startRlnRelay(ctx)
if err != nil {
return err
}
}

return nil
}

Expand Down
4 changes: 4 additions & 0 deletions waku/v2/node/wakunode2_rln.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ func (w *WakuNode) setupRLNRelay() error {
var err error
var groupManager rln.GroupManager

if !w.opts.enableRLN {
return nil
}

if !w.opts.rlnRelayDynamic {
w.log.Info("setting up waku-rln-relay in off-chain mode")

Expand Down
2 changes: 1 addition & 1 deletion waku/v2/protocol/rln/group_manager/dynamic/web3.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func (gm *DynamicGroupManager) watchNewEvents(ctx context.Context, rlnContract *
}
}

const maxBatchSize = uint64(5000000) // TODO: tune this
const maxBatchSize = uint64(5000)
const additiveFactorMultiplier = 0.10
const multiplicativeDecreaseDivisor = 2

Expand Down

0 comments on commit ddb08ad

Please sign in to comment.