-
Notifications
You must be signed in to change notification settings - Fork 370
Change: Do not request one transaction at a time when checking for solidity #1311
Conversation
I noticed that after doing this, most milestones all turn solid at the same time (or in 5 seconds) |
Yeah, I've been experimenting with different size values of the milestone solidification pool; although the changes were not that significant as far as I could experience. Anyhow this change refers to the Tangle traversing mechanism when checking solidity of either a milestone or a regular transaction. Instead of requesting a single branch as a result of a single |
After Discussing with @jakubcech we decided that this should be in 1.6.2 and not 1.6.1 @karimodm if you can please add a unit test for the specific change it will be great! |
@@ -266,7 +266,7 @@ public boolean checkSolidity(Hash hash, boolean milestone, int maxProcessedTrans | |||
|
|||
if (!transactionRequester.isTransactionRequested(hashPointer, milestone)) { | |||
transactionRequester.requestTransaction(hashPointer, milestone); | |||
break; | |||
continue; |
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.
not sure if the following suggestion makes sense:
if it's a milestone, then continue
, else break
.
the reason being:
this mechanism can be used to fill the request queue with arbitrary data faster.
0
| \
0 ?
0
| \
0 ?
0
| \
0 ?
...
in the current code the first ?
would be requested and stop (and if this ?
does not exist the rest will never be requested, with this change all the historical ?
s will be requested (up until the maxProccessedTransactions
is reached).
I'm not sure this is such an issue, but my proposal would not change behavior for random transactions but achieve the improvement for syncing nodes.
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.
in the current code the first ? would be requested and stop (and if this ? does not exist the rest will never be requested.
Is this true? In the current code, upon the next call of this method, the first ?
will already be in the requester queue, and the if (!transactionRequester.isTransactionRequested(hashPointer, milestone)) {
will return false: so it will continue to request the next ?
.
This being said I don't get your point on continue
only if it's a milestone.
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.
I think Alon's point is that all branches that are not confirmed by a milestone are "arbitrary data" and we don't want to have spend time or resources on them. The requester queue can fill up with sidetangle requests and thus hinder the solidification of "milestone branches".
However, if the TipsSolidifier
is not enabled we are not supposed to be solidifying on "arbitrary data", and if it is enabled then maybe it is because the operator cares about "arbitrary data"?
Bottom line, due to the TipsSolidifier
activation config I am with @karimodm.
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.
good point @karimodm, still this will take time to fill (1 tx per scan). I still think that this can be avoided by separating the cases; it will reduce the amount of change.
However, I don't insist on this, if @GalRogozinski thinks it's fine then I'm OK.
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.
still this will take time to fill (1 tx per scan)
Doesn't the continue
here make the queue fill faster in any of the cases?
@GalRogozinski true on arbitrary data, this change combined with the requester freshness should fend off those scenarios though.
Description
This change will make IRI request bigger portions of Tangle while exploring transactions for solidity.
Fixes #1310
Type of change
Checklist:
Please delete items that are not relevant.