Skip to content

Conversation

@jcstein
Copy link
Member

@jcstein jcstein commented Aug 27, 2024

Overview

This adds DAKeyringKeyname flag, opinionated to use default my_celes_key (which may need changes), to match MultiAccounts on celestia-node which were released in v0.15.0. https://github.com/celestiaorg/celestia-node/releases/tag/v0.15.0 celestiaorg/celestia-node#3349

Partially resolves #1821
Pairs with evstack/go-da#89

TODO

  • change to keyName KeyName

Summary by CodeRabbit

  • New Features

    • Introduced a new command-line flag --rollkit.da_keyname for specifying a keyring keyname during blob submissions.
    • Enhanced the rollkit start command documentation to include the new flag for improved usability.
  • Bug Fixes

    • Updated test suite to verify that the DAKeyName configuration parameter is correctly set, improving test coverage.
  • Documentation

    • Added details regarding the new --rollkit.da_keyname option in the Rollkit configuration documentation.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 27, 2024

Walkthrough

The changes introduce a new command-line flag --rollkit.da_keyname, enhancing the Rollkit configuration for specifying a keyring keyname used in blob transactions. This addition is reflected in various components, including tests, documentation, and configuration files, ensuring that the new parameter is accessible and properly integrated into the application.

Changes

Files Change Summary
cmd/rollkit/commands/run_node_test.go, cmd/rollkit/docs/rollkit_start.md Added support for the --rollkit.da_keyname flag for specifying a keyring keyname in tests and documentation.
config/config.go Introduced a new constant and field in NodeConfig for DAKeyName, updated configuration retrieval, and added command-line flag support.
da/da.md Documented the new --rollkit.da_keyname option for specifying the keyring keyname with a default value.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI
    participant Config
    participant Node

    User->>CLI: Run command with --rollkit.da_keyname
    CLI->>Config: Parse command-line flags
    Config->>Node: Set DAKeyName
    Node-->>User: Execute blob transaction with specified keyname
Loading

Assessment against linked issues

Objective Addressed Explanation
Add DAKeyringKeyname flag to rollkit (#[1821])
Update go-da to support this change (#[1821]) Changes do not directly indicate updates to go-da.

🐇 "In fields of green, I hop with glee,
A keyname added, oh what a spree!
With blobs to send and flags to play,
Rollkit's magic brightens the day!
So let’s all cheer, for changes are here,
A hop, a skip, let’s spread the cheer!" 🌼


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 testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • 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 testing code 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 and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@RollkitBot RollkitBot requested review from a team, Manav-Aggarwal, gupadhyaya and yarikbratashchuk and removed request for a team August 27, 2024 19:53
@codecov
Copy link

codecov bot commented Aug 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 43.80%. Comparing base (5ccf5b3) to head (de95895).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1820      +/-   ##
==========================================
- Coverage   43.83%   43.80%   -0.03%     
==========================================
  Files          76       76              
  Lines       10028    10030       +2     
==========================================
- Hits         4396     4394       -2     
- Misses       4897     4901       +4     
  Partials      735      735              

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

"--rollkit.da_mempool_ttl", "10",
"--rollkit.da_namespace", "namespace",
"--rollkit.da_start_height", "100",
"--rollkit.da_keyring_keyname", "my_celes_key",
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
"--rollkit.da_keyring_keyname", "my_celes_key",
"--rollkit.da_keyring_keyname", null,

I'm starting to think that it would be good to leave the default value null so that it only is used when someone intentionally sets the keyname. otherwise, it may accidentally redirect from key_node_is_running_with to my_celes_key default, instead of just sending requests to key_node_is_running_with. this flag is only going to be useful for those using multiaccounts on one light node / da service

da/da.md Outdated
* `--rollkit.da_address`: url address of the DA service (default: "grpc://localhost:26650")
* `--rollkit.da_auth_token`: authentication token of the DA service
* `--rollkit.da_namespace`: namespace to use when submitting blobs to the DA service
* `--rollkit.da_keyring_keyname`: keyring.keyname used when submitting blobs to the DA service (default: my_celes_key)
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
* `--rollkit.da_keyring_keyname`: keyring.keyname used when submitting blobs to the DA service (default: my_celes_key)
* `--rollkit.da_keyring_keyname`: keyring.keyname used when submitting blobs to the DA service (default: null)

{"DAMempoolTTL", nodeConfig.DAMempoolTTL, uint64(10)},
{"DANamespace", nodeConfig.DANamespace, "namespace"},
{"DAStartHeight", nodeConfig.DAStartHeight, uint64(100)},
{"DAKeyringKeyname", nodeConfig.DAKeyringKeyname, "my_celes_key"},
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
{"DAKeyringKeyname", nodeConfig.DAKeyringKeyname, "my_celes_key"},
{"DAKeyringKeyname", nodeConfig.DAKeyringKeyname, null},

@jcstein jcstein changed the title feat: add DAKeyringKeyname flag feat: add DAKeyName flag Aug 29, 2024
Copy link
Contributor

@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.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5ccf5b3 and 14901de.

Files selected for processing (4)
  • cmd/rollkit/commands/run_node_test.go (2 hunks)
  • cmd/rollkit/docs/rollkit_start.md (1 hunks)
  • config/config.go (4 hunks)
  • da/da.md (1 hunks)
Additional context used
golangci-lint
config/config.go

66-66: File is not goimports-ed with -local github.com/rollkit

(goimports)

Additional comments not posted (8)
da/da.md (1)

12-12: LGTM!

The addition of the new command-line option --rollkit.da_keyname is clear and aligns with the PR objectives.

cmd/rollkit/commands/run_node_test.go (2)

36-36: LGTM!

The addition of the new flag --rollkit.da_keyname to the list of flags in the TestParseFlags function is clear and aligns with the PR objectives.


88-88: LGTM!

The addition of the new test case for DAKeyName to the list of test cases in the TestParseFlags function is clear and aligns with the PR objectives.

cmd/rollkit/docs/rollkit_start.md (1)

39-39: LGTM!

The addition of the new command-line option --rollkit.da_keyname to the list of options for the rollkit start command is clear and aligns with the PR objectives.

config/config.go (4)

31-32: LGTM!

The addition of the FlagDAKeyName constant follows the existing pattern for defining flags.


66-67: LGTM!

The addition of the DAKeyName field in the NodeConfig struct follows the existing pattern for defining configuration fields.

Tools
golangci-lint

66-66: File is not goimports-ed with -local github.com/rollkit

(goimports)


134-134: LGTM!

The update in the GetViperConfig method to retrieve the value for DAKeyName follows the existing pattern for retrieving configuration values.


160-160: LGTM!

The addition of the new command-line flag for DAKeyName in the AddFlags function follows the existing pattern for adding flags.

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.

I have similar concerns as in evstack/go-da#89

Moreover, the option is added, but is never used actually passed anywhere (as go-da dep is not updated).

{"DAMempoolTTL", nodeConfig.DAMempoolTTL, uint64(10)},
{"DANamespace", nodeConfig.DANamespace, "namespace"},
{"DAStartHeight", nodeConfig.DAStartHeight, uint64(100)},
{"DAKeyName", nodeConfig.DAKeyName, "my_celes_key"},
Copy link
Member

Choose a reason for hiding this comment

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

Where credible neutrality? 😭

IMHO empty default (aka. user has to provide someting, or da implementation can provide da-specific default) is a better solution.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed! I commented this but I think since I changed it to KeyName it has dissapeared 😶‍🌫️

Should I use null here?

@tzdybal
Copy link
Member

tzdybal commented Sep 13, 2024

This will be replaced by more generic approach (ref: evstack/go-da#92)

@tzdybal tzdybal closed this Sep 13, 2024
@jcstein jcstein deleted the jcs/addKeyringKeyname branch September 16, 2024 09:37
@jcstein
Copy link
Member Author

jcstein commented Sep 16, 2024

sounds good! i had to try at least :)

@tac0turtle tac0turtle removed this from Evolve Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: add support for MultiAccounts on celestia-node

2 participants