mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 21:07:18 +00:00
1a27c21d9c
* load chain config from file * revert flag name change * add dependencies to image * Update shared/cmd/flags.go Co-authored-by: Victor Farazdagi <simple.square@gmail.com> * Update beacon-chain/main.go Co-authored-by: Victor Farazdagi <simple.square@gmail.com> * added test to load config file * Merge branch 'yaml_chain_config' of github.com:prysmaticlabs/prysm into yaml_chain_config # Conflicts: # beacon-chain/main.go * replace hex with yaml format of fixed byte array * fix test and check if comment * move to node package * gaz * added contract address case * fix key name issue * add tests * gaz * add 1 byte handling * change to fatal * add config printout * revert main changes * revert line removal * fix one byte handling * fix test and one byte handling * remove log * Apply suggestions from code review * change to debug * Update beacon-chain/node/node.go * move helper methods Co-authored-by: Victor Farazdagi <simple.square@gmail.com> Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com> Co-authored-by: Raul Jordan <raul@prysmaticlabs.com> Co-authored-by: terence tsao <terence@prysmaticlabs.com>
35 lines
966 B
Go
35 lines
966 B
Go
package fuzz
|
|
|
|
import (
|
|
"context"
|
|
|
|
ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
|
|
"github.com/prysmaticlabs/go-ssz"
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/core/state"
|
|
stateTrie "github.com/prysmaticlabs/prysm/beacon-chain/state"
|
|
prylabs_testing "github.com/prysmaticlabs/prysm/fuzz/testing"
|
|
"github.com/prysmaticlabs/prysm/shared/params"
|
|
)
|
|
|
|
// BeaconFuzzBlock using the corpora from sigp/beacon-fuzz.
|
|
func BeaconFuzzBlock(b []byte) ([]byte, bool) {
|
|
params.UseMainnetConfig()
|
|
input := &InputBlockHeader{}
|
|
if err := ssz.Unmarshal(b, input); 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 := state.ProcessBlock(context.Background(), st, ðpb.SignedBeaconBlock{Block: input.Block})
|
|
if err != nil {
|
|
return fail(err)
|
|
}
|
|
return success(post)
|
|
}
|