Skip to content

chore: fix some comments#3392

Merged
gartnera merged 1 commit intozeta-chain:developfrom
petercover:develop
Jan 22, 2025
Merged

chore: fix some comments#3392
gartnera merged 1 commit intozeta-chain:developfrom
petercover:develop

Conversation

@petercover
Copy link
Contributor

@petercover petercover commented Jan 22, 2025

Description

fix some comments

How Has This Been Tested?

  • Tested CCTX in localnet
  • Tested in development environment
  • Go unit tests
  • Go integration tests
  • Tested via GitHub Actions

Summary by CodeRabbit

  • Documentation

    • Fixed several typos in comments across multiple files
    • Corrected spelling errors in documentation strings
  • Refactor

    • Renamed newDepositInboundVote to newDepositAndCallInboundVote to better reflect its expanded functionality
    • Updated method to handle both deposit and call events in EVM observer
  • Chores

    • Improved code clarity through precise comment corrections
    • Standardized method naming for better code readability

Signed-off-by: petercover <raowanxiang@outlook.com>
@petercover petercover requested a review from a team as a code owner January 22, 2025 16:07
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 22, 2025

📝 Walkthrough

Walkthrough

This pull request encompasses a series of minor documentation and comment corrections across multiple files in the codebase. The changes primarily focus on fixing typographical errors, improving comment clarity, and making minor nomenclature adjustments without altering the underlying code functionality. The modifications span various components of the system, including RPC types, test files, and observer implementations.

Changes

File Change Summary
cmd/zetae2e/local/local.go Corrected spelling in comment from "immedately" to "immediately"
pkg/contracts/solana/gateway.go Fixed comment typo from "privides" to "provides"
pkg/mempool/custom_proposal_handler_test.go Corrected spelling of "Becasuse" to "Because" in comments
rpc/namespaces/ethereum/eth/filters/filter_system.go Fixed comment typo from "intantiated" to "instantiated"
rpc/types/utils.go Renamed NewTransactionFromData to NewRPCTransaction
x/lightclient/keeper/block_header_test.go Updated comment to correctly describe reading a header instead of a receipt
zetaclient/chains/evm/observer/v2_inbound.go Renamed newDepositInboundVote to newDepositAndCallInboundVote with expanded event handling

Possibly related PRs

Suggested Labels

no-changelog

Suggested Reviewers

  • kingpinXD
  • gartnera
  • swift1337
✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🔭 Outside diff range comments (1)
zetaclient/chains/evm/observer/v2_inbound.go (1)

Line range hint 449-472: Fix duplicate event appending in event validation.

The event is being appended to the slice twice: once before validation and once after successful validation. This results in duplicate events in the slice.

Apply this fix to the event validation logic:

-events = append(events, iterator.Event)
 err := evm.ValidateEvmTxLog(&iterator.Event.Raw, gatewayAddr, "", evm.TopicsGatewayDepositAndCall)
 if err == nil {
     events = append(events, iterator.Event)
     continue
 }
🧹 Nitpick comments (1)
zetaclient/chains/evm/observer/v2_inbound.go (1)

Line range hint 449-472: Replace hardcoded gas limit with a constant.

The gas limit is hardcoded to 1,500,000. Consider moving this value to a named constant for better maintainability and configurability.

+const DefaultDepositAndCallGasLimit = 1_500_000
+
 func (ob *Observer) newDepositAndCallInboundVote(event *gatewayevm.GatewayEVMDepositedAndCalled) types.MsgVoteInbound {
     // ... existing code ...
-    1_500_000,
+    DefaultDepositAndCallGasLimit,
     // ... rest of the code ...
 }
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 13d1673 and 900c831.

📒 Files selected for processing (7)
  • cmd/zetae2e/local/local.go (1 hunks)
  • pkg/contracts/solana/gateway.go (1 hunks)
  • pkg/mempool/custom_proposal_handler_test.go (2 hunks)
  • rpc/namespaces/ethereum/eth/filters/filter_system.go (1 hunks)
  • rpc/types/utils.go (1 hunks)
  • x/lightclient/keeper/block_header_test.go (1 hunks)
  • zetaclient/chains/evm/observer/v2_inbound.go (1 hunks)
✅ Files skipped from review due to trivial changes (5)
  • pkg/contracts/solana/gateway.go
  • pkg/mempool/custom_proposal_handler_test.go
  • rpc/namespaces/ethereum/eth/filters/filter_system.go
  • cmd/zetae2e/local/local.go
  • x/lightclient/keeper/block_header_test.go
🧰 Additional context used
📓 Path-based instructions (2)
rpc/types/utils.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

zetaclient/chains/evm/observer/v2_inbound.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

🔇 Additional comments (1)
rpc/types/utils.go (1)

Line range hint 187-249: Well-structured implementation with comprehensive transaction type handling.

The function properly handles different transaction types (legacy, access list, and dynamic fee), with appropriate chain ID and signature management.

@gartnera gartnera added the no-changelog Skip changelog CI check label Jan 22, 2025
@gartnera gartnera added this pull request to the merge queue Jan 22, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 22, 2025
@gartnera gartnera added this pull request to the merge queue Jan 22, 2025
Merged via the queue into zeta-chain:develop with commit 9fc89e0 Jan 22, 2025
37 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking:cli no-changelog Skip changelog CI check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants