-
Notifications
You must be signed in to change notification settings - Fork 2
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
Don't cut bytes from non-address topics + account for empty topics #108
base: main
Are you sure you want to change the base?
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @catalyst17 and the rest of your teammates on Graphite |
6912e8c
to
bd55ca1
Compare
if topic == "" { | ||
// if there is no indexed topic, indexer stores an empty string | ||
// we shouldn't pad and hexify such an argument then | ||
return "" |
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.
Can we change this to nil already since we're already working on this or will it blow it up too much?
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.
that's a separate thing I wanted to bring up, actually
saw this and thought that maybe we can actually leave it as is, but change the columns to not allow NULLs?
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, sounds good. Doesn't really matter '' or null for our use case. We can change the schema and then apply it manually
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.
since we anyway seem to have no benefit of NULL-ability in these columns and bloom filters are behaving the same way with negation - we can at least optimise some space and performance by completely turning it of
(and, consequently, continuing to use empty strings for topics that don't exist)
TL;DR
Improved handling of topic values in the
getTopicValueFormat
function.What changed?
getTopicValueFormat
function to handle empty topic strings.ethereum.FromHex
to convert the topic to bytesethereum.HexToAddress
was wrong in this context cause topics are not necessarily addresses)How to test?
Why make this change?
This change improves the robustness of topic value handling: