From 85680ef6facaa3b60adbfd04a36084fa45e0f55f Mon Sep 17 00:00:00 2001 From: HuangYi Date: Thu, 9 Nov 2023 16:02:38 +0800 Subject: [PATCH] add buffer --- rpc/namespaces/ethereum/eth/filters/filter_system.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/rpc/namespaces/ethereum/eth/filters/filter_system.go b/rpc/namespaces/ethereum/eth/filters/filter_system.go index f209d2b810..d6b24f365c 100644 --- a/rpc/namespaces/ethereum/eth/filters/filter_system.go +++ b/rpc/namespaces/ethereum/eth/filters/filter_system.go @@ -41,7 +41,10 @@ import ( evmtypes "github.com/evmos/ethermint/x/evm/types" ) -const subscriberName = "eth_filter" +const ( + subscriberName = "eth_filter" + subscribBufferSize = 2048 +) var ( txEvents = tmtypes.QueryForEvent(tmtypes.EventTx).String() @@ -134,11 +137,11 @@ func (es *EventSystem) subscribe(sub *Subscription) (*Subscription, pubsub.Unsub switch sub.typ { case filters.LogsSubscription: - chEvents, err = es.evtClient.Subscribe(ctx, subscriberName, sub.event) + chEvents, err = es.evtClient.Subscribe(ctx, subscriberName, sub.event, subscribBufferSize) case filters.BlocksSubscription: - chEvents, err = es.evtClient.Subscribe(ctx, subscriberName, sub.event) + chEvents, err = es.evtClient.Subscribe(ctx, subscriberName, sub.event, subscribBufferSize) case filters.PendingTransactionsSubscription: - chEvents, err = es.evtClient.Subscribe(ctx, subscriberName, sub.event) + chEvents, err = es.evtClient.Subscribe(ctx, subscriberName, sub.event, subscribBufferSize) default: err = fmt.Errorf("invalid filter subscription type %d", sub.typ) }