Skip to content

feat(bedrock): Add input fuzzer for MerkleTrie tests#3847

Closed
clabby wants to merge 2 commits intosc/ctb-mini-trie-refactorfrom
sc/ctb-mini-trie-refactor-fuzz
Closed

feat(bedrock): Add input fuzzer for MerkleTrie tests#3847
clabby wants to merge 2 commits intosc/ctb-mini-trie-refactorfrom
sc/ctb-mini-trie-refactor-fuzz

Conversation

@clabby
Copy link
Contributor

@clabby clabby commented Nov 2, 2022

Overview

Description

Adds an input fuzzer program for bedrock's MerkleTrie tests for use in #3771.

Checklist

  • Happy path mode
  • Modes for generating various error cases
  • Ensure that the patricia binary is built in the CI
  • Add information to the README.
  • Add build script for the binary in the package.json

Tests

Adds the testFuzzTrie_validProofs test.
todo- error case fuzzing

Additional context

n/a

Metadata
n/a

@changeset-bot
Copy link

changeset-bot bot commented Nov 2, 2022

⚠️ No Changeset found

Latest commit: 7fa60de

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@clabby clabby marked this pull request as draft November 2, 2022 06:30
@github-actions github-actions bot added 2-reviewers A-pkg-contracts-bedrock Area: packages/contracts-bedrock labels Nov 2, 2022
@clabby clabby force-pushed the sc/ctb-mini-trie-refactor-fuzz branch from b55c3e9 to 967fdff Compare November 2, 2022 07:16
Copy link
Contributor

@tynes tynes left a comment

Choose a reason for hiding this comment

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

Before we can merge this I think we will need to talk during office hours about introducing rust into the codebase. I do think for fuzzing its appropriate, we currently use JS for fuzzing and its really slow. The fuzzing exists in JS currently because we had implementations of primitives in JS but since then, I've implemented a lot of our primitives in go so i was thinking of porting the fuzzing to go.

If we have consensus on adding rust, to merge this we will need to add the rust toolchain to the ci-builder docker image that runs our tests as well as something to the package.json so that CI will run these tests. There is a build:differential command that would be appropriate to include building the fuzzer

@clabby
Copy link
Contributor Author

clabby commented Nov 3, 2022

Before we can merge this I think we will need to talk during office hours about introducing rust into the codebase. I do think for fuzzing its appropriate, we currently use JS for fuzzing and its really slow. The fuzzing exists in JS currently because we had implementations of primitives in JS but since then, I've implemented a lot of our primitives in go so i was thinking of porting the fuzzing to go.

If we have consensus on adding rust, to merge this we will need to add the rust toolchain to the ci-builder docker image that runs our tests as well as something to the package.json so that CI will run these tests. There is a build:differential command that would be appropriate to include building the fuzzer

Definitely- will bring this up during one of our meetings today. Just pushed a TS version of the fuzzer that I wrote yesterday between classes, it does introduce a significant slowdown:
Screen Shot 2022-11-02 at 4 40 39 PM

Spoke with Matt about this yesterday, adding the Rust toolchain into the CI builder may be more trouble than its worth, though. We could:

  • Pre-build a binary for the CI's arch so that it does not need to build on each run.
  • Add an ENV var that enables/disables these tests.

If that's not a route we want to take, making a Go impl might be a nice middle-ground.

@mslipper
Copy link
Contributor

Closing this in response to our discussion above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-pkg-contracts-bedrock Area: packages/contracts-bedrock

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants