Skip to content

Commit 7df01fe

Browse files
Remove libfuzzer / afl based builds in favor of go 1.18 fuzz testing (OffchainLabs#10065)
* Remove libfuzzer / afl based builds in favor of go 1.18 fuzz testing * rm beacon-fuzz archive Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
1 parent 49c73e6 commit 7df01fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+25
-12292
lines changed

.bazelrc

+1-14
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,7 @@ build:llvm-asan --config=llvm
6262
build:llvm-asan --config=asan
6363
build:llvm-asan --linkopt -fuse-ld=ld.lld
6464

65-
build:fuzz --define=gotags=libfuzzer
66-
build:fuzz --config=llvm-asan
67-
build:fuzz --copt=-fsanitize=fuzzer-no-link
68-
build:fuzz --linkopt=-fsanitize=fuzzer
69-
build:fuzz --copt=-fno-omit-frame-pointer
70-
build:fuzz --define=FUZZING_ENGINE=libfuzzer
71-
build:fuzz --copt=-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
72-
build:fuzz --linkopt -Wl,--no-as-needed
73-
build:fuzz --define=gc_goopts=-d=libfuzzer,checkptr
74-
build:fuzz --run_under=//tools:fuzz_wrapper
75-
build:fuzz --compilation_mode=opt
76-
build:fuzz --define=blst_disabled=true
77-
78-
test:fuzz --local_test_jobs="HOST_CPUS*.5"
65+
build:fuzz --@io_bazel_rules_go//go/config:tags=fuzz
7966

8067
# Build binary with cgo symbolizer for debugging / profiling.
8168
build:cgo_symbolizer --config=llvm

.buildkite-bazelrc

-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ build --flaky_test_attempts=5
4141
# Disabled race detection due to unstable test results under constrained environment build kite
4242
# build --features=race
4343

44-
# Disable flaky test detection for fuzzing.
45-
test:fuzz --flaky_test_attempts=1
46-
4744
# Better caching
4845
build:nostamp --nostamp
4946
build:nostamp --workspace_status_command=./hack/workspace_status_ci.sh

.gitignore

-4
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,5 @@ password.txt
3030
# Dist files
3131
dist
3232

33-
# libfuzzer
34-
oom-*
35-
crash-*
36-
3733
# deepsource cli
3834
bin

BUILD.bazel

-9
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,6 @@ common_files = {
144144
"//:README.md": "README.md",
145145
}
146146

147-
string_setting(
148-
name = "gotags",
149-
build_setting_default = "",
150-
values = [
151-
"",
152-
"libfuzzer",
153-
],
154-
)
155-
156147
sh_binary(
157148
name = "prysm_sh",
158149
srcs = ["prysm.sh"],

WORKSPACE

-10
Original file line numberDiff line numberDiff line change
@@ -341,16 +341,6 @@ git_repository(
341341
# Group the sources of the library so that CMake rule have access to it
342342
all_content = """filegroup(name = "all", srcs = glob(["**"]), visibility = ["//visibility:public"])"""
343343

344-
http_archive(
345-
name = "sigp_beacon_fuzz_corpora",
346-
build_file = "//third_party:beacon-fuzz/corpora.BUILD",
347-
sha256 = "42993d0901a316afda45b4ba6d53c7c21f30c551dcec290a4ca131c24453d1ef",
348-
strip_prefix = "beacon-fuzz-corpora-bac24ad78d45cc3664c0172241feac969c1ac29b",
349-
urls = [
350-
"https://github.com/sigp/beacon-fuzz-corpora/archive/bac24ad78d45cc3664c0172241feac969c1ac29b.tar.gz",
351-
],
352-
)
353-
354344
# External dependencies
355345

356346
http_archive(

beacon-chain/blockchain/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ go_library(
2525
visibility = [
2626
"//beacon-chain:__subpackages__",
2727
"//cmd/beacon-chain:__subpackages__",
28-
"//testing/fuzz:__pkg__",
2928
"//testing/slasher/simulator:__pkg__",
3029
],
3130
deps = [

beacon-chain/blockchain/testing/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ go_library(
88
visibility = [
99
"//beacon-chain:__subpackages__",
1010
"//testing:__subpackages__",
11-
"//testing/fuzz:__pkg__",
1211
],
1312
deps = [
1413
"//async/event:go_default_library",

beacon-chain/cache/BUILD.bazel

+9-17
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,31 @@
11
load("@prysm//tools/go:def.bzl", "go_library", "go_test")
22

3-
# gazelle:exclude committee_disabled.go
4-
# gazelle:exclude proposer_indices_disabled.go
53
go_library(
64
name = "go_default_library",
75
srcs = [
6+
"active_balance.go",
7+
"active_balance_disabled.go", # keep
88
"attestation_data.go",
99
"checkpoint_state.go",
10+
"committee.go",
11+
"committee_disabled.go", # keep
1012
"committees.go",
1113
"common.go",
1214
"doc.go",
1315
"error.go",
16+
"proposer_indices.go",
17+
"proposer_indices_disabled.go", # keep
1418
"proposer_indices_type.go",
1519
"skip_slot_cache.go",
1620
"subnet_ids.go",
21+
"sync_committee.go",
22+
"sync_committee_disabled.go", # keep
1723
"sync_committee_head_state.go",
1824
"sync_subnet_ids.go",
19-
] + select({
20-
"//testing/fuzz:fuzzing_enabled": [
21-
"active_balance_disabled.go",
22-
"committee_disabled.go",
23-
"proposer_indices_disabled.go",
24-
"sync_committee_disabled.go",
25-
],
26-
"//conditions:default": [
27-
"active_balance.go",
28-
"committee.go",
29-
"proposer_indices.go",
30-
"sync_committee.go",
31-
],
32-
}),
25+
],
3326
importpath = "github.com/prysmaticlabs/prysm/beacon-chain/cache",
3427
visibility = [
3528
"//beacon-chain:__subpackages__",
36-
"//testing/fuzz:__pkg__",
3729
"//tools:__subpackages__",
3830
],
3931
deps = [

beacon-chain/cache/active_balance.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build !libfuzzer
1+
// +build !fuzz
22

33
package cache
44

beacon-chain/cache/active_balance_disabled.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build libfuzzer
1+
// +build fuzz
22

33
package cache
44

beacon-chain/cache/committee.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build !libfuzzer
1+
// +build !fuzz
22

33
package cache
44

beacon-chain/cache/committee_disabled.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build libfuzzer
1+
// +build fuzz
22

33
// This file is used in fuzzer builds to bypass global committee caches.
44
package cache

beacon-chain/cache/proposer_indices.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build !libfuzzer
1+
// +build !fuzz
22

33
package cache
44

beacon-chain/cache/proposer_indices_disabled.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build libfuzzer
1+
// +build fuzz
22

33
// This file is used in fuzzer builds to bypass proposer indices caches.
44
package cache

beacon-chain/cache/sync_committee.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build !libfuzzer
1+
// +build !fuzz
22

33
package cache
44

beacon-chain/cache/sync_committee_disabled.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build libfuzzer
1+
// +build fuzz
22

33
package cache
44

beacon-chain/core/blocks/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ go_library(
1919
importpath = "github.com/prysmaticlabs/prysm/beacon-chain/core/blocks",
2020
visibility = [
2121
"//beacon-chain:__subpackages__",
22-
"//testing/fuzz:__pkg__",
2322
"//testing/spectest:__subpackages__",
2423
"//testing/util:__pkg__",
2524
"//validator:__subpackages__",

beacon-chain/core/helpers/BUILD.bazel

-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ go_library(
2020
"//cmd/beacon-chain:__subpackages__",
2121
"//contracts/deposit:__pkg__",
2222
"//crypto/keystore:__pkg__",
23-
"//fuzz:__pkg__",
2423
"//network/forks:__pkg__",
2524
"//proto/prysm/v1alpha1:__subpackages__",
2625
"//proto/prysm/v1alpha1/attestation:__pkg__",
@@ -29,7 +28,6 @@ go_library(
2928
"//testing/altair:__pkg__",
3029
"//testing/benchmark/benchmark_files:__subpackages__",
3130
"//testing/endtoend/evaluators:__pkg__",
32-
"//testing/fuzz:__pkg__",
3331
"//testing/slasher/simulator:__pkg__",
3432
"//testing/spectest:__subpackages__",
3533
"//testing/util:__pkg__",

beacon-chain/core/transition/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ go_library(
1515
"//beacon-chain:__subpackages__",
1616
"//runtime/interop:__pkg__",
1717
"//testing/endtoend:__pkg__",
18-
"//testing/fuzz:__pkg__",
1918
"//testing/spectest:__subpackages__",
2019
"//testing/util:__pkg__",
2120
"//tools/benchmark-files-gen:__pkg__",

beacon-chain/db/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ go_library(
1313
visibility = [
1414
"//beacon-chain:__subpackages__",
1515
"//cmd/beacon-chain:__subpackages__",
16-
"//testing/fuzz:__pkg__",
1716
"//testing/slasher/simulator:__pkg__",
1817
"//tools:__subpackages__",
1918
],

beacon-chain/db/kv/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ go_library(
3030
importpath = "github.com/prysmaticlabs/prysm/beacon-chain/db/kv",
3131
visibility = [
3232
"//beacon-chain:__subpackages__",
33-
"//testing/fuzz:__pkg__",
3433
"//tools:__subpackages__",
3534
],
3635
deps = [

beacon-chain/forkchoice/protoarray/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ go_library(
1414
importpath = "github.com/prysmaticlabs/prysm/beacon-chain/forkchoice/protoarray",
1515
visibility = [
1616
"//beacon-chain:__subpackages__",
17-
"//testing/fuzz:__pkg__",
1817
],
1918
deps = [
2019
"//config/params:go_default_library",

beacon-chain/operations/attestations/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ go_library(
1414
importpath = "github.com/prysmaticlabs/prysm/beacon-chain/operations/attestations",
1515
visibility = [
1616
"//beacon-chain:__subpackages__",
17-
"//testing/fuzz:__pkg__",
1817
],
1918
deps = [
2019
"//beacon-chain/operations/attestations/kv:go_default_library",

beacon-chain/operations/slashings/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ go_library(
1414
visibility = [
1515
"//beacon-chain:__subpackages__",
1616
"//testing/endtoend:__subpackages__",
17-
"//testing/fuzz:__pkg__",
1817
"//testing/slasher/simulator:__pkg__",
1918
],
2019
deps = [

beacon-chain/operations/voluntaryexits/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ go_library(
1010
importpath = "github.com/prysmaticlabs/prysm/beacon-chain/operations/voluntaryexits",
1111
visibility = [
1212
"//beacon-chain:__subpackages__",
13-
"//testing/fuzz:__pkg__",
1413
],
1514
deps = [
1615
"//beacon-chain/state:go_default_library",

beacon-chain/p2p/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ go_library(
3636
visibility = [
3737
"//beacon-chain:__subpackages__",
3838
"//testing/endtoend/evaluators:__pkg__",
39-
"//testing/fuzz:__pkg__",
4039
"//tools:__subpackages__",
4140
],
4241
deps = [

beacon-chain/p2p/encoder/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ go_library(
1111
importpath = "github.com/prysmaticlabs/prysm/beacon-chain/p2p/encoder",
1212
visibility = [
1313
"//beacon-chain:__subpackages__",
14-
"//testing/fuzz:__pkg__",
1514
],
1615
deps = [
1716
"//config/params:go_default_library",

beacon-chain/p2p/testing/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ go_library(
1515
importpath = "github.com/prysmaticlabs/prysm/beacon-chain/p2p/testing",
1616
visibility = [
1717
"//beacon-chain:__subpackages__",
18-
"//testing/fuzz:__pkg__",
1918
],
2019
deps = [
2120
"//beacon-chain/p2p/encoder:go_default_library",

beacon-chain/powchain/testing/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ go_library(
1010
importpath = "github.com/prysmaticlabs/prysm/beacon-chain/powchain/testing",
1111
visibility = [
1212
"//beacon-chain:__subpackages__",
13-
"//testing/fuzz:__pkg__",
1413
],
1514
deps = [
1615
"//async/event:go_default_library",

beacon-chain/state/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ go_library(
1616
"//proto/testing:__subpackages__",
1717
"//slasher/rpc:__subpackages__",
1818
"//testing/benchmark:__pkg__",
19-
"//testing/fuzz:__pkg__",
2019
"//testing/slasher/simulator:__pkg__",
2120
"//testing/spectest:__subpackages__",
2221
"//testing/util:__pkg__",

beacon-chain/state/stategen/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ go_library(
1919
visibility = [
2020
"//beacon-chain:__subpackages__",
2121
"//testing/endtoend:__subpackages__",
22-
"//testing/fuzz:__pkg__",
2322
"//testing/slasher/simulator:__pkg__",
2423
],
2524
deps = [

beacon-chain/state/stateutil/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ go_library(
2626
"//proto/testing:__subpackages__",
2727
"//slasher:__subpackages__",
2828
"//testing:__subpackages__",
29-
"//testing/fuzz:__pkg__",
3029
"//tools/blocktree:__pkg__",
3130
"//tools/pcli:__pkg__",
3231
"//validator/client:__pkg__",

beacon-chain/state/v1/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ go_library(
3838
"//runtime/interop:__subpackages__",
3939
"//slasher/rpc:__subpackages__",
4040
"//testing/benchmark:__pkg__",
41-
"//testing/fuzz:__pkg__",
4241
"//testing/spectest:__subpackages__",
4342
"//testing/util:__pkg__",
4443
"//tools/benchmark-files-gen:__pkg__",

beacon-chain/sync/fuzz_exports.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//go:build libfuzzer
2-
// +build libfuzzer
1+
//go:build fuzz
2+
// +build fuzz
33

44
package sync
55

beacon-chain/sync/initial-sync/testing/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ go_library(
77
importpath = "github.com/prysmaticlabs/prysm/beacon-chain/sync/initial-sync/testing",
88
visibility = [
99
"//beacon-chain:__subpackages__",
10-
"//testing/fuzz:__pkg__",
1110
],
1211
)

crypto/bls/blst/stub.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build blst_disabled libfuzzer
1+
// +build blst_disabled fuzz
22

33
package blst
44

deps.bzl

-4
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,6 @@ def prysm_deps():
845845
go_repository(
846846
name = "com_github_ferranbt_fastssz",
847847
importpath = "github.com/ferranbt/fastssz",
848-
nofuzz = True,
849848
replace = "github.com/prysmaticlabs/fastssz",
850849
sum = "h1:BC9nIbhpQMyFlmLUJsVv8/+UewAVIjJegtvgaP9bV/M=",
851850
version = "v0.0.0-20211123050228-97d96f38caae",
@@ -938,7 +937,6 @@ def prysm_deps():
938937
go_repository(
939938
name = "com_github_ghodss_yaml",
940939
importpath = "github.com/ghodss/yaml",
941-
nofuzz = True,
942940
sum = "h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=",
943941
version = "v1.0.0",
944942
)
@@ -1123,7 +1121,6 @@ def prysm_deps():
11231121
go_repository(
11241122
name = "com_github_golang_glog",
11251123
importpath = "github.com/golang/glog",
1126-
nofuzz = True,
11271124
sum = "h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=",
11281125
version = "v0.0.0-20160126235308-23def4e6c14b",
11291126
)
@@ -3995,7 +3992,6 @@ def prysm_deps():
39953992
go_repository(
39963993
name = "in_gopkg_yaml_v2",
39973994
importpath = "gopkg.in/yaml.v2",
3998-
nofuzz = True,
39993995
sum = "h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=",
40003996
version = "v2.4.0",
40013997
)

fuzzbuzz.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ base:
22
language: go
33
docker_image: golang:latest
44
build_tags:
5-
- libfuzzer
5+
- fuzz
66
- blst_disabled

0 commit comments

Comments
 (0)