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

Ensure stable ordering within same slot #67

Merged
merged 10 commits into from
Sep 29, 2022

Conversation

KtorZ
Copy link
Member

@KtorZ KtorZ commented Sep 28, 2022

Fixes #65


  • 📍 Refactor: extract serialization / deserialization logic for output reference.

  • 📍 Include transaction index within block when folding on blocks.
    Serialization now needs to be adjusted as it currently ignores the transaction index.

  • 📍 Rework OutputReference serialization to include transaction index.
    This has a side-benefits of making the database a bit more compact although the marking / removing of inputs may now be slightly less efficient (haven't run benchmarks yet; soon).
    The new index isn't used yet.

  • 📍 Order by descending created_at slot & fallback to transaction index when equal.

  • 📍 Add specification & supporting code for changing results order
    Going for 'most_recent_first' and 'oldest_first' instead of 'asc' or
    'desc' for more clarity.

    We could do something slightly more elaborate if there was multiple
    criteria to sort on, but only the sorting direction is configurable
    here.

  • 📍 re-introduce policy-id and asset-name in API doc, as deprecated parameters.

  • 📍 Create Makefile to group common commands and build instructions.

  • 📍 Refactor: leverage 'Either a' monad to simplify writing of Http handlers.
    Instead of building a pyramid of pattern matches, we can flatten it all using a do-syntax and an appropriate monad.

  • 📍 Wire new 'order' query parameter through the API.

  • 📍 Fix dynamic pattern addition end-to-end scenario & add more debugging to the test bench.

@KtorZ KtorZ self-assigned this Sep 28, 2022
@KtorZ KtorZ force-pushed the ensure-stable-ordering-within-same-slot branch from 7770590 to 37a079c Compare September 28, 2022 17:11
  Serialization now needs to be adjusted as it currently ignores the transaction index.
  This has a side-benefits of making the database a bit more compact although the marking / removing of inputs may now be slightly less efficient (haven't run benchmarks yet; soon).
  The new index isn't used yet.
@KtorZ KtorZ force-pushed the ensure-stable-ordering-within-same-slot branch 3 times, most recently from 1a25c8f to 85df95d Compare September 29, 2022 13:25
  Going for 'most_recent_first' and 'oldest_first' instead of 'asc' or
  'desc' for more clarity.

  We could do something slightly more elaborate if there was multiple
  criteria to sort on, but only the sorting direction is configurable
  here.
@KtorZ KtorZ force-pushed the ensure-stable-ordering-within-same-slot branch from 85df95d to 81d41e5 Compare September 29, 2022 13:30
@KtorZ KtorZ force-pushed the ensure-stable-ordering-within-same-slot branch from ceb27fc to 5f16a32 Compare September 29, 2022 16:11
@KtorZ KtorZ merged commit dec9918 into master Sep 29, 2022
@KtorZ KtorZ deleted the ensure-stable-ordering-within-same-slot branch September 29, 2022 16:15
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.

Ensure stable ordering of results within a same slot / block
1 participant