mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-10 11:41:21 +00:00
26a2311c82
* Rm outdated merge code * Update config_test.go * Native Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
19 lines
640 B
Go
19 lines
640 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.
|
|
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)
|
|
}
|