-
Notifications
You must be signed in to change notification settings - Fork 23
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: add SubmitWithOptions method to the API #95
Conversation
WalkthroughThe pull request introduces a new method, Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant DA
participant gRPC
participant JSONRPC
Client->>DA: SubmitWithOptions(blobs, gasPrice, namespace, options)
DA->>gRPC: Send SubmitRequest(blobs, gasPrice, namespace, options)
gRPC-->>DA: Response with IDs
DA-->>Client: Return IDs
Assessment against linked issues
Poem
Tip OpenAI O1 model for chat
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Outside diff range, codebase verification and nitpick comments (2)
da.go (1)
31-35
: Approve the addition ofSubmitWithOptions
method.The method
SubmitWithOptions
has been correctly added to theDA
interface, aligning with the PR objectives to enhance flexibility for multi-account support. The method signature is consistent and clear.However, consider using a more structured type than
[]byte
foroptions
to improve type safety and clarity on what the options can include, such as using a struct or predefined constants.proxy/jsonrpc/client.go (1)
69-72
: Approve the addition ofSubmitWithOptions
.The implementation of
SubmitWithOptions
in theAPI
struct is straightforward and aligns with the PR's objectives to enhance flexibility. Consider adding more detailed documentation or examples in the code comments to illustrate how clients can utilize this new method effectively.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
types/pb/da/da.pb.go
is excluded by!**/*.pb.go
Files selected for processing (6)
- da.go (1 hunks)
- proto/da/da.proto (1 hunks)
- proxy/grpc/client.go (1 hunks)
- proxy/jsonrpc/client.go (2 hunks)
- test/dummy.go (1 hunks)
- test/test_suite.go (1 hunks)
Additional context used
golangci-lint
test/dummy.go
[warning] 135-135: exported: exported method DummyDA.SubmitWithOptions should have comment or be unexported
(revive)
GitHub Check: lint / golangci-lint
test/dummy.go
[failure] 135-135:
exported: exported method DummyDA.SubmitWithOptions should have comment or be unexported (revive)
Additional comments not posted (1)
proto/da/da.proto (1)
111-111
: Approve the addition ofoptions
field with a note on compatibility.The addition of the
options
field to theSubmitRequest
message is a good enhancement, aligning with the PR objectives to allow for more flexible submissions.However, please verify the use of
optional
inproto3
, as it requires field presence to be enabled in the protobuf version used. If not supported, consider using a default value or a wrapper type.
This commit introduces a new method `SubmitWithOptions` for submitting blobs with additional options.
c718596
to
4521f9a
Compare
There was a problem hiding this 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 (1)
proxy/grpc/server.go (1)
72-72
: Update the method documentation.Consider adding a TODO comment to update the
Submit
method documentation to reflect the new behavior and the additionaloptions
parameter.+// TODO: Update the method documentation to reflect the new behavior and the additional `options` parameter. func (p *proxySrv) Submit(ctx context.Context, request *pbda.SubmitRequest) (*pbda.SubmitResponse, error) {
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
types/pb/da/da.pb.go
is excluded by!**/*.pb.go
Files selected for processing (7)
- da.go (1 hunks)
- proto/da/da.proto (1 hunks)
- proxy/grpc/client.go (1 hunks)
- proxy/grpc/server.go (1 hunks)
- proxy/jsonrpc/client.go (2 hunks)
- test/dummy.go (1 hunks)
- test/test_suite.go (1 hunks)
Files skipped from review as they are similar to previous changes (5)
- da.go
- proxy/grpc/client.go
- proxy/jsonrpc/client.go
- test/dummy.go
- test/test_suite.go
Additional comments not posted (2)
proxy/grpc/server.go (1)
72-72
: Verify the implementation of theSubmitWithOptions
method.The change to call the
SubmitWithOptions
method aligns with the PR objective of supporting multi-account scenarios. However, it's important to verify the implementation and behavior of this new method.Run the following script to verify the
SubmitWithOptions
method:Verification successful
The
SubmitWithOptions
method is correctly implemented and used.The verification process confirms that the
SubmitWithOptions
method is properly defined in theda
package interface and consistently implemented across the codebase. The change inproxy/grpc/server.go
correctly calls this method with all required parameters, including the newrequest.Options
. The method is also being used in test files, which helps ensure its correct behavior.While the
DummyDA
implementation ignores theoptions
parameter, this is acceptable for a test implementation. However, it's worth noting that real implementations should make proper use of this parameter to support multi-account scenarios as intended.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the implementation of the `SubmitWithOptions` method. # Test: Search for the method declaration. Expect: The method should be defined in the `da` package. rg --type go $'func \(d \*[a-zA-Z]+\) SubmitWithOptions\(' # Test: Search for the method usage. Expect: The method should be called with the correct parameters. rg --type go -A 5 $'SubmitWithOptions\('Length of output: 2686
proto/da/da.proto (1)
111-111
: LGTM!The addition of the
bytes options
field to theSubmitRequest
message aligns with the PR objective of introducing a new method calledSubmitWithOptions
to enable users to pass additional options, including key names. Thebytes
type is a generic type that can be used to pass various options, which is one of the potential solutions outlined in the linked issue. The field nameoptions
clearly conveys its purpose of carrying optional data, and the field number4
follows the existing field numbering sequence in the message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks alright to me
Overview
Resolves #93
Summary by CodeRabbit
New Features
SubmitWithOptions
, allowing users to submit blobs with additional options.SubmitRequest
message to include an optional field for extra configuration data.Bug Fixes
Submit
method to accommodate the new options parameter, improving its functionality.