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

Warpsync: epoch syncing #2367

Merged
merged 68 commits into from
Aug 24, 2022
Merged

Warpsync: epoch syncing #2367

merged 68 commits into from
Aug 24, 2022

Conversation

karimodm
Copy link
Contributor

@karimodm karimodm commented Jul 28, 2022

Description of change

Issue #2380
Implementation of the Warpsync plugin that will allow to retrieve entire epoch's content for a specific epoch commitment chain: for faster syncing and for switching to a heavier EC chain.

Type of change

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

@karimodm karimodm marked this pull request as ready for review August 12, 2022 11:34
packages/node/warpsync/validation.go Show resolved Hide resolved
packages/node/warpsync/validation.go Show resolved Hide resolved
packages/node/warpsync/validation.go Show resolved Hide resolved
packages/node/warpsync/syncing.go Show resolved Hide resolved
Comment on lines 136 to 138
if err != nil {
return errors.Errorf("sync failed for range %d-%d", start, end)
}
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 assigning the error in the callback I'd suggest the following: hand over a ctx that you can cancel to the goroutines and make them write into a result channel that contains an error and the completed EI (or maybe we don't even need that and counting is enough). Then you can cancel all goroutines on demand if there's an error and you wait on the result channel instead of the epochProcessingChan

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems to be addressed now with the resultChan, cancellable errCtx and errorChan.

// BlockBatchSize defines the amount of blocks to send in a single epoch blocks response"`
BlockBatchSize int `default:"100" usage:"the amount of blocks to send in a single epoch blocks response"`
// SyncRangeTimeOut defines the time after which a sync range is considered as failed.
SyncRangeTimeOut time.Duration `default:"30s" usage:"the time after which a sync range is considered as failed"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't that a little bit low as a default value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Increased it to 5m

@karimodm karimodm merged commit f1b453f into develop Aug 24, 2022
@karimodm karimodm deleted the feat/epoch-syncing branch August 24, 2022 06:56
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