From f00ceeeb771a487eee7706186022cc5f86ea63bf Mon Sep 17 00:00:00 2001 From: mission Date: Tue, 21 Mar 2023 07:26:26 -0700 Subject: [PATCH 1/5] disabling check --- eth/filters/filter_system.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/eth/filters/filter_system.go b/eth/filters/filter_system.go index 9fc20f335b1a..1b163e529df3 100644 --- a/eth/filters/filter_system.go +++ b/eth/filters/filter_system.go @@ -34,7 +34,6 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rpc" ) @@ -241,10 +240,10 @@ func NewEventSystem(sys *FilterSystem, lightMode bool) *EventSystem { m.chainSub = m.backend.SubscribeChainEvent(m.chainCh) m.pendingLogsSub = m.backend.SubscribePendingLogsEvent(m.pendingLogsCh) - // Make sure none of the subscriptions are empty - if m.txsSub == nil || m.logsSub == nil || m.rmLogsSub == nil || m.chainSub == nil || m.pendingLogsSub == nil { - log.Crit("Subscribe for event system failed") - } + // // Make sure none of the subscriptions are empty + // if m.txsSub == nil || m.logsSub == nil || m.rmLogsSub == nil || m.chainSub == nil || m.pendingLogsSub == nil { + // log.Crit("Subscribe for event system failed") + // } go m.eventLoop() return m From 7b790c6bfc8a691c16ccd5c363182b0c39cc9e12 Mon Sep 17 00:00:00 2001 From: mission Date: Tue, 21 Mar 2023 07:44:50 -0700 Subject: [PATCH 2/5] added todo --- eth/filters/filter_system.go | 1 + 1 file changed, 1 insertion(+) diff --git a/eth/filters/filter_system.go b/eth/filters/filter_system.go index 1b163e529df3..39b0301286f4 100644 --- a/eth/filters/filter_system.go +++ b/eth/filters/filter_system.go @@ -240,6 +240,7 @@ func NewEventSystem(sys *FilterSystem, lightMode bool) *EventSystem { m.chainSub = m.backend.SubscribeChainEvent(m.chainCh) m.pendingLogsSub = m.backend.SubscribePendingLogsEvent(m.pendingLogsCh) + // TODO: disable this check once m.txsSub is implemented // // Make sure none of the subscriptions are empty // if m.txsSub == nil || m.logsSub == nil || m.rmLogsSub == nil || m.chainSub == nil || m.pendingLogsSub == nil { // log.Crit("Subscribe for event system failed") From 98ec4705f63179dc18bb41a4cab9cb6e83ffce5e Mon Sep 17 00:00:00 2001 From: mission Date: Tue, 21 Mar 2023 07:45:33 -0700 Subject: [PATCH 3/5] enableeeeeee --- eth/filters/filter_system.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/filters/filter_system.go b/eth/filters/filter_system.go index 39b0301286f4..4d8b03934e7f 100644 --- a/eth/filters/filter_system.go +++ b/eth/filters/filter_system.go @@ -240,7 +240,7 @@ func NewEventSystem(sys *FilterSystem, lightMode bool) *EventSystem { m.chainSub = m.backend.SubscribeChainEvent(m.chainCh) m.pendingLogsSub = m.backend.SubscribePendingLogsEvent(m.pendingLogsCh) - // TODO: disable this check once m.txsSub is implemented + // TODO: enable this check once m.txsSub is implemented // // Make sure none of the subscriptions are empty // if m.txsSub == nil || m.logsSub == nil || m.rmLogsSub == nil || m.chainSub == nil || m.pendingLogsSub == nil { // log.Crit("Subscribe for event system failed") From 59896ddee303e2c4b3b84d31a1895c7ec9fef82c Mon Sep 17 00:00:00 2001 From: mission Date: Tue, 21 Mar 2023 08:42:51 -0700 Subject: [PATCH 4/5] comment out txsub --- eth/filters/filter_system.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eth/filters/filter_system.go b/eth/filters/filter_system.go index 4d8b03934e7f..237d63dbb8a9 100644 --- a/eth/filters/filter_system.go +++ b/eth/filters/filter_system.go @@ -234,7 +234,7 @@ func NewEventSystem(sys *FilterSystem, lightMode bool) *EventSystem { } // Subscribe events - m.txsSub = m.backend.SubscribeNewTxsEvent(m.txsCh) + // m.txsSub = m.backend.SubscribeNewTxsEvent(m.txsCh) m.logsSub = m.backend.SubscribeLogsEvent(m.logsCh) m.rmLogsSub = m.backend.SubscribeRemovedLogsEvent(m.rmLogsCh) m.chainSub = m.backend.SubscribeChainEvent(m.chainCh) @@ -553,7 +553,7 @@ func (es *EventSystem) lightFilterLogs(header *types.Header, addresses []common. func (es *EventSystem) eventLoop() { // Ensure all subscriptions get cleaned up defer func() { - es.txsSub.Unsubscribe() + // es.txsSub.Unsubscribe() es.logsSub.Unsubscribe() es.rmLogsSub.Unsubscribe() es.pendingLogsSub.Unsubscribe() @@ -567,8 +567,8 @@ func (es *EventSystem) eventLoop() { for { select { - case ev := <-es.txsCh: - es.handleTxsEvent(index, ev) + // case ev := <-es.txsCh: + // es.handleTxsEvent(index, ev) case ev := <-es.logsCh: es.handleLogs(index, ev) case ev := <-es.rmLogsCh: From ca32487181d7ea603dd7ff866ae040e2be841ed9 Mon Sep 17 00:00:00 2001 From: mission Date: Tue, 21 Mar 2023 10:20:26 -0700 Subject: [PATCH 5/5] fn comment --- eth/filters/filter_system.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/eth/filters/filter_system.go b/eth/filters/filter_system.go index 237d63dbb8a9..af26a133a3ed 100644 --- a/eth/filters/filter_system.go +++ b/eth/filters/filter_system.go @@ -452,11 +452,11 @@ func (es *EventSystem) handleRemovedLogs(filters filterIndex, ev core.RemovedLog } } -func (es *EventSystem) handleTxsEvent(filters filterIndex, ev core.NewTxsEvent) { - for _, f := range filters[PendingTransactionsSubscription] { - f.txs <- ev.Txs - } -} +// func (es *EventSystem) handleTxsEvent(filters filterIndex, ev core.NewTxsEvent) { +// for _, f := range filters[PendingTransactionsSubscription] { +// f.txs <- ev.Txs +// } +// } func (es *EventSystem) handleChainEvent(filters filterIndex, ev core.ChainEvent) { for _, f := range filters[BlocksSubscription] {