-
Notifications
You must be signed in to change notification settings - Fork 40
Streamable size limits #1423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Streamable size limits #1423
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,14 +72,17 @@ pub struct RejectHeaderRequest { | |
| pub struct RequestRemovals { | ||
| height: u32, | ||
| header_hash: Bytes32, | ||
| #[chia(max_length = 30000)] | ||
| coin_names: Option<Vec<Bytes32>>, | ||
| } | ||
|
arvidn marked this conversation as resolved.
|
||
|
|
||
| #[streamable(message)] | ||
| pub struct RespondRemovals { | ||
| height: u32, | ||
| header_hash: Bytes32, | ||
| #[chia(max_length = 30000)] | ||
| coins: Vec<(Bytes32, Option<Coin>)>, | ||
| #[chia(max_length = 30000)] | ||
| proofs: Option<Vec<(Bytes32, Bytes)>>, | ||
| } | ||
|
|
||
|
|
@@ -93,14 +96,17 @@ pub struct RejectRemovalsRequest { | |
| pub struct RequestAdditions { | ||
| height: u32, | ||
| header_hash: Option<Bytes32>, | ||
| #[chia(max_length = 30000)] | ||
| puzzle_hashes: Option<Vec<Bytes32>>, | ||
| } | ||
|
|
||
| #[streamable(message)] | ||
| pub struct RespondAdditions { | ||
| height: u32, | ||
| header_hash: Bytes32, | ||
| #[chia(max_length = 30000)] | ||
| coins: Vec<(Bytes32, Vec<Coin>)>, | ||
| #[chia(max_length = 30000)] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Vec size limits may break existing wallet clientsMedium Severity The Additional Locations (1)Reviewed by Cursor Bugbot for commit 8c79e84. Configure here. |
||
| proofs: Option<Vec<(Bytes32, Bytes, Option<Bytes>)>>, | ||
| } | ||
|
|
||
|
|
@@ -114,6 +120,7 @@ pub struct RejectAdditionsRequest { | |
| pub struct RespondBlockHeaders { | ||
| start_height: u32, | ||
| end_height: u32, | ||
| #[chia(max_length = 64)] | ||
|
arvidn marked this conversation as resolved.
Outdated
|
||
| header_blocks: Vec<HeaderBlock>, | ||
| } | ||
|
|
||
|
|
@@ -146,32 +153,39 @@ pub struct RejectHeaderBlocks { | |
| pub struct RespondHeaderBlocks { | ||
| start_height: u32, | ||
| end_height: u32, | ||
| #[chia(max_length = 64)] | ||
| header_blocks: Vec<HeaderBlock>, | ||
| } | ||
|
|
||
| #[streamable(message)] | ||
| pub struct RegisterForPhUpdates { | ||
| #[chia(max_length = 1600000)] | ||
| puzzle_hashes: Vec<Bytes32>, | ||
| min_height: u32, | ||
| } | ||
|
|
||
| #[streamable(message)] | ||
| pub struct RespondToPhUpdates { | ||
| #[chia(max_length = 1600000)] | ||
| puzzle_hashes: Vec<Bytes32>, | ||
| min_height: u32, | ||
| #[chia(max_length = 1600000)] | ||
| coin_states: Vec<CoinState>, | ||
| } | ||
|
|
||
| #[streamable(message)] | ||
| pub struct RegisterForCoinUpdates { | ||
| #[chia(max_length = 1600000)] | ||
| coin_ids: Vec<Bytes32>, | ||
| min_height: u32, | ||
| } | ||
|
|
||
| #[streamable(message)] | ||
| pub struct RespondToCoinUpdates { | ||
| #[chia(max_length = 1600000)] | ||
| coin_ids: Vec<Bytes32>, | ||
| min_height: u32, | ||
| #[chia(max_length = 1600000)] | ||
| coin_states: Vec<CoinState>, | ||
| } | ||
|
|
||
|
|
@@ -180,6 +194,7 @@ pub struct CoinStateUpdate { | |
| height: u32, | ||
| fork_height: u32, | ||
| peak_hash: Bytes32, | ||
| #[chia(max_length = 30000)] | ||
| items: Vec<CoinState>, | ||
| } | ||
|
|
||
|
|
@@ -190,6 +205,7 @@ pub struct RequestChildren { | |
|
|
||
| #[streamable(message)] | ||
| pub struct RespondChildren { | ||
| #[chia(max_length = 30000)] | ||
| coin_states: Vec<CoinState>, | ||
| } | ||
|
|
||
|
|
@@ -217,21 +233,25 @@ pub struct RespondFeeEstimates { | |
|
|
||
| #[streamable(message)] | ||
| pub struct RequestRemovePuzzleSubscriptions { | ||
| #[chia(max_length = 1600000)] | ||
| puzzle_hashes: Option<Vec<Bytes32>>, | ||
| } | ||
|
|
||
| #[streamable(message)] | ||
| pub struct RespondRemovePuzzleSubscriptions { | ||
| #[chia(max_length = 1600000)] | ||
| puzzle_hashes: Vec<Bytes32>, | ||
| } | ||
|
|
||
| #[streamable(message)] | ||
| pub struct RequestRemoveCoinSubscriptions { | ||
| #[chia(max_length = 1600000)] | ||
| coin_ids: Option<Vec<Bytes32>>, | ||
| } | ||
|
|
||
| #[streamable(message)] | ||
| pub struct RespondRemoveCoinSubscriptions { | ||
| #[chia(max_length = 1600000)] | ||
| coin_ids: Vec<Bytes32>, | ||
| } | ||
|
|
||
|
|
@@ -245,6 +265,7 @@ pub struct CoinStateFilters { | |
|
|
||
| #[streamable(message)] | ||
| pub struct RequestPuzzleState { | ||
| #[chia(max_length = 32700)] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If register_for_coin_updates and register_for_ph_updates can allow 1.6 million, so should these. This limit is insufficient for wallets like Sage to function. Many wallets have over this many puzzle hashes to subscribe to (each one is a wallet address).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the 1.6 million is derived from the 50 MiB message limit, which will not fit more 32 byte hashes. Does Sage subscribe to all coins in a single request? This number was picked based on The limit is defined here: https://github.com/Chia-Network/chia-blockchain/blob/main/chia/full_node/coin_store.py#L444 It seems like we silently drop any item past this limit. |
||
| puzzle_hashes: Vec<Bytes32>, | ||
| previous_height: Option<u32>, | ||
| header_hash: Bytes32, | ||
|
|
@@ -254,10 +275,12 @@ pub struct RequestPuzzleState { | |
|
|
||
| #[streamable(message)] | ||
| pub struct RespondPuzzleState { | ||
| #[chia(max_length = 32700)] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above |
||
| puzzle_hashes: Vec<Bytes32>, | ||
| height: u32, | ||
| header_hash: Bytes32, | ||
| is_finished: bool, | ||
| #[chia(max_length = 32700)] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above |
||
| coin_states: Vec<CoinState>, | ||
| } | ||
|
|
||
|
|
@@ -268,6 +291,7 @@ pub struct RejectPuzzleState { | |
|
|
||
| #[streamable(message)] | ||
| pub struct RequestCoinState { | ||
| #[chia(max_length = 32700)] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above |
||
| coin_ids: Vec<Bytes32>, | ||
| previous_height: Option<u32>, | ||
| header_hash: Bytes32, | ||
|
|
@@ -276,7 +300,9 @@ pub struct RequestCoinState { | |
|
|
||
| #[streamable(message)] | ||
| pub struct RespondCoinState { | ||
| #[chia(max_length = 32700)] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above |
||
| coin_ids: Vec<Bytes32>, | ||
| #[chia(max_length = 32700)] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above |
||
| coin_states: Vec<CoinState>, | ||
| } | ||
|
|
||
|
|
@@ -334,11 +360,13 @@ pub struct RemovedMempoolItem { | |
|
|
||
| #[streamable(message)] | ||
| pub struct MempoolItemsAdded { | ||
| #[chia(max_length = 30000)] | ||
| transaction_ids: Vec<Bytes32>, | ||
| } | ||
|
|
||
| #[streamable(message)] | ||
| pub struct MempoolItemsRemoved { | ||
| #[chia(max_length = 30000)] | ||
| removed_items: Vec<RemovedMempoolItem>, | ||
| } | ||
|
|
||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.