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

Fuzzy search for block in Immutable data by point only. #484

Merged
merged 11 commits into from
Jul 16, 2024

Conversation

stevenj
Copy link
Contributor

@stevenj stevenj commented Jul 11, 2024

This adds a feature where if the Point used in read_blocks_from_point() does not have a hash (zero length) then the search will look for the first block that equals or exceeds the given slot#, and the hash is ignored.

It is fully backwards compatible with the existing behavior and just allows the immutable data to be probed. That is, if a point/hash is given, the search is strict and both must match.

One potential use cases include extracting a section of the immutable data bounded by time, as slot# can be converted too and from a time for any particular blockchain.

Another is doing relative searches, such as returning the blocks up to n slots before a known slot#/hash.

We use both of these features in the cardano-chain-follower crate being developed here:
input-output-hk/hermes#266

@scarmuega scarmuega merged commit 56b2df5 into txpipe:main Jul 16, 2024
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

Successfully merging this pull request may close these issues.

3 participants