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

fix: Fix initial Eth events fetching and logging #1257

Merged
merged 2 commits into from
Aug 14, 2023

Conversation

adityapk00
Copy link
Contributor

@adityapk00 adityapk00 commented Aug 13, 2023

Motivation

Improve initial eth events fetching performance and improve logging.

  • Improves initial eth events sync from 9.8 min down to -> 1.7 m
  • 80% fewer alchemy calls

Change Summary

  • Fix perf bug where unnecessary blocks were being fetched
  • Fetch all events in parallel, since we are io bound
  • Still merge events serially
  • Improve logging

Merge Checklist

Choose all relevant options below by adding an x now or at any time before submitting for review

Additional Context

Screenshot from 2023-08-13 12-08-29


PR-Codex overview

This PR focuses on improving the initial ETH events fetching process.

Detailed summary

  • Added batch processing for syncing blocks in chunks
  • Improved logging and error handling
  • Refactored code for better readability and maintainability

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@changeset-bot
Copy link

changeset-bot bot commented Aug 13, 2023

🦋 Changeset detected

Latest commit: 9771e90

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@farcaster/hubble Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Aug 13, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hub-monorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 13, 2023 5:39pm

@codecov
Copy link

codecov bot commented Aug 13, 2023

Codecov Report

Patch coverage: 96.42% and no project coverage change.

Comparison is base (951793b) 69.85% compared to head (9771e90) 69.85%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1257   +/-   ##
=======================================
  Coverage   69.85%   69.85%           
=======================================
  Files          88       88           
  Lines        7851     7843    -8     
  Branches     1704     1701    -3     
=======================================
- Hits         5484     5479    -5     
+ Misses       2210     2208    -2     
+ Partials      157      156    -1     
Files Changed Coverage Δ
apps/hubble/src/eth/ethEventsProvider.ts 74.43% <96.42%> (-0.89%) ⬇️

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@adityapk00 adityapk00 merged commit 8d61f5f into farcasterxyz:main Aug 14, 2023
@adityapk00 adityapk00 deleted the ethevnts branch August 14, 2023 13:36
@sanjayprabhu
Copy link
Contributor

Nice. We need to update the l2 events provider as well, this file will go away after the migration.

@adityapk00
Copy link
Contributor Author

@sanjayprabhu , Yup, I'm making a new PR porting this to the L2 events provider also

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