mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-11 20:20:05 +00:00
20 lines
658 B
Go
20 lines
658 B
Go
|
package v3
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
|
||
|
"github.com/prysmaticlabs/prysm/beacon-chain/state/stateutil"
|
||
|
"github.com/prysmaticlabs/prysm/config/features"
|
||
|
ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
|
||
|
)
|
||
|
|
||
|
// computeFieldRoots returns the hash tree root computations of every field in
|
||
|
// the beacon state as a list of 32 byte roots.
|
||
|
//nolint:deadcode
|
||
|
func computeFieldRoots(ctx context.Context, state *ethpb.BeaconStateBellatrix) ([][]byte, error) {
|
||
|
if features.Get().EnableSSZCache {
|
||
|
return stateutil.CachedHasher.ComputeFieldRootsWithHasherBellatrix(ctx, state)
|
||
|
}
|
||
|
return stateutil.NocachedHasher.ComputeFieldRootsWithHasherBellatrix(ctx, state)
|
||
|
}
|