mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 03:30:35 +00:00
Move Fuzz/ Into Testing/ (#9617)
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
parent
23e2d62c0c
commit
61c24c3870
@ -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",
|
||||
|
@ -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",
|
||||
|
4
beacon-chain/cache/BUILD.bazel
vendored
4
beacon-chain/cache/BUILD.bazel
vendored
@ -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 = [
|
||||
|
@ -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__",
|
||||
|
@ -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__",
|
||||
],
|
||||
|
@ -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__",
|
||||
|
@ -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__",
|
||||
|
@ -12,7 +12,7 @@ go_library(
|
||||
visibility = [
|
||||
"//beacon-chain:__subpackages__",
|
||||
"//cmd/beacon-chain:__subpackages__",
|
||||
"//fuzz:__pkg__",
|
||||
"//testing/fuzz:__pkg__",
|
||||
"//tools:__subpackages__",
|
||||
],
|
||||
deps = [
|
||||
|
@ -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 = [
|
||||
|
@ -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",
|
||||
|
@ -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",
|
||||
|
@ -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",
|
||||
|
@ -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",
|
||||
|
@ -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 = [
|
||||
|
@ -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",
|
||||
|
@ -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",
|
||||
|
@ -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",
|
||||
|
@ -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__",
|
||||
|
@ -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",
|
||||
|
@ -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__",
|
||||
|
@ -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__",
|
||||
|
@ -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",
|
||||
|
@ -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__",
|
||||
],
|
||||
)
|
||||
|
@ -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=()
|
||||
|
@ -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
|
||||
|
@ -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",
|
@ -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
|
@ -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",
|
2
third_party/herumi/bls_eth_go_binary.BUILD
vendored
2
third_party/herumi/bls_eth_go_binary.BUILD
vendored
@ -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": [],
|
||||
}),
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user