-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Several fixes for FastSync #1074
Conversation
| for (Value value: dataList) { | ||
| if (value == null) continue; // Bad sign | ||
| dataListRLP.add(value.getData()); | ||
| dataListRLP.add(value.asBytes()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It results in a list with not encoded elements
| needToDrop = true; | ||
| } | ||
| // Drop bad peers before creating channel | ||
| if (!needToDrop && nodeManager.getNodeStatistics(new Node(new byte[0], ch.remoteAddress().getHostString(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requesting for nodeManager.isReputationPenalized(InetSocketAddress addr) which does all the job
| if (request == null) { | ||
| long t = System.currentTimeMillis(); | ||
| logger.debug("Received node which was not requested: " + toHexString(pair.getKey()) + " from " + idle); | ||
| idle.disconnect(ReasonCode.USELESS_PEER); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This case could not be related to the meaning of log message standing above. It may be a result of pendingNodes purging due to REQUEST_TIMEOUT. Isn't it too rude to disconnect peer with USELESS_PEER reason in that case? Btw, log message could also be fixed to avoid misunderstanding in the future.
SyncQueueReverseImplwhich could force Fast sync to stall for a long time when it needs only to download 256 blocks