-
Notifications
You must be signed in to change notification settings - Fork 219
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
Update Output Manager UTXO query to split into multiple queries #1949
Conversation
b59a1ce
to
34502d3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be pretty efficient because requests and responses are sent/received as fast as each side is able. Unfortunately, the code complexity to do this is rather high - something to improve on in the lower layer.
Just one comment which I think points out a bug.
} | ||
|
||
impl Default for OutputManagerServiceConfig { | ||
fn default() -> Self { | ||
Self { | ||
base_node_query_timeout: Duration::from_secs(30), | ||
max_utxo_query_size: 5000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noting the max request message size would be 160kb
and each response would be roughly less than 2Mb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that lines up with what I observed.
188b656
to
0d2c07c
Compare
Previously when the output manager service would send its UTXO validity query to its Base Node it would send a single query with all the UTXO hashes in it. The Base Node then responds with a single response message with all the valid UTXO’s that match a hash in the queries list. In large wallets this caused a problem where the response message could become large enough to be rejected by the frame size limits in the comms stack. In order to mitigate this issue the Output Manager service will now send queries consisting of up to a maximum number of outputs (specified in the config) and will send multiple queries until all the outputs have been queried so that any one response does not hit the frame size limit.
0d2c07c
to
7ca23d6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Previously when the output manager service would send its UTXO validity query to its Base Node it would send a single query with all the UTXO hashes in it. The Base Node then responds with a single response message with all the valid UTXO’s that match a hash in the queries list. In large wallets this caused a problem where the response message could become large enough to be rejected by the frame size limits in the comms stack.
In order to mitigate this issue the Output Manager service will now send queries consisting of up to a maximum number of outputs (specified in the config) and will send multiple queries until all the outputs have been queried so that any one response does not hit the frame size limit.
How Has This Been Tested?
test_startup_utxo_scan
was updated to have more UTXO's than the max query limit and tested response to the 2 part query that was generated.Types of changes
Checklist:
development
branch.cargo-fmt --all
before pushing.