Skip to content

Commit

Permalink
Merge branch 'develop' into update-geth-dep
Browse files Browse the repository at this point in the history
  • Loading branch information
rauljordan authored Apr 20, 2021
2 parents bf08dc1 + 70dc22a commit 16d682d
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 4 deletions.
6 changes: 6 additions & 0 deletions fuzz/block_fuzz.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ func (fakeChecker) Resync() error {
return nil
}

// FuzzBlock wraps BeaconFuzzBlock in a go-fuzz compatible interface
func FuzzBlock(b []byte) int {
BeaconFuzzBlock(b)
return 0
}

// BeaconFuzzBlock runs full processing of beacon block against a given state.
func BeaconFuzzBlock(b []byte) {
params.UseMainnetConfig()
Expand Down
6 changes: 6 additions & 0 deletions fuzz/rpc_status_fuzz.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ func init() {
})
}

// FuzzP2PRPCStatus wraps BeaconFuzzP2PRPCStatus in a go-fuzz compatible interface
func FuzzP2PRPCStatus(b []byte) int {
BeaconFuzzP2PRPCStatus(b)
return 0
}

// BeaconFuzzP2PRPCStatus implements libfuzzer and beacon fuzz interface.
func BeaconFuzzP2PRPCStatus(b []byte) {
s, err := h.NewStream(context.Background(), p.PeerID(), "/eth2/beacon_chain/req/status/1/ssz_snappy")
Expand Down
7 changes: 7 additions & 0 deletions fuzz/ssz_encoder_attestations_fuzz.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ import (

var buf = new(bytes.Buffer)

// FuzzSszEncoderAttestation wraps SszEncoderAttestationFuzz in a
// go-fuzz compatible interface
func FuzzSszEncoderAttestation(b []byte) int {
SszEncoderAttestationFuzz(b)
return 0
}

// SszEncoderAttestationFuzz runs network encode/decode for attestations.
func SszEncoderAttestationFuzz(b []byte) {
params.UseMainnetConfig()
Expand Down
6 changes: 6 additions & 0 deletions fuzz/state_fuzz.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ func init() {
})
}

// FuzzState wraps BeaconStateFuzz in a go-fuzz compatible interface
func FuzzState(b []byte) int {
BeaconStateFuzz(b)
return 0
}

// BeaconStateFuzz --
func BeaconStateFuzz(input []byte) {
params.UseMainnetConfig()
Expand Down
6 changes: 6 additions & 0 deletions fuzzbuzz.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
base:
language: go
docker_image: golang:latest
build_tags:
- libfuzzer
- blst_disabled
5 changes: 1 addition & 4 deletions tools/specs-checker/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,5 @@ func getAndSaveFile(specDocUrl, outFilePath string) error {
}

func prepareDir(dirPath string) error {
if err := os.MkdirAll(dirPath, os.ModePerm); err != nil {
return err
}
return nil
return os.MkdirAll(dirPath, os.ModePerm)
}

0 comments on commit 16d682d

Please sign in to comment.