-
Notifications
You must be signed in to change notification settings - Fork 2k
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
multiprocess_validation refactor #18541
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
arvidn
added
the
Changed
Required label for PR that categorizes merge commit message as "Changed" for changelog
label
Aug 30, 2024
arvidn
force-pushed
the
multiprocess-validation
branch
2 times, most recently
from
August 30, 2024 14:17
9bae17c
to
4a7b264
Compare
This comment was marked as outdated.
This comment was marked as outdated.
github-actions
bot
added
the
merge_conflict
Branch has conflicts that prevent merge to main
label
Sep 3, 2024
arvidn
force-pushed
the
multiprocess-validation
branch
from
September 4, 2024 07:02
4a7b264
to
76e5f77
Compare
This comment was marked as outdated.
This comment was marked as outdated.
github-actions
bot
removed
the
merge_conflict
Branch has conflicts that prevent merge to main
label
Sep 4, 2024
arvidn
force-pushed
the
multiprocess-validation
branch
from
September 4, 2024 09:05
76e5f77
to
9213746
Compare
This comment was marked as outdated.
This comment was marked as outdated.
github-actions
bot
added
the
merge_conflict
Branch has conflicts that prevent merge to main
label
Sep 6, 2024
arvidn
force-pushed
the
multiprocess-validation
branch
from
September 7, 2024 04:58
9213746
to
77a7eac
Compare
github-actions
bot
removed
the
merge_conflict
Branch has conflicts that prevent merge to main
label
Sep 7, 2024
This comment was marked as outdated.
This comment was marked as outdated.
Pull Request Test Coverage Report for Build 10748783848Details
💛 - Coveralls |
This comment was marked as outdated.
This comment was marked as outdated.
github-actions
bot
added
the
merge_conflict
Branch has conflicts that prevent merge to main
label
Sep 11, 2024
arvidn
force-pushed
the
multiprocess-validation
branch
from
September 12, 2024 05:39
77a7eac
to
bbafbf6
Compare
github-actions
bot
removed
the
merge_conflict
Branch has conflicts that prevent merge to main
label
Sep 12, 2024
This comment was marked as outdated.
This comment was marked as outdated.
arvidn
changed the title
slight multiprocess_validation refactor
multiprocess_validation refactor
Sep 12, 2024
arvidn
force-pushed
the
multiprocess-validation
branch
2 times, most recently
from
September 12, 2024 06:48
2285575
to
b20def2
Compare
…size is always 4, check_filter is always True. Remove the member function wrapper around it in Blockchain, to prepare for being able to pass wrapped blockchains into it
arvidn
force-pushed
the
multiprocess-validation
branch
from
September 12, 2024 07:23
b20def2
to
71ec126
Compare
AmineKhaldi
reviewed
Sep 17, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Added some suggestions to keep the calls consistent and Blockchain
oriented.
AmineKhaldi
approved these changes
Sep 17, 2024
emlowe
approved these changes
Sep 23, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Changed
Required label for PR that categorizes merge commit message as "Changed" for changelog
ready_to_merge
Submitter and reviewers think this is ready
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose:
This patch removes the thin wrapper
pre_validate_blocks_multiprocess()
method from theBlockchain
class.Specifically, this part of the patch: https://github.com/Chia-Network/chia-blockchain/pull/18541/files#diff-40409ea13958d9e8cec2be388c12e68da7c3179de55f01879713c5abdb1fed38L799-L825
The purpose of this wrapper is to pass the constants, self (as the
BlocksProtocol
) and ProcessPoolExecutor (also a member ofBlockchain
) into the underlying call to the free functionpre_validate_blocks_multiprocessing()
.The reason to remove it is to prepare call sites for passing in other classes implementing the
BlocksProtocol
, such asAugmentedBlockchain
, to support pipelining block validation during long sync.The underlying free function takes more parameters, specifically,
ConsensusConstants
,BlocksProtocol
andProcessPoolExecutor
. To reduce the impact of these additional parameters, two other parameters are removed;check_filter
andbatch_size
. In all calls these are always set toTrue
and4
, respectively. In fact, thebatch_size
can probably be removed (along with the batching itself) once validation is run in threads.Current Behavior:
Many calls to
pre_validate_blocks_multiprocessing()
are made via the wrapper inBlockchain
, passing in the blockchain object itself.pre_validate_blocks_multiprocessing()
takes parameterscheck_filter
andbatch_size
.New Behavior:
All calls to
pre_validate_blocks_multiprocessing()
explicitly pass in the object implementing theBlocksProtocol
(e.g.Blockchain
).pre_validate_blocks_multiprocessing()
no longer takes parameterscheck_filter
andbatch_size
, but hard code those toTrue
and4
.