-
Notifications
You must be signed in to change notification settings - Fork 12
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
SEP: Split epoch id into fields and support independent key input #239
Open
ulope
wants to merge
1
commit into
main
Choose a base branch
from
sep/001
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
docs/SEP/sep-001-split-epoch-id-into-fields-and-support-independent-key-input.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Shutter Enhancement Proposal: Split epoch id into fields and support independent key input | ||
|
||
## Current state | ||
|
||
Currently, the epoch id is a single field of size uint64 consisting of: | ||
- 4 bytes (uint32): activation block number | ||
- 4 bytes (uint32): epoch sequence number | ||
|
||
This value is used both as an identifier as well as the input to generate the epoch keys. | ||
|
||
## Proposal | ||
|
||
- Split activation block and sequence id into separate fields. | ||
- Add a key source field (name TBD) | ||
|
||
The collator needs to ensure that the key source field never accepts duplicate values. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should write something about message validity and/or slashing conditions for rolling shutter. I.e., messages are only valid if the epoch id is correctly derived from sequence number and activation block number. Collators can be slashed if they don't match. |
||
|
||
## Rationale | ||
|
||
During implementation of the Snapshot integration it became apparent that we need to support much larger ids (256 bit). | ||
The current scheme of merging block and sequence number into a single field make it cumbersome to work with and also will not easily scale to large id values. | ||
|
||
The current epoch id also is used as the key input as is. | ||
This will not work with the snapshot use case since they don't know about activation block numbers and only use their id as the key input. | ||
Therefore it is necessary to provide a separate field that will be used as the key input. | ||
In traditional rolling shutter it will simply contain the same value as the current epoch id. | ||
For snapshot it will only consist of the provided external id. | ||
|
||
|
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.
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 suggest to stick with calling it
epoch id
ordecryption key id
.What size should it be?
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.
Jannik and I discussed this in person and for now settled on
encryption key id
.For the protobuf messages it doesn't matter since
bytes
fields aren't size limited.But since we need to store this in the DB as well 32 Byte should be good for now (basically so it fits any 265 Bit hash).
This needs confirmation with Snapshot since they also have legacy Ids that are IPFS content ids (which don't have a specific fixed length).