iotaledger / iri

IOTA Reference Implementation
Other
1.15k stars 370 forks source link

Do not return unsolid tips for API call #1787

Open DyrellC opened 4 years ago

DyrellC commented 4 years ago

Description

The current GetTips api call returns both solid and unsolid tips. This can lead to chaining of transactions off of unsolid tips, which will not be seen by the gtta walks due to the current solidification logic. Transactions are placed into the TipsViewModel before any attempts to solidify the transaction are conducted. As such, in the event of an out of order transaction, a tip that can be returned in the TipsViewModel may not be solid by the time it is requested by the API call. If that is the case, the next transaction attached on top of it will result in a chain of transactions built upon a transaction that has yet to be marked solid. All transactions attached on top of that will also fail to solidify unless the propagation thread in the TransactionValidator happens to see the root transaction of this chain.

Fixes the current issue seen on devnet, and will likely assist in increasing the confirmation rate on mainnet as many users are using getTips() instead of getTransactionsToApprove() to fetch their trunks and branches right now.

Type of change

How Has This Been Tested?

Checklist:

GalRogozinski commented 4 years ago

Due to discord messages and #1615 maybe we will change it to delete this method (or class entirely)

DyrellC commented 4 years ago

In the meantime it's important to tell people that they should not use getTips as is then. There's still spam on devnet that follows the pattern of getTips calls which is dragging down confirmation of transaction branches