-
Notifications
You must be signed in to change notification settings - Fork 147
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3745562
to
7b07b56
Compare
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// 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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// 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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// This task intercept the NewTemplate and PrevHash message from template provider and | |
// This task intercept the NewTemplate and SetNewPrevHash message from Template Provider and |
closes: #1471