forked from forks/go-ethereum
beacon/engine: omit empty witness in payload response (#31739)
Fixes https://github.com/ethereum/go-ethereum/issues/31737
This commit is contained in:
parent
a511553e44
commit
0ac4a84a1f
2 changed files with 6 additions and 3 deletions
|
|
@ -131,7 +131,7 @@ type executionPayloadEnvelopeMarshaling struct {
|
||||||
|
|
||||||
type PayloadStatusV1 struct {
|
type PayloadStatusV1 struct {
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
Witness *hexutil.Bytes `json:"witness"`
|
Witness *hexutil.Bytes `json:"witness,omitempty"`
|
||||||
LatestValidHash *common.Hash `json:"latestValidHash"`
|
LatestValidHash *common.Hash `json:"latestValidHash"`
|
||||||
ValidationError *string `json:"validationError"`
|
ValidationError *string `json:"validationError"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -373,8 +373,11 @@ func (api *ConsensusAPI) forkchoiceUpdated(update engine.ForkchoiceStateV1, payl
|
||||||
}
|
}
|
||||||
valid := func(id *engine.PayloadID) engine.ForkChoiceResponse {
|
valid := func(id *engine.PayloadID) engine.ForkChoiceResponse {
|
||||||
return engine.ForkChoiceResponse{
|
return engine.ForkChoiceResponse{
|
||||||
PayloadStatus: engine.PayloadStatusV1{Status: engine.VALID, LatestValidHash: &update.HeadBlockHash},
|
PayloadStatus: engine.PayloadStatusV1{
|
||||||
PayloadID: id,
|
Status: engine.VALID,
|
||||||
|
LatestValidHash: &update.HeadBlockHash,
|
||||||
|
},
|
||||||
|
PayloadID: id,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if rawdb.ReadCanonicalHash(api.eth.ChainDb(), block.NumberU64()) != update.HeadBlockHash {
|
if rawdb.ReadCanonicalHash(api.eth.ChainDb(), block.NumberU64()) != update.HeadBlockHash {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue