Skip to content

Bound GetAddressUtxos result materialization#1173

Draft
Zk-nd3r wants to merge 1 commit into
zingolabs:devfrom
Zk-nd3r:fix/getaddressutxos-resource-bounds-current
Draft

Bound GetAddressUtxos result materialization#1173
Zk-nd3r wants to merge 1 commit into
zingolabs:devfrom
Zk-nd3r:fix/getaddressutxos-resource-bounds-current

Conversation

@Zk-nd3r

@Zk-nd3r Zk-nd3r commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #974 by threading the start_height and max_entries request bounds into the internal GetAddressUtxos path instead of materializing the full converted result first.

What changed

  • Added an internal AddressUtxosRequest carrying addresses, start_height, and optional max_entries.
  • Added ChainIndex::get_address_utxos_bounded(...) while preserving the existing unbounded get_address_utxos(...) behavior.
  • Wired fetch/state lightwallet unary and stream handlers through the bounded chain-index path.
  • Applied bounds while converting state-backed UTXO rows, so the converted Vec<GetAddressUtxos> stops at the requested limit.
  • Applied bounds after the unavoidable validator RPC response on the fetch path; the upstream getaddressutxos RPC has no height/limit parameters.
  • Extended the mockchain test to cover default unbounded behavior, explicit None bounds, max_entries=Some(1), and start_height filtering.

Validation

Ran against current zingolabs:dev (c4d8f381):

  • rustfmt --edition 2021 --check on the 8 changed files
  • git diff --cached --check
  • Amsterdam Linux: cargo check -p zaino-state -p zaino-fetch
  • Amsterdam Linux: cargo test -p zaino-state get_address_utxos -- --nocapture
    • 1 passed; 0 failed; 139 filtered out

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.

get_address_utxos materializes full backend result before applying max_entries cap

1 participant