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

chore(events): remove unnecessary DisableRealTimeFilterAPI #12610

Merged
Merged
Show file tree
Hide file tree
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
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
Loading