Skip to content

Commit

Permalink
simplify how payload is returned
Browse files Browse the repository at this point in the history
  • Loading branch information
rkapka committed Jan 22, 2024
1 parent 173c84b commit 071a1a1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 44 deletions.
2 changes: 1 addition & 1 deletion beacon-chain/rpc/eth/validator/handlers_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func (s *Server) produceBlockV3(ctx context.Context, w http.ResponseWriter, r *h
}

w.Header().Set(api.ExecutionPayloadBlindedHeader, fmt.Sprintf("%v", v1alpha1resp.IsBlinded))
w.Header().Set(api.ExecutionPayloadValueHeader, fmt.Sprintf("%d", v1alpha1resp.PayloadValue))
w.Header().Set(api.ExecutionPayloadValueHeader, v1alpha1resp.PayloadValue)
w.Header().Set(api.ConsensusBlockValueHeader, consensusBlockValue)

phase0Block, ok := v1alpha1resp.Block.(*eth.GenericBeaconBlock_Phase0)
Expand Down
1 change: 1 addition & 0 deletions beacon-chain/rpc/prysm/v1alpha1/validator/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ go_library(
"//crypto/rand:go_default_library",
"//encoding/bytesutil:go_default_library",
"//encoding/ssz:go_default_library",
"//math:go_default_library",
"//monitoring/tracing:go_default_library",
"//network/forks:go_default_library",
"//proto/engine/v1:go_default_library",
Expand Down
44 changes: 1 addition & 43 deletions consensus-types/blocks/getters.go
Original file line number Diff line number Diff line change
Expand Up @@ -1059,49 +1059,7 @@ func (b *BeaconBlockBody) Execution() (interfaces.ExecutionData, error) {
switch b.version {
case version.Phase0, version.Altair:
return nil, consensus_types.ErrNotSupported("Execution", b.version)
case version.Bellatrix:
if b.IsBlinded() {
var ph *enginev1.ExecutionPayloadHeader
var ok bool
if b.executionPayloadHeader != nil {
ph, ok = b.executionPayloadHeader.Proto().(*enginev1.ExecutionPayloadHeader)
if !ok {
return nil, errPayloadHeaderWrongType
}
}
return WrappedExecutionPayloadHeader(ph)
}
var p *enginev1.ExecutionPayload
var ok bool
if b.executionPayload != nil {
p, ok = b.executionPayload.Proto().(*enginev1.ExecutionPayload)
if !ok {
return nil, errPayloadWrongType
}
}
return WrappedExecutionPayload(p)
case version.Capella:
if b.IsBlinded() {
var ph *enginev1.ExecutionPayloadHeaderCapella
var ok bool
if b.executionPayloadHeader != nil {
ph, ok = b.executionPayloadHeader.Proto().(*enginev1.ExecutionPayloadHeaderCapella)
if !ok {
return nil, errPayloadHeaderWrongType
}
return WrappedExecutionPayloadHeaderCapella(ph, big.NewInt(0))
}
}
var p *enginev1.ExecutionPayloadCapella
var ok bool
if b.executionPayload != nil {
p, ok = b.executionPayload.Proto().(*enginev1.ExecutionPayloadCapella)
if !ok {
return nil, errPayloadWrongType
}
}
return WrappedExecutionPayloadCapella(p, big.NewInt(0))
case version.Deneb:
default:
if b.IsBlinded() {
return b.executionPayloadHeader, nil
}
Expand Down

0 comments on commit 071a1a1

Please sign in to comment.