Add Fulu fork boilerplate (#14771)

* Prepare for future fork boilerplate.

* Implement the Fulu fork boilerplate.

* `Upgraded state to <fork> log`: Move from debug to info.

Rationale:
This log is the only one notifying the user a new fork happened.
A new fork is always a little bit stressful for a node operator.
Having at least one log indicating the client switched fork is something useful.

* Update testing/util/helpers.go

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* Fix Radek's comment.

* Fix Radek's comment.

* Update beacon-chain/state/state-native/state_trie.go

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* Update beacon-chain/state/state-native/state_trie.go

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* Fix Radek's comment.

* Fix Radek's comment.

* Fix Radek's comment.

* Remove Electra struct type aliasing.

---------

Co-authored-by: Radosław Kapka <rkapka@wp.pl>
This commit is contained in:
Manu NALEPA
2025-01-07 21:09:12 +01:00
committed by GitHub
parent a21f544219
commit c48d40907c
99 changed files with 10951 additions and 1507 deletions

View File

@@ -148,6 +148,12 @@ func (v *validator) ProposeBlock(ctx context.Context, slot primitives.Slot, pubK
log.WithError(err).Error("Failed to build generic signed block")
return
}
case version.Fulu:
genericSignedBlock, err = buildGenericSignedBlockFuluWithBlobs(pb, b)
if err != nil {
log.WithError(err).Error("Failed to build generic signed block")
return
}
default:
log.Errorf("Unsupported block version %s", version.String(blk.Version()))
}
@@ -270,6 +276,22 @@ func buildGenericSignedBlockElectraWithBlobs(pb proto.Message, b *ethpb.GenericB
}, nil
}
func buildGenericSignedBlockFuluWithBlobs(pb proto.Message, b *ethpb.GenericBeaconBlock) (*ethpb.GenericSignedBeaconBlock, error) {
fuluBlock, ok := pb.(*ethpb.SignedBeaconBlockFulu)
if !ok {
return nil, errors.New("could cast to fulu block")
}
return &ethpb.GenericSignedBeaconBlock{
Block: &ethpb.GenericSignedBeaconBlock_Fulu{
Fulu: &ethpb.SignedBeaconBlockContentsFulu{
Block: fuluBlock,
KzgProofs: b.GetFulu().KzgProofs,
Blobs: b.GetFulu().Blobs,
},
},
}, nil
}
// ProposeExit performs a voluntary exit on a validator.
// The exit is signed by the validator before being sent to the beacon node for broadcasting.
func ProposeExit(