Files
prysm/beacon-chain/state/stateutil/proposer_lookahead_root.go
Potuz f8b88db1a4 EIP 7917 (#15129)
* Add the new Fulu state with the new field

* fix the hasher for the fulu state

* Fix ToProto() and ToProtoUnsafe()

* Add the fields as shared

* Add epoch transition code

* short circuit the proposer cache to use the state

* Marshal the state JSON

* update spectests to 1.6.0-alpha.1

* Remove deneb and electra entries from blob schedule

This was cherry picked from PR #15364
and edited to remove the minimal cases

* Fix minimal tests

* Increase deadling for processing blocks in spectests

* Preston's review

* review

---------

Co-authored-by: terence tsao <terence@prysmaticlabs.com>
2025-06-12 20:40:34 +00:00

19 lines
561 B
Go

package stateutil
import (
"encoding/binary"
"github.com/OffchainLabs/prysm/v6/consensus-types/primitives"
"github.com/OffchainLabs/prysm/v6/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
}