Version bump -> 0.3.3This update is not very critical, so nobody really has to update.
Sometimes, it might happen that peers get blacklisted because they have
1. sent a POW for a transaction meeting a specific block's target value but
2. the receiver side already was ahead of the chain (maybe because it just forged a new block but not yet broadcasted it) with a different difficulty, rendering the received POW invalid and causing the peer to be blacklisted
Typical symptom was something like this happening occasionally when mining on the local node (this means, some other node has blacklisted us).
2016-09-18 20:25:08 FINE: Peer 108.61.177.169 version 0.3.2 returned error: {"error":"nxt.NxtException$NotValidException: Peer sends invalid transactions: [nxt.NxtException$NotValidException: Proof of work is invalid: does not meet target]"}, request was: {"protocol":1,"requestType":"processTransactions","transactions":[{"senderPublicKey":"d9d5c57971eefb085e3abaf7a5a4a6cdb8185f30105583cdb09ad8f61886ec65","attachment":{"input":[1665498805,-467634391,-1035598394],"version.PiggybackedProofOfWork":1,"id":"7680446930260947479"},"subtype":2,"amountNQT":0,"signature":"d536bc11494fad4bdbfd1477463ce3bd9361ba336591af792fb3ad291b6d9e0acd55e6fa302fbb7af798f6e0b32ddb081b38a7429393793e802d0e7d0f733d3c","feeNQT":0,"ecBlockHeight":3945,"type":3,"deadline":3,"version":1,"timestamp":88928708,"ecBlockId":"17321588210217598091"}]}, disconnecting
The fix was to introduce a soft_unblock. Basically, we do not block peers that send POW which are invalid but were valid in the last 5 blocks. For this we have added a second Exception type. Besides the regular "NotValidException" (which causes a peer to be blacklisted) we now have the LostValidityException. If the lost validity happened not later than 5 blocks ago, there will be no blacklisting, the tx will just be dropped silently.
Fixes:
https://github.com/OrdinaryDude/elastic-core/commit/6e836ef42701ba799715bb16d55f00a51a87048f (The fix)
https://github.com/OrdinaryDude/elastic-core/commit/4da2959b90e1ef6fab4adf598c8345a357d4890e (Added LRU cache, and fixed little bug)