eth/filters: change limit to 1K

This commit is contained in:
Martin Holst Swende 2024-04-15 14:25:08 +02:00
parent 13f209ff47
commit 5a91d23df7
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0

View file

@ -43,6 +43,9 @@ var (
// The maximum number of topic criteria allowed, vm.LOG4 - vm.LOG0 // The maximum number of topic criteria allowed, vm.LOG4 - vm.LOG0
const maxTopics = 4 const maxTopics = 4
// The maximum number of allowed topics within a topic criteria
const maxSubTopics = 1000
// filter is a helper struct that holds meta information over the filter type // filter is a helper struct that holds meta information over the filter type
// and associated subscription in the event system. // and associated subscription in the event system.
type filter struct { type filter struct {
@ -562,7 +565,7 @@ func (args *FilterCriteria) UnmarshalJSON(data []byte) error {
case []interface{}: case []interface{}:
// or case e.g. [null, "topic0", "topic1"] // or case e.g. [null, "topic0", "topic1"]
if len(topic) > maxTopics { if len(topic) > maxSubTopics {
return errExceedMaxTopics return errExceedMaxTopics
} }
for _, rawTopic := range topic { for _, rawTopic := range topic {