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

da interface: add max blob size method #23

Merged
merged 15 commits into from
Dec 7, 2023
Merged

da interface: add max blob size method #23

merged 15 commits into from
Dec 7, 2023

Conversation

tuxcanfly
Copy link
Contributor

@tuxcanfly tuxcanfly commented Dec 1, 2023

Overview

This PR adds a new method MaxBlobSize to the service, which returns the max blob size.

Fixes #12

Checklist

  • New and updated code has appropriate documentation
  • New and updated code has new and/or updated testing
  • Required CI checks are passing
  • Visual proof for any user facing features like CLI or documentation updates
  • Linked issues closed with keywords

Summary by CodeRabbit

  • New Features

    • Introduced a new initialization process for the server with versioning and configuration details.
    • Added a configuration retrieval feature that allows users to fetch maximum blob size settings.
  • Enhancements

    • Improved server initialization and configuration methods for better performance and reliability.
  • Documentation

    • Updated documentation to reflect new initialization and configuration features.
  • Tests

    • Implemented new tests to cover the initialization and configuration functionalities.

Copy link

coderabbitai bot commented Dec 1, 2023

Walkthrough

The codebase has been updated to include a new MaxBlobSize method across various components, reflecting an enhancement to the DA interface and related structures. This method provides the maximum blob size, which is a critical feature for managing data blobs within the system. The changes span across protobuf service definitions, server and client implementations, and test structures, ensuring consistency and integration of the new functionality throughout the system.

Changes

File Pattern Change Summary
proto/da/da.proto Added MaxBlobSize RPC method with request and response message types.
proxy/client.go, proxy/server.go Added MaxBlobSize method to Client and proxySrv types.
test/dummy.go, da.go Added MaxBlobSize method to DummyDA struct and DA interface.
da_test.go, proxy/proxy_test.go Added constants and modified function calls to include DefaultMaxBytes.

Assessment against linked issues

Objective Addressed Explanation
Add MaxBlobSize to the DA interface (#12) The MaxBlobSize method has been added to the DA interface, as seen in the changes to da.go.
Ensure the sum of blobs is smaller than MaxBlobSize (#12) The code changes do not explicitly show logic enforcing the sum of blobs to be smaller than MaxBlobSize, but the addition of the method allows for such checks to be implemented.

Poem

In the code where data blobs reside,
A rabbit hopped through, with a stride.
"MaxBlobSize is here!" it cheered with glee,
"Now manage your blobs, as easy as can be!" 🐰💻✨


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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.

Note: For conversation with the bot, please use the review comments on code diffs or files.

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

Copy link

codecov bot commented Dec 1, 2023

Codecov Report

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

Comparison is base (ee3b613) 84.04% compared to head (68ea42e) 79.19%.

❗ Current head 68ea42e differs from pull request most recent head 93600f2. Consider uploading reports for the commit 93600f2 to get more accurate results

Files Patch % Lines
proxy/client.go 0.00% 7 Missing ⚠️
proxy/server.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #23      +/-   ##
==========================================
- Coverage   84.04%   79.19%   -4.86%     
==========================================
  Files           3        3              
  Lines         163      173      +10     
==========================================
  Hits          137      137              
- Misses         18       28      +10     
  Partials        8        8              

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

@tuxcanfly tuxcanfly marked this pull request as ready for review December 4, 2023 19:54
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: 2

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between ee3b613 and 0d56ccc.
Files ignored due to filter (1)
  • types/pb/da/da.pb.go
Files selected for processing (2)
  • proto/da/da.proto (3 hunks)
  • proxy/server.go (1 hunks)
Additional comments: 4
proto/da/da.proto (3)
  • 5-7: The addition of the Init RPC method to the DAService service definition aligns with the PR objectives to establish initial communication between clients and the service.

  • 45-53: The new message types InitRequest and InitResponse have been correctly defined, with InitResponse including the necessary fields version, name, and max_blob_size as per the PR objectives.

  • 42-58: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [3-106]

The rest of the protobuf file appears to be unchanged, which is consistent with the PR objectives that only specified the addition of the Init method and related message types.

proxy/server.go (1)
  • 31-33: The Get method and other methods in the proxySrv type are not directly related to the Init method changes. Ensure that the existing functionality of these methods remains unaffected by the new Init method.

proxy/server.go Outdated Show resolved Hide resolved
@tuxcanfly tuxcanfly requested a review from tzdybal December 4, 2023 19:57
@tuxcanfly tuxcanfly changed the title da interface: add Init method da interface: add Config method Dec 4, 2023
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 0d56ccc and 4d2b7ed.
Files ignored due to filter (1)
  • types/pb/da/da.pb.go
Files selected for processing (2)
  • proto/da/da.proto (3 hunks)
  • proxy/server.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • proxy/server.go
Additional comments: 3
proto/da/da.proto (3)
  • 4-7: The PR objective mentions the addition of an Init method, but the code and the summary indicate the addition of a Config method. This discrepancy needs to be resolved to ensure the code aligns with the intended feature described in the PR objective.

  • 45-52: The addition of ConfigRequest and ConfigResponse message types aligns with the summary and the changes in the hunk.

  • 50-51: The inclusion of the max_blob_size field in the ConfigResponse message is consistent with the PR objective to address the need for a MaxBlobSize parameter.

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: 3

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 4d2b7ed and cdabafc.
Files ignored due to filter (1)
  • types/pb/da/da.pb.go
Files selected for processing (4)
  • da.go (1 hunks)
  • proto/da/da.proto (3 hunks)
  • proxy/client.go (1 hunks)
  • test/dummy.go (1 hunks)
Additional comments: 3
da.go (1)
  • 3-6: The addition of the Config method to the DA interface is consistent with the PR objectives and the summary provided. Ensure that all implementations of the DA interface are updated to include this new method.
proto/da/da.proto (1)
  • 101-104: This change appears to be unrelated to the PR's objective of adding a Config method. Ensure that the addition of the ValidateResponse message type is intentional and relevant to the PR.
test/dummy.go (1)
  • 43-45: The addition of the Config method to the DummyDA struct is consistent with the PR objectives and the summary provided. It correctly implements a hardcoded maximum blob size return value, which is suitable for a dummy/testing implementation.

proto/da/da.proto Outdated Show resolved Hide resolved
proxy/client.go Outdated Show resolved Hide resolved
proxy/client.go Outdated Show resolved Hide resolved
@tuxcanfly tuxcanfly mentioned this pull request Dec 5, 2023
5 tasks
Copy link
Member

@nashqueue nashqueue left a comment

Choose a reason for hiding this comment

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

Thanks! Should we add a test to the testing suite for the max blob size?

da.go Outdated Show resolved Hide resolved
proxy/server.go Outdated Show resolved Hide resolved
proxy/server.go Outdated Show resolved Hide resolved
test/dummy.go Outdated Show resolved Hide resolved
tzdybal
tzdybal previously requested changes Dec 6, 2023
Copy link
Member

@tzdybal tzdybal left a comment

Choose a reason for hiding this comment

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

Left comments.

da.go Outdated Show resolved Hide resolved
test/dummy.go Outdated Show resolved Hide resolved
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: 2

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between dc5355a and 3faffb3.
Files ignored due to filter (1)
  • types/pb/da/da.pb.go
Files selected for processing (7)
  • da.go (1 hunks)
  • da_test.go (1 hunks)
  • proto/da/da.proto (3 hunks)
  • proxy/client.go (1 hunks)
  • proxy/proxy_test.go (1 hunks)
  • proxy/server.go (1 hunks)
  • test/dummy.go (1 hunks)
Additional comments: 12
da.go (1)
  • 4-10: The addition of the MaxBlobSize method to the DA interface aligns with the PR objectives and the summary provided. This change will require all implementations of the DA interface to include this new method.
da_test.go (1)
  • 9-41: The constants and the TestDummyDA function have been updated correctly to reflect the new DefaultMaxBytes parameter and related constants. These changes are consistent with the PR objectives and the AI-generated summaries.
proto/da/da.proto (3)
  • 5-7: The summary incorrectly refers to the RPC method as MaxBlobSize, but the code indicates that no such method has been added. The PR objectives mention the addition of a Config method, which is not present in the provided hunks. This discrepancy needs to be addressed.

  • 45-51: The message types MaxBlobSizeRequest and MaxBlobSizeResponse are correctly defined and consistent with the summary. However, the corresponding RPC method is not present in the service definition.

  • 101-103: The addition of the ValidateResponse message type is consistent with the expected changes and aligns with the protobuf service definition's requirements.

proxy/proxy_test.go (2)
  • 16-41: Constants related to namespace and share sizes have been added correctly and are well-documented.

  • 44-48: The TestProxy function correctly initializes dummy with the new DefaultMaxBytes parameter.

proxy/server.go (2)
  • 27-29: The implementation of the MaxBlobSize method appears correct and aligns with the PR objectives to provide the maximum blob size configuration.

  • 24-34: The summary mentions an Init method that is not present in the provided hunk. If this method is part of the changes, please ensure it is implemented and correctly initializes the proxy server with version information, server name, and maximum blob size.

test/dummy.go (3)
  • 17-25: The addition of the maxBlobSize field to the DummyDA struct and the corresponding MaxBlobSize method aligns with the PR objectives to manage blob size configurations.

  • 32-40: The update to the NewDummyDA function to accept a maxBlobSize parameter is consistent with the PR's goal of adding blob size configuration.

  • 45-47: The implementation of the MaxBlobSize method is correct and serves the purpose of returning the maximum blob size as intended by the PR.

test/dummy.go Outdated Show resolved Hide resolved
proxy/client.go Show resolved Hide resolved
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 3faffb3 and 68ea42e.
Files selected for processing (1)
  • test/dummy.go (1 hunks)
Additional comments: 4
test/dummy.go (4)
  • 61-66: The summary states that NewDummyDA function has been updated to accept a maxBlobSize parameter, but the actual implementation uses a variadic opts function to configure the DummyDA instance. This allows for more flexible configuration but differs from the summary description.

  • 77-79: The implementation of the MaxBlobSize method is correct and aligns with the PR objectives to provide access to the maximum blob size configuration.

  • 15-41: The constants added to the file are not mentioned in the summary. If these constants are part of the new feature implementation, the summary should be updated to include them.

  • 48-66: The DummyDA struct has been updated with a maxBlobSize field, and the NewDummyDA function initializes this field with DefaultMaxBytes if no options are provided. This aligns with the PR objectives to manage the maximum blob size.

@tuxcanfly
Copy link
Contributor Author

The MaxBlobSize should be fully configurable by the implementation because even though the nodes might accept a higher max blob size, the practical limit might depend on various factors including block time etc.

Realised this after trying to submit a max blob to local-celestia-devnet but the tx timed out with: rpc error: code = Unknown desc = timed out waiting for tx to be included in a block.

@tuxcanfly tuxcanfly changed the title da interface: add Config method da interface: add max blob size method Dec 6, 2023
test/dummy.go Outdated Show resolved Hide resolved
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 68ea42e and eb3bc4b.
Files selected for processing (1)
  • test/dummy.go (1 hunks)
Additional comments: 2
test/dummy.go (2)
  • 22-27: The summary indicates that the height field was replaced with maxBlobSize, but the code shows that both fields are present in the DummyDA struct. This is an inconsistency between the summary and the actual code changes.

  • 17-53: Ensure that the documentation is updated to reflect the new maxBlobSize field in the DummyDA struct and the addition of the MaxBlobSize 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 eb3bc4b and 93600f2.
Files selected for processing (1)
  • test/dummy.go (1 hunks)
Additional comments: 2
test/dummy.go (2)
  • 22-28: The summary incorrectly states that the height field was replaced with maxBlobSize. Both fields are present in the final code, which is correct as per the PR objectives.

  • 35-46: The summary states that the NewDummyDA constructor requires a maxBlobSize parameter, but the constructor sets maxBlobSize to a default value instead. The constructor is correctly implemented to allow optional customization via variadic options.

@MSevey MSevey requested a review from gupadhyaya December 7, 2023 15:24
@MSevey MSevey dismissed tzdybal’s stale review December 7, 2023 15:25

To merge of course

@MSevey MSevey merged commit ad9f599 into main Dec 7, 2023
10 checks passed
@MSevey MSevey deleted the tux/max-blob-size branch December 7, 2023 15:25
github-merge-queue bot pushed a commit to rollkit/rollkit that referenced this pull request Dec 7, 2023
<!--
Please read and fill out this form before submitting your PR.

Please make sure you have reviewed our contributors guide before
submitting your
first PR.
-->

## Overview

Fixes #1233

<!--
Please provide an explanation of the PR, including the appropriate
context,
background, goal, and rationale. If there is an issue with this
information,
please provide a tl;dr and link the issue.
-->

## Checklist

<!--
Please complete the checklist to ensure that the PR is ready to be
reviewed.

IMPORTANT:
PRs should be left in Draft until the below checklist is completed.
-->

- [x] New and updated code has appropriate documentation
- [x] New and updated code has new and/or updated testing
- [x] Required CI checks are passing
- [x] Visual proof for any user facing features like CLI or
documentation updates
- [x] Linked issues closed with keywords

Depends on rollkit/go-da#23

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Improved block submission process with retries and exponential backoff
for increased reliability.
- Added error handling for block size limitations and existence issues
during submission.

- **Enhancements**
- Block submission now includes a count of successfully submitted blocks
for better tracking.
- Partial reset functionality added to the management of pending blocks
based on submission status.

- **Bug Fixes**
- Fixed an issue where block submission could fail silently by ensuring
all pending blocks are confirmed as submitted before completion.

- **Documentation**
- Updated function documentation to reflect new error handling and
submission count features.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Feature Request]: Add MaxBlobSize to the Da-Interface
6 participants