ChorusOne / solido

Lido for Solana is a Lido-DAO governed liquid staking protocol for the Solana blockchain.
https://chorusone.github.io/solido/
GNU General Public License v3.0
101 stars 43 forks source link

Fuzz APY daemon http handler #553

Closed ruuda closed 2 years ago

ruuda commented 2 years ago

This adds a fuzzer to fuzz the http handler, as it will be exposed to the public internet, and we don’t want bad inputs to be able to crash the application.

The fuzzer generates instances of Action, which can be one of two cases:

This ensures that we can also test tricky cases that might only be reachable when the database is in a certain state.

Closes #529

ruuda commented 2 years ago

I’m running this as we speak, and it does manage to discover the important functions such as get_interval_price_request. I’ll keep it running for a few days.

The fuzz target is quite slow, I get about 200 runs/sec per core in debug mode with address sanitizer, 1500 execs/sec per core in release mode with no sanitizer but debug assertions enabled ... I suspect it’s because of the SQLite interactions, but I’m not sure. Either way it’s not the end of the world, we’ll just run it for a few days longer.