Skip to content
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

Split storage ranges to parallelize execution #7733

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

damian-orzechowski
Copy link
Contributor

@damian-orzechowski damian-orzechowski commented Nov 6, 2024

Changes

At the end of state ranges sync, when only large storage trie is left to be synced, snap batches will be processed sequentially. This change splits the range left to be requested for a given storage trie, if the processed data is less than 50% of requested range (maybe this shouldn't be 50%). The aim is to speed up processing of large storage tries, especially towards the end of snap ranges phase, when progress gets "stuck" at 100%. This is to aid the same problem as #7688, but with a slightly different approach.

Tested on OP-Mainnet - time between logging 100% progress for State Ranges and finishing:

  • Master: ~70 minutes
  • Test run 1: ~35 minutes
  • Test run 2: ~36 minutes

image
image
image

In both test runs in the last phase, there are messages with incorrect snap ranges response - missing hash in proofs. The #7741 might improve this.
image

UPDATE:
Looks really good with #7741
image
Unfortunately healing failed - can't merge

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Description

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Notes on testing

Optional. Remove if not applicable.

Documentation

Requires documentation update

  • Yes
  • No

If yes, link the PR to the docs update or the issue with the details labeled docs. Remove if not applicable.

Requires explanation in Release Notes

  • Yes
  • No

@damian-orzechowski damian-orzechowski marked this pull request as ready for review November 8, 2024 16:59
Copy link
Member

@LukaszRozmej LukaszRozmej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please wait for @asdacap review too

@@ -29,6 +29,7 @@ public class ProgressTracker : IDisposable
public const int HIGH_STORAGE_QUEUE_SIZE = STORAGE_BATCH_SIZE * 100;
private const int CODES_BATCH_SIZE = 1_000;
public const int HIGH_CODES_QUEUE_SIZE = CODES_BATCH_SIZE * 5;
private const uint StorageRangeSplitFactor = 2;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have you experimented with more radical splitting factors? 4? 8? 16? 32?

@asdacap
Copy link
Contributor

asdacap commented Nov 8, 2024

Can add unit test?

@damian-orzechowski damian-orzechowski removed request for a team and rubo November 11, 2024 13:44
@damian-orzechowski
Copy link
Contributor Author

Can add unit test?

Added

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants