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
VDF clean ups #770
VDF clean ups #770
Conversation
jonas-lj
commented
Apr 23, 2024
•
edited
edited
- Derive Serialize/Deserilialize automatically and use bcs for all serialization and deserialization.
- Simplify: Get rid of unnecessary abstractions.
- Add more tests and update existing tests.
- Refactoring: Move unit tests to modules.
- Update benchmarks and cli.
c788ab8
to
4b03382
Compare
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.
Please have a final check for any padding issues where size of vectors (length) can panic or similar issues. All public functions used by the blockchain should not trust user input and should never panic.
#[test] | ||
fn test_discriminant_from_seed() { | ||
let seed = [1, 2, 3]; | ||
let target_size = 512; |
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.
shall we do at least 1024?
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.
Also with the new paper we could theoretically support 2K+ sizes, shall we do or not? Do we actually have a default strong one, generated with some nothing up my sleeve properties?
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 does support larger discriminants, but it takes a long time. I'll update the test to generate a 1024 bit discriminant instead (takes ~9 seconds) and compare it to a test vector from chiavdf.
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.
Re a larger discriminant, generating a strong "nothing-up-my-sleeve" is straight-forward to do. 1) We demonstrate that the implementation follows chiavdf for 1024 bits, 2) decide on some future information, say a bitcoin block hash or similar, 3) generate a 3072 bit discriminant with that seed and use that as a fixed discriminant..
@@ -54,3 +54,34 @@ impl QuadraticForm { | |||
} | |||
} | |||
} | |||
|
|||
#[cfg(test)] |
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.
after this is merged I'd expect some fuzzy test coverage here (even via LLM aid)
7689c88
to
28bd286
Compare
550a606
to
0ceb924
Compare