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

refactor(verification): remove BlockVerifier inheritance [part 4/9] #833

Merged

Conversation

glevco
Copy link
Contributor

@glevco glevco commented Oct 27, 2023

Depends on #832

Motivation

Simplify block verification by removing the BlockVerifier inheritance from MergeMinedBlockVerifier, as it was not necessary.

To do that, the main verification "entrypoints" (verify_basic(), verify(), and verify_without_storage()) are moved to the VerificationService, making it a single source of verification definition for all vertex types (the same will be done for other types in the next PRs).

This also guarantees that it's not possible to call BlockVerifier.verify() with a MergeMinedBlock, for example, which would be wrong. By using the single implementation from the VerificationService, we make sure the most specific verifier is called.

Acceptance Criteria

  • Move verify_basic(), verify(), and verify_without_storage() from BlockVerifier to VerificationService.
  • Move verify_without_storage() from MergeMinedBlockVerifier to VerificationService, removing its BlockVerifier inheritance, which is not needed anymore.
  • Update usages accordingly.
  • No behavior should be changed by this PR.

Checklist

  • If you are requesting a merge into master, confirm this code is production-ready and can be included in future releases as soon as it gets merged

@glevco glevco self-assigned this Oct 27, 2023
@glevco glevco changed the title refactor(verification): remove BlockVerifier inheritance refactor(verification): remove BlockVerifier inheritance [part 4/9] Oct 27, 2023
@codecov
Copy link

codecov bot commented Oct 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (965fba3) 85.24% compared to head (2d102bb) 85.28%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #833      +/-   ##
==========================================
+ Coverage   85.24%   85.28%   +0.03%     
==========================================
  Files         281      281              
  Lines       22390    22392       +2     
  Branches     3391     3391              
==========================================
+ Hits        19086    19096      +10     
+ Misses       2615     2610       -5     
+ Partials      689      686       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@glevco glevco force-pushed the refactor/verification-inheritance/3-verify-minted-tokens branch 4 times, most recently from 11a0131 to 6309230 Compare November 10, 2023 16:31
@glevco glevco force-pushed the refactor/verification-inheritance/4-remove-block-inheritance branch from afef179 to f7652cb Compare November 10, 2023 16:32
@glevco glevco force-pushed the refactor/verification-inheritance/3-verify-minted-tokens branch from 6309230 to 68a887d Compare November 10, 2023 17:02
@glevco glevco force-pushed the refactor/verification-inheritance/4-remove-block-inheritance branch from f7652cb to 0242b97 Compare November 10, 2023 17:04
@glevco glevco marked this pull request as ready for review November 10, 2023 19:58
@glevco glevco force-pushed the refactor/verification-inheritance/3-verify-minted-tokens branch from 68a887d to 4a9bd3e Compare November 16, 2023 17:03
@glevco glevco force-pushed the refactor/verification-inheritance/4-remove-block-inheritance branch from 0242b97 to a9205ca Compare November 16, 2023 17:04
@glevco glevco force-pushed the refactor/verification-inheritance/3-verify-minted-tokens branch from 4a9bd3e to a4bbe0f Compare November 16, 2023 20:05
@glevco glevco force-pushed the refactor/verification-inheritance/4-remove-block-inheritance branch from a9205ca to 7be536d Compare November 16, 2023 20:05
@glevco glevco force-pushed the refactor/verification-inheritance/3-verify-minted-tokens branch from a4bbe0f to 05498fa Compare November 16, 2023 21:24
@glevco glevco force-pushed the refactor/verification-inheritance/4-remove-block-inheritance branch from 7be536d to 7fbb16a Compare November 16, 2023 21:24
msbrogli
msbrogli previously approved these changes Nov 23, 2023
jansegre
jansegre previously approved these changes Nov 23, 2023
@glevco glevco force-pushed the refactor/verification-inheritance/3-verify-minted-tokens branch from 05498fa to 905d6bc Compare November 23, 2023 20:14
@glevco glevco force-pushed the refactor/verification-inheritance/4-remove-block-inheritance branch from 7fbb16a to 34467ed Compare November 23, 2023 20:14
Base automatically changed from refactor/verification-inheritance/3-verify-minted-tokens to master November 23, 2023 21:02
@glevco glevco dismissed stale reviews from jansegre and msbrogli November 23, 2023 21:02

The base branch was changed.

@glevco glevco force-pushed the refactor/verification-inheritance/4-remove-block-inheritance branch from 34467ed to 7df606c Compare November 23, 2023 21:03
@glevco glevco force-pushed the refactor/verification-inheritance/4-remove-block-inheritance branch from 7df606c to 64c94b8 Compare November 24, 2023 15:23
@glevco glevco force-pushed the refactor/verification-inheritance/4-remove-block-inheritance branch from 64c94b8 to 2d102bb Compare November 24, 2023 16:06
@glevco glevco merged commit cffe172 into master Nov 24, 2023
9 checks passed
@glevco glevco deleted the refactor/verification-inheritance/4-remove-block-inheritance branch November 24, 2023 17:12
@jansegre jansegre mentioned this pull request Dec 11, 2023
2 tasks
This was referenced Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants