@@ -80,6 +80,8 @@ func (b *SignedBeaconBlock) Copy() (interfaces.SignedBeaconBlock, error) {
8080 return initBlindedSignedBlockFromProtoFulu (pb .(* eth.SignedBlindedBeaconBlockFulu ).Copy ())
8181 }
8282 return initSignedBlockFromProtoFulu (pb .(* eth.SignedBeaconBlockFulu ).Copy ())
83+ case version .Gloas :
84+ return initSignedBlockFromProtoGloas (eth .CopySignedBeaconBlockGloas (pb .(* eth.SignedBeaconBlockGloas )))
8385 default :
8486 return nil , errIncorrectBlockVersion
8587 }
@@ -157,14 +159,17 @@ func (b *SignedBeaconBlock) PbGenericBlock() (*eth.GenericSignedBeaconBlock, err
157159 return & eth.GenericSignedBeaconBlock {
158160 Block : & eth.GenericSignedBeaconBlock_Fulu {Fulu : bc },
159161 }, nil
162+ case version .Gloas :
163+ // Gloas doesn't support GenericSignedBeaconBlock yet
164+ return nil , errors .New ("Gloas blocks don't support GenericSignedBeaconBlock conversion" )
160165 default :
161166 return nil , errIncorrectBlockVersion
162167 }
163168}
164169
165170// ToBlinded converts a non-blinded block to its blinded equivalent.
166171func (b * SignedBeaconBlock ) ToBlinded () (interfaces.ReadOnlySignedBeaconBlock , error ) {
167- if b .version < version .Bellatrix {
172+ if b .version < version .Bellatrix || b . version >= version . Gloas {
168173 return nil , ErrUnsupportedVersion
169174 }
170175 if b .IsBlinded () {
@@ -376,7 +381,7 @@ func (b *SignedBeaconBlock) Version() int {
376381
377382// IsBlinded metadata on whether a block is blinded
378383func (b * SignedBeaconBlock ) IsBlinded () bool {
379- return b .version >= version .Bellatrix && b .block .body .executionPayload == nil
384+ return b .version < version . Gloas && b . version >= version .Bellatrix && b .block .body .executionPayload == nil
380385}
381386
382387// Header converts the underlying protobuf object from blinded block to header format.
@@ -437,6 +442,8 @@ func (b *SignedBeaconBlock) MarshalSSZ() ([]byte, error) {
437442 return pb .(* eth.SignedBlindedBeaconBlockFulu ).MarshalSSZ ()
438443 }
439444 return pb .(* eth.SignedBeaconBlockFulu ).MarshalSSZ ()
445+ case version .Gloas :
446+ return pb .(* eth.SignedBeaconBlockGloas ).MarshalSSZ ()
440447 default :
441448 return []byte {}, errIncorrectBlockVersion
442449 }
@@ -479,6 +486,8 @@ func (b *SignedBeaconBlock) MarshalSSZTo(dst []byte) ([]byte, error) {
479486 return pb .(* eth.SignedBlindedBeaconBlockFulu ).MarshalSSZTo (dst )
480487 }
481488 return pb .(* eth.SignedBeaconBlockFulu ).MarshalSSZTo (dst )
489+ case version .Gloas :
490+ return pb .(* eth.SignedBeaconBlockGloas ).MarshalSSZTo (dst )
482491 default :
483492 return []byte {}, errIncorrectBlockVersion
484493 }
@@ -526,6 +535,8 @@ func (b *SignedBeaconBlock) SizeSSZ() int {
526535 return pb .(* eth.SignedBlindedBeaconBlockFulu ).SizeSSZ ()
527536 }
528537 return pb .(* eth.SignedBeaconBlockFulu ).SizeSSZ ()
538+ case version .Gloas :
539+ return pb .(* eth.SignedBeaconBlockGloas ).SizeSSZ ()
529540 default :
530541 panic (incorrectBlockVersion )
531542 }
@@ -666,6 +677,16 @@ func (b *SignedBeaconBlock) UnmarshalSSZ(buf []byte) error {
666677 return err
667678 }
668679 }
680+ case version .Gloas :
681+ pb := & eth.SignedBeaconBlockGloas {}
682+ if err := pb .UnmarshalSSZ (buf ); err != nil {
683+ return err
684+ }
685+ var err error
686+ newBlock , err = initSignedBlockFromProtoGloas (pb )
687+ if err != nil {
688+ return err
689+ }
669690 default :
670691 return errIncorrectBlockVersion
671692 }
@@ -705,7 +726,7 @@ func (b *BeaconBlock) IsNil() bool {
705726
706727// IsBlinded checks if the beacon block is a blinded block.
707728func (b * BeaconBlock ) IsBlinded () bool {
708- return b .version >= version .Bellatrix && b .body .executionPayload == nil
729+ return b .version < version . Gloas && b . version >= version .Bellatrix && b .body .executionPayload == nil
709730}
710731
711732// Version of the underlying protobuf object.
@@ -749,6 +770,9 @@ func (b *BeaconBlock) HashTreeRoot() ([field_params.RootLength]byte, error) {
749770 return pb .(* eth.BlindedBeaconBlockFulu ).HashTreeRoot ()
750771 }
751772 return pb .(* eth.BeaconBlockElectra ).HashTreeRoot ()
773+ case version .Gloas :
774+ return pb .(* eth.BeaconBlockGloas ).HashTreeRoot ()
775+
752776 default :
753777 return [field_params .RootLength ]byte {}, errIncorrectBlockVersion
754778 }
@@ -790,6 +814,8 @@ func (b *BeaconBlock) HashTreeRootWith(h *ssz.Hasher) error {
790814 return pb .(* eth.BlindedBeaconBlockFulu ).HashTreeRootWith (h )
791815 }
792816 return pb .(* eth.BeaconBlockElectra ).HashTreeRootWith (h )
817+ case version .Gloas :
818+ return pb .(* eth.BeaconBlockGloas ).HashTreeRootWith (h )
793819 default :
794820 return errIncorrectBlockVersion
795821 }
@@ -832,6 +858,8 @@ func (b *BeaconBlock) MarshalSSZ() ([]byte, error) {
832858 return pb .(* eth.BlindedBeaconBlockFulu ).MarshalSSZ ()
833859 }
834860 return pb .(* eth.BeaconBlockElectra ).MarshalSSZ ()
861+ case version .Gloas :
862+ return pb .(* eth.BeaconBlockGloas ).MarshalSSZ ()
835863 default :
836864 return []byte {}, errIncorrectBlockVersion
837865 }
@@ -874,6 +902,8 @@ func (b *BeaconBlock) MarshalSSZTo(dst []byte) ([]byte, error) {
874902 return pb .(* eth.BlindedBeaconBlockFulu ).MarshalSSZTo (dst )
875903 }
876904 return pb .(* eth.BeaconBlockElectra ).MarshalSSZTo (dst )
905+ case version .Gloas :
906+ return pb .(* eth.BeaconBlockGloas ).MarshalSSZTo (dst )
877907 default :
878908 return []byte {}, errIncorrectBlockVersion
879909 }
@@ -921,6 +951,8 @@ func (b *BeaconBlock) SizeSSZ() int {
921951 return pb .(* eth.BlindedBeaconBlockFulu ).SizeSSZ ()
922952 }
923953 return pb .(* eth.BeaconBlockElectra ).SizeSSZ ()
954+ case version .Gloas :
955+ return pb .(* eth.BeaconBlockGloas ).SizeSSZ ()
924956 default :
925957 panic (incorrectBodyVersion )
926958 }
@@ -1061,6 +1093,16 @@ func (b *BeaconBlock) UnmarshalSSZ(buf []byte) error {
10611093 return err
10621094 }
10631095 }
1096+ case version .Gloas :
1097+ pb := & eth.BeaconBlockGloas {}
1098+ if err := pb .UnmarshalSSZ (buf ); err != nil {
1099+ return err
1100+ }
1101+ var err error
1102+ newBlock , err = initBlockFromProtoGloas (pb )
1103+ if err != nil {
1104+ return err
1105+ }
10641106 default :
10651107 return errIncorrectBlockVersion
10661108 }
@@ -1239,6 +1281,22 @@ func (b *BeaconBlockBody) ExecutionRequests() (*enginev1.ExecutionRequests, erro
12391281 return b .executionRequests , nil
12401282}
12411283
1284+ // PayloadAttestations returns the payload attestations in the block.
1285+ func (b * BeaconBlockBody ) PayloadAttestations () ([]* eth.PayloadAttestation , error ) {
1286+ if b .version >= version .Gloas {
1287+ return b .payloadAttestations , nil
1288+ }
1289+ return nil , consensus_types .ErrNotSupported ("PayloadAttestations" , b .version )
1290+ }
1291+
1292+ // SignedExecutionPayloadBid returns the signed execution payload header in the block.
1293+ func (b * BeaconBlockBody ) SignedExecutionPayloadBid () (* eth.SignedExecutionPayloadBid , error ) {
1294+ if b .version >= version .Gloas {
1295+ return b .signedExecutionPayloadBid , nil
1296+ }
1297+ return nil , consensus_types .ErrNotSupported ("SignedExecutionPayloadBid" , b .version )
1298+ }
1299+
12421300// Version returns the version of the beacon block body
12431301func (b * BeaconBlockBody ) Version () int {
12441302 return b .version
@@ -1280,12 +1338,14 @@ func (b *BeaconBlockBody) HashTreeRoot() ([field_params.RootLength]byte, error)
12801338 return pb .(* eth.BlindedBeaconBlockBodyElectra ).HashTreeRoot ()
12811339 }
12821340 return pb .(* eth.BeaconBlockBodyElectra ).HashTreeRoot ()
1341+ case version .Gloas :
1342+ return pb .(* eth.BeaconBlockBodyGloas ).HashTreeRoot ()
12831343 default :
12841344 return [field_params .RootLength ]byte {}, errIncorrectBodyVersion
12851345 }
12861346}
12871347
12881348// IsBlinded checks if the beacon block body is a blinded block body.
12891349func (b * BeaconBlockBody ) IsBlinded () bool {
1290- return b .version >= version .Bellatrix && b .executionPayload == nil
1350+ return b .version < version . Gloas && b . version >= version .Bellatrix && b .executionPayload == nil
12911351}
0 commit comments