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

improve(Dataworker): Speed up BundleDataClient.loadDataFromScratch #1587

Merged
merged 6 commits into from
Jun 4, 2024

Conversation

nicholaspai
Copy link
Member

@nicholaspai nicholaspai commented Jun 3, 2024

Motivation

Loading bundle data is now consistently taking 3-5 minutes given increased volume, likely stemming from increase in total bridge events per bundle

I've narrowed down, using timers, the slowdown to the loadDataFromScratch and the SpokePoolClient.update() calls which together account for most of the vast majority of the total run time for any dataworker function

Implementation

  • Replacing utils.getRelayHashFromEvent implementation takes current bundle construction with ~5000 deposits and fills runtime from 160s to 5s within the loadDataFromScratch function.
  • Fetching bundle data from Arweave instead of from scratch in the Executor saves executor time
  • Added timers for loading bundle data to help track regressions

The slowdown in the executor/disputer is coming from slowdown in the bundleDataClient.loadData but we can short circuit this in the executor safely by loading from arweave
- Replacing `utils.getRelayHashFromEvent` implementation takes current bundle construction with ~5000 deposits and fills runtime from 80s to 5s
- Fetching bundle data from arweave instead of from scratch in the executor saves executor time
- Added timers for loading bundle data to help track regressions
@nicholaspai nicholaspai changed the title improve(Dataworker): Executor should load bundle data from arweave improve(Dataworker): Speed up BundleDataClient.loadDataFromScratch Jun 3, 2024
@nicholaspai nicholaspai marked this pull request as ready for review June 3, 2024 22:58
@nicholaspai nicholaspai requested a review from bmzig June 4, 2024 00:06
Copy link
Contributor

@pxrl pxrl left a comment

Choose a reason for hiding this comment

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

Given the speedup it makes sense to get this in ASAP.

src/clients/BundleDataClient.ts Show resolved Hide resolved
@nicholaspai nicholaspai merged commit c55d036 into master Jun 4, 2024
4 checks passed
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.

2 participants