Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Expose config max-round-blocks-to-import #9439

Merged
merged 4 commits into from
Oct 26, 2018
Merged

Conversation

sorpaas
Copy link
Collaborator

@sorpaas sorpaas commented Aug 30, 2018

Fixes #9320.

parity-ethereum imports blocks in rounds. If at the end of any round, the queue is not empty, we consider it to be "importing" and won't notify pubsub. On large re-orgs (10+ blocks), this is possible.

  • Change default max_round_blocks_to_import number from 4 to 12.
  • Make this configurable via --max-round-blocks-to-import [S]. With unstable network conditions, it is advised to increase the number. This shouldn't have any noticeable performance impact unless the number is set to really large.

@sorpaas sorpaas added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Aug 30, 2018
@sorpaas sorpaas added this to the 2.1 milestone Aug 30, 2018
@5chdn 5chdn added the B7-releasenotes 📜 Changes should be mentioned in the release notes of the next minor version release. label Aug 30, 2018
Copy link
Contributor

@andresilva andresilva left a comment

Choose a reason for hiding this comment

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

Overall LGTM, just some minor grumbles.

@@ -98,6 +98,7 @@ pub struct ImportBlockchain {
pub with_color: bool,
pub verifier_settings: VerifierSettings,
pub light: bool,
pub max_round_blocks_to_import: usize,
Copy link
Contributor

Choose a reason for hiding this comment

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

We probably don't need to add this field here and just use the default (12). Same below for Export* structs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

--max-round-blocks-to-import is a valid args for ImportBlockchain and Snapshot commands anyway, so I think it would be better to include them there, just in case it caught people in surprise? For example, --max-round-blocks-to-import do have (small) impact because the execution would call import_verified_blocks.

Copy link
Contributor

@andresilva andresilva Sep 6, 2018

Choose a reason for hiding this comment

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

It is a valid option indeed, I just assumed it wouldn't make much of a difference without networking. I'm OK with keeping it configurable.

@@ -62,6 +62,7 @@ pub struct SnapshotCommand {
pub file_path: Option<String>,
pub kind: Kind,
pub block_at: BlockId,
pub max_round_blocks_to_import: usize,
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above, I think we only need to add this for the RunCmd.

@5chdn 5chdn added A6-mustntgrumble 💦 Pull request has areas for improvement. The author need not address them before merging. and removed A0-pleasereview 🤓 Pull request needs code review. labels Sep 6, 2018
@ngotchac
Copy link
Contributor

Did you experience any performance improvements/decreases defaulting from 4 to 12?

@sorpaas
Copy link
Collaborator Author

sorpaas commented Sep 10, 2018

@ngotchac No. Not sure how to benchmark this.

@ngotchac
Copy link
Contributor

Nothing really precise here, but just looking empirically how fast can you sync to block #N I guess? I think it won't change much though.

@5chdn 5chdn modified the milestones: 2.1, 2.2 Sep 11, 2018
@5chdn
Copy link
Contributor

5chdn commented Sep 18, 2018

Are you still working on this?

@5chdn 5chdn added the A3-stale 🍃 Pull request did not receive any updates in a long time. No review needed at this stage. Close it. label Sep 18, 2018
@sorpaas
Copy link
Collaborator Author

sorpaas commented Sep 18, 2018

@5chdn Fixed! Didn't realize there were merge conflicts!

@sorpaas sorpaas added A0-pleasereview 🤓 Pull request needs code review. and removed A3-stale 🍃 Pull request did not receive any updates in a long time. No review needed at this stage. Close it. labels Sep 18, 2018
@5chdn
Copy link
Contributor

5chdn commented Sep 30, 2018

Could you take a look @ngotchac @tomusdrw :)

Copy link
Collaborator

@tomusdrw tomusdrw left a comment

Choose a reason for hiding this comment

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

lgtm

@@ -785,6 +785,10 @@ usage! {
"--stratum-secret=[STRING]",
"Secret for authorizing Stratum server for peers.",

ARG arg_max_round_blocks_to_import: (usize) = 12usize, or |c: &Config| c.mining.as_ref()?.max_round_blocks_to_import.clone(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Doesn't it fit more into Performance section?

@5chdn
Copy link
Contributor

5chdn commented Oct 4, 2018

please rebase on master 🙈

@5chdn 5chdn removed the A0-pleasereview 🤓 Pull request needs code review. label Oct 26, 2018
@5chdn 5chdn merged commit 1ff827b into master Oct 26, 2018
@5chdn 5chdn deleted the sp-max-round-blocks-to-import branch October 26, 2018 11:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A6-mustntgrumble 💦 Pull request has areas for improvement. The author need not address them before merging. B7-releasenotes 📜 Changes should be mentioned in the release notes of the next minor version release. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants