refactor: improve cctx error message for out of gas errrors when creating outbound#3709
refactor: improve cctx error message for out of gas errrors when creating outbound#3709
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 📝 WalkthroughWalkthroughThis pull request introduces a new "Refactor" section in the changelog and updates error messages across multiple keeper methods within the cross-chain module. The modifications include simplifying error outputs in both outbound transaction observers and gas payment functions by removing redundant log identifiers while adding contextual information (such as outbound chain ID and fee amounts). The corresponding test expectations have been updated accordingly, and an old logging method from the cross-chain transaction struct has been removed. Changes
Suggested labels
Suggested reviewers
🪧 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
Documentation and Community
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #3709 +/- ##
========================================
Coverage 64.58% 64.58%
========================================
Files 469 469
Lines 32918 32924 +6
========================================
+ Hits 21259 21265 +6
Misses 10694 10694
Partials 965 965
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
changelog.md (1)
9-9: Fix spelling error in changelog entry.There's a typo in the word "errrors" which should be "errors".
-* [3709](https://github.com/zeta-chain/node/pull/3709) - improve cctx error message for out of gas errrors when creating outbound +* [3709](https://github.com/zeta-chain/node/pull/3709) - improve cctx error message for out of gas errors when creating outbound
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
changelog.md(1 hunks)x/crosschain/keeper/cctx_utils.go(2 hunks)x/crosschain/keeper/gas_payment.go(4 hunks)x/crosschain/keeper/gas_payment_test.go(1 hunks)x/crosschain/types/keys.go(0 hunks)
💤 Files with no reviewable changes (1)
- x/crosschain/types/keys.go
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.go`: Review the Go code, point out issues relative to ...
**/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.
x/crosschain/keeper/cctx_utils.gox/crosschain/keeper/gas_payment_test.gox/crosschain/keeper/gas_payment.go
🔇 Additional comments (7)
x/crosschain/keeper/cctx_utils.go (2)
28-32: Improved error message clarity.The simplified error message provides clearer, more focused information by including only the chain name rather than verbose identifiers.
37-40: Well-structured error message simplification.This refactored error message follows the same pattern as the previous change, providing consistent error formatting throughout the codebase.
x/crosschain/keeper/gas_payment_test.go (1)
645-645: Updated test to match implementation's error type standardization.The test now correctly expects
types.ErrNotEnoughGaserror, which aligns with the implementation changes that standardize error types across different gas payment methods.x/crosschain/keeper/gas_payment.go (4)
137-142: Enhanced error context with specific transaction details.The error message now provides comprehensive information about the failed transaction, including outbound chain ID and the specific amounts required vs. available. This significantly improves troubleshooting capabilities.
228-233: Improved error message specificity for ZRC20 transactions.This enhanced error format follows the same pattern as other gas payment methods, providing consistent detailed information about the transaction failure context, particularly for ZRC20 tokens.
354-356: Simplified error message for GetMedianGasValues failures.The error message is appropriately simplified while still retaining the essential chain ID information.
387-393: Standardized error message format for Zeta token gas payments.Error now follows the same detailed format as other payment methods, creating a consistent error reporting pattern throughout the codebase. This change also properly consolidates errors under the more generic
ErrNotEnoughGastype.
Description
Closes : #3696
How Has This Been Tested?
Summary by CodeRabbit