Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Use header validation mode for ommers #1313

Merged
merged 10 commits into from
Apr 23, 2019

Conversation

ajsutton
Copy link
Contributor

PR description

During a fast sync, we should only fully validate a random sampling of ommer headers and otherwise skip the proof of work validity and ancestry checks which are expensive.

Profiling shows the PoW checks in particular were causing the majority of CPU usage during a fast sync for an ethash chain.

Copy link
Contributor

@mbaxter mbaxter left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -224,6 +224,17 @@ private boolean isOmmerValid(
return false;
}

if (ommerValidationMode != HeaderValidationMode.LIGHT
&& ommerValidationMode != HeaderValidationMode.LIGHT_SKIP_DETACHED
&& ommerValidationMode != HeaderValidationMode.LIGHT_DETACHED_ONLY) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this be clarified with something like: !HeaderValidationMode.isLight(ommerValidationMode) ?

@ajsutton ajsutton merged commit 80d9af3 into PegaSysEng:master Apr 23, 2019
@ajsutton ajsutton deleted the light-validate-ommers branch April 23, 2019 23:07
notlesh pushed a commit to notlesh/pantheon that referenced this pull request Apr 24, 2019
notlesh pushed a commit to notlesh/pantheon that referenced this pull request May 4, 2019
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