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

Validator refactor #1873

Merged
merged 1 commit into from
May 22, 2020
Merged

Validator refactor #1873

merged 1 commit into from
May 22, 2020

Conversation

SWvheerden
Copy link
Collaborator

Description

Refactor the validators to ensure that each validation step only completes once. Before this PR some validation steps where done twice.
The stateless validator also now checks accounting balance and this is not only checked when the block is added to the main chain.

Motivation and Context

There was a lot of duplicate checking between the stateless and stateful validators. This is now ensured that each check is only ran once. It was also checked to ensure that state-full and stateless is always ran. Blocks are checked by the stateless before going into the orphan pool. After this the block is checked and might be moved to main chain. Only then is state-full validation performed.

We can now be sure that all blocks in the orphan pool was checked and it correct.

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Feature refactor (No new feature or functional changes, but performance or technical debt improvements)
  • New Tests
  • Documentation

Checklist:

  • I'm merging against the development branch.
  • I ran cargo-fmt --all before pushing.
  • I have squashed my commits into a single commit.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@SWvheerden
Copy link
Collaborator Author

This is blocked by : #1861

@SWvheerden SWvheerden marked this pull request as draft May 15, 2020 13:38
@SWvheerden SWvheerden marked this pull request as ready for review May 15, 2020 13:39
neonknight64
neonknight64 previously approved these changes May 18, 2020
Copy link
Contributor

@neonknight64 neonknight64 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@neonknight64 neonknight64 left a comment

Choose a reason for hiding this comment

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

LGTM

@CjS77 CjS77 merged commit 2cee086 into development May 22, 2020
@sdbondi sdbondi deleted the sw_refactor_validators branch May 22, 2020 11:46
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.

3 participants