Closed
Conversation
…nd aggregate functionalities
Member
|
wemeetagain
pushed a commit
to ChainSafe/lodestar-z
that referenced
this pull request
Mar 30, 2026
This is moved from [this PR](ChainSafe/blst-z#59). to run the fuzzing: (If you are on Linux) e.g., 1. `sudo apt install afl++` 2. cd `test/fuzz` 3. `zig build run-bls_public_key` (If you are using MacOs) 1. `brew install afl++` 2. cd `test/fuzz` 3. follow the instruction in this [session](https://github.com/jeffoodchain/lodestar-z/blob/jeff/fuzz-test/test/fuzz/README.md#on-macos). 4. run `zig build run-bls_public_key` you could see the following dashboard running in your terminal ```bash AFL ++4.09c {default} (...64d672b6e452d6305a3425b7e2487cb/public_key) [fast] ┌─ process timing ────────────────────────────────────┬─ overall results ────┐ │ run time : 0 days, 0 hrs, 0 min, 8 sec │ cycles done : 20 │ │ last new find : 0 days, 0 hrs, 0 min, 8 sec │ corpus count : 14 │ │last saved crash : none seen yet │saved crashes : 0 │ │ last saved hang : none seen yet │ saved hangs : 0 │ ├─ cycle progress ─────────────────────┬─ map coverage┴──────────────────────┤ │ now processing : 2.197 (14.3%) │ map density : 0.17% / 0.48% │ │ runs timed out : 0 (0.00%) │ count coverage : 2.89 bits/tuple │ ├─ stage progress ─────────────────────┼─ findings in depth ─────────────────┤ │ now trying : splice 10 │ favored items : 10 (71.43%) │ │ stage execs : 85/86 (98.84%) │ new edges on : 10 (71.43%) │ │ total execs : 424k │ total crashes : 0 (0 saved) │ │ exec speed : 52.7k/sec │ total tmouts : 0 (0 saved) │ ├─ fuzzing strategy yields ────────────┴─────────────┬─ item geometry ───────┤ │ bit flips : disabled (default, enable with -D) │ levels : 2 │ │ byte flips : disabled (default, enable with -D) │ pending : 0 │ │ arithmetics : disabled (default, enable with -D) │ pend fav : 0 │ │ known ints : disabled (default, enable with -D) │ own finds : 7 │ │ dictionary : n/a │ imported : 0 │ │havoc/splice : 7/180k, 0/244k │ stability : 100.00% │ │py/custom/rq : unused, unused, unused, unused ├───────────────────────┘ │ trim/eff : 5.20%/170, disabled │ [cpu000: 31%] └─ strategy: explore ────────── state: started :-) ──┘ ``` --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously I was using the native fuzzing in zig. However, after discussing with @GrapeBaBa, I think the native zig fuzzing in 0.14.1 is not mature enough for our testing purpose. Therefore, I switched the method to what has done in
sszfuzzing in lodestar-z.Currently the first initial corpus is generated from the spec tests through this file.
And currently this only supports on Linux machine.
to run the fuzzing:
e.g.,
sudo apt install afl++test/fuzzzig build fuzz-public_keyAFL ++4.09c {default} (...64d672b6e452d6305a3425b7e2487cb/public_key) [fast] ┌─ process timing ────────────────────────────────────┬─ overall results ────┐ │ run time : 0 days, 0 hrs, 0 min, 8 sec │ cycles done : 20 │ │ last new find : 0 days, 0 hrs, 0 min, 8 sec │ corpus count : 14 │ │last saved crash : none seen yet │saved crashes : 0 │ │ last saved hang : none seen yet │ saved hangs : 0 │ ├─ cycle progress ─────────────────────┬─ map coverage┴──────────────────────┤ │ now processing : 2.197 (14.3%) │ map density : 0.17% / 0.48% │ │ runs timed out : 0 (0.00%) │ count coverage : 2.89 bits/tuple │ ├─ stage progress ─────────────────────┼─ findings in depth ─────────────────┤ │ now trying : splice 10 │ favored items : 10 (71.43%) │ │ stage execs : 85/86 (98.84%) │ new edges on : 10 (71.43%) │ │ total execs : 424k │ total crashes : 0 (0 saved) │ │ exec speed : 52.7k/sec │ total tmouts : 0 (0 saved) │ ├─ fuzzing strategy yields ────────────┴─────────────┬─ item geometry ───────┤ │ bit flips : disabled (default, enable with -D) │ levels : 2 │ │ byte flips : disabled (default, enable with -D) │ pending : 0 │ │ arithmetics : disabled (default, enable with -D) │ pend fav : 0 │ │ known ints : disabled (default, enable with -D) │ own finds : 7 │ │ dictionary : n/a │ imported : 0 │ │havoc/splice : 7/180k, 0/244k │ stability : 100.00% │ │py/custom/rq : unused, unused, unused, unused ├───────────────────────┘ │ trim/eff : 5.20%/170, disabled │ [cpu000: 31%] └─ strategy: explore ────────── state: started :-) ──┘