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

Fuzz utils #1444

Merged
merged 1 commit into from Aug 21, 2020
Merged

Fuzz utils #1444

merged 1 commit into from Aug 21, 2020

Conversation

gnattishness
Copy link
Contributor

@gnattishness gnattishness commented Mar 23, 2020

Fuzzing harnesses suitable for use with beacon_fuzz

PR Description

Implements harnesses that exercise relevant state transition functions.
They read SSZ-encoded bytes (generally a BeaconState + Operation, perform the operation, then output the resulting SSZ-encoded BeaconState).

Fixed Issue(s)

Java-side of the implementation that fixes sigp/beacon-fuzz#16

TODO

  • Full integration testing (when beacon-fuzz supports v0.10.1)
  • Ability to disable BLS signature verification (could be a separate PR)
  • Squash and neaten commits

@gnattishness
Copy link
Contributor Author

gnattishness commented Mar 23, 2020

Currently builds, but quite likely some runtime failures.

@gnattishness
Copy link
Contributor Author

gnattishness commented May 12, 2020

Ready for review.

@gnattishness
Copy link
Contributor Author

gnattishness commented Aug 16, 2020

Updated to incorporate updates to master.
Additional testing and equality methods added by @mbaxter Thanks!

If this all looks fine, I'll give it a final rebase and squash

@gnattishness
Copy link
Contributor Author

gnattishness commented Aug 20, 2020

Squished into a single reasonably pretty commit.
Please let me know if there's any better attribution I can do protect against erasing the history of other's contributions!

@mbaxter
Copy link
Contributor

mbaxter commented Aug 20, 2020

Squished into a single reasonably pretty commit.
Please let me know if there's any better attribution I can do protect against erasing the history of other's contributions!

Thanks @gnattishness - looks good! I'll try to do a final review today 🎉

Copy link
Contributor

@mbaxter mbaxter left a comment

Hey @gnattishness - this looks good to me! Just wondering if you can clean up some of the TODOs before we merge.

import tech.pegasys.teku.ssz.sos.ReflectionInformation;
import tech.pegasys.teku.util.config.Constants;

// TODO a Java FuzzHarness interface? - that way type safety can be checked at compile time
Copy link
Contributor

@mbaxter mbaxter Aug 20, 2020

Choose a reason for hiding this comment

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

Would you mind clearing out some of these TODO comments? We should either implement the TODO's now or cut them.

Copy link
Contributor Author

@gnattishness gnattishness Aug 21, 2020

Choose a reason for hiding this comment

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

Done! Sorry to leave them sitting around.

Copy link
Contributor

@mbaxter mbaxter Aug 21, 2020

Choose a reason for hiding this comment

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

np - thanks for the clean up!

Thanks @mbaxter and @cemozerr for their assistance and contributions.
(More detailed attribution below).

Creates a FuzzUtil package that exercises relevant state transition
operations, given XXXFuzzInput classes. A functional API that can
be targeted for fuzz-testing (including by beacon-fuzz differential
fuzzing framework).

Adds XXXFuzzInput classes that represent SSZ containers consistent with
other clients. For block processing operations, these are in the form of
Container + BeaconState.

Thanks @mbaxter for:
    - Moving the harnesses to a standalone package.
    - Fix up XXXFuzzInput de/serialization and equality methods.
    - Help with merge conflicts due to this long-lived PR!
    - Make unit tests using reference test input.
    - General assistance and advice!

Thanks @cemozerr for assistance with disabling BLS.
@mbaxter mbaxter changed the title WIP: Fuzz utils Fuzz utils Aug 21, 2020
@mbaxter mbaxter merged commit 1dc9801 into ConsenSys:master Aug 21, 2020
10 checks passed
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.

Add java client
2 participants