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

Variable Size Kernels #21

Merged
merged 13 commits into from
Sep 11, 2019
Merged

Conversation

antiochp
Copy link
Member

@antiochp antiochp commented Aug 15, 2019

Rendered link to RFC document
Tracking issue: mimblewimble/grin#3038

This is a pre-requisite for "relative kernels" as we need to be able to introduce new kernel feature variants, with additional associated data.

The proposal is to support kernels of variable size, with each kernel variant supporting additional data specific to the variant. Height locked kernels have an associated lock height for example.

@antiochp antiochp added the node dev Related to node dev team label Aug 15, 2019
@antiochp antiochp self-assigned this Aug 15, 2019
@tromp

This comment has been minimized.

@lehnberg

This comment has been minimized.

@antiochp

This comment has been minimized.

@antiochp antiochp marked this pull request as ready for review August 22, 2019 11:36
@antiochp

This comment has been minimized.

@antiochp antiochp changed the title [WIP] Variable Size Kernels Variable Size Kernels Aug 22, 2019
@lehnberg
Copy link
Contributor

In accordance with our RFC process, as of today this can be considered in Final Comment Period with a disposition of merge

@lehnberg
Copy link
Contributor

lehnberg commented Sep 9, 2019

The Final Comment Period is due to expire for this RFC tomorrow. The proposal will then be merged and considered accepted unless there is a strong case made against it.

@jaspervdm
Copy link
Contributor

This might be a stupid question, but do block headers commit to the full kernels that are contained in the block?

  • If yes: does this versioning affect this? I.e. if i convert the kernels inside a block from protocol v1 to v2, will it invalidate the PoW?
  • If no: what does it commit to, the excess only? Wouldn't that make kernels malleable to some extent? Maybe this is not a big deal because creating a kernel with the same public excess but different features requires knowledge of the excess, so only the original creators could do it.

@DavidBurkett
Copy link
Contributor

This might be a stupid question, but do block headers commit to the full kernels that are contained in the block?

  • If yes: does this versioning affect this? I.e. if i convert the kernels inside a block from protocol v1 to v2, will it invalidate the PoW?
  • If no: what does it commit to, the excess only? Wouldn't that make kernels malleable to some extent? Maybe this is not a big deal because creating a kernel with the same public excess but different features requires knowledge of the excess, so only the original creators could do it.

No, block headers just commit to the excess, MMR roots, and MMR sizes. Kernels aren't malleable because changing them would change the MMR root

@antiochp
Copy link
Member Author

antiochp commented Sep 9, 2019

do block headers commit to the full kernels that are contained in the block?

Headers commit to the kernel MMR root. Which in turn commits to the hashes (and positions) of all the kernels contained in the kernel MMR.

So headers don't commit to the full kernels contained in the block directly.
But they do commit to all kernel hashes in the kernel MMR in its entirety (which includes the kernels in the block in question).

tl;dr not the full kernels in the block, but the kernel hashes in all blocks

Kernel hashes currently are based on the full kernels (even for 0 fee on coinbase kernels etc). And we need to be careful to preserve this for historical data even when moving to future protocol versions.

Copy link
Member

@quentinlesceller quentinlesceller left a comment

Choose a reason for hiding this comment

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

👍. Minors formatting and typo comments.

text/0000-variable-size-kernels.md Outdated Show resolved Hide resolved
text/0000-variable-size-kernels.md Outdated Show resolved Hide resolved
text/0000-variable-size-kernels.md Outdated Show resolved Hide resolved
text/0000-variable-size-kernels.md Outdated Show resolved Hide resolved
text/0000-variable-size-kernels.md Outdated Show resolved Hide resolved
text/0000-variable-size-kernels.md Outdated Show resolved Hide resolved
Add tracking issue, PR, assign RFC number
Missed two tweaks in previous commit.
@lehnberg lehnberg merged commit a4aea53 into mimblewimble:master Sep 11, 2019
@lehnberg
Copy link
Contributor

🎉 Wohooo! This RFC has now been merged! 🤸‍♀️
Tracking issue: mimblewimble/grin#3038

@antiochp antiochp deleted the variable_size_kernels branch September 11, 2019 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
node dev Related to node dev team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants