Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Enumeratable dispatches using unhashed index in key #4278

Merged
merged 1 commit into from
Dec 2, 2019

Conversation

gavofyork
Copy link
Member

@gavofyork gavofyork commented Dec 2, 2019

Right now although we can enumerate all values of the democracy::DispatchQueue mapping, we cannot enumerate all the keys. This is a general failing of map, since it will be default use a cryptographic hash (Blake2) to index the item, which is by design not useful for deriving the key itself.

This uses a non-cryptographic hash (the key material is a block number coming from a high-friction governance process and cannot be easily or cheaply gamed) along with the index itself, allowing the index to be derived from the database key.

CC @jacogr

@gavofyork gavofyork added the A2-insubstantial Pull request requires no code review (e.g., a sub-repository hash update). label Dec 2, 2019
@gavofyork gavofyork merged commit 368318c into master Dec 2, 2019
@gavofyork gavofyork deleted the gav-enum-dispatches branch December 2, 2019 23:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A2-insubstantial Pull request requires no code review (e.g., a sub-repository hash update).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants