Skip to content

[Feat] Add 2 new REST routes#4032

Draft
ljedrz wants to merge 2 commits intoProvableHQ:stagingfrom
ljedrz:feat/record_queries
Draft

[Feat] Add 2 new REST routes#4032
ljedrz wants to merge 2 commits intoProvableHQ:stagingfrom
ljedrz:feat/record_queries

Conversation

@ljedrz
Copy link
Copy Markdown
Collaborator

@ljedrz ljedrz commented Dec 2, 2025

The snarkOS counterpart to ProvableHQ/snarkVM#3047.

Filing as a draft due to the corresponding snarkVM branch not having been merged yet.

Signed-off-by: ljedrz <ljedrz@users.noreply.github.com>
@ljedrz ljedrz requested a review from niklaslong December 2, 2025 11:13
Signed-off-by: ljedrz <ljedrz@users.noreply.github.com>
Comment thread node/rest/src/routes.rs
ErasedJson::pretty(record_counts)
}

/// GET /{network}/{block}/record_count
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// GET /{network}/{block}/record_count
/// GET /{network}/block/{block}/record_count

Comment thread node/rest/src/routes.rs
}

/// GET /{network}/record_count
pub(crate) async fn get_number_of_records(State(rest): State<Self>) -> ErasedJson {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This endpoint will be quite expensive, can we put it behind auth to prevent DoSing nodes? - ProvableHQ/snarkVM#3047 (comment)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

as mentioned in the linked thread, this operation is in general less expensive than just obtaining a block; what should the criteria for auth-gating be? some fixed amount of time on reference hardware, or just algorithmic complexity (even if it's unlikely to be a concern until very large numbers are reached)?

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.

3 participants