Removes fork-specific concrete type getters (#13941)

* removing typed pb accessors

* refactor ssz api resp handlers to avoid typed pbs

* json get block handler refactor

* SubmitBlindedBlock to use generic json handling

* update SubmitBlindedBlock

* clear out more usages of PbForkname methods

* remove fork-specific getters from block interface

* remove usages of payload pb methods

* remove pb helpers from execution payload interface

* Update beacon-chain/rpc/eth/beacon/handlers.go

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

* Update beacon-chain/rpc/eth/beacon/handlers.go

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

* Update api/client/builder/client.go

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

* Update api/client/builder/client.go

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

* Update api/client/builder/client.go

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

* Update api/client/builder/client.go

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

* Update api/client/builder/client.go

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

* Radek review

* fix error message

* deal with wonky builder responses

* ✂️

* gaz

* lint

* tweaks for deep source

---------

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
This commit is contained in:
kasey
2024-05-02 15:52:27 -05:00
committed by GitHub
parent 625818d556
commit c312a88aa3
26 changed files with 553 additions and 1442 deletions

View File

@@ -128,11 +128,16 @@ func (v *validator) ProposeBlock(ctx context.Context, slot primitives.Slot, pubK
var genericSignedBlock *ethpb.GenericSignedBeaconBlock
if blk.Version() >= version.Deneb && !blk.IsBlinded() {
denebBlock, err := blk.PbDenebBlock()
pb, err := blk.Proto()
if err != nil {
log.WithError(err).Error("Failed to get deneb block")
return
}
denebBlock, ok := pb.(*ethpb.SignedBeaconBlockDeneb)
if !ok {
log.WithError(err).Error("Failed to get deneb block - assertion failure")
return
}
genericSignedBlock = &ethpb.GenericSignedBeaconBlock{
Block: &ethpb.GenericSignedBeaconBlock_Deneb{
Deneb: &ethpb.SignedBeaconBlockContentsDeneb{