Skip to content
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

Iterate over historical data in SnapshotMap #487

Closed
archseer opened this issue Oct 12, 2021 · 2 comments
Closed

Iterate over historical data in SnapshotMap #487

archseer opened this issue Oct 12, 2021 · 2 comments

Comments

@archseer
Copy link

SnapshotMap currently provides may_load_at_height, but there's no such equivalent for range. Would it be possible to implement this? We're trying to iterate over historical data at a certain block height to see what the state was at the time.

@ethanfrey
Copy link
Member

That is not possible with the current lazy data structures.

We make it very easy to range over (Addr, height), but that means the data is stored such that (height, Addr) will require a brute force range.

We're trying to iterate over historical data at a certain block height to see what the state was at the time.

You can do this externally with historical queries to gRPC/REST/Tendermint RPC (the underlying DB keeps history)

Can you give me the clear use case you have?
This can definitely be done in some cases (with limited data) if you take a real snapshot, rather than a zero-cost Copy-on-Write approach.

@ethanfrey
Copy link
Member

In short, we cannot (and will not) implement this for SnapshotMap.
If this is a very clear requirement for your use case, I can advise for an alternative data structure that may fill your needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants