Skip to content

Replace GasPrice with SubmitOptions in rust code example#1730

Merged
jcstein merged 1 commit intocelestiaorg:mainfrom
msuiche:main
Sep 26, 2024
Merged

Replace GasPrice with SubmitOptions in rust code example#1730
jcstein merged 1 commit intocelestiaorg:mainfrom
msuiche:main

Conversation

@msuiche
Copy link
Copy Markdown
Contributor

@msuiche msuiche commented Sep 25, 2024

Fixing some deprecated references in the rust sample code

Summary by CodeRabbit

  • Documentation
    • Updated the Rust client tutorial to reflect changes in blob submission parameters for the Celestia RPC library.
    • Revised method signatures to enhance clarity on how to submit blobs to the network.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Sep 25, 2024

Walkthrough

The pull request introduces a change in the Rust client tutorial for the Celestia RPC library. It updates the method for submitting blobs by replacing the GasPrice type with SubmitOptions from the blob module. This change modifies the submission parameters used in the submit_blob function, indicating a new approach to configuring submission options for blob interactions within the network.

Changes

File Change Summary
developers/rust-client-tutorial.md Updated blob_submit method to use SubmitOptions::default() instead of GasPrice::default().

Possibly related PRs

  • refactor: v0.15.0 #1671: This PR also shifts from using a gas price to a more flexible submission options approach, indicating a similar update in handling submission parameters in both Rust and Golang tutorials for blob submissions.

🐰 In the meadow where the code does flow,
A change was made, and now we know,
From gas to options, a leap so bright,
Submitting blobs with newfound light.
Hopping forward, we celebrate,
In Rust we trust, let’s innovate! 🌟


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
Copy Markdown
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 (2)
developers/rust-client-tutorial.md (2)

54-54: LGTM: Method call updated correctly. Consider updating the comment.

The blob_submit method call has been correctly updated to use SubmitOptions::default() instead of GasPrice::default(). This change aligns with the PR objective and maintains the simplicity of the example by using default options.

Consider updating the comment above this line (around line 51-52) to reflect the change from GasPrice to SubmitOptions. For example:

- // You can set `GasPrice::default()` as the gas price to have celestia-node automatically determine an appropriate gas price.
+ // You can use `SubmitOptions::default()` to have celestia-node use default submission options, including gas price.

This will help maintain consistency between the code and its documentation.


Line range hint 1-24: Consider updating the "Project setup" section for clarity.

While the main changes have been implemented correctly, it might be beneficial to update the "Project setup" section to provide more context about the specific types being used in the tutorial.

Consider adding a brief note about SubmitOptions in the "Project setup" section. For example, you could add:

To use the following methods, you will need the node URL and your auth token. To get your auth token, see this [guide](./node-tutorial.md#auth-token). To run your node without an auth token, you can use the `--rpc.skip-auth` flag when starting your node. This allows you to pass an empty string as your auth token.

The default URL is `http://localhost:26658`. If you would like to use subscription methods, such as `SubmitOptions` below, you must use the `ws` protocol in place of `http`: `ws://localhost:26658`.

This addition would provide users with a better understanding of the types they'll be working with in the tutorial.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 7a373e5 and 98040f7.

📒 Files selected for processing (1)
  • developers/rust-client-tutorial.md (2 hunks)
🔇 Additional comments not posted (2)
developers/rust-client-tutorial.md (2)

39-39: LGTM: Import statement updated correctly.

The import statement has been correctly updated to use SubmitOptions from the blob module instead of GasPrice. This change aligns with the PR objective and is necessary for the subsequent code modifications.


Line range hint 1-154: Summary: Successfully updated tutorial to use SubmitOptions

The changes in this PR successfully replace the usage of GasPrice with SubmitOptions in the Rust client library tutorial. The modifications are minimal and focused, maintaining the clarity and conciseness of the tutorial.

Key points:

  1. The import statement has been correctly updated.
  2. The blob_submit method call now uses SubmitOptions::default().
  3. The core functionality of the tutorial remains intact.

These changes ensure that the tutorial remains up-to-date with the latest API changes in the Celestia RPC library.

To further enhance the tutorial, consider implementing the minor suggestions provided in the previous comments:

  1. Update the comment above the blob_submit method call to reflect the change to SubmitOptions.
  2. Add a brief note about SubmitOptions in the "Project setup" section for better context.

These small improvements will help maintain consistency between the code and its documentation, providing a smoother learning experience for users of the tutorial.

@jcstein jcstein merged commit 82ca8c2 into celestiaorg:main Sep 26, 2024
@gitpoap-bot
Copy link
Copy Markdown

gitpoap-bot bot commented Sep 26, 2024

Congrats, your important contribution to this open-source project has earned you a GitPOAP!

GitPOAP: 2024 Celestia Contributor:

GitPOAP: 2024 Celestia Contributor GitPOAP Badge

Head to gitpoap.io & connect your GitHub account to mint!

Learn more about GitPOAPs here.

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.

2 participants