🥅 server: enrich sentry fingerprint with revert reason#740
Conversation
🦋 Changeset detectedLatest commit: 10160fb The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Summary of ChangesHello @cruzdanilo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the server's error monitoring by integrating detailed smart contract revert reasons directly into Sentry error fingerprints. This change provides more granular context for blockchain-related exceptions, enabling more efficient identification, categorization, and resolution of issues stemming from contract execution failures. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
WalkthroughThese changes enhance Sentry error reporting by enriching error fingerprints with contract revert reasons. The hook layer (block.ts and panda.ts) now captures detailed error context when contract execution fails, with corresponding test updates verifying the new fingerprint behavior. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request enriches Sentry error reports by adding a fingerprint based on the contract revert reason. This is a great improvement for error grouping and analysis. The changes are implemented in block.ts and panda.ts, with corresponding test updates to verify the new fingerprinting logic. Otherwise, the changes look good and the tests are thorough.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #740 +/- ##
==========================================
- Coverage 67.27% 67.27% -0.01%
==========================================
Files 206 206
Lines 6909 7080 +171
Branches 2151 2219 +68
==========================================
+ Hits 4648 4763 +115
- Misses 2078 2117 +39
- Partials 183 200 +17
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@server/hooks/panda.ts`:
- Around line 385-394: The revert-reason extraction chain is duplicated where
you build the fingerprint (using contractError.cause and
ContractFunctionRevertedError); extract that fallback logic into a single helper
(e.g., export function revertReason(err: unknown): string) that returns
cause.reason ?? cause.data?.errorName ?? cause.signature ?? "unknown", replace
the inline ternary in the fingerprint construction with a call to
revertReason(contractError.cause), and update the other call site that currently
uses the same chain so both use this helper to stay in sync.
Issues attributed to commits in this pull requestThis pull request was merged and Sentry observed the following issues:
|
Summary by CodeRabbit
Improvements
Tests