-
Notifications
You must be signed in to change notification settings - Fork 14
add Group Channel adaptations on apps #156
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
add Group Channel adaptations on apps #156
Conversation
4a0fa49 to
c7b55c2
Compare
c7b55c2 to
6a9c060
Compare
d61670c to
b907454
Compare
|
@lucasbalieiro can you please do some testing with the changes from this PR + stratum-mining/stratum#2044? please make sure you cover:
|
Working on It |
|
I was able to do some testing mine some blocks, see if it open more channels than necessary upstream and seems to be working fine. With all the scenarios that you suggested. I was not able to do longer testing sessions because I need the patch from #138 for my setup to behave better |
pool-apps/pool/src/lib/channel_manager/template_distribution_message_handler.rs
Outdated
Show resolved
Hide resolved
pool-apps/pool/src/lib/channel_manager/template_distribution_message_handler.rs
Outdated
Show resolved
Hide resolved
pool-apps/pool/src/lib/channel_manager/template_distribution_message_handler.rs
Outdated
Show resolved
Hide resolved
miner-apps/jd-client/src/lib/channel_manager/downstream_message_handler.rs
Outdated
Show resolved
Hide resolved
miner-apps/jd-client/src/lib/channel_manager/downstream_message_handler.rs
Outdated
Show resolved
Hide resolved
miner-apps/jd-client/src/lib/channel_manager/template_message_handler.rs
Outdated
Show resolved
Hide resolved
miner-apps/jd-client/src/lib/channel_manager/template_message_handler.rs
Outdated
Show resolved
Hide resolved
miner-apps/jd-client/src/lib/channel_manager/template_message_handler.rs
Outdated
Show resolved
Hide resolved
miner-apps/jd-client/src/lib/channel_manager/template_message_handler.rs
Outdated
Show resolved
Hide resolved
miner-apps/jd-client/src/lib/channel_manager/template_message_handler.rs
Show resolved
Hide resolved
|
I was testing this PR by running Pool + tProxy in aggregated mode, and I noticed that after the channel is opened when the first downstream connection arrives, if we try to connect a second cpu-miner, it doesn't receive the This doesn't happen on current To reproduce:
To make this test more clear, I would suggest to change the |
|
Ok, I guess I found the issue. In the ChannelManager we are not setting the And this PR we introduced the following in Sv1Server (on these lines): But, if we don't use the |
|
thanks for spotting this @GitGab19 I reproduced it, and based on your investigation I introduced the following adaptation into line 407 of more specifically, the context of this change is:
// update the downstream channel with the active job and the chain
// tip
if let Some(mut job) = last_active_job {
if let Some(last_chain_tip) = last_chain_tip {
// update the downstream channel with the active chain tip
self.channel_manager_data.super_safe_lock(|c| {
if let Some(ch) =
c.extended_channels.get(&next_channel_id)
{
ch.write()
.unwrap()
.set_chain_tip(last_chain_tip.clone());
}
});
}
job.channel_id = next_channel_id;
// update the downstream channel with the active job
self.channel_manager_data.super_safe_lock(|c| {
if let Some(ch) = c.extended_channels.get(&next_channel_id)
{
let _ = ch
.write()
.unwrap()
.on_new_extended_mining_job(job.clone());
}
});
+ // set the channel id to the aggregated channel id
+ // before sending the message to the SV1Server
+ job.channel_id = AGGREGATED_CHANNEL_ID;
self.channel_state
.sv1_server_sender
.send((Mining::NewExtendedMiningJob(job.clone()), None))
.await
.map_err(|e| {
error!("Failed to send last new extended mining job to SV1Server: {:?}", e);
TproxyError::shutdown(TproxyErrorKind::ChannelErrorSender)
})?;
}after this modification, the issue is no longer reproducible I'm squashing this modification into a80cba2 |
ab33bfb to
28020fc
Compare
GitGab19
left a comment
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.
tACK
Shourya742
left a comment
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.
ACK
28020fc to
c9118d4
Compare
c9118d4 to
71068aa
Compare
…ream,Sniffer,SnifferSV1}
71068aa to
fc5ff90
Compare
close #146 #140
companion to stratum-mining/stratum#2044