Remove Fulu block and state. (#14905)

* Remove Fulu block and state.

* Add missing tests.

* Alias `ProtobufBeaconStateFulu` to `ProtobufBeaconStateElectra`
This commit is contained in:
Manu NALEPA
2025-02-14 11:48:24 +01:00
committed by GitHub
parent e39f44b529
commit 215fbcb2e4
38 changed files with 1485 additions and 5763 deletions

View File

@@ -489,7 +489,7 @@ func unmarshalSignedElectraBlock(t *testing.T, raw []byte) interfaces.SignedBeac
// ----------------------------------------------------------------------------
func unmarshalFuluState(t *testing.T, raw []byte) state.BeaconState {
base := &ethpb.BeaconStateFulu{}
base := &ethpb.BeaconStateElectra{}
require.NoError(t, base.UnmarshalSSZ(raw))
st, err := state_native.InitializeFromProtoFulu(base)
require.NoError(t, err)
@@ -497,7 +497,7 @@ func unmarshalFuluState(t *testing.T, raw []byte) state.BeaconState {
}
func unmarshalFuluBlock(t *testing.T, raw []byte) interfaces.SignedBeaconBlock {
base := &ethpb.BeaconBlockFulu{}
base := &ethpb.BeaconBlockElectra{}
require.NoError(t, base.UnmarshalSSZ(raw))
blk, err := blocks.NewSignedBeaconBlock(&ethpb.SignedBeaconBlockFulu{Block: base, Signature: make([]byte, fieldparams.BLSSignatureLength)})
require.NoError(t, err)

View File

@@ -1346,9 +1346,9 @@ func HydrateSignedBeaconBlockContentsFulu(b *ethpb.SignedBeaconBlockContentsFulu
// HydrateBeaconBlockFulu hydrates a beacon block with correct field length sizes
// to comply with fssz marshalling and unmarshalling rules.
func HydrateBeaconBlockFulu(b *ethpb.BeaconBlockFulu) *ethpb.BeaconBlockFulu {
func HydrateBeaconBlockFulu(b *ethpb.BeaconBlockElectra) *ethpb.BeaconBlockElectra {
if b == nil {
b = &ethpb.BeaconBlockFulu{}
b = &ethpb.BeaconBlockElectra{}
}
if b.ParentRoot == nil {
b.ParentRoot = make([]byte, fieldparams.RootLength)
@@ -1362,9 +1362,9 @@ func HydrateBeaconBlockFulu(b *ethpb.BeaconBlockFulu) *ethpb.BeaconBlockFulu {
// HydrateBeaconBlockBodyFulu hydrates a beacon block body with correct field length sizes
// to comply with fssz marshalling and unmarshalling rules.
func HydrateBeaconBlockBodyFulu(b *ethpb.BeaconBlockBodyFulu) *ethpb.BeaconBlockBodyFulu {
func HydrateBeaconBlockBodyFulu(b *ethpb.BeaconBlockBodyElectra) *ethpb.BeaconBlockBodyElectra {
if b == nil {
b = &ethpb.BeaconBlockBodyFulu{}
b = &ethpb.BeaconBlockBodyElectra{}
}
if b.RandaoReveal == nil {
b.RandaoReveal = make([]byte, fieldparams.BLSSignatureLength)
@@ -1431,9 +1431,9 @@ func HydrateBlindedBeaconBlockFulu(b *ethpb.BlindedBeaconBlockFulu) *ethpb.Blind
// HydrateBlindedBeaconBlockBodyFulu hydrates a blinded beacon block body with correct field length sizes
// to comply with fssz marshalling and unmarshalling rules.
func HydrateBlindedBeaconBlockBodyFulu(b *ethpb.BlindedBeaconBlockBodyFulu) *ethpb.BlindedBeaconBlockBodyFulu {
func HydrateBlindedBeaconBlockBodyFulu(b *ethpb.BlindedBeaconBlockBodyElectra) *ethpb.BlindedBeaconBlockBodyElectra {
if b == nil {
b = &ethpb.BlindedBeaconBlockBodyFulu{}
b = &ethpb.BlindedBeaconBlockBodyElectra{}
}
if b.RandaoReveal == nil {
b.RandaoReveal = make([]byte, fieldparams.BLSSignatureLength)

View File

@@ -455,13 +455,13 @@ func NewBeaconStateElectra(options ...func(state *ethpb.BeaconStateElectra) erro
}
// NewBeaconStateFulu creates a beacon state with minimum marshalable fields.
func NewBeaconStateFulu(options ...func(state *ethpb.BeaconStateFulu) error) (state.BeaconState, error) {
func NewBeaconStateFulu(options ...func(state *ethpb.BeaconStateElectra) error) (state.BeaconState, error) {
pubkeys := make([][]byte, 512)
for i := range pubkeys {
pubkeys[i] = make([]byte, 48)
}
seed := &ethpb.BeaconStateFulu{
seed := &ethpb.BeaconStateElectra{
BlockRoots: filledByteSlice2D(uint64(params.BeaconConfig().SlotsPerHistoricalRoot), 32),
StateRoots: filledByteSlice2D(uint64(params.BeaconConfig().SlotsPerHistoricalRoot), 32),
Slashings: make([]uint64, params.BeaconConfig().EpochsPerSlashingsVector),