Skip to content

Conversation

@tanut32039
Copy link
Contributor

Fixed: #XXXX

Implementation details

  • add alert when failed saving database transaction

Please ensure the following requirements are met before submitting a pull request:

  • The pull request is targeted against the correct target branch
  • The pull request is linked to an issue with appropriate discussion and an accepted design OR is linked to a spec that describes the work.
  • The pull request includes a description of the implementation/work done in detail.
  • The pull request includes any and all appropriate unit/integration tests
  • You have added a relevant changelog entry to CHANGELOG_UNRELEASED.md
  • You have re-reviewed the files affected by the pull request (e.g. using the Files changed tab in the Github PR explorer)

Copy link

Copilot AI left a 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 NewUnconfirmedTransaction and NewConfirmedTransaction into a single NewTransaction function
  • Removed TxHash field from TxResult structure (redundant as it's passed separately)
  • Added three new alert types: GetBlockErrorMsg, GetBalanceErrorMsg, and SaveDatabaseErrorMsg
  • Refactored transaction saving logic into prepareTransaction and handleSaveTransaction helper 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.

Copy link

Copilot AI left a 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.

Copy link

Copilot AI left a 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.

@RogerKSI RogerKSI merged commit 0ced54d into main Nov 24, 2025
2 checks passed
@RogerKSI RogerKSI deleted the save-db-alert branch November 24, 2025 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants