🥅 server: handle timelocked proposal reverts#805
Conversation
🦋 Changeset detectedLatest commit: 6b15e0a 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 |
WalkthroughCentralizes proposal error handling in the block hook using a revertReason switch. Adds Timelocked handling that reschedules proposals with updated unlock and retryCount, adjusts NotNext rescheduling behavior, treats NoProposal/NonceTooLow as aborted, and updates tests to cover Timelocked requeue and adjusted warnings. Changes
Sequence DiagramsequenceDiagram
participant Executor as Proposal Executor
participant Contract as Smart Contract
participant ErrorHandler as Block Hook Error Handler
participant Previewer as exaPreviewer
participant Queue as Redis Queue
participant Blockchain as Blockchain State
Executor->>Contract: executeProposal()
Contract-->>Executor: revert (Timelocked / NotNext / NonceTooLow / NoProposal / other)
Executor->>ErrorHandler: throw/catch error
ErrorHandler->>ErrorHandler: classify using revertReason(error)
alt Timelocked
ErrorHandler->>Blockchain: getCurrentBlock()
ErrorHandler->>ErrorHandler: compute nextUnlock, retryCount++
ErrorHandler->>Queue: enqueue rescheduled proposal (nextUnlock, retryCount)
else NotNext
ErrorHandler->>Previewer: read pendingProposals()
ErrorHandler->>ErrorHandler: build idle/rescheduled proposals (retryCount++)
ErrorHandler->>Queue: enqueue idle/rescheduled proposals
else NonceTooLow / NoProposal
ErrorHandler->>Queue: remove proposal from Redis (abort)
else Default
ErrorHandler->>ErrorHandler: mark error / captureException (with optional skipNonce handling)
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 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)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. 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 enhances the server's robustness by introducing a dedicated mechanism to manage proposals that encounter a 'Timelocked' revert error. Instead of failing, these proposals are now intelligently re-scheduled for a later attempt, improving the system's ability to process transactions under specific on-chain conditions. The changes also refine existing error handling and testing practices. 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
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #805 +/- ##
==========================================
- Coverage 69.33% 69.11% -0.22%
==========================================
Files 208 208
Lines 7092 7155 +63
Branches 2251 2269 +18
==========================================
+ Hits 4917 4945 +28
- Misses 1992 2020 +28
- Partials 183 190 +7
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:
|
e99ab21 to
3239d15
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6b15e0a40b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Summary by CodeRabbit