stacks-core
stacks-core copied to clipboard
`PeerNetwork` state must survive from neon node to nakamoto node.
This can be done using the JoinHandle
returns.
This should include the socket to avoid #4547
If this isn't done, could lead to an empty 5-6 blocks once 3.0 kicks off
Can I just transfer the entire p2p thread like we do with the monitoring thread? Like this:
let monitoring_thread = neon_loop.take_monitoring_thread();
let naka = NakaRunLoop::new(
/* ... */
monitoring_thread,
);
Yes I believe you can
On Tue, May 7, 2024, 4:21 PM Jeff Bencin @.***> wrote:
Can I just transfer the entire p2p thread like we do with the monitoring thread? Like this:
let monitoring_thread = neon_loop.take_monitoring_thread();let naka = NakaRunLoop::new( /* ... */ monitoring_thread,);
— Reply to this email directly, view it on GitHub https://github.com/stacks-network/stacks-core/issues/4355#issuecomment-2099236882, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADQJKZLLSKQWXQ7ST5J5RTZBEZUFAVCNFSM6AAAAABDAH33SOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJZGIZTMOBYGI . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Can I just transfer the entire p2p thread like we do with the monitoring thread? Like this:
After looking into this a bit more, I don't think this would work. PeerThread
holds a copy of Globals
, which would reference a closed MPSC channel:
pub struct Globals<T> {
// ...
/// Writer endpoint to the relayer thread
pub relay_send: SyncSender<T>,
}
I don't think there is anything else that becomes invalid after the neon runloop terminates, but it seems safer to pass PeerNetwork
than to pass PeerThread
and try to manually update any invalid references
Closed by #4767