blur-network / blur

The Blur Network is a privacy-oriented peer-to-peer network, built upon the premise that privacy is incompatible with centralization. BLUR employs a custom mining algorithm called CryptoNight-Dynamic. Iterations adjust approximately once every five seconds, with a goal of maintaining CPU advantages over specialized mining hardware.
https://blur.cash
Other
44 stars 19 forks source link

Log reason for banning host #65

Closed leto closed 5 years ago

leto commented 5 years ago

I saw a message that one of my mining rigs banned another rig on my LAN, but no reason was given. It would be useful for some kind of reason to be logged, to aid in debugging.

FYI I am also using the --allow-local-ip option

who-biz commented 5 years ago

This is a good idea. The host blocked message you received was printed in red correct? I am having trouble finding the location at which this occurs in code. Doesn't appear to be the one located in net_node.inl, as that message should be displayed in blue/cyan colored text.

who-biz commented 5 years ago

Also, would you mind opening another issue following our discussion, yesterday? I.e. Nodes erroneously mining when not connected to the network/offline? That is an issue that should be handled with some urgency, IMO. I think some public discourse on it may be helpful, as well.

leto commented 5 years ago

@who-biz sure thing, here ya go: https://github.com/blur-network/blur/issues/66

leto commented 5 years ago

@who-biz and to confirm, yes it was printed in red on STDOUT. It blocked a host on my LAN, so I was really intrigued about why it blocked it. I can also say that the node blocked was not listed as a priority node, which is not surprising.

who-biz commented 5 years ago

It blocked a host on my LAN, so I was really intrigued about why it blocked it

That is very interesting. I'll keep trying to trackdown the locus of this specific blocking. If it is not within the p2p code, then it will be happening in the epee library. Will get back once I find it.

who-biz commented 5 years ago

Aha! So the MCLOG_CYAN macro prints the location in source giving rise to the error in cyan... and the actual log message in red. So the location https://github.com/blur-network/blur/blob/master/src/p2p/net_node.inl#L172 is indeed the one we are looking for.

As an added bonus, I figured this out while adding log messages for notary node wallet generation... Instructions now added to the README.md located here :)

who-biz commented 5 years ago

Should be resolved in https://github.com/blur-network/blur/commit/9f8a0a496859ec935f0692995f6d9de1278600ba. If, for some reason, the added messages aren't displayed, please let me know and we can re-open.

You should see two messages :

1.) Upon failure to connect after 9 attempts, when node is added to block list. 2.) Upon finding the node's address on the block list, after it is added.

Both will display in bold red text.

leto commented 5 years ago

awesome, I will test it on some new rigs soon :+1: