iotaledger / iri

IOTA Reference Implementation
Other
1.15k stars 370 forks source link

Add milestone stage #1822

Closed DyrellC closed 4 years ago

DyrellC commented 4 years ago

Description

This is step one towards the migration of milestone handling logic as per #1674. In this phase we add a milestone stage to the processing pipeline to handle milestone transactions as they are received rather than relying on the LatestMilestoneTracker to pull them from the db. This should mitigate the issue demonstrated on devnet, when a node has a high number of milestone transactions present in the db, and it takes a long time to pull them out. New milestones were not being seen and processed fast enough, so to fix that, we handle them straight from the received stage.

This is a follow up to #1821

Fixes #1688
Also relevant to #1448 and #1797

Type of change

How Has This Been Tested?

Checklist:

DyrellC commented 4 years ago

@GalRogozinski ready to go. I added a couple missing unit tests as well if you want to take a quick look at those.