Files
prysm/beacon-chain/state/stateutil/proposer_lookahead_root.go
Bastin 92bd211e4d upgrade v6 to v7 (#15989)
* upgrade v6 to v7

* changelog

* update-go-ssz
2025-11-06 16:16:23 +00:00

19 lines
561 B
Go

package stateutil
import (
"encoding/binary"
"github.com/OffchainLabs/prysm/v7/consensus-types/primitives"
"github.com/OffchainLabs/prysm/v7/encoding/ssz"
)
// ProposerLookaheadRoot computes the hash tree root of the proposer lookahead
func ProposerLookaheadRoot(lookahead []primitives.ValidatorIndex) ([32]byte, error) {
chunks := make([][32]byte, (len(lookahead)*8+31)/32)
for i, idx := range lookahead {
j := i / 4
binary.LittleEndian.PutUint64(chunks[j][(i%4)*8:], uint64(idx))
}
return ssz.MerkleizeVector(chunks, uint64(len(chunks))), nil
}