-
Notifications
You must be signed in to change notification settings - Fork 69
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
Disable "ahash-compile-time-rng" feature in hashbrown. #36
Conversation
It looks like @eddyb hasn't signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement at the following URL: https://cla.parity.io Once you've signed, please reply to this thread with Many thanks, Parity Technologies CLA Bot |
[clabot:check] |
It looks like @eddyb signed our Contributor License Agreement. 👍 Many thanks, Parity Technologies CLA Bot |
Does it interfere with |
It depends if you want the build process (and the resulting binaries) to be deterministic (with this change) or not (without) - cc @rphmeier who merged paritytech/finality-grandpa#90. One thing I'll note is that any published binaries (e.g. WASM blobs on-chain) will have the seed extractable from them anyway, so that should be included in the attack model for hash collisions. |
I agree with @eddyb here, if needed then randomness should be obtained at runtime. At worse, we could handle ephemeral cases inside execute block by constructing the random seed from the parachain block hash or relay chain block hash or VRF output, so that everyone had equal seeds right now, but the seed gets created after the block. In fact, I'd worry more about alternative builds behaving differently. In particular, it appears There are tools like https://docs.rs/ordermap/0.4.2/ordermap/ that iterate over a randomized hashmap predictably or maybe |
This was my reasoning for merging the PR against finality-grandpa. Randomizing the seed only matters if you do so on each run of the program. In the case of on-chain WASM, it's fixed at compile-time. That bears re-evaluation of any of our usages of hash maps in our no-std crates, but that's beyond the scope of the PR. |
This will ensure that every build uses the same
ahash
seed, instead of a compile-time randomized one (which is now the default - see rust-lang/hashbrown#124, rust-lang/hashbrown#125, tkaitchuck/aHash#18 and tkaitchuck/aHash#25 for more details/background).(The other such update PR needed is paritytech/finality-grandpa#90).