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

Range queries for synchronization #37

Open
Scooletz opened this issue Apr 14, 2023 · 1 comment
Open

Range queries for synchronization #37

Scooletz opened this issue Apr 14, 2023 · 1 comment
Labels
ethereum An Ethereum specific work item that requires a good understanding of Eth

Comments

@Scooletz
Copy link
Contributor

Scooletz commented Apr 14, 2023

Provide primitives needed for synchronization using Paprika. The most important one is a range query that can be executed over a readonly transaction. This query should provide:

  1. ranges accounts by their hash,
  2. ranges of storage items per account.

Probably the easiest implementation would be based on a cursor approach, which would allot to provide an IEnumerable or ref-based enumeration. The cursor implementation would be similar to LMBD stack approach, where for cursor serving they remember a vector over all the pages deep. The reason for that is that neither LMBD or Paprika implements B+ tree properly, meaning, that the pointer to the next page on the leaf level is missing. This has already been implemented in LMBD and we can follow the same path. So if you open a readonly batch for the given block, you can read as long as you need to providing a cursor like-behavior.

One could think of providing a next pointer in the page. This is against the COW design and breaks it terribly. It's discussed in depth in Howard Chu at this LMBD talk

@Scooletz Scooletz added this to the Protocol & migration milestone Apr 14, 2023
@Scooletz Scooletz added the ethereum An Ethereum specific work item that requires a good understanding of Eth label Apr 14, 2023
@Scooletz
Copy link
Contributor Author

Scooletz commented Oct 9, 2023

This is needed for snap serve so not needed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ethereum An Ethereum specific work item that requires a good understanding of Eth
Projects
Status: Backlog
Development

No branches or pull requests

1 participant