-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Increase number of requested block bodies in chain sync #10247
Conversation
* Increase the number of block bodies requested during Sync. * Check if our peer is an older parity client with the bug of not handling large requests properly * Add a ClientVersion struct and a ClientCapabilites trait
* Replace strings with ClientVersion in PeerInfo * Group further functionality in ClientCapabilities
from ClientVersion.
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.
Looks good! I found some issue with version parsing though.
if it's parity, remove version check. * Remove dependency on semver in ethcore-sync * Remove unnecessary String instantiation * Rename peer_info to peer_version * Update RPC test helpers * Simplify From<String> * Parse static version string only once * Update RPC tests to new ClientVersion struct * Document public members * More robust parsing of ID string
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
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
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.
There are some leftovers after changing PARITY_CLIENT_LARGE_REQUESTS_VERSION
to 2.4.0
,
Co-Authored-By: elferdo <elferdo@gmail.com>
Co-Authored-By: elferdo <elferdo@gmail.com>
Co-Authored-By: elferdo <elferdo@gmail.com>
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.
Awesome, looks good to me!
It's squash-and-merge day! Sorry for the conflicts again. |
* master: fix: parity-clib/examples/cpp/CMakeLists.txt (#10313) CI optimizations (#10297) Increase number of requested block bodies in chain sync (#10247) Deprecate account management (#10213) Properly handle check_epoch_end_signal errors (#10015) fix(osx and windows builds): bump parity-daemonize (#10291) Add missing step for Using `systemd` service file (#10175) Call private contract methods from another private contract (read-only) (#10086) update ring to 0.14 (#10262) fix(secret-store): deprecation warning (#10301) Update to jsonrpc-derive 10.0.2, fixes aliases bug (#10300) Convert to jsonrpc-derive, use jsonrpc-* from crates.io (#10298)
In order to speed up syncing and to be on par with geth, we want to increase the number of block bodies requested from a peer. It happens, though, that older parity software would not send any reply at all when a packet went over a given size. To play it safe, if syncing with such a peer we want to keep the lower numbers we have today.
In addition to increasing the number of block bodies per request, I have imlemented a struct, ClientVersion, and associated functionality to help parsing peer Id strings and querying for specific capabilities of the peer software.
Preliminary tests syncing with only geth nodes show an increase in synced blocks for a given fixed length of time of around 30% (with variations between runs).
Thanks to @ngotchac for support and reviewing.