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

Make explorer API reflect the multiverse better #2963

Closed
ecioppettini opened this issue Jan 27, 2021 · 0 comments
Closed

Make explorer API reflect the multiverse better #2963

ecioppettini opened this issue Jan 27, 2021 · 0 comments
Assignees
Labels
A-explorer Area: Explorer API and backend

Comments

@ecioppettini
Copy link
Contributor

#2801 was getting too large/ambitious, so I'm closing it and organizing things a bit more in a few PR's and here.

Motivation

Have the explorer API reflect the multiverse better. This requires keeping track of active branches, be able to search for things in multiple branches, and I'd say adding garbage collection because it also affects the API a bit, among other things.

Plans

In GraphQL API

  • Change block by id query so it searches in all candidate branches.
  • Change transaction by id query so it searches in all candidate branches.
  • Change vote plan by id query so it searches in all candidate branches.
  • Add a Branch graphql type. A Branch is identified by a Block hash, but not all blocks are branches, particularly because for old stable/confirmed blocks we may not have the whole State anymore.
  • Add query for current tip (this exists already, but to return Branch).
  • Add query for all tips (or candidate tips).
  • Move queries to Branch: all_blocks (paginated block history), transactions_by_address, blocks per epoch (maybe just as a filter in all_blocks?)
  • Change Transaction::block to Transaction::blocks (in graphql, rust syntax is just illustrative)
  • Add Block::branches to kwow which branches is it in, and by having the chain_length of the tips, an idea of how confirmed it is.
  • Change block by chain length query to return a list of blocks when needed.
  • Expose epoch stability depth in graphql.
  • Add Block::is_confirmed (Explorer add gc and confirmed block notion #2962)
  • Add query for last confirmed block (Explorer add gc and confirmed block notion #2962)

In explorer backend

  • Add generalized multiverse gc and call it (Explorer add gc and confirmed block notion #2962) .
  • Add tip tracking multiverse wrapper (proxy).
  • Move branch dependent methods to State, so the ExplorerDB can be used like get_branch(hash) or get_main_branch(hash). Also, just in case, we need to make sure to keep the Ref alive during the query, although it would only have strange behavior in edge cases anyway.

PR's

Explorer add gc and confirmed block notion #2962

@ecioppettini ecioppettini added the A-explorer Area: Explorer API and backend label Jan 27, 2021
@ecioppettini ecioppettini self-assigned this Jan 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-explorer Area: Explorer API and backend
Projects
None yet
Development

No branches or pull requests

1 participant