-
Notifications
You must be signed in to change notification settings - Fork 241
feat: DA Client remove interface part 2, replace types with new code #2910
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
base: add-da-blob-api-client
Are you sure you want to change the base?
Conversation
…sult types and error handling
|
The latest Buf updates on your PR. Results from workflow CI / buf-check (pull_request).
|
|
Claude finished @randygrok's task —— View job Code Review CompleteI've conducted a comprehensive review of the DA client refactoring changes across all 22 modified files. This is a significant architectural improvement that moves from generic interfaces to concrete, type-safe structures. SummaryOverall Assessment: This refactoring is well-executed with solid architecture, comprehensive testing, and good error handling. However, I've identified one critical bug (already flagged by Gemini), several important improvements, and some minor issues that should be addressed before merging. Critical Issues1. Loss of Error Handling in
|
Summary of ChangesHello @randygrok, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request undertakes a significant refactoring of the Data Availability (DA) client architecture. The primary goal is to streamline interactions with the Celestia network by introducing a dedicated Celestia-specific client and replacing abstract DA interface types with concrete, purpose-built structures. This approach enhances type safety and reduces the project's dependency footprint on larger Celestia libraries, while ensuring full compatibility with the Celestia blob RPC. The changes are supported by comprehensive dependency updates and new integration tests to verify the robustness of the new implementation. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request continues the refactoring of the Data Availability (DA) client by moving types, errors, and namespace logic out of the core/da package and into new, more modular packages like pkg/da/types and pkg/namespace. The changes are mostly mechanical, replacing old type references with new ones across several files. The refactoring is well-executed, and new tests have been added for the extracted namespace logic. I found one issue where a change in a function's signature led to the loss of error handling for malformed IDs. I've provided a suggestion to fix this.
| height, _ = blob.SplitID(ids[0]) | ||
| if err != nil { | ||
| c.logger.Error().Err(err).Msg("failed to split ID") | ||
| } |
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.
The blob.SplitID function signature is different from the old coreda.SplitID; it no longer returns an error. Instead, it returns a nil commitment for a malformed ID. The current if err != nil check is using a stale err variable from a previous call, which is guaranteed to be nil at this point. This makes the block dead code and removes the error handling for a malformed ID.
I suggest restoring the check by verifying if the returned commitment is nil and logging an error if so.
if h, com := blob.SplitID(ids[0]); com != nil {
height = h
} else {
c.logger.Error().Msg("failed to split ID: malformed ID")
}…ype safety and consistency
Overview