Skip to content

feat(v1beta): make FetchBlock, ReadUtxos and ReadData single-item operations - #208

Open
carbolymer wants to merge 1 commit into
utxorpc:mainfrom
carbolymer:sync-fetchblock-single-block
Open

feat(v1beta): make FetchBlock, ReadUtxos and ReadData single-item operations#208
carbolymer wants to merge 1 commit into
utxorpc:mainfrom
carbolymer:sync-fetchblock-single-block

Conversation

@carbolymer

@carbolymer carbolymer commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Remove repeated from FetchBlockRequest.ref and FetchBlockResponse.block, making FetchBlock a single-block operation.
  • Remove repeated from ReadUtxosRequest.keys and ReadUtxosResponse.items (now key and item), making ReadUtxos a single-UTxO operation.
  • Remove repeated from ReadDataRequest.keys and ReadDataResponse.values (now key and value), making ReadData a single-datum operation.

Motivation

Batching at the protobuf message level adds complexity without clear benefit - callers needing multiple items can issue concurrent requests, which maps naturally to gRPC streaming for bulk use cases.

These RPCs are per-item lookups, but the batched responses had no per-item error channel.
When one item could not be resolved, a server could only fail the whole call or silently omit the item, and the client could not tell omission from an error.
With single-item requests, the gRPC status code applies unambiguously to the one requested item.

This follows the same approach as #163, which made SubmitTx and EvalTx singular.

Breaking change

This is a wire format breaking change to the v1beta proto definition.
A client sending multiple entries in a single request will have message-typed fields silently merged (FetchBlock, ReadUtxos) or resolved as last-value-wins for the bytes key (ReadData), producing incorrect results.
The renamed fields (keys -> key, items -> item, values -> value) also change the JSON mapping.

@carbolymer carbolymer changed the title feat(sync): make FetchBlock accept a single block reference feat(v1beta): make FetchBlock, ReadUtxos and ReadData single-item operations Jul 20, 2026
@carbolymer
carbolymer force-pushed the sync-fetchblock-single-block branch from c236c61 to 16d52e3 Compare July 20, 2026 15:39
@carbolymer
carbolymer force-pushed the sync-fetchblock-single-block branch from 16d52e3 to e3a8517 Compare July 20, 2026 15:40
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.

1 participant