Skip to content

Conversation

jeandemeusy
Copy link
Contributor

Aligns the config file examples with the code, by adding/renaming/removing parameters.

@jeandemeusy jeandemeusy self-assigned this Jan 16, 2025
Copy link
Contributor

coderabbitai bot commented Jan 16, 2025

📝 Walkthrough

Walkthrough

The pull request modifies configuration files across multiple components of the HOPR protocol, focusing on changes to ticket redemption and aggregation strategies. Key modifications include renaming the on_close_redeem_single_tickets_value_min parameter to minimum_redeem_ticket_value, removing the aggregation_timeout parameter, and introducing a new redeem_all_on_close option for ticket redemption. These changes standardize and simplify the configuration approach for ticket management without altering existing values or types.

Changes

File Changes
deploy/compose/hoprd_data/hoprd.cfg.yaml Renamed strategy parameter from on_close_redeem_single_tickets_value_min to minimum_redeem_ticket_value
hoprd/hoprd/example_cfg.yaml - Removed aggregation_timeout from !Aggregating strategy
- Added redeem_all_on_close to !AutoRedeeming strategy
- Added minimum_redeem_ticket_value to !AutoRedeeming strategy
sdk/default.cfg.yaml - Removed aggregation_timeout configuration
- Removed on_close_redeem_single_tickets_value_min configuration
README.md Minor text corrections and formatting adjustments

Possibly related PRs

  • Guidelines on how to start a node on rotsee #6679: The changes in hoprd.cfg.yaml regarding the minimum_redeem_ticket_value parameter are directly related to the modifications made in the same file in the main PR, as both involve updates to ticket redemption parameters.

Suggested labels

crate:hopli, status:in-progress

Suggested reviewers

  • ausias-armesto

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5f043a4 and 2ccb9b2.

📒 Files selected for processing (1)
  • deploy/compose/hoprd_data/hoprd.cfg.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • deploy/compose/hoprd_data/hoprd.cfg.yaml
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: hoprd / docker
  • GitHub Check: hopli / docker
  • GitHub Check: Docs / Rust docs
  • GitHub Check: tests-unit
  • GitHub Check: tests-smart-contracts
  • GitHub Check: tests-unit-nightly
  • GitHub Check: Linter

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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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.

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.

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

🧹 Nitpick comments (2)
sdk/default.cfg.yaml (1)

24-24: Add newline at end of file.

The file is missing a newline character at the end, which is a POSIX requirement.

 minimum_redeem_ticket_value: "0 HOPR"
+
🧰 Tools
🪛 yamllint (1.35.1)

[error] 24-24: no new line character at the end of file

(new-line-at-end-of-file)

hoprd/hoprd/example_cfg.yaml (1)

107-110: LGTM! New parameters enhance ticket redemption control.

The addition of redeem_all_on_close and minimum_redeem_ticket_value parameters provides better control over the ticket redemption process.

Add descriptive comments for new parameters.

Consider adding detailed comments for the new parameters to maintain consistency with the documentation style of other parameters in this example configuration file.

-        # If set, all tickets will be redeemed on channel closure.
+        # If set to true, all tickets (including non-aggregated ones) will be redeemed when
+        # a channel transitions to the PendingToClose state. This can lead to higher gas costs
+        # if there are many small-value tickets.
         redeem_all_on_close: true
-        # Sets the minimum value of a ticket to be able to redeem it.
+        # Specifies the minimum value that a ticket must have to be eligible for redemption.
+        # This helps prevent redemption of very small tickets that might cost more in gas
+        # than the ticket value itself. Format: "<amount> HOPR"
         minimum_redeem_ticket_value: "0 HOPR"
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c9bb870 and bbc10f1.

📒 Files selected for processing (3)
  • deploy/compose/hoprd_data/hoprd.cfg.yaml (1 hunks)
  • hoprd/hoprd/example_cfg.yaml (1 hunks)
  • sdk/default.cfg.yaml (1 hunks)
🧰 Additional context used
🪛 yamllint (1.35.1)
sdk/default.cfg.yaml

[error] 24-24: no new line character at the end of file

(new-line-at-end-of-file)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: hoprd / docker
  • GitHub Check: hopli / docker
  • GitHub Check: Docs / Rust docs
🔇 Additional comments (2)
sdk/default.cfg.yaml (1)

24-24: LGTM! Default value for minimum_redeem_ticket_value is appropriate.

Setting minimum_redeem_ticket_value: "0 HOPR" as the default allows redeeming tickets of any value, which is a sensible default configuration.

🧰 Tools
🪛 yamllint (1.35.1)

[error] 24-24: no new line character at the end of file

(new-line-at-end-of-file)

deploy/compose/hoprd_data/hoprd.cfg.yaml (1)

18-18: LGTM! Production-appropriate minimum redemption value.

Setting minimum_redeem_ticket_value: "2000000000000000000 HOPR" is appropriate for production deployment as it prevents micro-redemptions that could lead to higher gas costs.

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: 1

🧹 Nitpick comments (1)
hoprd/hoprd/example_cfg.yaml (1)

107-110: Add documentation comments for the new parameters.

The new parameters are well-placed and follow consistent naming patterns. However, they would benefit from documentation comments like other parameters in the file.

Add documentation comments:

        redeem_only_aggregated: true
+       # If set, the strategy will attempt to redeem all tickets when a channel is being closed,
+       # regardless of their aggregation status.
        redeem_all_on_close: true
+       # Minimum value that a ticket must have to be considered for redemption.
+       # Set to "0 HOPR" to allow redemption of all tickets.
        minimum_redeem_ticket_value: "0 HOPR"
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 69e8e69 and 1961641.

📒 Files selected for processing (1)
  • hoprd/hoprd/example_cfg.yaml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Docs / Rust docs
  • GitHub Check: tests-unit
  • GitHub Check: tests-unit-nightly
  • GitHub Check: tests-smart-contracts
  • GitHub Check: tests-smoke-websocket
  • GitHub Check: Linter

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

🧹 Nitpick comments (1)
hoprd/hoprd/example_cfg.yaml (1)

109-110: Consider documenting the minimum ticket value threshold

The minimum_redeem_ticket_value is set to "90000000000000000 HOPR" (0.09 HOPR). Consider adding a comment explaining:

  1. The rationale behind this specific threshold
  2. The implications of setting it too high or too low
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1961641 and 30fab9f.

📒 Files selected for processing (1)
  • hoprd/hoprd/example_cfg.yaml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: hoprd / docker
  • GitHub Check: hopli / docker
  • GitHub Check: tests-smoke-websocket
  • GitHub Check: tests-unit-nightly
  • GitHub Check: Linter
  • GitHub Check: tests-unit
🔇 Additional comments (2)
hoprd/hoprd/example_cfg.yaml (2)

107-110: Configuration inconsistencies detected across files

The values and parameters in the !AutoRedeeming strategy differ across configuration files:

  • minimum_redeem_ticket_value varies significantly across files
  • redeem_all_on_close parameter exists here but other files use redeem_only_aggregated

Let's verify the configuration consistency:

#!/bin/bash
# Description: Check for consistency of the new parameters across config files
# Expected: Same default values in other config files

echo "Searching for config files containing the parameters..."
rg --type yaml --hidden -l "redeem_all_on_close|minimum_redeem_ticket_value"

echo -e "\nShowing parameter values across files..."
rg --type yaml --hidden -B1 -A1 "redeem_all_on_close|minimum_redeem_ticket_value"

107-108: Document the relationship between redeem_all_on_close and redeem_only_aggregated

The configuration has both redeem_all_on_close: true and redeem_only_aggregated: true, which seems contradictory. Please clarify:

  1. The precedence between these parameters
  2. The behavior when both are set to true

@Teebor-Choka Teebor-Choka merged commit bf58be5 into release/singapore Jan 22, 2025
27 of 28 checks passed
@Teebor-Choka Teebor-Choka deleted the jean/improve-examples-coherency branch January 22, 2025 12:01
tolbrino pushed a commit that referenced this pull request Apr 4, 2025
Co-authored-by: Lukas <lukas.pohanka@inina.net>
Co-authored-by: Tibor <9529609+Teebor-Choka@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants