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

Add VRF proof and output in proposal block #7

Closed
torao opened this issue Dec 13, 2019 · 3 comments · Fixed by #45
Closed

Add VRF proof and output in proposal block #7

torao opened this issue Dec 13, 2019 · 3 comments · Fixed by #45
Assignees
Labels
C: enhancement Classification: New feature or its request, or improvement in maintainability of code

Comments

@torao
Copy link
Contributor

torao commented Dec 13, 2019

The proposer needs to add its VRF proof and output (hash) to designate the proposer of the next round. In this issue, the current proposer will be modified to embed the VRF proof and output when a new proposal block is generated.

@torao torao added the C: enhancement Classification: New feature or its request, or improvement in maintainability of code label Dec 13, 2019
@torao torao added this to the Evolve Leader Election into VRF milestone Dec 13, 2019
@torao torao self-assigned this Dec 13, 2019
@torao
Copy link
Contributor Author

torao commented Dec 13, 2019

Investigation to identify the location of the modification

  • At the deepest level, a new proposal block is generated with types.MakeBlock() in test_util.go.
    • called by state.MakeBlock() in state/state.go.
      • called by state.CreateProposerBlock() in state/execution.go.
        • called by consensus.createProposerBlock() in consensus/state.go.
          • called by consensus.defaultDecideProposer() in consensus/state.go.
            • used by NewConsensusState() as function pointer in generating new consensus state.
  • Since the block header contains the hash value of the previous block and the proposer address, both VRF proof and output should also be added at this position.
  • It seems to be better to pass the VRF proof along with the proposer address. The location is createProposalBlock() of consensus/state.go that obtains the proposer address.

@egonspace
Copy link
Contributor

Should we write both of proof and output hash in a block although we can calculate output hash with proof?

@zemyblue zemyblue assigned egonspace and unassigned torao Mar 23, 2020
@zemyblue
Copy link
Member

Should we write both of proof and output hash in a block although we can calculate output hash with proof?

As discussed offline, I also think hash doesn't need to be added in block, if it can be extract from proof.

egonspace pushed a commit that referenced this issue Nov 24, 2020
Closes #4837

- `/block_results`

  before:

  failed to update light client to 7: failed to obtain the header #7: signed header not found

  after:

  We can't return the latest block results because we won't be able to
  prove them. Return the results for the previous block instead.

- /block_results?height=X`

  no changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: enhancement Classification: New feature or its request, or improvement in maintainability of code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants