Skip to content

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

Merged
nicholaspai merged 6 commits intomasterfrom
npai/load-from-arweave
Jun 4, 2024
Merged

improve(Dataworker): Speed up BundleDataClient.loadDataFromScratch#1587
nicholaspai merged 6 commits intomasterfrom
npai/load-from-arweave

Conversation

@nicholaspai
Copy link
Copy Markdown
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
Copy Markdown
Collaborator

@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.

Comment thread src/clients/BundleDataClient.ts
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