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

Document pub code in pool #1542

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Shourya742
Copy link
Contributor

closes: #1471

Copy link

codecov bot commented Mar 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 21.91%. Comparing base (8a48a76) to head (7b07b56).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1542   +/-   ##
=======================================
  Coverage   21.91%   21.91%           
=======================================
  Files         135      135           
  Lines        9573     9573           
=======================================
  Hits         2098     2098           
  Misses       7475     7475           
Flag Coverage Δ
binary_codec_sv2-coverage 0.00% <ø> (ø)
binary_sv2-coverage 10.12% <ø> (ø)
bip32_derivation-coverage 0.00% <ø> (ø)
buffer_sv2-coverage 37.68% <ø> (ø)
codec_sv2-coverage 0.03% <ø> (ø)
common_messages_sv2-coverage 0.25% <ø> (ø)
const_sv2-coverage 0.00% <ø> (ø)
error_handling-coverage 0.00% <ø> (ø)
framing_sv2-coverage 0.54% <ø> (ø)
jd_client-coverage 0.39% <ø> (ø)
jd_server-coverage 12.42% <ø> (ø)
job_declaration_sv2-coverage 0.00% <ø> (ø)
key-utils-coverage 3.61% <ø> (ø)
mining-coverage 5.02% <ø> (+0.03%) ⬆️
mining_device-coverage 0.00% <ø> (ø)
mining_proxy_sv2-coverage 1.18% <ø> (ø)
noise_sv2-coverage 8.63% <ø> (ø)
pool_sv2-coverage 7.00% <100.00%> (-0.03%) ⬇️
protocols 30.61% <ø> (+0.02%) ⬆️
roles 12.17% <100.00%> (-0.03%) ⬇️
roles_logic_sv2-coverage 15.22% <ø> (ø)
sv2_ffi-coverage 0.00% <ø> (ø)
template_distribution_sv2-coverage 0.00% <ø> (ø)
translator_sv2-coverage 9.11% <ø> (ø)
utils 36.39% <ø> (?)
v1-coverage 4.36% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Shourya742 Shourya742 force-pushed the 2025-02-25-add-pool-doc branch from 3745562 to 7b07b56 Compare March 28, 2025 13:50
@@ -4,7 +4,7 @@ use std::convert::TryFrom;

/// Represents the configuration of a Pool.
///
/// Pool acts an upstream throug hthe [`PoolConfig::listen_address`] and a downstream to the
/// Pool acts an upstream through the [`PoolConfig::listen_address`] and a downstream to the
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// Pool acts an upstream through the [`PoolConfig::listen_address`] and a downstream to the
/// Pool acts as an upstream through the [`PoolConfig::listen_address`] and as a downstream to the

@@ -77,6 +84,10 @@ pub struct Pool {
}

impl Downstream {
/// Establishes a new connection with a downstream miner.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// Establishes a new connection with a downstream miner.
/// Establishes a new connection with a downstream role.

@@ -176,6 +192,8 @@ impl Downstream {
Self::match_send_to(self_mutex, next_message_to_send).await
}

/// This method is responsible for sending message to downstream, or
/// broadcasting messages to multiple downstream.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// broadcasting messages to multiple downstream.
/// broadcasting messages to multiple downstreams.

@@ -218,6 +236,7 @@ impl Downstream {
Ok(())
}

/// This method is used to send message to downstream.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// This method is used to send message to downstream.
/// This method is used to send messages to downstreams.

@@ -321,6 +344,8 @@ impl Pool {
Ok(())
}

// This method instantiates the downstream structures and updates the pools
// downstream snapshots.
Copy link
Collaborator

Choose a reason for hiding this comment

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

What do you mean with snapshots?

pub fn new() -> Self {
Self { header_only: None }
}

/// Handles the `SetupConnection` message from a downstream connection.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// Handles the `SetupConnection` message from a downstream connection.
/// Handles the `SetupConnection` message coming from a downstream connection.

TemplateProviderShutdown(PoolError),
/// Indicates that a specific downstream miner instance has disconnected.
/// The `u32` value represents the ID of the disconnected instance.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// The `u32` value represents the ID of the disconnected instance.
/// The `u32` value represents the channel ID of the disconnected instance.

DownstreamInstanceDropped(u32),
/// Represents a healthy state with an accompanying status message.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the status message always an "healthy" status?

This name always put some doubts in me ;)

@@ -34,6 +40,7 @@ pub struct TemplateRx {
}

impl TemplateRx {
/// Establishes a connection with the template provider and sets up communication channels.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// Establishes a connection with the template provider and sets up communication channels.
/// Establishes a connection with the Template Provider and sets up communication channels.

@@ -91,12 +98,16 @@ impl TemplateRx {

Self::send(self_.clone(), frame).await?;

// This task intercept the NewTemplate and PrevHash message from template provider and
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// This task intercept the NewTemplate and PrevHash message from template provider and
// This task intercept the NewTemplate and SetNewPrevHash message from Template Provider and

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.

Document Pool async primitives
2 participants