Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Rework ProposalSignedData to Proposal and signature refactoring #355

Merged
merged 4 commits into from
Mar 8, 2019

Conversation

hwwhww
Copy link
Contributor

@hwwhww hwwhww commented Mar 2, 2019

What was wrong?

#343 task 2: rework ProposalSignedData to Proposal
Spec PR: ethereum/consensus-specs#633

How was it fixed?

  1. Rename ProposalSignedData to Proposal
  2. Move ProposerSlashing.proposal_signature_1 and ProposerSlashing.proposal_signature_2 into per Proposal's signature
  3. Note that we don't have SSZ signed_root currently, I add an property Proposal. signed_root as the replacement interface.

Cute Animal Picture

hedgehog-child-1759505_640

Copy link
Member

@ralexstokes ralexstokes left a comment

Choose a reason for hiding this comment

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

looks great! one minor change so that the validation error message is correct. (implicit here is that we will want to get rid of any hash and root properties once we move to the full SSZ but i believe there is already an issue to track this.... and all the TODOs we have been sprinkling across the code)

SignatureDomain.DOMAIN_PROPOSAL,
)
)
if not proposal_signature_is_valid:
raise ValidationError(
"Proposal signature is invalid: "
f"proposer pubkey: {pubkey}, message_hash: {proposal_signed_data.root}, "
f"signature: {proposal_signature}"
f"proposer pubkey: {pubkey}, message_hash: {proposal.root}, "
Copy link
Member

Choose a reason for hiding this comment

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

s/proposal.root/proposal.signed_root/ correct?

@ralexstokes ralexstokes merged commit 78a0278 into ethereum:master Mar 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants