mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
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:
@@ -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 ðpb.GenericSignedBeaconBlock{
|
||||
Block: ðpb.GenericSignedBeaconBlock_Fulu{
|
||||
Fulu: ðpb.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(
|
||||
|
||||
Reference in New Issue
Block a user