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

feat: add more logging for on chain events #2247

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

aditiharini
Copy link
Contributor

@aditiharini aditiharini commented Aug 9, 2024

Why is this change needed?

With the current logging it's hard to determine if we dropped an on-chain event or never received it in the first place. This feature adds a log in the first place where our code is responsible for handling on-chain events to give us better insight into this moving forward.

Merge Checklist

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


PR-Codex overview

This PR enhances the logging for on-chain events in the L2EventsProvider class in the @farcaster/hubble package.

Detailed summary

  • Added more detailed logging for different types of on-chain events in L2EventsProvider.
  • Logs now include event name and specify the event type being processed.

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

Copy link

changeset-bot bot commented Aug 9, 2024

🦋 Changeset detected

Latest commit: a7ad5fc

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

Copy link

vercel bot commented Aug 9, 2024

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 9, 2024 10:46pm

@aditiharini aditiharini added the t-feat Add a new feature or protocol improvement label Aug 9, 2024
Copy link

codecov bot commented Aug 9, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 45.31%. Comparing base (1880070) to head (a7ad5fc).
Report is 307 commits behind head on main.

Files Patch % Lines
apps/hubble/src/eth/l2EventsProvider.ts 33.33% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2247       +/-   ##
===========================================
- Coverage   74.05%   45.31%   -28.75%     
===========================================
  Files          99      144       +45     
  Lines        9425    23314    +13889     
  Branches     2097     8115     +6018     
===========================================
+ Hits         6980    10564     +3584     
- Misses       2327    11231     +8904     
- Partials      118     1519     +1401     

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

@@ -479,6 +488,11 @@ export class L2EventsProvider<chain extends Chain = Chain, transport extends Tra
for (const event of logs) {
const { blockNumber, blockHash, transactionHash, transactionIndex, logIndex } = event;

log.info(
{ blockNumber, blockHash, transactionHash, transactionIndex, logIndex, eventName: event.eventName },
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you need all these tags? Just blockNumber and transactionHash (and maybe log index) should be sufficient?

@sanjayprabhu
Copy link
Contributor

Do we still need this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t-feat Add a new feature or protocol improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants