Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Pause Substrate sync #52

Merged
merged 3 commits into from
Jun 27, 2023
Merged

Conversation

nazar-pc
Copy link
Member

@nazar-pc nazar-pc commented Jun 26, 2023

The first commit was sent upstream here: paritytech#14465

The second commit makes sync_mode updatable and third introduces SyncMode::Paused that temporarily makes node not request blocks from other nodes, we'll use that to pause regular Substrate sync when doing sync from DSN (otherwise it results in a decreased reputation of connected peers and a lot of unnecessary reconnections/disconnections).

I'll try to upstream the other two commits if/when the first one lands upstream.

I have tested this locally with Subspace node, seems to behave as expected.

Needed for autonomys/subspace#1514

@nazar-pc nazar-pc changed the title Subspace v5 pause substrate sync Pause Substrate sync Jun 26, 2023
Copy link
Member

@shamil-gadelshin shamil-gadelshin left a comment

Choose a reason for hiding this comment

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

The PR generally makes sense to me.


return
},
PollBlockAnnounceValidation::ImportHeader { announce, is_best, who } => {
Copy link
Member

Choose a reason for hiding this comment

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

I wonder, why did you remove this option?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is a part of paritytech#14465 and it was no longer used after SyncMode::Light enum variant was gone, I just pulled the strings and removed all unused code after that.

@nazar-pc nazar-pc merged commit 55c157c into subspace-v5 Jun 27, 2023
0 of 4 checks passed
@nazar-pc nazar-pc deleted the subspace-v5-pause-substrate-sync branch June 27, 2023 18:30
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