mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 04:47:18 +00:00
Reuse ProcessBlockForStateRoot (#8781)
This commit is contained in:
parent
59ee339497
commit
400e42cc2d
@ -174,16 +174,11 @@ func ProcessBlockNoVerifyAnySig(
|
||||
}
|
||||
|
||||
blk := signed.Block
|
||||
body := blk.Body
|
||||
bodyRoot, err := body.HashTreeRoot()
|
||||
state, err := ProcessBlockForStateRoot(ctx, state, signed)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
state, err = b.ProcessBlockHeaderNoVerify(state, blk.Slot, blk.ProposerIndex, blk.ParentRoot, bodyRoot[:])
|
||||
if err != nil {
|
||||
traceutil.AnnotateError(span, err)
|
||||
return nil, nil, errors.Wrap(err, "could not process block header")
|
||||
}
|
||||
|
||||
bSet, err := b.BlockSignatureSet(state, blk.ProposerIndex, signed.Signature, blk.HashTreeRoot)
|
||||
if err != nil {
|
||||
traceutil.AnnotateError(span, err)
|
||||
@ -194,23 +189,6 @@ func ProcessBlockNoVerifyAnySig(
|
||||
traceutil.AnnotateError(span, err)
|
||||
return nil, nil, errors.Wrap(err, "could not retrieve randao signature set")
|
||||
}
|
||||
state, err = b.ProcessRandaoNoVerify(state, signed.Block.Body.RandaoReveal)
|
||||
if err != nil {
|
||||
traceutil.AnnotateError(span, err)
|
||||
return nil, nil, errors.Wrap(err, "could not verify and process randao")
|
||||
}
|
||||
|
||||
state, err = b.ProcessEth1DataInBlock(ctx, state, signed.Block.Body.Eth1Data)
|
||||
if err != nil {
|
||||
traceutil.AnnotateError(span, err)
|
||||
return nil, nil, errors.Wrap(err, "could not process eth1 data")
|
||||
}
|
||||
|
||||
state, err = ProcessOperationsNoVerifyAttsSigs(ctx, state, signed)
|
||||
if err != nil {
|
||||
traceutil.AnnotateError(span, err)
|
||||
return nil, nil, errors.Wrap(err, "could not process block operation")
|
||||
}
|
||||
aSet, err := b.AttestationSignatureSet(ctx, state, signed.Block.Body.Attestations)
|
||||
if err != nil {
|
||||
return nil, nil, errors.Wrap(err, "could not retrieve attestation signature set")
|
||||
|
Loading…
Reference in New Issue
Block a user