beacon/engine: ensure nil ExecutionPayloadEnvelope.BlockValue doesn't crash (#35140)

Found while updating to go-ethereum master in prysm.
This commit is contained in:
Felix Lange 2026-06-10 20:03:13 +02:00 committed by GitHub
parent e444c267a2
commit 8a8becaeab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -66,7 +66,11 @@ func (e ExecutionPayloadEnvelope) MarshalJSON() ([]byte, error) {
b.RawValue(payload)
b.Key("blockValue")
b.HexBigInt(e.BlockValue)
if e.BlockValue != nil {
b.HexBigInt(e.BlockValue)
} else {
b.Null()
}
b.Key("blobsBundle")
marshalBlobsBundle(&b, e.BlobsBundle)