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

MilestoneTracker and LedgerValidator rework #1151

Conversation

hmoog
Copy link

@hmoog hmoog commented Nov 15, 2018

Description

To prepare and simplify the next PR that enables the remaining features, we introduce a new milestone and ledger package that contains a rework of the named classes. They conform to the new code guidelines (using interfaces and fully documented).

Type of change

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

How Has This Been Tested?

Additional Unit Tests will be written later.

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
  • New and existing unit tests pass locally with my changes

@iotaledger iotaledger deleted a comment Nov 16, 2018
@iotaledger iotaledger deleted a comment from hmoog Nov 16, 2018
@iotaledger iotaledger deleted a comment Nov 16, 2018
@iotaledger iotaledger deleted a comment Nov 16, 2018
@iotaledger iotaledger deleted a comment from hmoog Nov 16, 2018
@iotaledger iotaledger deleted a comment Nov 16, 2018
@iotaledger iotaledger deleted a comment from hmoog Nov 16, 2018
@iotaledger iotaledger deleted a comment Nov 16, 2018
@iotaledger iotaledger deleted a comment Nov 16, 2018
@iotaledger iotaledger deleted a comment from hmoog Nov 16, 2018
@iotaledger iotaledger deleted a comment Nov 16, 2018
@iotaledger iotaledger deleted a comment from hmoog Nov 16, 2018
@iotaledger iotaledger deleted a comment from hmoog Nov 16, 2018
@iotaledger iotaledger deleted a comment Nov 16, 2018
@iotaledger iotaledger deleted a comment Nov 16, 2018
@iotaledger iotaledger deleted a comment from hmoog Nov 16, 2018
@iotaledger iotaledger deleted a comment from hmoog Nov 16, 2018
@iotaledger iotaledger deleted a comment Nov 16, 2018
@iotaledger iotaledger deleted a comment from hmoog Nov 16, 2018
@iotaledger iotaledger deleted a comment Nov 16, 2018
@iotaledger iotaledger deleted a comment from hmoog Nov 16, 2018
@iotaledger iotaledger deleted a comment from hmoog Nov 16, 2018
@iotaledger iotaledger deleted a comment Nov 18, 2018
@iotaledger iotaledger deleted a comment Nov 18, 2018
@iotaledger iotaledger deleted a comment Nov 18, 2018
Copy link
Contributor

@GalRogozinski GalRogozinski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!!!
Code is tops :-)

I mainly have javadocs nits that are not inline with the styleguide.

if (currentSolidMilestoneIndex < latestMilestoneTracker.getLatestMilestoneIndex()) {
MilestoneViewModel nextMilestone;
while (!Thread.currentThread().isInterrupted() &&
(nextMilestone = MilestoneViewModel.get(tangle, currentSolidMilestoneIndex + 1)) != null &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this should be bound by latestMilestoneTracker.getLatestMilestoneIndex() because you are doing an extra read from the db

Seems like a minor issue

Copy link
Author

@hmoog hmoog Nov 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the latestMilestoneTracker currently scans all candidates at the start it can take a really long time to have the correct value - If we find another solid milestone here I think it should be processed without waiting for the latestMilestoneTracker to advance to this milestone (thats also the reason why we have the method that syncs with the latestMilestoneTracker further down in the code).

@iotaledger iotaledger deleted a comment Nov 19, 2018
@iotaledger iotaledger deleted a comment Nov 19, 2018
@iotaledger iotaledger deleted a comment from hmoog Nov 19, 2018
@iotaledger iotaledger deleted a comment Nov 19, 2018
@iotaledger iotaledger deleted a comment Nov 19, 2018
@iotaledger iotaledger deleted a comment from GalRogozinski Nov 19, 2018
@iotaledger iotaledger deleted a comment Nov 19, 2018
@iotaledger iotaledger deleted a comment from hmoog Nov 19, 2018
@iotaledger iotaledger deleted a comment Nov 19, 2018
Copy link
Contributor

@GalRogozinski GalRogozinski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great Job

@GalRogozinski GalRogozinski merged commit 064d32f into iotaledger:dev-localsnapshots Nov 19, 2018
@hmoog hmoog deleted the merge_milestonetracker_rework branch November 19, 2018 14:05
@iotaledger iotaledger deleted a comment Nov 19, 2018
@iotaledger iotaledger deleted a comment Nov 19, 2018
@iotaledger iotaledger deleted a comment from hmoog Nov 19, 2018
@iotaledger iotaledger deleted a comment Nov 19, 2018
@iotaledger iotaledger deleted a comment from hmoog Nov 19, 2018
@iotaledger iotaledger deleted a comment from hmoog Nov 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants