Skip to content

Commit

Permalink
chore(events): remove unnecessary DisableRealTimeFilterAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Oct 17, 2024
1 parent 54d6632 commit 3617fc3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 31 deletions.
7 changes: 0 additions & 7 deletions documentation/en/default-lotus-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,6 @@


[Events]
# DisableRealTimeFilterAPI will disable the RealTimeFilterAPI that can create and query filters for actor events as they are emitted.
# The API is enabled when Fevm.EnableEthRPC or EnableActorEventsAPI is true, but can be disabled selectively with this flag.
#
# type: bool
# env var: LOTUS_EVENTS_DISABLEREALTIMEFILTERAPI
#DisableRealTimeFilterAPI = false

# EnableActorEventsAPI enables the Actor events API that enables clients to consume events
# emitted by (smart contracts + built-in Actors).
# This will also enable the RealTimeFilterAPI and HistoricFilterAPI by default, but they can be
Expand Down
11 changes: 5 additions & 6 deletions node/config/def.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,11 @@ func DefaultFullNode() *FullNode {
EthBlkCacheSize: 500,
},
Events: EventsConfig{
DisableRealTimeFilterAPI: false,
EnableActorEventsAPI: false,
FilterTTL: Duration(time.Hour * 1),
MaxFilters: 100,
MaxFilterResults: 10000,
MaxFilterHeightRange: 2880, // conservative limit of one day
EnableActorEventsAPI: false,
FilterTTL: Duration(time.Hour * 1),
MaxFilters: 100,
MaxFilterResults: 10000,
MaxFilterHeightRange: 2880, // conservative limit of one day
},
ChainIndexer: ChainIndexerConfig{
EnableIndexer: false,
Expand Down
7 changes: 0 additions & 7 deletions node/config/doc_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions node/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,10 +554,6 @@ type FevmConfig struct {
}

type EventsConfig struct {
// DisableRealTimeFilterAPI will disable the RealTimeFilterAPI that can create and query filters for actor events as they are emitted.
// The API is enabled when Fevm.EnableEthRPC or EnableActorEventsAPI is true, but can be disabled selectively with this flag.
DisableRealTimeFilterAPI bool

// EnableActorEventsAPI enables the Actor events API that enables clients to consume events
// emitted by (smart contracts + built-in Actors).
// This will also enable the RealTimeFilterAPI and HistoricFilterAPI by default, but they can be
Expand All @@ -581,11 +577,6 @@ type EventsConfig struct {
// MaxFilterHeightRange specifies the maximum range of heights that can be used in a filter (to avoid querying
// the entire chain)
MaxFilterHeightRange uint64

// Others, not implemented yet:
// Set a limit on the number of active websocket subscriptions (may be zero)
// Set a timeout for subscription clients
// Set upper bound on index size
}

type ChainIndexerConfig struct {
Expand Down
4 changes: 2 additions & 2 deletions node/modules/actorevent.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func EthEventHandler(cfg config.EventsConfig, enableEthRPC bool) func(helpers.Me
SubscribtionCtx: ctx,
}

if !enableEthRPC || cfg.DisableRealTimeFilterAPI {
if !enableEthRPC {
// all event functionality is disabled
// the historic filter API relies on the real time one
return ee, nil
Expand Down Expand Up @@ -141,7 +141,7 @@ 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 {
if !cfg.EnableActorEventsAPI {
return full.NewActorEventHandler(
cs,
nil, // no EventFilterManager disables API calls
Expand Down

0 comments on commit 3617fc3

Please sign in to comment.