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

Update block validations #711

Merged
merged 23 commits into from
Sep 23, 2020
Merged

Update block validations #711

merged 23 commits into from
Sep 23, 2020

Conversation

austinabell
Copy link
Contributor

@austinabell austinabell commented Sep 22, 2020

Summary of changes
Changes introduced in this pull request:

  • Updated and implemented all block validations with all non-trivial checks done async
  • Moved ElectionProof to blocks crate as logic was not tied to crypto functions and want to keep crypto crate as small as possible
    • Also implementing computing win count, which is the inverse of logic done in reward actor (but with different precision and other slight differences which is why it may seem like some duplication with the params, also to avoid circular dep)
  • Makes ticket optional in block header
    • This was always a pointer in go impl, so not sure if they did to heap allocate or if we just haven't hit the case where their is nil yet

What left unfinished (I will create issues for):

  • Updating verify_winning_post_proof: there is conflicts with miner actor PR, and the changes should be focused on in their own changes as it's very specific integration with proofs
  • Allowing for insecure post validation (optional, but will most likely be helpful when debugging)

Reference issue to close (if applicable)

Closes #78

Other information and links

@ec2
Copy link
Member

ec2 commented Sep 23, 2020

I noticed in Lotus that the whether the block has been validated or not only effects whether the signature of the block is checked again or not. It looks like everything else gets checked again. Any thoughts on if this is desired?

@austinabell
Copy link
Contributor Author

I noticed in Lotus that the whether the block has been validated or not only effects whether the signature of the block is checked again or not. It looks like everything else gets checked again. Any thoughts on if this is desired?

You're mixing up the block header signature verification cache with the block validation. We don't cache the validated status of the signature check, but that's why the TODO is there, just isn't much of a need now.

@austinabell austinabell merged commit dae9342 into main Sep 23, 2020
@austinabell austinabell deleted the austin/block/val branch September 23, 2020 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Block Validation Check Methods
3 participants