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

feat!: GetProofs introduction #38

Merged
merged 3 commits into from
Feb 1, 2024
Merged

feat!: GetProofs introduction #38

merged 3 commits into from
Feb 1, 2024

Conversation

distractedm1nd
Copy link
Collaborator

@distractedm1nd distractedm1nd commented Jan 30, 2024

This PR is stacked on top of #35, so keeping in draft.

The contents of this PR:

  • Removal of proofs as a return value from Submit
  • Introduction of GetProofs method

There are three reasons for the removal of proofs as a return value from Submit and the introduction of the GetProofs method:

  1. Returning multiple values breaks the JSON-RPC spec. Breaking the spec would mean adding support in all client libraries in other languages as well
  2. When this interface is ported to other languages, not all of them support multiple return values
  3. We should not assume that the user is going to want proofs upon submit. They can retrieve them if they need.

Summary by CodeRabbit

  • New Features
    • Introduced a GetProofs method to obtain inclusion proofs for blobs at a specific blockchain height.
  • Changes
    • Updated the Submit method to return only blob IDs upon successful submission, removing the inclusion proofs from the return type.

@distractedm1nd distractedm1nd added the enhancement New feature or request label Jan 30, 2024
@distractedm1nd distractedm1nd self-assigned this Jan 30, 2024
Copy link

coderabbitai bot commented Jan 30, 2024

Walkthrough

The recent update introduces the GetProofs method, enhancing data retrieval by providing inclusion proofs for blobs at a specific blockchain height. Concurrently, it simplifies the Submit method's return value to only include blob IDs, omitting proofs. This change streamlines interactions with the Data Availability layer, focusing on efficiency and clarity in data submission and verification processes.

Changes

Files Change Summary
README.md Added GetProofs; Modified Submit to return []ID only.
da.go, proto/da/da.proto, proxy/client.go, proxy/server.go, test/dummy.go, test/test_suite.go Added GetProofs method for inclusion proofs; Updated Submit method to return only []ID. Adjusted logic to reflect these changes.

🐇✨
In the code where data flows,
A new path, the rabbit knows.
With proofs to show and IDs to submit,
Our blockchain's strength, bit by bit.
🌟📜

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>.
    • Generate unit-tests for this file.
  • 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 tests 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 generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

codecov bot commented Jan 30, 2024

Codecov Report

Attention: 7 lines in your changes are missing coverage. Please review.

Comparison is base (58fb4d0) 79.77% compared to head (45451c3) 78.01%.

Files Patch % Lines
proxy/client.go 69.23% 3 Missing and 1 partial ⚠️
proxy/server.go 66.66% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #38      +/-   ##
==========================================
- Coverage   79.77%   78.01%   -1.77%     
==========================================
  Files           3        3              
  Lines         178      191      +13     
==========================================
+ Hits          142      149       +7     
- Misses         28       32       +4     
- Partials        8       10       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

* adding namespaces

* changing submitoptions to gasprice,ns

* adding namespace to remaining endpoints

* updating readme w note

* nit: lint md013 - skip tables

---------

Co-authored-by: Javed Khan <tuxcanfly@gmail.com>

updating readme w note

feat: GetProofs introduction

updating readme
@distractedm1nd distractedm1nd marked this pull request as ready for review January 31, 2024 22:01
Copy link

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 58fb4d0 and 760dfcf.
Files ignored due to path filters (1)
  • types/pb/da/da.pb.go is excluded by: !**/*.pb.go
Files selected for processing (7)
  • README.md (1 hunks)
  • da.go (1 hunks)
  • proto/da/da.proto (3 hunks)
  • proxy/client.go (3 hunks)
  • proxy/server.go (1 hunks)
  • test/dummy.go (2 hunks)
  • test/test_suite.go (4 hunks)
Additional comments: 14
da.go (2)
  • 19-21: The addition of the GetProofs method aligns with the PR objectives to separate the retrieval of proofs from the Submit method. This change enhances flexibility and compliance with the JSON-RPC specification.
  • 27-29: The modification to the Submit method, which now returns only the IDs identifying blobs in the DA, is correctly implemented. This change simplifies the method's return type, improving language compatibility and user flexibility as intended.
proxy/server.go (2)
  • 59-66: The implementation of the GetProofs method in the proxySrv struct correctly delegates the call to the underlying DA interface's GetProofs method. This ensures that the proxy server can retrieve proofs as per the new interface requirements.
  • 71-77: The modification to the Submit method, removing the proofs return value and its associated logic, is correctly implemented. This change aligns with the PR objectives to streamline the Submit method's return type.
README.md (1)
  • 20-24: The documentation in the README.md file has been updated to include the new GetProofs method and modify the Submit method's return type. These updates accurately reflect the changes made to the interface, ensuring that the documentation remains consistent with the codebase.
proto/da/da.proto (2)
  • 15-17: The addition of the GetProofs RPC method to the DAService service is correctly defined. This change enables the retrieval of inclusion proofs for all blobs at a given height, aligning with the PR objectives.
  • 84-93: The corresponding request and response message types for the GetProofs method (GetProofsRequest and GetProofsResponse) are correctly defined. These message types facilitate the correct exchange of data for the retrieval of proofs.
proxy/client.go (2)
  • 78-87: The implementation of the GetProofs method in the Client struct correctly interacts with the gRPC client to retrieve proofs from the DA layer. This addition is consistent with the interface changes and the PR objectives.
  • 111-125: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [105-122]

The modification to the Submit method, removing the []da.Proof slice from the return signature, is correctly implemented. This change reflects the updated interface requirements and simplifies the method's return type.

test/dummy.go (2)
  • 93-103: The implementation of the GetProofs method in the DummyDA struct correctly simulates the retrieval of inclusion proofs for all blobs at a given height. This method is essential for testing the new interface functionality.
  • 115-126: The modification to the Submit method, removing the return of proofs and the namespace parameter, is correctly implemented. This change aligns with the updated interface and simplifies the method's functionality for testing purposes.
test/test_suite.go (3)
  • 63-81: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [39-78]

The BasicDATest function has been updated to remove proof variables from the Submit function calls and to separate the retrieval and validation of proofs into distinct steps. These changes correctly reflect the updated interface and ensure that the tests remain valid.

  • 114-114: In the GetIDsTest function, the removal of the proofs variable from the Submit function's return values and the adjustment of corresponding assertions are correctly implemented. This change aligns with the interface modifications.
  • 167-167: The ConcurrentReadWriteTest function correctly removes the proof variable from the Submit function call, aligning with the updated interface. This ensures that the test accurately reflects the changes made to the Submit method.

Copy link

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 760dfcf and 45451c3.
Files ignored due to path filters (1)
  • types/pb/da/da.pb.go is excluded by: !**/*.pb.go
Files selected for processing (7)
  • README.md (1 hunks)
  • da.go (1 hunks)
  • proto/da/da.proto (3 hunks)
  • proxy/client.go (3 hunks)
  • proxy/server.go (1 hunks)
  • test/dummy.go (2 hunks)
  • test/test_suite.go (4 hunks)
Files skipped from review as they are similar to previous changes (7)
  • README.md
  • da.go
  • proto/da/da.proto
  • proxy/client.go
  • proxy/server.go
  • test/dummy.go
  • test/test_suite.go

@nashqueue nashqueue merged commit 011ba69 into main Feb 1, 2024
12 of 14 checks passed
@nashqueue nashqueue deleted the get-proofs branch February 1, 2024 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants