stellar / rs-soroban-sdk

Rust SDK for Soroban contracts.
Apache License 2.0
128 stars 67 forks source link

Automatic fuzzing based on XDR specs #1104

Open brson opened 1 year ago

brson commented 1 year ago

What problem does your feature solve?

Soroban contracts provide metadata to introspect contracts, enough to automatically generate randomized calls to the methods of a contract.

I have been suggested that it would be useful to use the XDR to generate a fuzzer automatically.

It's not clear exactly how useful this might be because writing a fuzzer tends to require understanding of what the program does, but it could e.g. detect reachable panics that don't call panic_with_error.

What would you like to see?

Not sure yet.

What alternatives are there?

This is similar to https://github.com/stellar/rs-soroban-sdk/issues/414

leighmcculloch commented 1 year ago

This is really intriguing idea. Could this be a fuzzer in the sense that we could do branch detection, or would this be more like property testing where the contract interface would be used to figure out what are valid inputs to generate for the tests?

This sounds useful even if we can't do branch detection of the wasm, so my question isn't intended to vote one way or the other, just understanding what the scope is.