You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, you can only get keys from the input stores of a given module. Sometimes, it would be desirable to scan some keys in there.
Today, the data structure used to support the stores are simple map[string][]byte, which doesn't help with scan and prefix searches. It only helped getting off the ground with modules.
To support scan and prefix semantics, we would need a nice model, like a prefix-tree.. or some things similar to those routers (that do prefix searches), and keep keys ordered at all times.
We also have an additional challenge: in stores, we can get_at, to get the state of the store at a given ordinal in the block. So even with an underlying structure that keeps things ordered, we would still need to overlay the StoreDeltas inside the responses to scan and prefix.. adding a bit of complexity.
It's all doable, but let's first hear your use cases. Chime in!
The text was updated successfully, but these errors were encountered:
A use case could be to iterate over kv pairs of an input store module within a map module.
For example, if we have a store module that keeps track of token holdings for every address, we could iterate over all (holder , holding) pairs from within a map module in order to produce outputs that are a function of the latest state of the holdings, like say, ownership percentages.
Right now, you can only
get
keys from the input stores of a given module. Sometimes, it would be desirable to scan some keys in there.Today, the data structure used to support the stores are simple
map[string][]byte
, which doesn't help with scan and prefix searches. It only helped getting off the ground with modules.To support
scan
andprefix
semantics, we would need a nice model, like a prefix-tree.. or some things similar to those routers (that do prefix searches), and keep keys ordered at all times.We also have an additional challenge: in stores, we can
get_at
, to get the state of the store at a given ordinal in the block. So even with an underlying structure that keeps things ordered, we would still need to overlay theStoreDeltas
inside the responses toscan
andprefix
.. adding a bit of complexity.It's all doable, but let's first hear your use cases. Chime in!
The text was updated successfully, but these errors were encountered: