-
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
Rust HeaderBlock #17694
Merged
Merged
Rust HeaderBlock #17694
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
Mar 12, 2024
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
Mar 14, 2024
arvidn
force-pushed
the
rust-header-block
branch
from
March 15, 2024 17:20
449785f
to
9e3b3ec
Compare
github-actions
bot
removed
the
merge_conflict
Branch has conflicts that prevent merge to main
label
Mar 15, 2024
This comment was marked as outdated.
This comment was marked as outdated.
arvidn
force-pushed
the
rust-header-block
branch
from
March 16, 2024 08:31
9e3b3ec
to
396f84b
Compare
AmineKhaldi
previously approved these changes
Mar 18, 2024
altendky
reviewed
Mar 18, 2024
github-actions
bot
added
merge_conflict
Branch has conflicts that prevent merge to main
labels
Mar 18, 2024
This comment was marked as outdated.
This comment was marked as outdated.
1 similar comment
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
arvidn
force-pushed
the
rust-header-block
branch
from
March 18, 2024 18:38
396f84b
to
254faed
Compare
github-actions
bot
removed
the
merge_conflict
Branch has conflicts that prevent merge to main
label
Mar 18, 2024
This comment was marked as outdated.
This comment was marked as outdated.
altendky
approved these changes
Mar 18, 2024
AmineKhaldi
approved these changes
Mar 19, 2024
emlowe
approved these changes
Mar 19, 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:
Transition
HeaderBlock
to use the rust implementation. The rationale is to speed up serialization and deserialization and preparing for validation logic to move to rust and threads (rather than processes).The rust implementation and type definition can be found here:
https://github.com/Chia-Network/chia_rs/blob/main/crates/chia-protocol/src/header_block.rs
The
batch_pre_validate_blocks()
function is run in aProcessPoolExecutor
, i.e. in separate python processes. In order to support passing data across the process boundary, we need to serialize (and pickle) the arguments, and the return value.We invoke the
ProcessPoolExecutor
job here: https://github.com/Chia-Network/chia-blockchain/blob/main/chia/consensus/multiprocess_validation.py#L347We serialize the
FullBlock
objects a few lines up: https://github.com/Chia-Network/chia-blockchain/blob/main/chia/consensus/multiprocess_validation.py#L332Since we already have valid
FullBlock
objects (i.e. the public keys and signatures are known to be on the curve, and the CLVM generator is know to have valid serialization), we don't need to validate that again in the worker process.Current Behavior:
HeaderBlock
is a python type.New Behavior:
HeaderBlock
is a rust type.