Skip to content

feat: add UTxO events query and pagination support to state queries#772

Open
whankinsiv wants to merge 3 commits intomainfrom
whankinsiv/get-utxo-events
Open

feat: add UTxO events query and pagination support to state queries#772
whankinsiv wants to merge 3 commits intomainfrom
whankinsiv/get-utxo-events

Conversation

@whankinsiv
Copy link
Collaborator

@whankinsiv whankinsiv commented Mar 5, 2026

Description

This PR adds UtxoEventsRequest which will be used as an alternative to the 4 separate query calls needed by the MidnightCNightObservationDataSource trait in midnight-node. This allows us to do server side sorting and capacity limiting, significantly simplifying the client side implementation.

Related Issue(s)

Relates to #734

How was this tested?

  • Added unit tests for sorting, truncation, and getter capacity limitations

Checklist

  • My code builds and passes local tests
  • I added/updated tests for my changes, where applicable
  • I updated documentation (if applicable)
  • branch has ≤ 5 commits (honor system)
  • commit messages tell a coherent story
  • branch is up to date with main (rebased on main; fast-forward possible)
  • CI/CD passes on the merged-with-main result

Impact / Side effects

Adds a new request handler and refactors the existing asset and candidate getters to return based on a provided capacity parameter.

Reviewer notes / Areas to focus

Sorting and truncation logic in modules/midnight_state/src/grpc/utxo_events.rs

Signed-off-by: William Hankins <william@sundae.fi>
@whankinsiv whankinsiv requested a review from lowhung March 5, 2026 22:02
Copy link
Collaborator

@lowhung lowhung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just some comments about the .expect(...) and test names.

Signed-off-by: William Hankins <william@sundae.fi>
Signed-off-by: William Hankins <william@sundae.fi>
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.

2 participants