diff --git a/beacon-chain/blockchain/BUILD.bazel b/beacon-chain/blockchain/BUILD.bazel index c0a171d2b..dcc455e03 100644 --- a/beacon-chain/blockchain/BUILD.bazel +++ b/beacon-chain/blockchain/BUILD.bazel @@ -22,7 +22,7 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/beacon-chain/blockchain", visibility = [ "//beacon-chain:__subpackages__", - "//fuzz:__pkg__", + "//testing/fuzz:__pkg__", ], deps = [ "//beacon-chain/cache:go_default_library", diff --git a/beacon-chain/blockchain/testing/BUILD.bazel b/beacon-chain/blockchain/testing/BUILD.bazel index f7c45e7c2..3cb9e41d9 100644 --- a/beacon-chain/blockchain/testing/BUILD.bazel +++ b/beacon-chain/blockchain/testing/BUILD.bazel @@ -7,7 +7,7 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/beacon-chain/blockchain/testing", visibility = [ "//beacon-chain:__subpackages__", - "//fuzz:__pkg__", + "//testing/fuzz:__pkg__", ], deps = [ "//beacon-chain/core/epoch/precompute:go_default_library", diff --git a/beacon-chain/cache/BUILD.bazel b/beacon-chain/cache/BUILD.bazel index 4a514be91..db86a9f6c 100644 --- a/beacon-chain/cache/BUILD.bazel +++ b/beacon-chain/cache/BUILD.bazel @@ -17,7 +17,7 @@ go_library( "sync_committee_head_state.go", "sync_subnet_ids.go", ] + select({ - "//fuzz:fuzzing_enabled": [ + "//testing/fuzz:fuzzing_enabled": [ "active_balance_disabled.go", "committee_disabled.go", "proposer_indices_disabled.go", @@ -33,7 +33,7 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/beacon-chain/cache", visibility = [ "//beacon-chain:__subpackages__", - "//fuzz:__pkg__", + "//testing/fuzz:__pkg__", "//tools:__subpackages__", ], deps = [ diff --git a/beacon-chain/core/BUILD.bazel b/beacon-chain/core/BUILD.bazel index 7f08ec05f..84e56053c 100644 --- a/beacon-chain/core/BUILD.bazel +++ b/beacon-chain/core/BUILD.bazel @@ -6,7 +6,6 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/beacon-chain/core", visibility = [ "//beacon-chain:__subpackages__", - "//fuzz:__pkg__", "//shared/attestationutil:__pkg__", "//shared/depositutil:__pkg__", "//shared/interop:__pkg__", @@ -17,6 +16,7 @@ go_library( "//slasher:__subpackages__", "//testing/benchmark/benchmark_files:__subpackages__", "//testing/endtoend/evaluators:__pkg__", + "//testing/fuzz:__pkg__", "//testing/spectest:__subpackages__", "//tools:__subpackages__", "//validator:__subpackages__", diff --git a/beacon-chain/core/blocks/BUILD.bazel b/beacon-chain/core/blocks/BUILD.bazel index 40b8bacc5..76772389f 100644 --- a/beacon-chain/core/blocks/BUILD.bazel +++ b/beacon-chain/core/blocks/BUILD.bazel @@ -18,8 +18,8 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/beacon-chain/core/blocks", visibility = [ "//beacon-chain:__subpackages__", - "//fuzz:__pkg__", "//shared/testutil:__pkg__", + "//testing/fuzz:__pkg__", "//testing/spectest:__subpackages__", "//validator/accounts:__pkg__", ], diff --git a/beacon-chain/core/helpers/BUILD.bazel b/beacon-chain/core/helpers/BUILD.bazel index b629913c9..67ed92d22 100644 --- a/beacon-chain/core/helpers/BUILD.bazel +++ b/beacon-chain/core/helpers/BUILD.bazel @@ -18,7 +18,6 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/beacon-chain/core/helpers", visibility = [ "//beacon-chain:__subpackages__", - "//fuzz:__pkg__", "//shared/attestationutil:__pkg__", "//shared/depositutil:__pkg__", "//shared/interop:__pkg__", @@ -29,6 +28,7 @@ go_library( "//slasher:__subpackages__", "//testing/benchmark/benchmark_files:__subpackages__", "//testing/endtoend/evaluators:__pkg__", + "//testing/fuzz:__pkg__", "//testing/spectest:__subpackages__", "//tools:__subpackages__", "//validator:__subpackages__", diff --git a/beacon-chain/core/transition/BUILD.bazel b/beacon-chain/core/transition/BUILD.bazel index 706a7ab1a..6d69689c1 100644 --- a/beacon-chain/core/transition/BUILD.bazel +++ b/beacon-chain/core/transition/BUILD.bazel @@ -15,10 +15,10 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/beacon-chain/core/transition", visibility = [ "//beacon-chain:__subpackages__", - "//fuzz:__pkg__", "//shared/interop:__pkg__", "//shared/testutil:__pkg__", "//testing/endtoend:__pkg__", + "//testing/fuzz:__pkg__", "//testing/spectest:__subpackages__", "//tools/benchmark-files-gen:__pkg__", "//tools/genesis-state-gen:__pkg__", diff --git a/beacon-chain/db/BUILD.bazel b/beacon-chain/db/BUILD.bazel index bf8dcbbb7..64559394a 100644 --- a/beacon-chain/db/BUILD.bazel +++ b/beacon-chain/db/BUILD.bazel @@ -12,7 +12,7 @@ go_library( visibility = [ "//beacon-chain:__subpackages__", "//cmd/beacon-chain:__subpackages__", - "//fuzz:__pkg__", + "//testing/fuzz:__pkg__", "//tools:__subpackages__", ], deps = [ diff --git a/beacon-chain/db/kv/BUILD.bazel b/beacon-chain/db/kv/BUILD.bazel index c6d0065c7..777d6cb20 100644 --- a/beacon-chain/db/kv/BUILD.bazel +++ b/beacon-chain/db/kv/BUILD.bazel @@ -30,7 +30,7 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/beacon-chain/db/kv", visibility = [ "//beacon-chain:__subpackages__", - "//fuzz:__pkg__", + "//testing/fuzz:__pkg__", "//tools:__subpackages__", ], deps = [ diff --git a/beacon-chain/forkchoice/protoarray/BUILD.bazel b/beacon-chain/forkchoice/protoarray/BUILD.bazel index 64f92e3d1..3728099be 100644 --- a/beacon-chain/forkchoice/protoarray/BUILD.bazel +++ b/beacon-chain/forkchoice/protoarray/BUILD.bazel @@ -14,7 +14,7 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/beacon-chain/forkchoice/protoarray", visibility = [ "//beacon-chain:__subpackages__", - "//fuzz:__pkg__", + "//testing/fuzz:__pkg__", ], deps = [ "//shared/params:go_default_library", diff --git a/beacon-chain/operations/attestations/BUILD.bazel b/beacon-chain/operations/attestations/BUILD.bazel index b639b4764..c96aa3b20 100644 --- a/beacon-chain/operations/attestations/BUILD.bazel +++ b/beacon-chain/operations/attestations/BUILD.bazel @@ -14,7 +14,7 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/beacon-chain/operations/attestations", visibility = [ "//beacon-chain:__subpackages__", - "//fuzz:__pkg__", + "//testing/fuzz:__pkg__", ], deps = [ "//beacon-chain/operations/attestations/kv:go_default_library", diff --git a/beacon-chain/operations/slashings/BUILD.bazel b/beacon-chain/operations/slashings/BUILD.bazel index d6b067041..3bb2cb4ac 100644 --- a/beacon-chain/operations/slashings/BUILD.bazel +++ b/beacon-chain/operations/slashings/BUILD.bazel @@ -13,7 +13,7 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/beacon-chain/operations/slashings", visibility = [ "//beacon-chain:__subpackages__", - "//fuzz:__pkg__", + "//testing/fuzz:__pkg__", ], deps = [ "//beacon-chain/core:go_default_library", diff --git a/beacon-chain/operations/voluntaryexits/BUILD.bazel b/beacon-chain/operations/voluntaryexits/BUILD.bazel index 9f0daa86b..7adc46f67 100644 --- a/beacon-chain/operations/voluntaryexits/BUILD.bazel +++ b/beacon-chain/operations/voluntaryexits/BUILD.bazel @@ -10,7 +10,7 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/beacon-chain/operations/voluntaryexits", visibility = [ "//beacon-chain:__subpackages__", - "//fuzz:__pkg__", + "//testing/fuzz:__pkg__", ], deps = [ "//beacon-chain/core:go_default_library", diff --git a/beacon-chain/p2p/BUILD.bazel b/beacon-chain/p2p/BUILD.bazel index c3693cf2b..78fd64a11 100644 --- a/beacon-chain/p2p/BUILD.bazel +++ b/beacon-chain/p2p/BUILD.bazel @@ -35,8 +35,8 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/beacon-chain/p2p", visibility = [ "//beacon-chain:__subpackages__", - "//fuzz:__pkg__", "//testing/endtoend/evaluators:__pkg__", + "//testing/fuzz:__pkg__", "//tools:__subpackages__", ], deps = [ diff --git a/beacon-chain/p2p/encoder/BUILD.bazel b/beacon-chain/p2p/encoder/BUILD.bazel index a519f2f96..1bdb04986 100644 --- a/beacon-chain/p2p/encoder/BUILD.bazel +++ b/beacon-chain/p2p/encoder/BUILD.bazel @@ -11,7 +11,7 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/beacon-chain/p2p/encoder", visibility = [ "//beacon-chain:__subpackages__", - "//fuzz:__pkg__", + "//testing/fuzz:__pkg__", ], deps = [ "//shared/params:go_default_library", diff --git a/beacon-chain/p2p/testing/BUILD.bazel b/beacon-chain/p2p/testing/BUILD.bazel index f0da75217..225d32423 100644 --- a/beacon-chain/p2p/testing/BUILD.bazel +++ b/beacon-chain/p2p/testing/BUILD.bazel @@ -15,7 +15,7 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/beacon-chain/p2p/testing", visibility = [ "//beacon-chain:__subpackages__", - "//fuzz:__pkg__", + "//testing/fuzz:__pkg__", ], deps = [ "//beacon-chain/p2p/encoder:go_default_library", diff --git a/beacon-chain/powchain/testing/BUILD.bazel b/beacon-chain/powchain/testing/BUILD.bazel index dfd5e8fe6..001c84e77 100644 --- a/beacon-chain/powchain/testing/BUILD.bazel +++ b/beacon-chain/powchain/testing/BUILD.bazel @@ -10,7 +10,7 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/beacon-chain/powchain/testing", visibility = [ "//beacon-chain:__subpackages__", - "//fuzz:__pkg__", + "//testing/fuzz:__pkg__", ], deps = [ "//beacon-chain/powchain/types:go_default_library", diff --git a/beacon-chain/state/BUILD.bazel b/beacon-chain/state/BUILD.bazel index f04311796..6c13a3fdf 100644 --- a/beacon-chain/state/BUILD.bazel +++ b/beacon-chain/state/BUILD.bazel @@ -9,13 +9,13 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/beacon-chain/state", visibility = [ "//beacon-chain:__subpackages__", - "//fuzz:__pkg__", "//proto/testing:__subpackages__", "//shared/aggregation:__subpackages__", "//shared/depositutil:__subpackages__", "//shared/testutil:__pkg__", "//slasher/rpc:__subpackages__", "//testing/benchmark:__pkg__", + "//testing/fuzz:__pkg__", "//testing/spectest:__subpackages__", "//tools/benchmark-files-gen:__pkg__", "//tools/exploredb:__pkg__", diff --git a/beacon-chain/state/stategen/BUILD.bazel b/beacon-chain/state/stategen/BUILD.bazel index 547f778b4..7acf49a1f 100644 --- a/beacon-chain/state/stategen/BUILD.bazel +++ b/beacon-chain/state/stategen/BUILD.bazel @@ -18,7 +18,7 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/beacon-chain/state/stategen", visibility = [ "//beacon-chain:__subpackages__", - "//fuzz:__pkg__", + "//testing/fuzz:__pkg__", ], deps = [ "//beacon-chain/core:go_default_library", diff --git a/beacon-chain/state/stateutil/BUILD.bazel b/beacon-chain/state/stateutil/BUILD.bazel index c65164da4..4eaabf95f 100644 --- a/beacon-chain/state/stateutil/BUILD.bazel +++ b/beacon-chain/state/stateutil/BUILD.bazel @@ -15,12 +15,12 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/beacon-chain/state/stateutil", visibility = [ "//beacon-chain:__subpackages__", - "//fuzz:__pkg__", "//proto/migration:__subpackages__", "//proto/testing:__subpackages__", "//shared/blockutil:__subpackages__", "//shared/testutil:__subpackages__", "//slasher:__subpackages__", + "//testing/fuzz:__pkg__", "//tools/blocktree:__pkg__", "//tools/pcli:__pkg__", "//validator/client:__pkg__", diff --git a/beacon-chain/state/v1/BUILD.bazel b/beacon-chain/state/v1/BUILD.bazel index b799031e7..eba3eb8d8 100644 --- a/beacon-chain/state/v1/BUILD.bazel +++ b/beacon-chain/state/v1/BUILD.bazel @@ -30,7 +30,6 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/beacon-chain/state/v1", visibility = [ "//beacon-chain:__subpackages__", - "//fuzz:__pkg__", "//proto/testing:__subpackages__", "//shared/aggregation:__subpackages__", "//shared/depositutil:__subpackages__", @@ -38,6 +37,7 @@ go_library( "//shared/testutil:__pkg__", "//slasher/rpc:__subpackages__", "//testing/benchmark:__pkg__", + "//testing/fuzz:__pkg__", "//testing/spectest:__subpackages__", "//tools/benchmark-files-gen:__pkg__", "//tools/pcli:__pkg__", diff --git a/beacon-chain/sync/BUILD.bazel b/beacon-chain/sync/BUILD.bazel index 2dc8a47b6..da21e4a29 100644 --- a/beacon-chain/sync/BUILD.bazel +++ b/beacon-chain/sync/BUILD.bazel @@ -47,7 +47,7 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/beacon-chain/sync", visibility = [ "//beacon-chain:__subpackages__", - "//fuzz:__pkg__", + "//testing/fuzz:__pkg__", ], deps = [ "//beacon-chain/blockchain:go_default_library", diff --git a/beacon-chain/sync/initial-sync/testing/BUILD.bazel b/beacon-chain/sync/initial-sync/testing/BUILD.bazel index 735e73c5c..c1db6c915 100644 --- a/beacon-chain/sync/initial-sync/testing/BUILD.bazel +++ b/beacon-chain/sync/initial-sync/testing/BUILD.bazel @@ -7,6 +7,6 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/beacon-chain/sync/initial-sync/testing", visibility = [ "//beacon-chain:__subpackages__", - "//fuzz:__pkg__", + "//testing/fuzz:__pkg__", ], ) diff --git a/hack/update-go-ssz.sh b/hack/update-go-ssz.sh index 48bd8c292..8ec5141ba 100755 --- a/hack/update-go-ssz.sh +++ b/hack/update-go-ssz.sh @@ -4,7 +4,7 @@ # Script to copy ssz.go files from bazel build folder to appropriate location. # Bazel builds to bazel-bin/... folder, script copies them back to original folder where target is. -bazel query 'kind(ssz_gen_marshal, //proto/...) union kind(ssz_gen_marshal, //fuzz/...)' | xargs bazel build +bazel query 'kind(ssz_gen_marshal, //proto/...) union kind(ssz_gen_marshal, //testing/fuzz/...)' | xargs bazel build # Get locations of proto ssz.go files. file_list=() diff --git a/hack/upload_fuzzers.sh b/hack/upload_fuzzers.sh index 10438e5a3..97306bde1 100755 --- a/hack/upload_fuzzers.sh +++ b/hack/upload_fuzzers.sh @@ -5,9 +5,9 @@ # Build targets. bazel build --config=fuzz \ - //fuzz:block_fuzz_test_libfuzzer_bundle \ - //fuzz:state_fuzz_test_libfuzzer_bundle \ - //fuzz:ssz_encoder_attestations_test_libfuzzer_bundle + //testing/fuzz:block_fuzz_test_libfuzzer_bundle \ + //testing/fuzz:state_fuzz_test_libfuzzer_bundle \ + //testing/fuzz:ssz_encoder_attestations_test_libfuzzer_bundle # Upload bundles with date timestamps in the filename. gsutil cp bazel-bin/fuzz/block_fuzz_test_libfuzzer_bundle.zip gs://builds.prysmaticlabs.appspot.com/libfuzzer_asan_blocks/fuzzer-build-"$(date +%Y%m%d%H%M)".zip diff --git a/fuzz/BUILD.bazel b/testing/fuzz/BUILD.bazel similarity index 98% rename from fuzz/BUILD.bazel rename to testing/fuzz/BUILD.bazel index 484dc5233..ad344de28 100644 --- a/fuzz/BUILD.bazel +++ b/testing/fuzz/BUILD.bazel @@ -61,7 +61,7 @@ go_fuzz_test( deps = [ "//beacon-chain/core/blocks:go_default_library", "//beacon-chain/core/transition:go_default_library", - "//fuzz/testing:go_default_library", + "//testing/fuzz/testing:go_default_library", "//shared/params:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1/block:go_default_library", @@ -185,7 +185,7 @@ go_library( "//beacon-chain/state/stategen:go_default_library", "//beacon-chain/sync:go_default_library", "//beacon-chain/sync/initial-sync/testing:go_default_library", - "//fuzz/testing:go_default_library", + "//testing/fuzz/testing:go_default_library", "//shared/bytesutil:go_default_library", "//config/features:go_default_library", "//shared/params:go_default_library", diff --git a/fuzz/README.md b/testing/fuzz/README.md similarity index 91% rename from fuzz/README.md rename to testing/fuzz/README.md index 3064242c7..8ae6350e0 100644 --- a/fuzz/README.md +++ b/testing/fuzz/README.md @@ -29,7 +29,7 @@ type InputBlockWithPrestate struct { } ``` -You'll also want to add that struct to `//fuzz:ssz_generated_files` to generate the custom fast SSZ +You'll also want to add that struct to `//testing/fuzz:ssz_generated_files` to generate the custom fast SSZ methods for serialization to improve test performance. Your fuzz test must accept a single argument of type `[]byte`. The return types are ignored by @@ -77,7 +77,7 @@ go_fuzz_test( ) ``` -Be sure to add your target to the test suite at `//fuzz:fuzz_tests`. +Be sure to add your target to the test suite at `//testing/fuzz:fuzz_tests`. ### 4) Run your fuzz test @@ -85,7 +85,7 @@ To run your fuzz test you must manually target it with bazel test and run with t `--config=fuzz`. ``` -bazel test //fuzz:example_fuzz_test --config=fuzz +bazel test //testing/fuzz:example_fuzz_test --config=fuzz ``` ## Running fuzzit regression tests @@ -95,7 +95,7 @@ configuration flag. Note: This requires docker installed on your machine. See [fuzzitdev/fuzzit#58](https://github.com/fuzzitdev/fuzzit/issues/58). ``` -bazel test //fuzz:fuzz_tests --config=fuzzit +bazel test //testing/fuzz:fuzz_tests --config=fuzzit ``` If the same command above is run with the FUZZIT_API_KEY environment variable set, then the fuzzit diff --git a/fuzz/block_fuzz.go b/testing/fuzz/block_fuzz.go similarity index 100% rename from fuzz/block_fuzz.go rename to testing/fuzz/block_fuzz.go diff --git a/fuzz/common.go b/testing/fuzz/common.go similarity index 100% rename from fuzz/common.go rename to testing/fuzz/common.go diff --git a/fuzz/generated.ssz.go b/testing/fuzz/generated.ssz.go similarity index 100% rename from fuzz/generated.ssz.go rename to testing/fuzz/generated.ssz.go diff --git a/fuzz/inputs.go b/testing/fuzz/inputs.go similarity index 100% rename from fuzz/inputs.go rename to testing/fuzz/inputs.go diff --git a/fuzz/rpc_status_corpus/.gitkeep b/testing/fuzz/rpc_status_corpus/.gitkeep similarity index 100% rename from fuzz/rpc_status_corpus/.gitkeep rename to testing/fuzz/rpc_status_corpus/.gitkeep diff --git a/fuzz/rpc_status_fuzz.go b/testing/fuzz/rpc_status_fuzz.go similarity index 100% rename from fuzz/rpc_status_fuzz.go rename to testing/fuzz/rpc_status_fuzz.go diff --git a/fuzz/ssz_encoder_attestations_fuzz.go b/testing/fuzz/ssz_encoder_attestations_fuzz.go similarity index 100% rename from fuzz/ssz_encoder_attestations_fuzz.go rename to testing/fuzz/ssz_encoder_attestations_fuzz.go diff --git a/fuzz/state_fuzz.go b/testing/fuzz/state_fuzz.go similarity index 100% rename from fuzz/state_fuzz.go rename to testing/fuzz/state_fuzz.go diff --git a/fuzz/testing/BUILD.bazel b/testing/fuzz/testing/BUILD.bazel similarity index 84% rename from fuzz/testing/BUILD.bazel rename to testing/fuzz/testing/BUILD.bazel index 7b31d604a..5e8783f45 100644 --- a/fuzz/testing/BUILD.bazel +++ b/testing/fuzz/testing/BUILD.bazel @@ -7,9 +7,9 @@ go_library( data = [ "@sigp_beacon_fuzz_corpora//:current_mainnet_beaconstate", ], - importpath = "github.com/prysmaticlabs/prysm/fuzz/testing", + importpath = "github.com/prysmaticlabs/prysm/testing/fuzz/testing", visibility = [ - "//fuzz:__pkg__", + "//testing/fuzz:__pkg__", ], deps = [ "//proto/prysm/v1alpha1:go_default_library", diff --git a/fuzz/testing/beacon_fuzz_states.go b/testing/fuzz/testing/beacon_fuzz_states.go similarity index 100% rename from fuzz/testing/beacon_fuzz_states.go rename to testing/fuzz/testing/beacon_fuzz_states.go diff --git a/fuzz/testing/beacon_fuzz_states_test.go b/testing/fuzz/testing/beacon_fuzz_states_test.go similarity index 100% rename from fuzz/testing/beacon_fuzz_states_test.go rename to testing/fuzz/testing/beacon_fuzz_states_test.go diff --git a/third_party/herumi/bls_eth_go_binary.BUILD b/third_party/herumi/bls_eth_go_binary.BUILD index 10ae15023..14647ec6c 100644 --- a/third_party/herumi/bls_eth_go_binary.BUILD +++ b/third_party/herumi/bls_eth_go_binary.BUILD @@ -153,7 +153,7 @@ go_library( "@com_github_wealdtech_go_eth2_types_v2//:__pkg__", ], clinkopts = select({ - "@prysm//fuzz:fuzzing_enabled": ["-Wl,--unresolved-symbols=ignore-all", "-fsanitize=address"], + "@prysm//testing/fuzz:fuzzing_enabled": ["-Wl,--unresolved-symbols=ignore-all", "-fsanitize=address"], "//conditions:default": [], }), )