-
Notifications
You must be signed in to change notification settings - Fork 990
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
[DNM] kernel data file download #2743
Conversation
Just making @DavidBurkett aware of this. |
Yep, following closely. I actually still have the code to download kernels in parallel from different peers, if anyone wants to go that route. If we're looking to go with a bittorrent-like download though, then there would be no point. |
0 = fixed size 1 = variable size (proposed)
@antiochp please make sure the new protocol messages get documented in https://github.com/mimblewimble/docs/wiki/P2P-Protocol once this PR is merged. |
/// Note: Both versions will produce identical hash values (and corresponding MMR root). | ||
/// Only the "data" serialization differs. | ||
/// | ||
pub version: u8, |
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.
Not sure this will be very useful. If the peer that requested the kernel data can't support v1, then it shouldn't ever receive v1 kernel data. It should be up to the requester to ask which version it needs.
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.
Also, if we implement the protocol versioning scheme I suggested here: mimblewimble/grin-pm#102 (comment) , we won't even need a version byte at all.
verify all kernel signatures verify kernel MMR root for each header
Went down the slippery slope of integrating part of this with the txhashset validation logic and it got out of hand (500 lines of code changed). |
Split out the initial piece of work (the kernel download request/response msg) in to #2765. |
Closing for now. Will revisit again at some point. |
Adds support for "kernel file download" via a new protocol msg pair (
KernelDataRequest
andKernelDataResponse
).Still very much WIP but given we are planning to support "variable length" kernel MMR and we need some way of supporting this in a backward compatible way it may end up being convenient to split out the kernel sync from the output/rangeproof txhashset state sync at the same time.
The kernel MMR consists of the following file -
Note the
hash
file and thesize
file can be (re)built locally from the underlyingdata
file.So for a full kernel sync we only need to send the
data
file across.Can test this via API endpoint -
This PR introduces the following -
KernelDataResponse
msg type with a single "kernel data file" as attachmentKernelDataResponse
TODO -
KernelDataResponse
writing the attachment to a temp file on receiving end