Skip to content

Prevent mining when disconnected from network #66

Open
@leto

Description

I noticed that blurd will continue to mine after a suspend + resume when no internet access exists on resume. It will mine and use CPU resources indefinitely, not realizing it has no valid peers and no internet connection. Not even a valid interface, since there was no valid wifi connection nor ethernet connection.

It seems that blurd could have heuristics to detect this edge case and stop mining, until it is reconnected to the network. Some heuristics might be OS-level detection of a working network interface that is not loopback, maybe via some kind of ping. A harder edge case is to detect when we have a valid internet connection but no packets (for whatever reason, such as firewall or misconfiguration) are getting through.

Part of the issue seems related to the fact that in XMR world, it's valid for a single node to mine, while in BTC world, it's always required to have 2 nodes connected to enable mining.

One idea is "If blur has not seen a block or message from a valid network peer in X minutes, have a 50% chance of stopping mining." This allows some nodes to stay online in case there is some actual bug in the difficulty adjustment algorithm or catastrophic network event. The main problem in fixing this issue seems to be how to correctly detect it, and not get false positives which would have a detrimental effect on the P2P health of the network.

Metadata

Assignees

Labels

bugSomething isn't workingfast-trackEnhancements that need treated as important, just behind bugs in priority.under investigationurgent-noncriticalthings that require haste

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions