iotaledger / iri

IOTA Reference Implementation
Other
1.15k stars 370 forks source link

Fix milestone solidification on reboot #1862

Closed DyrellC closed 4 years ago

DyrellC commented 4 years ago

Description of change

If a sync is midway through and the node is shut off, it's possible for milestone transactions to get lost in the mix on restart. The transaction object may be present but the milestone object has not been generated. This means that if the node tries to solidify a transaction that references this milestone, it will always skip requesting this transaction as it is already stored.

This stops the milestones from making it into the solidification queue again. By making the TransactionSolidifier request milestones regardless of solidity, and adding an address scanning method for when synchronization stalls out on reboot, we can mitigate most issues that would pop up revolving around syncing and restarting during a sync.

Also lowers the max size of the TransactionSolidifier processing queue to ensure we solidify from bottom up in a more efficient manner.

Type of change

How the change has been tested

I have started, stopped and restarted many times on mainnet from a Local Snapshot 13k milestones back. Stops and starts resumed syncing in almost all instances.

Change checklist