fix: set retry gas limit if outbound is successful#3821
Conversation
* set retry gas limit if evm outbound is successful * add constant for retry gas limit
📝 WalkthroughWalkthroughThis update introduces a new constant, Changes
Sequence Diagram(s)sequenceDiagram
participant Observer
participant Zetacore
Observer->>Observer: Initialize retryGasLimit = PostVoteOutboundRetryGasLimit
alt If outbound status is failed
Observer->>Observer: retryGasLimit = PostVoteOutboundRevertGasLimit
end
Observer->>Zetacore: Post vote outbound with retryGasLimit
✨ Finishing Touches
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. 🪧 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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3821 +/- ##
========================================
Coverage 64.38% 64.38%
========================================
Files 463 463
Lines 33353 33354 +1
========================================
+ Hits 21473 21474 +1
Misses 10889 10889
Partials 991 991
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
zetaclient/chains/solana/observer/outbound.go (1)
175-181: Update outdated comment to match implementation.The comment at lines 175-177 states that "we set retryGasLimit to 0", which contradicts the new implementation that initializes it to the new constant value of 1,000,000.
- // so we set retryGasLimit to 0 because the solana gateway withdrawal will always succeed - // and the vote msg won't trigger ZEVM interaction + // We set retryGasLimit to PostVoteOutboundRetryGasLimit by default for successful transactions + // and use a higher gas limit (PostVoteOutboundRevertGasLimit) for failed transactions🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 181-181: zetaclient/chains/solana/observer/outbound.go#L181
Added line #L181 was not covered by tests
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
changelog.md(1 hunks)x/crosschain/keeper/evm_hooks.go(1 hunks)zetaclient/chains/evm/observer/outbound.go(1 hunks)zetaclient/chains/solana/observer/outbound.go(1 hunks)zetaclient/chains/sui/observer/outbound.go(1 hunks)zetaclient/chains/ton/observer/outbound.go(1 hunks)zetaclient/zetacore/constant.go(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.go`: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.
**/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.
zetaclient/chains/sui/observer/outbound.gozetaclient/chains/ton/observer/outbound.gozetaclient/zetacore/constant.gox/crosschain/keeper/evm_hooks.gozetaclient/chains/solana/observer/outbound.gozetaclient/chains/evm/observer/outbound.go
🧬 Code Graph Analysis (4)
zetaclient/chains/sui/observer/outbound.go (1)
zetaclient/zetacore/constant.go (1)
PostVoteOutboundRetryGasLimit(44-44)
zetaclient/chains/ton/observer/outbound.go (1)
zetaclient/zetacore/constant.go (1)
PostVoteOutboundRetryGasLimit(44-44)
zetaclient/chains/solana/observer/outbound.go (1)
zetaclient/zetacore/constant.go (1)
PostVoteOutboundRetryGasLimit(44-44)
zetaclient/chains/evm/observer/outbound.go (1)
zetaclient/zetacore/constant.go (1)
PostVoteOutboundRetryGasLimit(44-44)
🪛 GitHub Check: codecov/patch
zetaclient/chains/ton/observer/outbound.go
[warning] 255-255: zetaclient/chains/ton/observer/outbound.go#L255
Added line #L255 was not covered by tests
zetaclient/chains/solana/observer/outbound.go
[warning] 181-181: zetaclient/chains/solana/observer/outbound.go#L181
Added line #L181 was not covered by tests
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: start-e2e-test / e2e
🔇 Additional comments (5)
zetaclient/zetacore/constant.go (1)
43-44: Clear and well-documented constant addition.The new constant
PostVoteOutboundRetryGasLimitprovides a standard value for retry gas limits when processing successful outbound transactions, complementing the existingPostVoteOutboundRevertGasLimitused for revert cases.changelog.md (1)
38-38: Changelog entry is concise and appropriately placed.The addition properly documents the change related to setting retry gas limits for successful outbound transactions and includes the correct PR reference.
x/crosschain/keeper/evm_hooks.go (1)
352-353: Comment enhancement improves clarity.The expanded comment provides better explanation of why rent exempt checks aren't needed for both SPL token withdrawals and simple no-asset calls on Solana.
zetaclient/chains/sui/observer/outbound.go (1)
230-230: Consistent initialization of retryGasLimit enhances reliability.The initialization of
retryGasLimitwith the newPostVoteOutboundRetryGasLimitconstant improves the handling of successful outbound transactions by providing a standardized gas limit for retry operations.zetaclient/chains/evm/observer/outbound.go (1)
124-127: Standardized retry gas limit handling improves cross-chain consistency.Setting
retryGasLimitto the new constantPostVoteOutboundRetryGasLimitaligns the EVM implementation with other chain observers (Sui, Solana, TON) and standardizes the gas limit for retry operations across the system.
original PR: #3820
Summary by CodeRabbit
Bug Fixes
Documentation
Chores