Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TSC to compare tangle time with time of confirmed message. #2167

Merged
merged 29 commits into from
Jun 21, 2022

Conversation

piotrm50
Copy link
Contributor

Description of change

Solves #2160

Type of change

Choose a type of change, and delete any options that are not relevant.

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

How the change has been tested

Describe the tests that you ran to verify your changes.

Make sure to provide instructions for the maintainer as well as any relevant configurations.

Unit tests, manual testing.

Change checklist

Add an x to the boxes that are relevant to your changes, and delete any items that are not.

  • My code follows the contribution 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

@piotrm50 piotrm50 requested a review from jonastheis April 21, 2022 10:09
@piotrm50 piotrm50 self-assigned this Apr 21, 2022
@piotrm50 piotrm50 linked an issue Apr 21, 2022 that may be closed by this pull request
@@ -363,8 +363,7 @@ func (t *TipManager) Tips(p payload.Payload, countParents int) (parents MessageI
}

func (t *TipManager) isPastConeTimestampCorrect(messageID MessageID) (timestampValid bool) {
now := clock.SyncedTime()
minSupportedTimestamp := now.Add(-t.tangle.Options.TimeSinceConfirmationThreshold)
minSupportedTimestamp := t.tangle.TimeManager.Time().Add(-t.tangle.Options.TimeSinceConfirmationThreshold)
Copy link
Contributor

Choose a reason for hiding this comment

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

With the new time types (CTT, RCTT, FTT, RFTT) added to the TimeManager, you might want to change that condition.

Copy link
Contributor

@karimodm karimodm left a comment

Choose a reason for hiding this comment

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

Can we merge #2193 into this one before merging?

packages/tangle/tipmanager.go Show resolved Hide resolved
// if closest past marker is confirmed and before minSupportedTimestamp, then message should be ok
return true
// if closest past marker is confirmed and before minSupportedTimestamp, then need to walk message past cone of the previously marker message
messageWalker.Push(previousMessageID)
Copy link
Contributor

Choose a reason for hiding this comment

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

Needed!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

wdym?

Copy link
Contributor

Choose a reason for hiding this comment

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

We needed to push the message to the messageWalker to evaluate it; before we were just assuming that if the closest marker was confirmed the message was ok.

@georgysavva georgysavva mentioned this pull request May 23, 2022
// if closest past marker is confirmed and before minSupportedTimestamp, then message should be ok
return true
// if closest past marker is confirmed and before minSupportedTimestamp, then need to walk message past cone of the previously marker message
messageWalker.Push(previousMessageID)
Copy link
Contributor

Choose a reason for hiding this comment

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

We needed to push the message to the messageWalker to evaluate it; before we were just assuming that if the closest marker was confirmed the message was ok.

georgysavva and others added 7 commits May 23, 2022 14:40
* Add CTT, FTT. Rename Synced to Bootstrapped

* Add RCTT and RFTT to time manager

* Change sync logic to bootstrap

* Add new time types to the API responses

* Use RCTT for activity window

* Review fixes

* Review fixes

* Use to distinct states for bootstrapped and synced

* Add bootstrapped check

* Change RCTT calculation

* Issue metrics only when node is synced.

Co-authored-by: Daria Dziubałtowska <daria.dziubaltowska@iota.org>
Co-authored-by: Piotr Macek <piotr.macek@iota.org>
packages/tangle/timemanager.go Outdated Show resolved Hide resolved
plugins/dashboard/plugin.go Outdated Show resolved Hide resolved
plugins/faucet/plugin.go Show resolved Hide resolved
plugins/messagelayer/plugin.go Show resolved Hide resolved
tools/integration-tests/tester/framework/network.go Outdated Show resolved Hide resolved
tools/integration-tests/tester/framework/network.go Outdated Show resolved Hide resolved
tools/integration-tests/tester/framework/network.go Outdated Show resolved Hide resolved
@piotrm50 piotrm50 merged commit f22b3f2 into develop Jun 21, 2022
@piotrm50 piotrm50 deleted the feat/tsc-update branch June 21, 2022 10:57
This was referenced Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New TSC condition
4 participants