-
Notifications
You must be signed in to change notification settings - Fork 790
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
Ascending bootstrap dependency resolution #4692
Ascending bootstrap dependency resolution #4692
Conversation
Co-authored-by: gr0vity-dev <[email protected]>
Co-authored-by: gr0vity-dev <[email protected]>
Co-authored-by: gr0vity-dev <[email protected]>
Co-authored-by: gr0vity-dev <[email protected]>
Co-authored-by: gr0vity-dev <[email protected]>
Co-authored-by: gr0vity-dev <[email protected]>
Co-authored-by: gr0vity-dev <[email protected]>
3ea0c51
to
9f44594
Compare
@@ -211,6 +209,25 @@ nano::account nano::bootstrap_ascending::account_sets::next () | |||
return result; | |||
} | |||
|
|||
nano::block_hash nano::bootstrap_ascending::account_sets::next_blocking () |
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.
Should this return optional rather than 0?
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.
Could and should be done. I didn't have too much time to cleanup everything though.
@@ -241,22 +273,52 @@ nano::account nano::bootstrap_ascending::service::wait_available_account () | |||
return { 0 }; | |||
} | |||
|
|||
bool nano::bootstrap_ascending::service::request (nano::account & account, std::shared_ptr<nano::transport::channel> & channel) | |||
nano::block_hash nano::bootstrap_ascending::service::available_dependency () |
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.
Optionals for these too.
* Dependency walking * Parallel database scan * Stats * Throttling & backoff * Dependency account scanning * Sync dependencies * Track source when throttling * Count tags * Priorities backoff Co-authored-by: gr0vity-dev <[email protected]> * Timestamps * Avoid reprocessing old blocks Co-authored-by: gr0vity-dev <[email protected]> * Max tags limit * Handle `gap_previous` Co-authored-by: gr0vity-dev <[email protected]> * Check timestamp * Tune initial priority Co-authored-by: gr0vity-dev <[email protected]> * Fix config * Verify response * Use filters * Remove random sampling Co-authored-by: gr0vity-dev <[email protected]> * Backoff adjustments * Insert genesis on start Co-authored-by: gr0vity-dev <[email protected]> * Fix timestamp check performance Co-authored-by: gr0vity-dev <[email protected]> * Adjust throttle size computation * Config improvements * Fix compilation * Extend test timeout --------- Co-authored-by: gr0vity-dev <[email protected]>
This is the first part of our (mine & @gr0vity-dev) work on improving ascending bootstrapper. This part contains a new dependency resolution strategy among a few other smaller improvements.
An example of how it dependency resolution process works: let's have three accounts A, B, C. A depends on a transaction sent by B, and B depends on a transaction sent by C. Let's now assume we have a ledger that is not synced 100%, might be because we're doing an initial sync or our node was offline for a while. If account A performs a new live transaction, we can't process it immediately, because we're still missing chains for B & C. In the previous version resolving these dependencies was slow, as it was relying on sequential sampling of the whole ledger. With this improved algorithm, we first add account A to the blocking set, resolve its dependency as account B, since B is blocked we repeat the same process for B, finally arriving at account C that unblocks all these chains.