🥅 server: capture proposal reverts as warnings#808
Conversation
🦋 Changeset detectedLatest commit: 2cc0413 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 |
WalkthroughAdds configurable severity handling to keeper.exaSend, maps certain executeProposal contract errors to warnings, attaches proposal context (account/nonce/type/retry) to Sentry captures, and updates tests to expect the new capture levels and matching behavior. Changes
Sequence Diagram(s)sequenceDiagram
participant Hook as Proposal Hook
participant Keeper as keeper.exaSend
participant Sentry as Sentry Scope
participant Capture as captureException
Hook->>Keeper: call exaSend / executeProposal (error occurs)
Note over Keeper: determine options.level
alt level is function
Keeper->>Keeper: computedLevel = level(reason, error)
else level is static
Keeper->>Keeper: computedLevel = static
else level === false
Keeper->>Keeper: suppress capture (end)
else no level provided
Keeper->>Keeper: computedLevel = "error"
end
alt computedLevel truthy
Keeper->>Sentry: withScope()
Sentry->>Sentry: fingerprint = revertFingerprint(error)
Sentry->>Sentry: if fingerprint known -> augment event.type
Sentry->>Capture: captureException(error, { level: computedLevel, contexts: { proposal } })
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
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 |
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 error reporting mechanism within the server, specifically for handling proposal execution failures. By introducing a flexible 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
|
Greptile Summaryrefactored error capture logic to treat proposal execution reverts as warnings instead of errors, reducing noise in error monitoring. key changes:
impact:
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[keeper.exaSend called] --> B{Execution succeeds?}
B -->|Yes| C[Return receipt]
B -->|No| D[Extract revert reason]
D --> E{Check level option}
E -->|Function| F[Call level function with reason and error]
E -->|Static string| G[Use static level]
E -->|false| H[Skip capture]
E -->|undefined| G
F --> I{Function returns?}
I -->|false| H
I -->|warning| J[Capture as warning]
I -->|error| K[Capture as error]
G --> L{Level value?}
L -->|warning| J
L -->|error| K
J --> M[Apply fingerprint and type formatting]
K --> M
M --> N[captureException]
H --> O[Re-throw error]
N --> O
P[Proposal execution] --> Q[Set proposal context]
Q --> A
Q -.context propagates.-> M
Last reviewed commit: d0ff8c6 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #808 +/- ##
==========================================
+ Coverage 69.34% 69.37% +0.02%
==========================================
Files 208 208
Lines 7101 7111 +10
Branches 2249 2256 +7
==========================================
+ Hits 4924 4933 +9
Misses 1992 1992
- Partials 185 186 +1
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:
|
Greptile Summaryadded configurable error severity control to the keeper utility's
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[keeper.exaSend called] --> B{Simulate & Execute Transaction}
B -->|Success| C[Return Receipt]
B -->|Error| D[Extract Revert Reason]
D --> E{Check ignore option}
E -->|Ignored| F[Set OK Status]
E -->|Not Ignored| G{Evaluate level option}
G -->|level = function| H[Call level function with reason & error]
G -->|level = static value| I[Use static level]
H --> J{Function returns false?}
J -->|true| K[Suppress Capture]
J -->|false| L{Function returns warning or error?}
L -->|warning| M[Capture as Warning]
L -->|error| N[Capture as Error]
I -->|false| K
I -->|warning| M
I -->|error| N
M --> O[Set Error Status & Throw]
N --> O
K --> O
P[executeProposal in block.ts] --> Q[keeper.exaSend with level function]
Q --> R{Check Reason}
R -->|NonceTooLow or NoProposal| S[Return false - suppress]
R -->|ContractFunctionExecutionError| T[Return warning]
R -->|Other Error| U[Return error]
Last reviewed commit: 6184b72 |
Greptile Summaryadds configurable severity levels for blockchain transaction operations, allowing proposal reverts to be captured as warnings instead of errors for clearer diagnostics.
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[keeper.exaSend called] --> B{Transaction succeeds?}
B -->|Yes| C[Return receipt]
B -->|No| D[Determine revert reason]
D --> E{Check ignore option}
E -->|Matches| F[Mark span OK, return null/receipt]
E -->|No match| G{Evaluate level option}
G -->|false| H[Suppress capture, throw error]
G -->|function| I[Call level function with reason & error]
G -->|static string| J[Use static level]
I --> K{Function returns false?}
K -->|Yes| H
K -->|No| L[Use returned level]
J --> L
L --> M[Capture exception with level]
M --> N{Has fingerprint?}
N -->|Yes| O[Add custom event processor]
N -->|No| P[Capture with standard fingerprint]
O --> P
P --> Q[Throw error]
F --> C
H --> Q
Last reviewed commit: 2cc0413 |
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Chores