Files
prysm/testing/util/gloas_state.go
terence c02c057b7d core: implement cached PTC window in state (#16573)
This adds the PTC cache to the Gloas proto and native beacon state,
updates SSZ/hash-tree-root handling, initializes the cache on Gloas
upgrade, rotates it during epoch processing, and switches payload
committee lookups to read from the cached window instead of recomputing
PTC assignments on demand

Reference: https://github.com/ethereum/consensus-specs/pull/4979
2026-04-02 17:56:02 +00:00

25 lines
768 B
Go

package util
import (
"testing"
"github.com/OffchainLabs/prysm/v7/beacon-chain/core/gloas"
"github.com/OffchainLabs/prysm/v7/beacon-chain/state"
"github.com/OffchainLabs/prysm/v7/crypto/bls"
"github.com/pkg/errors"
)
// DeterministicGenesisStateGloas returns a genesis state in Gloas format made
// using the deterministic deposits.
func DeterministicGenesisStateGloas(t testing.TB, numValidators uint64) (state.BeaconState, []bls.SecretKey) {
t.Helper()
fuluState, privKeys := DeterministicGenesisStateFulu(t, numValidators)
beaconState, err := gloas.UpgradeToGloas(fuluState)
if err != nil {
t.Fatal(errors.Wrapf(err, "failed to upgrade genesis beacon state of %d validators to gloas", numValidators))
}
resetCache()
return beaconState, privKeys
}