-
Notifications
You must be signed in to change notification settings - Fork 93
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
[EASY] Improve mempool submission expired logs #3272
Conversation
WalkthroughThis pull request enhances error handling and logging across several modules. The main change is in the Mempools' submit method, where the Expired error variant now carries additional information (transaction ID, submission block, and deadline). Logging has been updated to include the current block number at key points. Similarly, the notify and observe modules have been updated to pattern match on the enriched Expired error without altering the overall logic. Changes
Sequence Diagram(s)sequenceDiagram
participant C as Client
participant M as Mempool
participant L as Logger
C->>M: submit(transaction)
M->>L: Log submission (tx hash, current block)
M->>M: Check transaction expiration
alt Transaction expired
M->>L: Log error (tx_id, submitted_at_block, submission_deadline, current block)
M-->>C: Return Expired Error {tx_id, submitted_at_block, submission_deadline}
else Transaction valid
M->>L: Log confirmation check (current block)
M-->>C: Return success
end
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms (4)
🔇 Additional comments (3)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is that rabbit thing? 😅
Currently, it is not really convenient to debug mempool submission errors, especially when a tx has expired. This PR adds current block number info, when the submission started and the deadline. The expired tx hash would help search for the logs associated with it without looking into the code to find the required messages to filter in.
Summary by CodeRabbit
Expired
error variant, allowing for more detailed future handling.