-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat] add db alert #64
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
Conversation
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.
Pull Request Overview
This PR adds database transaction failure alerting capabilities to the EVM relayer. The changes refactor transaction handling to introduce alert mechanisms that trigger when database operations fail, including when fetching block information, getting balance data, or saving transactions to the database.
Key changes:
- Consolidated
NewUnconfirmedTransactionandNewConfirmedTransactioninto a singleNewTransactionfunction - Removed
TxHashfield fromTxResultstructure (redundant as it's passed separately) - Added three new alert types:
GetBlockErrorMsg,GetBalanceErrorMsg, andSaveDatabaseErrorMsg - Refactored transaction saving logic into
prepareTransactionandhandleSaveTransactionhelper functions with integrated alerting
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| relayer/alert/alert.go | Adds three new alert message constants for database-related errors |
| relayer/db/types.go | Changes BlockTimestamp to nullable pointer type and consolidates transaction constructor functions |
| relayer/chains/evm/types.go | Removes redundant TxHash field from TxResult struct and its constructor |
| relayer/chains/evm/provider.go | Refactors transaction preparation and saving with integrated alert triggering/resetting for database operations |
| relayer/chains/evm/provider_test.go | Updates test expectations to reflect removed TxHash parameter |
| relayer/chains/evm/provider_legacy_test.go | Removes GetBalance mock expectations since balance fetching is now conditional on database presence |
| relayer/chains/evm/provider_eip1559_test.go | Removes GetBalance mock expectations since balance fetching is now conditional on database presence |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull Request Overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull Request Overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fixed: #XXXX
Implementation details
Please ensure the following requirements are met before submitting a pull request:
CHANGELOG_UNRELEASED.mdFiles changedtab in the Github PR explorer)