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

Mana vector fixes #2396

Merged
merged 25 commits into from
Aug 30, 2022
Merged

Mana vector fixes #2396

merged 25 commits into from
Aug 30, 2022

Conversation

daria305
Copy link
Contributor

  • Use manaDelay parameter only from mana plugin. Update mana vector event has now only EI.
  • Adjust activity record during snapshotting: we keep only activity window for lastConfirmed-activeEpochThreshold

@daria305 daria305 requested a review from karimodm August 22, 2022 16:17
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.

Looks good!!! I would just like to turn the activityLog to a ShrinkingMap


return weights, totalWeight
}

// SnapshotEpochActivity returns the activity log for snapshotting.
func (c *CManaWeightProvider) SnapshotEpochActivity() (epochActivity epoch.SnapshotEpochActivity) {
func (c *CManaWeightProvider) SnapshotEpochActivity(epochDiffIndex epoch.Index) (epochActivity epoch.SnapshotEpochActivity) {
epochActivity = epoch.NewSnapshotEpochActivity()

c.mutex.Lock()
defer c.mutex.Unlock()

for ei, al := range c.activityLog {
al.SetEpochs.ForEach(func(nodeID identity.ID) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of having ActivityLog exposing an AdvanceSet, can we create a ForEach on the activity record itself while unexporting the AdvancedSet itself?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now I use ForEach, but it turned out that I cannot unexport SetEpochs as the serialization stops working

packages/core/tangleold/cmanaweightprovider.go Outdated Show resolved Hide resolved
packages/core/epoch/types.go Outdated Show resolved Hide resolved
@daria305 daria305 merged commit 999496f into develop Aug 30, 2022
@daria305 daria305 deleted the feat/mana-vector-update-fixes branch August 30, 2022 12:23
This was referenced Aug 31, 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.

2 participants