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 header serialization #337

Merged
merged 5 commits into from
Apr 9, 2020
Merged

Conversation

austinabell
Copy link
Contributor

@austinabell austinabell commented Apr 9, 2020

Summary of changes
Changes introduced in this pull request:

  • Either some things have changed or there was some discrepancies in the port from go, They are using a pointer for signatures and the nil value gets serialized as null in Cbor, which is equivalent to Option or None in rust. They were checking the nil if bytes are empty, which doesn't translate to Rust or how we had our types setup
    • Also found a bug in the deserialization of Signature that I did a while ago, if bytes are empty it will panic on .remove(0) because that impl expects a valid serialization

Edit: Also updates EPoStProof serialization as discussed, and removed the tests that were statically setup for the old serialization

Edit2: Added test runner for block header serialization vectors, but the vectors were a little broken so I switched the submodule to be my fork for now

Reference issue to close (if applicable)

Closes

Other information and links

@@ -1,3 +1,3 @@
[submodule "tests/serialization-vectors"]
path = tests/serialization-vectors
url = https://github.com/filecoin-project/serialization-vectors
url = https://github.com/austinabell/serialization-vectors
Copy link
Contributor

Choose a reason for hiding this comment

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

Should prob move this under chainsafe

Copy link
Member

@ec2 ec2 left a comment

Choose a reason for hiding this comment

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

looks good other than dustins comment on putting the vectors under chainsafe

@austinabell austinabell merged commit 380dde3 into master Apr 9, 2020
@austinabell austinabell deleted the austin/fixheaderser branch April 9, 2020 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants