Skip to content

Commit

Permalink
fix(events): properly disable actor events API via cfg
Browse files Browse the repository at this point in the history
Now EventFilterManager is received as an interface, setting it to `nil` isn't
enough for the `== nil` checks inside ActorEventHandler.
  • Loading branch information
rvagg committed Mar 13, 2024
1 parent a617f81 commit ea2d079
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions node/modules/actorevent.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,13 @@ func EventFilterManager(cfg config.EventsConfig) func(helpers.MetricsCtx, repo.L

func ActorEventHandler(cfg config.EventsConfig) func(helpers.MetricsCtx, repo.LockedRepo, fx.Lifecycle, *filter.EventFilterManager, *store.ChainStore, *stmgr.StateManager, EventHelperAPI, *messagepool.MessagePool, full.StateAPI, full.ChainAPI) (*full.ActorEventHandler, error) {
return func(mctx helpers.MetricsCtx, r repo.LockedRepo, lc fx.Lifecycle, fm *filter.EventFilterManager, cs *store.ChainStore, sm *stmgr.StateManager, evapi EventHelperAPI, mp *messagepool.MessagePool, stateapi full.StateAPI, chainapi full.ChainAPI) (*full.ActorEventHandler, error) {

if !cfg.EnableActorEventsAPI || cfg.DisableRealTimeFilterAPI {
fm = nil
return full.NewActorEventHandler(
cs,
nil, // no EventFilterManager disables API calls
time.Duration(build.BlockDelaySecs)*time.Second,
abi.ChainEpoch(cfg.MaxFilterHeightRange),
), nil
}

return full.NewActorEventHandler(
Expand Down

0 comments on commit ea2d079

Please sign in to comment.