Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

celestia: pass submit options #31

Closed
wants to merge 1 commit into from
Closed

Conversation

tuxcanfly
Copy link
Collaborator

@tuxcanfly tuxcanfly commented Dec 18, 2023

Overview

This PR updates go-da to v0.0.1 which includes a breaking change in the DA interface.

The Submit method now accepts a second param: SubmitOptions, which can be nil to default to DefaultSubmitOptions as before. SubmitOptions which is non-nil and includes Gas and Fee params will be passed through to the node.

This PR adds SubmitOptions to the Submit method.

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

Depends on:

Summary by CodeRabbit

  • New Features

    • Enhanced the Submit function to accept transaction fee and gas limit options.
  • Refactor

    • Updated test suite setup with a new container image tag and command adjustments.
    • Improved test case configurations to align with the updated Submit function parameters.
  • Bug Fixes

    • Fixed an issue where token strings could have leading or trailing white spaces in tests.

Copy link

coderabbitai bot commented Dec 18, 2023

Walkthrough

The CelestiaDA struct's Submit function now accepts a new parameter for submission options, which influences fee and gas limit settings. The test suite has been updated with a new image tag and a modified command for the container. Additionally, test cases have been adjusted to handle the new Submit function argument, ensuring proper handling of the updated function signature.

Changes

File Path Change Summary
celestia/celestia.go Added daOptions parameter to Submit function; set Fee and GasLimit if daOptions is not nil.
.../celestia_test.go Updated SetupSuite with new image tag and command; adjusted Submit calls in test cases.

🐇✨
In the code, we hop and leap,
With changes vast, not just skin-deep.
A rabbit's touch, now see it soar,
New options set, tests fixed once more. 🚀🌟

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

@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 d8dd2df and 367abf5.
Files ignored due to filter (1)
  • go.mod
Files selected for processing (1)
  • celestia.go (1 hunks)
Additional comments: 2
celestia.go (2)
  • 77-85: The Submit method has been correctly updated to include the options *da.SubmitOptions parameter, which is used to pass fee and gas limit information to the client.Blob.Submit call. Ensure that there is proper validation for the options parameter to handle cases where it might be nil or contain invalid values.

  • 77-77: Ensure that the new options parameter is documented in the method comment, and verify that there are tests covering the new functionality introduced by this parameter.

celestia.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 367abf5 and 6a3cb69.
Files ignored due to filter (2)
  • go.mod
  • go.sum
Files selected for processing (1)
  • celestia.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • celestia.go

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 6a3cb69 and d637042.
Files selected for processing (1)
  • celestia.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • celestia.go

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 d637042 and 52f57e3.
Files selected for processing (1)
  • celestia.go (1 hunks)
Files skipped from review due to trivial changes (1)
  • celestia.go

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 52f57e3 and 406cd2c.
Files ignored due to filter (2)
  • go.mod
  • go.sum
Files selected for processing (1)
  • celestia_test.go (2 hunks)
Additional comments: 3
celestia_test.go (3)
  • 48-51: The image tag has been updated to "76be922". Please ensure that this tag points to a compatible and intended version of the image.

  • 78-78: The command executed within the container has been changed to use the new binary "/bin/celestia-da". Please verify that the new binary is compatible and functions as expected within the test environment.

  • 83-83: Trimming white spaces from the token is a good practice to avoid parsing issues. This change enhances the robustness of the code.

Copy link

codecov bot commented Dec 19, 2023

Codecov Report

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

Comparison is base (5b2fc0b) 71.52% compared to head (33156dd) 69.79%.

Files Patch % Lines
celestia/celestia.go 42.85% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #31      +/-   ##
==========================================
- Coverage   71.52%   69.79%   -1.73%     
==========================================
  Files           2        2              
  Lines         144      149       +5     
==========================================
+ Hits          103      104       +1     
- Misses         28       31       +3     
- Partials       13       14       +1     

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

go.mod 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 84a07bb and 0a0c152.
Files ignored due to filter (2)
  • go.mod
  • go.sum
Files selected for processing (2)
  • celestia.go (1 hunks)
  • celestia_test.go (2 hunks)
Additional comments: 4
celestia_test.go (2)
  • 78-78: The change from "/bin/celestia" to "/bin/celestia-da" is consistent with the PR's objective to update the test suite to reflect changes in the binary naming.

  • 83-83: Trimming white spaces from the t.token assignment is a good practice to ensure that tokens are handled correctly in subsequent use.

celestia.go (2)
  • 77-77: The Submit function has been correctly updated to accept an additional parameter daOptions of type *da.SubmitOptions. This change aligns with the PR objectives to allow customization of the submission process.

  • 82-86: The handling of the daOptions parameter to set the Fee and GasLimit is correctly implemented, allowing users to customize the submission process.

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 f9b3e63 and 8015bee.
Files ignored due to filter (2)
  • go.mod
  • go.sum
Files selected for processing (2)
  • celestia.go (1 hunks)
  • celestia_test.go (2 hunks)
Additional comments: 4
celestia_test.go (2)
  • 78-78: The change in the command executed within the container is consistent with the PR objectives.

  • 83-83: Trimming white spaces from the t.token value is a good practice to ensure clean data handling.

celestia.go (2)
  • 77-90: The addition of the daOptions parameter to the Submit function allows for customizable submission options, aligning with the PR objectives.

  • 82-86: Properly setting blobOptions using the daOptions properties ensures that the submission options are applied as intended.

celestia_test.go Outdated Show resolved Hide resolved
celestia.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 2e6404b and 26afb07.
Files ignored due to filter (2)
  • go.mod
  • go.sum
Files selected for processing (2)
  • celestia.go (1 hunks)
  • celestia_test.go (2 hunks)
Files skipped from review as they are similar to previous changes (2)
  • celestia.go
  • celestia_test.go

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 0f605e9 and 60dc9ed.
Files ignored due to filter (2)
  • go.mod
  • go.sum
Files selected for processing (2)
  • celestia.go (1 hunks)
  • celestia_test.go (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • celestia.go
Additional comments: 3
celestia_test.go (3)
  • 48-48: The image tag "0dd21fb" used in pool.Run should be verified to ensure it corresponds to the correct and intended version of the local-celestia-devnet Docker image.

  • 78-78: The command executed within the container has been updated to "/bin/celestia-da". Ensure this change aligns with the new functionality and the executable name change is intentional and correct.

  • 83-83: Trimming white spaces from t.token is a good practice to avoid issues with token handling in subsequent requests.

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 339de43 and dbb6d7a.
Files ignored due to filter (2)
  • go.mod
  • go.sum
Files selected for processing (2)
  • celestia.go (1 hunks)
  • celestia_test.go (2 hunks)
Files skipped from review as they are similar to previous changes (2)
  • celestia.go
  • celestia_test.go

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 ad7e4cb and 1acad54.
Files ignored due to filter (2)
  • go.mod
  • go.sum
Files selected for processing (3)
  • celestia/celestia.go (1 hunks)
  • celestia/celestia_test.go (2 hunks)
  • celestia_test.go (2 hunks)
Additional comments: 5
celestia_test.go (2)
  • 78-78: The command executed within the container has been changed to /bin/celestia-da bridge auth admin --node.store /home/celestia/bridge. Verify that this command is correct and that the binary celestia-da exists at the specified path in the container.
Verification successful

The Dockerfile in the repository includes a step that copies the celestia-da binary to /bin/celestia-da in the final container image. This suggests that the binary should indeed exist at the specified path within the container, which aligns with the changes made in the celestia_test.go file. However, without the ability to execute Docker commands in the script environment, we cannot directly verify the binary's executability or the container's configuration to run the specified command.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that the binary exists in the container and the command is executable.
# Note: This script assumes that the container is running and accessible.
docker exec $(docker ps -q --filter ancestor=ghcr.io/rollkit/local-celestia-devnet:0dd21fb) ls /bin/celestia-da

Length of output: 261



Script:

#!/bin/bash
# Attempt to find the Dockerfile or build scripts for the container image.
# Since we don't know the exact location or name, we'll search for common patterns.
fd Dockerfile --exec cat {} \;
fd build.sh --exec cat {} \;
fd setup.sh --exec cat {} \;

Length of output: 1488

* 83-83: Trimming leading or trailing white spaces from the buffer content before assigning to `t.token` is a good practice to avoid unexpected issues due to white space.
celestia/celestia_test.go (2)
  • 82-82: The Submit function now correctly passes nil for the new daOptions parameter in the test case Submit_empty. This change is consistent with the updated function signature.

  • 121-121: The Submit function also correctly passes nil for the new daOptions parameter in the test case Submit_existing. This change is consistent with the updated function signature.

celestia/celestia.go (1)
  • 77-87: The Submit function has been updated to accept a new parameter daOptions. The code correctly checks if daOptions is not nil before setting the Fee and GasLimit in blobOptions. This is a good practice to avoid null pointer dereferences.

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 5b2fc0b and 33156dd.
Files ignored due to filter (2)
  • go.mod
  • go.sum
Files selected for processing (3)
  • celestia/celestia.go (1 hunks)
  • celestia/celestia_test.go (2 hunks)
  • celestia_test.go (2 hunks)
Files skipped from review as they are similar to previous changes (3)
  • celestia/celestia.go
  • celestia/celestia_test.go
  • celestia_test.go

height, err := c.client.Blob.Submit(c.ctx, blobs, blob.DefaultSubmitOptions())
blobOptions := blob.DefaultSubmitOptions()
if daOptions != nil {
blobOptions.Fee = daOptions.Fee
Copy link
Member

Choose a reason for hiding this comment

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

🔥

@tuxcanfly
Copy link
Collaborator Author

Will be superseded by #46

@tuxcanfly
Copy link
Collaborator Author

Closing in favor of #46

@tuxcanfly tuxcanfly closed this Jan 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants