snarkOS
snarkOS copied to clipboard
Ensure the operator is connected to the prover before sending work
This avoids an infinite loop in which a worker continually asks for work but cant get it back from the pool as it is not properly connected.
Other than the fact that I agree that we should instead have something like https://github.com/AleoHQ/snarkOS/issues/1554 in place, this workaround should be adjusted as follows:
- the first few early returns in
Peers::updateshould sendErr(<some meaningful error>)to theSenderinconnection_result, so we can actually know if we weren't already connected or if there's some other connection attempt error - instead of ignoring the result of the corresponding
Receiver(let _ = handler.await;), we should check whether we succeeded at connecting, were already connected or if there was an error and potentially act differently if ultimately we're not connected after all
The CI jobs should succeed once https://github.com/AleoHQ/snarkOS/pull/1625 is merged and this PR is rebased on top of it.
Admin: Please respond with "build this" in order to build this PR.