-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Refactor signature handling #633
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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
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
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.
Why do we even need to do this? Why not be more radical and just remove the Proposal class entirely and directly sign the block? Or is that to reduce the number of slashing conditions down the line when we have shard blocks?
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 do like the idea of having two separate slashing conditions for two reasons:
Proposal
andBEACON_CHAIN_SHARD_NUMBER
)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.
It's not completely trivial if we remove
Proposal
. The reason is that for the proposer slashing you would need a Merkle path to the block root to prove the slot number.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.
Wait, why? Why not just have a
ProposerSlashing
object that contains two block headers? Sure it's maybe a hundred bytes longer, but that's nothing compared to attester slashings in any case...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.
We could replace
Proposal
with aBeaconBlockHeader
object but would that be more verbose (Proposal
only have 4 fields,BeaconBlockHeader
would have 7) and slightly less efficient?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.
Aah I see,
BeaconBlock
objects themselves are too big, and we technically don't have aBeaconBlockHeader
(well, from any block you can create a block header with an equivalent SSZ root by replacing the body with a hash of the body, but if we're going to take advantage of this fact in the spec it would be good to document it well...I see a few possibilities:
BeaconBlock
object so it has an explicit header that containshash(body)
and a separate bodyBeaconBlockHeader
as a header that can be derived from anyBeaconBlock
Note that in terms of hashes and bytes, (1) and (2) are exactly equivalent; object1 containing the SSZ root of object2 with object2 living "somewhere else", and obect1 literally containing object2 in its entirety, are in some sense exactly the same thing and will have exactly the same SSZ root. So it's a choice of presentation rather than content.
(3) would change things less relative to the status quo and it would not introduce this weirdness of the header being kinda part of and kinda separate from the rest of the block, though it would lead to a slightly longer spec. I guess my "don't change things at this stage of the game unless it's a really really good idea" bias does make me lean slightly toward (3)....
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.
Ok, I'll keep as is and mull over it a bit.
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.
Can you approve the PR?