mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 21:07:18 +00:00
98e26d1dcc
* First pass at adding bulk signature verification for block deposits * checkpoint * some refactoring to allow for bulk deposit signature verification * nil check * fix goimports * fmt * rename ProcessPreGenesisDeposit -> ProcessPreGenesisDeposits
31 lines
828 B
Go
31 lines
828 B
Go
package fuzz
|
|
|
|
import (
|
|
"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"
|
|
)
|
|
|
|
// BeaconFuzzDeposit implements libfuzzer and beacon fuzz interface.
|
|
func BeaconFuzzDeposit(b []byte) ([]byte, bool) {
|
|
params.UseMainnetConfig()
|
|
input := &InputDepositWrapper{}
|
|
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.ProcessDeposit(st, input.Deposit, true)
|
|
if err != nil {
|
|
return fail(err)
|
|
}
|
|
return success(post)
|
|
}
|