Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: updating tutorial with new API #252

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

distractedm1nd
Copy link
Contributor

@distractedm1nd distractedm1nd commented Feb 20, 2025

This is only a basic update.

We need to add an additional tutorial once specter is ready on how to use the client without running the prover in the same binary.

Summary by CodeRabbit

  • Chores

    • Updated container image configurations to use alternative versions of system binaries, ensuring consistent behavior across different node types.
  • Documentation

    • Streamlined tutorial content with simplified instructions for service registration, account creation, and data management for improved clarity.

Copy link

vercel bot commented Feb 20, 2025

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

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
prism ⬜️ Ignored (Inspect) Feb 20, 2025 9:05am

Copy link
Contributor

coderabbitai bot commented Feb 20, 2025

Walkthrough

The changes update version references for Celestia binaries in multiple Dockerfiles and refactor tutorial documentation. The bridge and lightnode Dockerfiles now copy binaries from version v0.20.4 instead of v0.21.5, while the validator Dockerfile downgrades the celestia-appd binary from v3.3.1 to v3.0.2. In the tutorial, the module service_registration is renamed to operations and key functions (registering services, creating accounts, and handling keys/data) are refactored to simplify control flow and transaction construction.

Changes

File(s) Change Summary
ci/Dockerfile.bridge, ci/Dockerfile.lightnode Updated Celestia node binaries (celestia and cel-key) from v0.21.5 to v0.20.4 in the Docker images.
ci/Dockerfile.validator Updated celestia-appd binary from v3.3.1 to v3.0.2 in the Docker image.
doc/.../tutorial.md Renamed module from service_registration to operations and refactored functions (register_service, create_account, add_key, add_data) to simplify logic and improve flow.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant T as Tutorial Module
    participant O as Operations Module
    participant TB as Transaction Builder

    U->>T: Initiates service registration
    T->>O: Call register_service()
    O->>O: Check for existing service/account
    alt Not registered
        O->>TB: Build registration transaction
        TB-->>O: Transaction built
        O->>T: Complete registration
    else Registered
        O->>T: Return existing service info
    end
Loading
sequenceDiagram
    participant U as User
    participant T as Tutorial Module
    participant O as Operations Module
    participant TB as Transaction Builder

    U->>T: Request account creation
    T->>O: Call create_account()
    O->>O: Verify account existence
    alt Account does not exist
        O->>TB: Construct account creation transaction
        TB-->>O: Return transaction details
        O->>T: Execute account creation
    else
        O->>T: Return existing account data
    end
Loading

Possibly related PRs

Poem

I hopped through Docker and code with glee,
Updating binaries for all to see.
With refactored flows in my tutorial den,
I skip through functions again and again.
In the world of code, I'm a playful sight,
A rabbit on a byte-filled flight! 🐇💻


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9931422 and 738ac15.

📒 Files selected for processing (4)
  • ci/Dockerfile.bridge (1 hunks)
  • ci/Dockerfile.lightnode (1 hunks)
  • ci/Dockerfile.validator (1 hunks)
  • doc/src/tutorial.md (8 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: unused dependencies
  • GitHub Check: unit-test
  • GitHub Check: integration-test
🔇 Additional comments (12)
ci/Dockerfile.validator (1)

13-13: Version Downgrade Confirmation for celestia-appd
The binary version has been updated to v3.0.2 as part of the coordinated changes across the Dockerfiles. Please verify that this downgrade is intentional and that it aligns with compatibility requirements and related documentation.

ci/Dockerfile.bridge (1)

13-14: Binaries Version Downgrade for celestia-node
The Dockerfile now copies both celestia and cel-key binaries from version v0.20.4, which is consistent with the coordinated update across multiple Dockerfiles. Please double-check that all dependent services and configurations are compatible with this version.

ci/Dockerfile.lightnode (1)

13-14: Consistency Check: Binary Version Update for Lightnode
The Dockerfile now uses binaries from version v0.20.4 to match the changes in the bridge Dockerfile. Ensure that any configuration or integration tests have been updated accordingly to account for this version change.

doc/src/tutorial.md (9)

39-39: Module Renaming Update
The module has been renamed from service_registration to operations to better reflect its broader functionality. Make sure that all references to this module in the codebase and documentation have been updated accordingly.


44-44: Import Change: Using prism_client::SigningKey
The import now uses prism_client::SigningKey instead of the previous source. Confirm that any usages of SigningKey in the file and its dependents are compatible with this change.


117-120: Simplified Service Registration Logic
The check to determine if a service is already registered is now a concise conditional using prover.get_account(SERVICE_ID).await?.account.is_some(). This streamlines the logic—please confirm that the new approach meets the intended behavior in all edge cases.


137-140: Refactored Registration Operation API Usage
The call now leverages the new register_service API, which encapsulates both the registration operation and the transaction preparation. Ensure that the new method correctly integrates authentication and challenge-handling as expected.


183-194: Adoption of Request Builder for Account Creation
The account creation flow now uses a request builder pattern to construct an unsigned transaction. This makes explicit the steps for handling challenges when the user’s private key isn’t directly passed. Please verify that the meeting_signed_challenge method and the builder chain operate as intended.


195-204: User Signing Process Implementation
The explicit conversion of the unsigned transaction to bytes, followed by signing and the construction of a SignatureBundle, enhances the transparency of the signing process. Confirm that encode_to_bytes() and subsequent signing logic handle errors robustly.


207-213: Account Creation and Transaction Processing
After constructing a default account, the transaction is processed and then queued for an update. This flow appears consistent; however, please ensure that processing the transaction in this manner fully satisfies the account creation logic and state consistency requirements.


236-245: Updated add_key Method Usage
The add_key function now utilizes the new API call, awaiting the result and processing it accordingly. Verify that potential errors are gracefully handled and that the updated account state is correctly returned.


257-269: Refactored add_data Implementation
The add_data function now uses the new add_data method with an updated asynchronous pattern. Please double-check that the API’s error messages and result waiting (via .await? and .wait()) are consistent with the updated design and provide meaningful feedback in failure scenarios.


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.

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.

.clone()
.validate_and_queue_update(create_acc_tx.clone())
.await?;
prover.clone().validate_and_queue_update(tx.clone()).await?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Even without #253 , we could use let account = prover.post_transaction(tx)?.await?.wait().await? or something like this

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