mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-12 20:50:05 +00:00
Reuse ProcessBlockForStateRoot (#8781)
This commit is contained in:
parent
59ee339497
commit
400e42cc2d
@ -174,16 +174,11 @@ func ProcessBlockNoVerifyAnySig(
|
|||||||
}
|
}
|
||||||
|
|
||||||
blk := signed.Block
|
blk := signed.Block
|
||||||
body := blk.Body
|
state, err := ProcessBlockForStateRoot(ctx, state, signed)
|
||||||
bodyRoot, err := body.HashTreeRoot()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
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)
|
bSet, err := b.BlockSignatureSet(state, blk.ProposerIndex, signed.Signature, blk.HashTreeRoot)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
traceutil.AnnotateError(span, err)
|
traceutil.AnnotateError(span, err)
|
||||||
@ -194,23 +189,6 @@ func ProcessBlockNoVerifyAnySig(
|
|||||||
traceutil.AnnotateError(span, err)
|
traceutil.AnnotateError(span, err)
|
||||||
return nil, nil, errors.Wrap(err, "could not retrieve randao signature set")
|
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)
|
aSet, err := b.AttestationSignatureSet(ctx, state, signed.Block.Body.Attestations)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, errors.Wrap(err, "could not retrieve attestation signature set")
|
return nil, nil, errors.Wrap(err, "could not retrieve attestation signature set")
|
||||||
|
Loading…
Reference in New Issue
Block a user