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: replace submit options with gas price #31

Merged
merged 3 commits into from
Jan 10, 2024
Merged

da: replace submit options with gas price #31

merged 3 commits into from
Jan 10, 2024

Conversation

tuxcanfly
Copy link
Contributor

@tuxcanfly tuxcanfly commented Jan 9, 2024

Overview

This PR replaces SubmitOptions with a float64 GasPrice. Fixes #30

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

    • Streamlined submission process with a direct gasPrice parameter for submitting data.
  • Refactor

    • Simplified internal handling of gas price during data submission.
  • Bug Fixes

    • Fixed an issue where a nil input could lead to unexpected behavior by ensuring a consistent return type.
  • Tests

    • Adjusted test suite to align with the new submission parameter requirements.

Copy link

coderabbitai bot commented Jan 9, 2024

Warning

Rate Limit Exceeded

@tuxcanfly has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 9 minutes and 10 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between 1bddfc5 and 0707fa9.

Walkthrough

The codebase has undergone a significant change where the SubmitOptions parameter has been replaced with a gasPrice parameter across various files. This alteration simplifies the configuration of gas prices for transactions by allowing users to specify a GasPrice directly, which then determines the GasLimit and Fee based on the transaction's blob size.

Changes

File(s) Change Summary
da.go, proxy/client.go, test/dummy.go Changed Submit method to accept gasPrice instead of SubmitOptions.
proto/da/da.proto Replaced options field with gas_price in SubmitRequest message.
proxy/server.go Removed optionsPB2DA call and replaced request.GetOptions() with request.GasPrice in Submit function.
proxy/util.go Removed optionsDA2PB and optionsPB2DA functions; updated blobsPB2DA to return empty slice on nil input.
test/test_suite.go Replaced nil with 0 for gasPrice in da.Submit calls.

Assessment against linked issues

Objective Addressed Explanation
[#30]: Implement configurable gas price by replacing *SubmitOptions with GasPrice float64. -

Poem

In the realm of code, where data streams glide,
A rabbit hopped forth, with changes applied.
GasPrice now leads, the SubmitOptions part,
A dance of the bytes, with efficiency's art. 🐇💻

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 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (704b67e) 75.51% compared to head (0707fa9) 79.31%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #31      +/-   ##
==========================================
+ Coverage   75.51%   79.31%   +3.80%     
==========================================
  Files           4        3       -1     
  Lines         196      174      -22     
==========================================
- Hits          148      138      -10     
+ Misses         39       28      -11     
+ Partials        9        8       -1     

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

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 704b67e and 5258ae1.
Files ignored due to filter (1)
  • types/pb/da/da.pb.go
Files selected for processing (7)
  • da.go (1 hunks)
  • proto/da/da.proto (1 hunks)
  • proxy/client.go (1 hunks)
  • proxy/server.go (1 hunks)
  • proxy/util.go (1 hunks)
  • test/dummy.go (1 hunks)
  • test/test_suite.go (3 hunks)
Additional comments: 7
proxy/util.go (2)
  • 21-26: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [1-39]

The removal of optionsDA2PB and optionsPB2DA functions aligns with the PR's objective to simplify the gas pricing model. Ensure that there are no remaining references to these functions elsewhere in the codebase.

Verification successful

The executed script did not find any references to the removed functions optionsDA2PB or optionsPB2DA in the Go files of the codebase. This suggests that these functions have been successfully removed without leaving behind any dangling references that could cause compilation errors or runtime issues.

Given this information, it appears that the removal of these functions has been handled correctly in the context of the codebase.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for any remaining references to the removed functions.
rg --type go 'optionsDA2PB|optionsPB2DA'

Length of output: 42

* 21-26: > Note: This review was outside the patches, and no patch overlapping with it was found. Original lines [13-17]

The blobsPB2DA function appears to be unchanged and should correctly handle nil inputs by returning an empty slice. This is consistent with the PR's objectives.

proxy/server.go (1)
  • 60-60: The update to the Submit function in the proxySrv struct to use request.GasPrice directly is in line with the PR's objectives to simplify gas pricing.
proxy/client.go (1)
  • 92-95: The changes to the Submit function in the Client type to accept a gasPrice parameter and the inclusion of the GasPrice field in the SubmitRequest struct align with the PR's objectives.
proto/da/da.proto (1)
  • 87-87: The modification of the SubmitRequest message to include a gas_price field instead of options is consistent with the PR's objectives to simplify the gas pricing model.
test/dummy.go (1)
  • 102-102: The update to the Submit function in the DummyDA type to accept a gasPrice parameter instead of SubmitOptions aligns with the PR's objectives.
test/test_suite.go (1)
  • 43-43: The updates to the test suite to pass 0 as the gasPrice parameter in da.Submit calls are correct and reflect the changes made in the PR.

Also applies to: 48-48, 53-53, 113-113, 165-165

da.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 5258ae1 and 1bddfc5.
Files selected for processing (1)
  • da.go (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • da.go

Manav-Aggarwal
Manav-Aggarwal previously approved these changes Jan 9, 2024
@tuxcanfly tuxcanfly requested a review from S1nus January 10, 2024 00:43
@tuxcanfly tuxcanfly merged commit 755acd2 into main Jan 10, 2024
12 checks passed
@tuxcanfly tuxcanfly deleted the tux/gas-price branch January 10, 2024 01:51
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]: configurable gas price
3 participants