-
Notifications
You must be signed in to change notification settings - Fork 251
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
perf: use ahash for reserved keys set #3001
base: master
Are you sure you want to change the base?
Conversation
This change is technically a breaking change given that the reserved keys set and its consumers primarily live in the sdk crate. We already broke the API in v2.0 and so maybe one could argue that a backport to v2.0 before mainnet moves over would be ok. But still far from ideal and will inevitably still break some downstream users. @apfitzge how far away are we from being able to make a change like this to an internal transaction type which is not subject to a backwards compatibility policy? |
can we just make this generic over any hasher? it doesn't really matter which hasher we use, right? for performance in validator we can use ahash, but for client-side i think using default is fine, and being generic would probably make this not break most existing code? |
That's not a bad idea but I don't think it will make things much better. Without generics you could be passing It would be nice if we could specific a default type for the generic but support for doing that on functions is getting phased out according to this error I got:
So I don't think there's anyway this is not going to be a breaking change |
Got it - still would be nicer (imo) to have flexibility in hash function. |
Thought maybe we could define a wrapper type with a default generic param for the internal map. EDIT: interestingly, as pointed out to me on twitter, it does work with |
Problem
The reserved keys set introduced in #84 for SIMD-0105 uses the default cryptographically secure siphash algorithm used by
HashSet
. The reserved keys set implementation doesn't require a cryptographically secure hash algorithm so it should use a faster hash algorithm.Summary of Changes
ahash
for the reserved keys setFixes #