aptos-labs / aptos-core

Aptos is a layer 1 blockchain built to support the widespread use of blockchain through better technology and user experience.
https://aptosfoundation.org
Other
6.14k stars 3.62k forks source link

[Feature Request] Fuzz Testing #11660

Open 0xbe1 opened 8 months ago

0xbe1 commented 8 months ago

🚀 Feature Request

Add fuzz testing under aptos move

Motivation

Is your feature request related to a problem? Please describe.

DeFi protocols usually have many invariants hold, for example:

And it is a common practice to rely on fuzz testing to make sure the invariants always hold. More context can be found in this post. And Foundry offers fuzz testing feature that makes fuzz testing extremely simple.

Pitch

Describe the solution you'd like

Similar experience as in Foundry is preferred.

Describe alternatives you've considered

Are you willing to open a pull request? (See CONTRIBUTING)

I am not familiar with Aptos enough to do so.

Additional context

github-actions[bot] commented 7 months ago

This issue is stale because it has been open 45 days with no activity. Remove the stale label or comment - otherwise this will be closed in 15 days.

rahxephon89 commented 6 months ago

Hi @0xbe1, thanks for sharing the thoughts. Apart from fuzzing, have you tried the Move prover to specify and prove invariants? If you are interested in this direction, please let us know.

0xbe1 commented 6 months ago

Hi @0xbe1, thanks for sharing the thoughts. Apart from fuzzing, have you tried the Move prover to specify and prove invariants? If you are interested in this direction, please let us know.

Have chatted with greg: Prover is not feature complete enough afaik for example delegated_staking is not proved on its own. Therefore seems no easy to prove thala LSD given it builds on top of delegated_staking

Also, prover has its own syntax and stuff, while foundry fuzz testing allows devs to write vanilla unit tests that're 10x easier than prover