Skip to content

Commit

Permalink
add buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang committed Nov 9, 2023
1 parent 3905524 commit 85680ef
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions rpc/namespaces/ethereum/eth/filters/filter_system.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 85680ef

Please sign in to comment.