mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 12:57:18 +00:00
No magic number for BlockBodyRoot
(#5803)
* `GetValidatorPerformance` return `Unavailable` when syncing * Use proper config values for BlockBodyRoot Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
parent
bfe694c4f3
commit
34f28a31b1
@ -91,12 +91,12 @@ func BlockBodyRoot(body *ethpb.BeaconBlockBody) ([32]byte, error) {
|
|||||||
graffitiRoot := bytesutil.ToBytes32(body.Graffiti)
|
graffitiRoot := bytesutil.ToBytes32(body.Graffiti)
|
||||||
fieldRoots[2] = graffitiRoot
|
fieldRoots[2] = graffitiRoot
|
||||||
|
|
||||||
proposerSlashingsRoot, err := ssz.HashTreeRootWithCapacity(body.ProposerSlashings, 16)
|
proposerSlashingsRoot, err := ssz.HashTreeRootWithCapacity(body.ProposerSlashings, params.BeaconConfig().MaxProposerSlashings)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return [32]byte{}, err
|
return [32]byte{}, err
|
||||||
}
|
}
|
||||||
fieldRoots[3] = proposerSlashingsRoot
|
fieldRoots[3] = proposerSlashingsRoot
|
||||||
attesterSlashingsRoot, err := ssz.HashTreeRootWithCapacity(body.AttesterSlashings, 1)
|
attesterSlashingsRoot, err := ssz.HashTreeRootWithCapacity(body.AttesterSlashings, params.BeaconConfig().MaxAttesterSlashings)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return [32]byte{}, err
|
return [32]byte{}, err
|
||||||
}
|
}
|
||||||
@ -107,13 +107,13 @@ func BlockBodyRoot(body *ethpb.BeaconBlockBody) ([32]byte, error) {
|
|||||||
}
|
}
|
||||||
fieldRoots[5] = attsRoot
|
fieldRoots[5] = attsRoot
|
||||||
|
|
||||||
depositRoot, err := ssz.HashTreeRootWithCapacity(body.Deposits, 16)
|
depositRoot, err := ssz.HashTreeRootWithCapacity(body.Deposits, params.BeaconConfig().MaxDeposits)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return [32]byte{}, err
|
return [32]byte{}, err
|
||||||
}
|
}
|
||||||
fieldRoots[6] = depositRoot
|
fieldRoots[6] = depositRoot
|
||||||
|
|
||||||
exitRoot, err := ssz.HashTreeRootWithCapacity(body.VoluntaryExits, 16)
|
exitRoot, err := ssz.HashTreeRootWithCapacity(body.VoluntaryExits, params.BeaconConfig().MaxVoluntaryExits)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return [32]byte{}, err
|
return [32]byte{}, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user