• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Chia-Network / chia-blockchain / 25216204131

30 Apr 2026 02:16PM UTC coverage: 91.294% (+0.02%) from 91.277%
25216204131

push

github

web-flow
[CHIA-4203] Add dynamic list-limited deserialization for Streamable types (#20829)

* Add dynamic list-limited deserialization for Streamable types

When a message with a large list field arrives (e.g. RequestCoinState
with 1.2M coin_ids), the full node previously parsed every item before
the handler truncated. On a Pi4 this took ~6s.

API handlers can now specify per-field list limits at runtime via a
callable on the @metadata.request() decorator. Parsing stops early and
seeks past remaining fixed-size elements in O(1).

For RequestCoinState with 1.2M items (limit 200K), deserialization drops
from ~0.45s to ~0.07s on a dev machine (~6x), and proportionally on Pi4.

* Wire list_limits into more wallet protocol handlers

Add deserialization-level list limits to three more handlers that
previously sliced or capped lists after full parsing:

- register_for_ph_updates: puzzle_hashes capped to max_subscriptions
- register_for_coin_updates: coin_ids capped to max_subscriptions
- request_puzzle_state: puzzle_hashes capped to MAX_PUZZLE_HASH_BATCH_SIZE

Remove the now-redundant post-parse slices from register_for_coin_updates,
request_puzzle_state, and request_coin_state since the lists are already
truncated during deserialization.

* Wire list_limits into more wallet protocol handlers

Add deserialization-level list limits to three more handlers that
previously sliced or capped lists after full parsing:

- register_for_ph_updates: puzzle_hashes capped to max_subscriptions
- register_for_coin_updates: coin_ids capped to max_subscriptions
- request_puzzle_state: puzzle_hashes capped to MAX_PUZZLE_HASH_BATCH_SIZE

Remove the now-redundant post-parse slices from register_for_coin_updates,
request_puzzle_state, and request_coin_state since the lists are already
truncated during deserialization.

* tests adjusted for new behaviour

* remove test file

* add some edge case testing

* handle case better if the API is called outside the normal on the wire pate

* add... (continued)

10572 of 11765 branches covered (89.86%)

Branch coverage included in aggregate %.

140 of 140 new or added lines in 7 files covered. (100.0%)

23 existing lines in 8 files now uncovered.

108117 of 118243 relevant lines covered (91.44%)

1.83 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

87.95
/chia/full_node/full_node.py


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc