snarkOS icon indicating copy to clipboard operation
snarkOS copied to clipboard

[Bug] The reason why some solutions can not be relayed to the beacon

Open shannon-6block opened this issue 3 years ago • 6 comments

It's in node/router/src/outbound.rs. When a UnconfirmedSolution message calls propogate()->send()->can_send(), the can_send() function will return false when propogate() try to send the message to the 2nd peer.

shannon-6block avatar Dec 02 '22 12:12 shannon-6block

So every time, the UnconfirmedSolution message can only propagate to the 1st peer in the peer list.

shannon-6block avatar Dec 02 '22 12:12 shannon-6block

It seems the validators would only send the UnconfirmedSolutions to beacons (propagate_to_beacons, not propagate), and the validators are only allowed to connect to the official beacon (checked in verify_challenge_request). I think the current situation is not caused by this.

EDIT: unless somehow there are more than one official beacons and the official validators are connected to all of them. Not sure

However when we have more beacons this could be an issue though.

HarukaMa avatar Dec 02 '22 12:12 HarukaMa

The propagate_to_beacons() will also send UnconfirmedSolution message to the 1st beacon only. When it tries to send the message to the 2nd beacon, the can_send() will return false.

shannon-6block avatar Dec 02 '22 12:12 shannon-6block

Because the cache key uses the puzzle_ Commitment, the same commitment, will return the old timestamp. Therefore, starting from the second node, false will be returned

fhigher avatar Dec 02 '22 12:12 fhigher

I have added PR #2134 which checks for duplicate solutions or transactions on a per IP address basis. Feel free to check if this change fixes the issue and can close the issue.

howardwu avatar Dec 03 '22 05:12 howardwu

The CPU load will drop to 0, intermittent.

15012700225 avatar Dec 04 '22 01:12 15012700225

Closing as the issue has been fixed with PR #2134.

howardwu avatar Dec 04 '22 19:12 howardwu