Skip to content
This repository has been archived by the owner on Aug 23, 2020. It is now read-only.

Change: Do not request one transaction at a time when checking for solidity #1311

Merged
merged 1 commit into from
Mar 26, 2019

Conversation

karimodm
Copy link
Contributor

@karimodm karimodm commented Jan 29, 2019

Description

This change will make IRI request bigger portions of Tangle while exploring transactions for solidity.

Fixes #1310

Type of change

  • Enhancement (a non-breaking change which adds functionality)

Checklist:

Please delete items that are not relevant.

  • My code follows the style guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@kwek20
Copy link
Contributor

kwek20 commented Jan 29, 2019

I noticed that after doing this, most milestones all turn solid at the same time (or in 5 seconds)
Although i'm not sure if that's bad, it seems that the 10 milestones list is kind of ineffective then and maybe we should change this to 2 or 3 to solidify the next milestone faster during syncing

@karimodm
Copy link
Contributor Author

karimodm commented Jan 30, 2019

it seems that the 10 milestones list is kind of ineffective

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 checkSolidity call, this change would make more than one PREFILLED_SLOT end up in the requester queue, before the next call happens: I've experienced an improvement in solidification times.

@GalRogozinski
Copy link
Contributor

After Discussing with @jakubcech we decided that this should be in 1.6.2 and not 1.6.1
We first want to add the stabilizing fixes and see that the system stabilizes and then add the improvements.

@karimodm if you can please add a unit test for the specific change it will be great!

alon-e
alon-e previously requested changes Jan 31, 2019
@@ -266,7 +266,7 @@ public boolean checkSolidity(Hash hash, boolean milestone, int maxProcessedTrans

if (!transactionRequester.isTransactionRequested(hashPointer, milestone)) {
transactionRequester.requestTransaction(hashPointer, milestone);
break;
continue;
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

@GalRogozinski GalRogozinski Feb 3, 2019

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.

Copy link
Contributor

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.

Copy link
Contributor Author

@karimodm karimodm Feb 5, 2019

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.

@kwek20 kwek20 changed the title Do not request one transaction at a time when checking for solidity Change: Do not request one transaction at a time when checking for solidity Mar 15, 2019
@GalRogozinski GalRogozinski merged commit dc44633 into iotaledger:dev Mar 26, 2019
@jakubcech jakubcech mentioned this pull request May 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request as much transactions as possible as part of checkSolidity
4 participants