-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Add EIP: Forward compatible consensus data structures #8439
Conversation
✅ All reviewers have approved. |
0876895
to
f33acc9
Compare
The commit f33acc9 (as a parent of 115a964) contains errors. |
EIPS/eip-####.md
Outdated
@@ -0,0 +1,291 @@ | |||
--- |
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.
--- | |
--- | |
eip: 7688 |
Assigning next sequential EIP/ERC/RIP number.
Please also update the filename.
EIPS/eip-####.md
Outdated
title: Forward compatible consensus data structures | ||
description: Transition consensus SSZ data structures to StableContainer | ||
author: Etan Kissling (@etan-status) | ||
discussions-to: https://ethereum-magicians.org/t/eip-forward-compatible-consensus-data-structures/19673 |
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.
discussions-to: https://ethereum-magicians.org/t/eip-forward-compatible-consensus-data-structures/19673 | |
discussions-to: https://ethereum-magicians.org/t/eip-7688-forward-compatible-consensus-data-structures/19673 |
f33acc9
to
32b0a49
Compare
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.
These aren't really that important of changes, they just fit the style better. Looks great otherwise.
Co-authored-by: Nikki Gaudreau <[email protected]>
Co-authored-by: Nikki Gaudreau <[email protected]>
EIPS/eip-7688.md
Outdated
For each converted data structure, a new `StableContainer` type `S` is introduced that serves as the primary definition of each data structure. | ||
|
||
- Each `StableContainer` is assigned a capacity to represent its potential design space that SHALL NOT change across future forks; if it is later determined that it is insufficient, a new field can be added to contain additional fields in a sub-container. | ||
- The historical forks are examined and fields that have not been present in all forks are marked as `Optional` in the new `StableContainer` type. |
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.
I think this might be a little confusing (and not particularly useful) considering we don't have backwards compatibility to forks before the conversion. IMO its just easier to make all fields non-optional when considering historical forks (before conversion).
- To guarantee forward and backward compatibility, new fields from future forks MUST be appended to the end of the `StableContainer` definition. Existing fields MAY be converted to `Optional`. | ||
|
||
Furthermore, a `Variant` type is defined that is specific to the fork at which the conversion is applied. This `Variant` is the equivalent of the legacy `Container` type, except that it inherits from `Variant[S]`. The SSZ serialization of `Variant` is compatible with `Container`, but the merkleization and `hash_tree_root` are computed differently. Furthermore, `Variant` MAY use fields of `Optional` type if necessary. | ||
|
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.
You might mention that a new Variant will be defined for every additional fork as needed, as fields are added or removed.
EIPS/eip-7688.md
Outdated
|
||
Furthermore, a `Variant` type is defined that is specific to the fork at which the conversion is applied. This `Variant` is the equivalent of the legacy `Container` type, except that it inherits from `Variant[S]`. The SSZ serialization of `Variant` is compatible with `Container`, but the merkleization and `hash_tree_root` are computed differently. Furthermore, `Variant` MAY use fields of `Optional` type if necessary. | ||
|
||
libp2p topics still exchange fork specific `Variant` definitions using the same serialization as the legacy `Container` type. Only merkleization and `hash_tree_root` are computed differently. |
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 just libp2p, but all processing will be done with Variants, right? For spec purposes, just for better type safety.
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 great, lemme know once suggestions by @wemeetagain are incorporated, will approve the draft
Co-authored-by: Cayman <[email protected]>
Co-authored-by: Cayman <[email protected]>
Co-authored-by: Cayman <[email protected]>
Co-authored-by: Cayman <[email protected]>
Co-authored-by: g11tech <[email protected]>
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.
lgtm
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.
All Reviewers Have Approved; Performing Automatic Merge...
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.
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.
No description provided.