-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix: add max results error and default raw codec for eth_getLogs #12671
base: master
Are you sure you want to change the base?
fix: add max results error and default raw codec for eth_getLogs #12671
Conversation
chain/index/events.go
Outdated
@@ -563,6 +566,9 @@ func makePrefillFilterQuery(f *EventFilter) ([]any, string, error) { | |||
clauses = append(clauses, "("+strings.Join(subclauses, " OR ")+")") | |||
} | |||
} | |||
} else { | |||
clauses = append(clauses, "ee.codec=?") | |||
values = append(values, uint64(multicodec.Raw)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work because we call this method from both the eth APIs and also GetActorEventsRaw
and SubscribeActorEventsRaw
and these APIs want any codec if they don't specify a KeysWithCodec
.
I think what you might need to do is extend EventFilter
to add a OnlyRaw
, or WithCodec
or something like that so that when this gets called from the Eth APIs, that can be set so we can restrict to Raw only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah while testing I realised this. So after going over the code I agree with you on extending the EventFilter
.
I am in favour of adding an optional field in EventFilter
suggesting, filtering based on this codec
if keys are not available.
Codec *uint64 // Optional codec filter, used only if keys are not available
Note: We can also use array of codecs
, but I don't think it will be useful because we only use two codecs (CBOR and RAW) to filter from.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, for now just Codec
is fine, "only used if KeysWithCodec is not set"
Related Issues
#12636
Proposed Changes
Checklist
Before you mark the PR ready for review, please make sure that: