mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-05 09:14:28 +00:00
55074bcc6c
* DB: add block roots test * Merge branch 'master' of github.com:prysmaticlabs/prysm * Merge branch 'master' of github.com:prysmaticlabs/prysm * Pool: add seen atts map * Pool: use seen atts map * Pool: clear seen map * Merge branch 'master' of github.com:prysmaticlabs/prysm * Core: clean up unused noverify and tidy up namings * Gaz * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Core: Add no verify back. Better namings * Merge branch 'rm-no-verify' of github.com:prysmaticlabs/prysm into rm-no-verify * Merge refs/heads/master into rm-no-verify * Core: fixed a test * Merge branch 'rm-no-verify' of github.com:prysmaticlabs/prysm into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify * Merge refs/heads/master into rm-no-verify
34 lines
894 B
Go
34 lines
894 B
Go
package fuzz
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/core/blocks"
|
|
stateTrie "github.com/prysmaticlabs/prysm/beacon-chain/state"
|
|
prylabs_testing "github.com/prysmaticlabs/prysm/fuzz/testing"
|
|
"github.com/prysmaticlabs/prysm/shared/params"
|
|
)
|
|
|
|
// BeaconFuzzAttestation implements libfuzzer and beacon fuzz interface.
|
|
func BeaconFuzzAttestation(b []byte) ([]byte, bool) {
|
|
params.UseMainnetConfig()
|
|
input := &InputAttestationWrapper{}
|
|
if err := input.UnmarshalSSZ(b); err != nil {
|
|
return fail(err)
|
|
}
|
|
s, err := prylabs_testing.GetBeaconFuzzState(input.StateID)
|
|
if err != nil || s == nil {
|
|
return nil, false
|
|
}
|
|
st, err := stateTrie.InitializeFromProto(s)
|
|
if err != nil {
|
|
return fail(err)
|
|
}
|
|
post, err := blocks.ProcessAttestationNoVerifySignature(context.Background(), st, input.Attestation)
|
|
if err != nil {
|
|
return fail(err)
|
|
}
|
|
|
|
return success(post)
|
|
}
|