Skip to content

Conversation

@fadeev
Copy link
Member

@fadeev fadeev commented Nov 29, 2024

  • Gas fees
  • phrasing

Summary by CodeRabbit

  • New Features

    • Updated documentation to provide clear guidance on fees for interacting with universal apps on ZetaChain.
    • Introduced detailed instructions for querying withdraw gas fees and ensuring sufficient gas token balance.
  • Documentation

    • Replaced "Overview" with "Calling Universal Apps" to focus on specific fee details.
    • Expanded the "Withdraw" section with new code snippets and examples for better user understanding.
    • Renamed "Current omnichain fees" to "Current Fees" for clarity.

@fadeev fadeev requested review from a team, bbbeeeee and brewmaster012 as code owners November 29, 2024 14:34
@vercel
Copy link

vercel bot commented Nov 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview Dec 5, 2024 5:15pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 29, 2024

Warning

Rate limit exceeded

@fadeev has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 27 minutes and 23 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 8c2e98d and 0a42594.

📝 Walkthrough
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request introduces substantial modifications to the documentation regarding gas fees for universal apps on ZetaChain. The "Overview" section has been replaced with "Calling Universal Apps," detailing the fee structure associated with these applications. The document now clarifies that fees are paid in the native gas token of the source chain and outlines the gas fee requirements for direct contract calls on ZetaChain's EVM. Additionally, the "Withdraw" section has been expanded with instructions for querying gas fees, and the "Current omnichain fees" section has been renamed to "Current Fees" to reflect updated content.

Changes

File Change Summary
src/pages/developers/evm/gas.mdx Replaced "Overview" with "Calling Universal Apps," restructured content on gas fees, expanded "Withdraw" section with querying instructions, and renamed "Current omnichain fees" to "Current Fees."

Possibly related PRs

  • Why Build Universal Apps #474: Focuses on the advantages of building universal apps, providing context for the fee structure discussed in the main PR.
  • Fixed withdraw gas table #487: Modifies the Fees component to include a new API endpoint for fetching fee data, directly relating to updates on querying and displaying gas fees.

Suggested reviewers

  • bbbbeeeee
  • brewmaster012
  • GMaiolo

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 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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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 and nitpick comments (3)
src/pages/developers/evm/gas.mdx (3)

19-20: Fix typographical error in documentation link

There's a double comma in the Ethereum gas documentation reference.

-Ethereum gas,, refer to the [official
+Ethereum gas, refer to the [official
🧰 Tools
🪛 LanguageTool

[typographical] ~19-~19: Two consecutive commas
Context: ...For detailed information on Ethereum gas,, refer to the [official documentation](h...

(DOUBLE_PUNCTUATION)


36-37: Improve grammar in gas fee query description

The word "withdraw" is being used incorrectly as a noun.

-Before making a call from a universal app to a contract on a connected chain, query the withdraw gas fee
+Before making a call from a universal app to a contract on a connected chain, query the withdrawal gas fee
🧰 Tools
🪛 LanguageTool

[grammar] ~37-~37: The word ‘withdraw’ is not a noun. Did you mean “withdrawal”?
Context: ...ontract on a connected chain, query the withdraw gas fee for the expected gas limit: ``...

(PREPOSITION_VERB)


31-34: Consider adding gas estimation examples

The documentation effectively explains the gas fee mechanism, but could benefit from practical examples of gas estimation for common operations. This would help developers better understand the cost implications of different operations.

Consider adding:

  1. Examples of typical gas costs for common operations
  2. Best practices for gas optimization
  3. Guidelines for setting appropriate gas limits
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between df80461 and 8c2e98d.

📒 Files selected for processing (1)
  • src/pages/developers/evm/gas.mdx (1 hunks)
🧰 Additional context used
🪛 LanguageTool
src/pages/developers/evm/gas.mdx

[typographical] ~19-~19: Two consecutive commas
Context: ...For detailed information on Ethereum gas,, refer to the [official documentation](h...

(DOUBLE_PUNCTUATION)


[grammar] ~37-~37: The word ‘withdraw’ is not a noun. Did you mean “withdrawal”?
Context: ...ontract on a connected chain, query the withdraw gas fee for the expected gas limit: ``...

(PREPOSITION_VERB)


[grammar] ~49-~49: The word ‘withdraw’ is not a noun. Did you mean “withdrawal”?
Context: ... tokens to a connected chain, query the withdraw gas fee: ```solidity (address gasZRC20...

(PREPOSITION_VERB)

🔇 Additional comments (3)
src/pages/developers/evm/gas.mdx (3)

39-41: LGTM: Well-structured code example

The code snippet effectively demonstrates how to query gas fees with a specific gas limit.


49-54: LGTM: Clear withdrawal fee query example

The code example and explanation for querying withdrawal fees are clear and accurate.

🧰 Tools
🪛 LanguageTool

[grammar] ~49-~49: The word ‘withdraw’ is not a noun. Did you mean “withdrawal”?
Context: ... tokens to a connected chain, query the withdraw gas fee: ```solidity (address gasZRC20...

(PREPOSITION_VERB)


65-67: Verify the accuracy of the default gas limit

The documentation mentions a default gas limit of 500,000. Let's verify this value is current and consistent with the template repository.

✅ Verification successful

Default gas limit of 500,000 is verified and consistent

The default gas limit of 500,000 is confirmed to be accurate and consistently used across the codebase:

  • Used in frontend toolkit's default configuration (ZetaChainClient and sendZeta function)
  • Referenced in deployment scripts for NFT contracts
  • Documented in the gas fee calculation section
  • Consistently used in tutorials and example code

The value is also properly integrated with the withdraw gas fee system through withdrawGasFeeWithGasLimit() function calls.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the default gas limit in the template repository

# Check for gas limit references in the template repository
gh repo clone zeta-chain/template /tmp/template 2>/dev/null || true
cd /tmp/template
rg -i "500,000|500000" -A 3 -B 3

Length of output: 103


Script:

#!/bin/bash
# Let's search for gas limit references in the codebase
rg -i "gas.?limit" -A 3 -B 3

# Also search for specific numbers that might indicate gas limits
rg -i "500,000|500000|gas.*fee" -A 3 -B 3

# Check if there are any configuration files that might contain gas limits
fd -e json -e toml -e yaml -e yml -X rg -i "gas"

Length of output: 139412


Script:

#!/bin/bash
# Let's search for gas limit references in the fungible module and crosschain module
rg -i "gas.?limit.*500|500.*gas.?limit" -A 3 -B 3

# Search for withdraw fee configurations
rg -i "withdraw.*fee.*gas|gas.*withdraw.*fee" -A 3 -B 3

# Look for gas limit configurations in config files
fd -e json -e toml -e yaml -e yml -X rg -i "gas.?limit.*=|gas.?limit.*:" -A 3 -B 3

Length of output: 17632

Copy link
Member

@hernan-clich hernan-clich left a comment

Choose a reason for hiding this comment

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

Tested ACK

fadeev and others added 3 commits December 5, 2024 20:03
Co-authored-by: Hernan Clich <62221379+hernan-clich@users.noreply.github.com>
Co-authored-by: Hernan Clich <62221379+hernan-clich@users.noreply.github.com>
Co-authored-by: Hernan Clich <62221379+hernan-clich@users.noreply.github.com>
@fadeev fadeev merged commit 5968b12 into main Dec 6, 2024
5 checks passed
@fadeev fadeev deleted the gas-page-improvements branch December 6, 2024 10:00
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.

3 participants