Skip to content

Conversation

NumberFour8
Copy link
Contributor

This PR adds the network.quality_auto_path_threshold (defaults to 0.95) to allow the auto-path finding algorithm to ignore nodes, which have lower quality than this threshold.

This PR adds the `network.quality_auto_path_threshold` (defaults to 0.95) to allow the auto-path finding algorithm to ignore nodes, which have lower quality than this threshold.
@NumberFour8 NumberFour8 added this to the 2.2.1 milestone Jan 28, 2025
@NumberFour8 NumberFour8 requested a review from a team January 28, 2025 09:18
@NumberFour8 NumberFour8 self-assigned this Jan 28, 2025
@NumberFour8 NumberFour8 marked this pull request as ready for review January 28, 2025 09:18
Copy link
Contributor

coderabbitai bot commented Jan 28, 2025

Warning

Rate limit exceeded

@NumberFour8 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 24 minutes and 28 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

Reviewing files that changed from the base of the PR and between 010c635 and 468dd84.

📒 Files selected for processing (1)
  • transport/network/src/config.rs (4 hunks)
📝 Walkthrough

Walkthrough

The pull request introduces a modification in the transport layer, specifically changing the quality threshold configuration for path selection. In the HoprTransport struct's initialization, the threshold parameter is updated from quality_bad_threshold to quality_auto_path_threshold. Simultaneously, a new constant DEFAULT_AUTO_PATH_QUALITY_THRESHOLD is added to the NetworkConfig with a value of 0.95, along with a corresponding struct field and a default value function.

Changes

File Change Summary
transport/api/src/lib.rs Updated path selector configuration to use cfg.network.quality_auto_path_threshold
transport/network/src/config.rs - Added constant DEFAULT_AUTO_PATH_QUALITY_THRESHOLD (0.95)
- Added field quality_auto_path_threshold to NetworkConfig
- Added inline function quality_auto_path_threshold() to provide default value

Possibly related PRs

Suggested reviewers

  • tolbrino

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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3829cb5 and 010c635.

📒 Files selected for processing (2)
  • transport/api/src/lib.rs (1 hunks)
  • transport/network/src/config.rs (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: hoprd / docker
  • GitHub Check: hopli / docker
  • GitHub Check: Docs / Rust docs
  • GitHub Check: tests-smoke-websocket
  • GitHub Check: tests-smart-contracts
  • GitHub Check: tests-unit-nightly
  • GitHub Check: Linter
  • GitHub Check: tests-unit
🔇 Additional comments (3)
transport/network/src/config.rs (2)

17-17: LGTM! The default threshold value is appropriate.

The default value of 0.95 for DEFAULT_AUTO_PATH_QUALITY_THRESHOLD is a reasonable choice as it ensures high-quality paths are selected.


159-162: LGTM! The helper function follows the established pattern.

The implementation of quality_auto_path_threshold() is consistent with other similar functions in the file.

transport/api/src/lib.rs (1)

253-255: LGTM! The configuration usage is appropriate.

The change correctly uses the new quality_auto_path_threshold for path selection instead of quality_bad_threshold. This is a better choice as auto-path finding should prioritize high-quality paths.

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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3829cb5 and 010c635.

📒 Files selected for processing (2)
  • transport/api/src/lib.rs (1 hunks)
  • transport/network/src/config.rs (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: hoprd / docker
  • GitHub Check: hopli / docker
  • GitHub Check: Docs / Rust docs
  • GitHub Check: tests-smoke-websocket
  • GitHub Check: tests-smart-contracts
  • GitHub Check: tests-unit-nightly
  • GitHub Check: Linter
  • GitHub Check: tests-unit
🔇 Additional comments (2)
transport/network/src/config.rs (1)

17-17: Consider if 0.95 is too restrictive for a default threshold.

The default auto-path quality threshold of 0.95 (95%) is quite high and might be too restrictive, potentially limiting the number of available paths. Consider if a lower default value would be more appropriate while still maintaining acceptable quality standards.

✅ Verification successful

The 0.95 threshold is indeed too restrictive and should be lowered

The default auto-path quality threshold of 0.95 (95%) is significantly higher than other quality thresholds in the codebase:

  • Network considers nodes "bad" at 0.1 (10%)
  • DFS path selector uses 0.2 (20%) by default
  • Promiscuous strategy uses 0.5 (50%)

Consider lowering it to 0.5-0.6 range to align with other components while still maintaining good quality standards.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check current quality metrics across nodes to assess impact
rg -A 5 "quality.*=.*0\.[0-9]+" 

Length of output: 2229


Script:

#!/bin/bash
# Search for quality-related constants and documentation
rg -i "quality.*threshold|quality.*score" -A 3 -B 1

# Search for comments explaining quality metrics
rg -i "quality" -g "*.md" -A 3 -B 1

Length of output: 65869

transport/api/src/lib.rs (1)

253-255: LGTM!

The change correctly updates the DfsPathSelectorConfig to use the new quality_auto_path_threshold while maintaining other default configuration values.

@NumberFour8 NumberFour8 merged commit 93537f1 into release/singapore Jan 28, 2025
28 of 29 checks passed
@NumberFour8 NumberFour8 deleted the hotfix/cfg-auto-path-quality branch January 28, 2025 10:33
@coderabbitai coderabbitai bot mentioned this pull request Jan 28, 2025
7 tasks
NumberFour8 added a commit that referenced this pull request Jan 31, 2025
…6835)

Co-authored-by: ausias-armesto <ausiasarmesto@gmail.com>
Co-authored-by: QYuQianchen <10935300+QYuQianchen@users.noreply.github.com>
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.

2 participants