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

Lookup of previous on-chain points #29

Merged
merged 3 commits into from
Jun 10, 2022

Conversation

KtorZ
Copy link
Member

@KtorZ KtorZ commented Jun 10, 2022

Fixes #24


  • 📍 Provide a new database accessor to retrieve checkpoints' ancestors.
    This is built as a simple query on the checkpoints table. The commit
    also add two property test focused on the checkpoints table. It also
    test the insertion and listing of checkpoints (and found a bug). The
    interface is a bit flexible and allows for returning many a list of
    ancestors, even though the main motivating use-case is only about
    single ancestors. It makes for a nicer interface (lists for the win
    o/).

  • 📍 Re-organize App.Http, split pure code out and tidy up.
    The module was starting to get big with many level of abstractions
    intertwined. For the sake of keeping the separation good (and
    possibly, indidually improve test coverage of the sub-parts), I've
    move all the pure helpers into separate modules under the 'Data'
    section. Remains in 'App.Http' only the actual route handlers. This is
    a bit cleaner and allow to extend even more the http endpoints while
    keeping things clean and tidy.

  • 📍 Add new endpoint to retrive checkpoints by slot number.
    The API is purposely flexible to also make it easy to retrieve
    ancestors from a given point. It suffices to remove 1 from any given
    slot number to get the nearest slot that is smaller or equal to the
    provided slot number. Because this behavior can also be somewhat odd,
    it is possible to make the request completely strict using a query
    flag '?strict', in which case, the server will only retrun results if
    strictly matching the request.

  This is built as a simple query on the checkpoints table. The commit
  also add two property test focused on the checkpoints table. It also
  test the insertion and listing of checkpoints (and found a bug). The
  interface is a bit flexible and allows for returning many a list of
  ancestors, even though the main motivating use-case is only about
  single ancestors. It makes for a nicer interface (lists for the win
  o/).
  The module was starting to get big with many level of abstractions
  intertwined. For the sake of keeping the separation good (and
  possibly, indidually improve test coverage of the sub-parts), I've
  move all the pure helpers into separate modules under the 'Data'
  section. Remains in 'App.Http' only the actual route handlers. This is
  a bit cleaner and allow to extend even more the http endpoints while
  keeping things clean and tidy.
  The API is purposely flexible to also make it easy to retrieve
  ancestors from a given point. It suffices to remove 1 from any given
  slot number to get the nearest slot that is smaller or equal to the
  provided slot number. Because this behavior can also be somewhat odd,
  it is possible to make the request completely strict using a query
  flag '?strict', in which case, the server will only retrun results if
  strictly matching the request.
@KtorZ KtorZ self-assigned this Jun 10, 2022
@KtorZ KtorZ merged commit 66470ce into master Jun 10, 2022
@KtorZ KtorZ deleted the 24/lookup-of-previous-on-chain-points branch June 10, 2022 16:08
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.

Lookup of previous on-chain points
1 participant