ledgerwatch / erigon

Ethereum implementation on the efficiency frontier
GNU Lesser General Public License v3.0
3.03k stars 1.06k forks source link

Implement continuous-fuzzing #7119

Open AskAlexSharov opened 1 year ago

AskAlexSharov commented 1 year ago

Long time ago we added native golang fuzz tests to txpool and other places. But I didn't automate such tests (I didn't know how and Go's fuzzing was not enough mature). Seems now I understood how we can do continuous-fuzzing in Go (fuzz every night a bit, but keep progress between runs).

Go does store progress in folder: $GOCACHE/fuzz we need keep this folder - between test runs (on CI) - as file-cache. And seems we already doing it in .github/workflows/ci.yml: ~/go/pkg/mod it's actually $GOCACHE

So, seems we can create new github actions workflow - run it every night - and fuzz by something like: go test -fuzztime=1m -fuzz=FuzzOnNewBlocks ./txpool

And maybe even commit $GOCACHE/fuzz to some git repo (as a backup): it's human-readable text files

Also if fuzzing found some crush it adding new file (with crush case) to Erigon's source code: for example "erigon-lib/txpool/testdata/fuzz/FuzzOnNewBlocks/". And we need commit/push this new files - then Go will run such cases as usual unit-test (by go test).

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 40 days with no activity. Remove stale label or comment, or this will be closed in 7 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for 7 days with no activity.