internal/ethapi: encode slotNumber as hex in RPCMarshalHeader (#34005)
Some checks are pending
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run

The slotNumber field was being passed as a raw *uint64 to the JSON
marshaler, which serializes it as a plain decimal integer (e.g. 159).
All Ethereum JSON-RPC quantity fields must be hex-encoded per spec.

Wrap with hexutil.Uint64 to match the encoding of other numeric header
fields like blobGasUsed and excessBlobGas.

Co-authored-by: qu0b <stefan@starflinger.eu>
This commit is contained in:
jwasinger 2026-03-13 12:09:32 -04:00 committed by GitHub
parent 189f9d0b17
commit ede376af8e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -966,7 +966,7 @@ func RPCMarshalHeader(head *types.Header) map[string]interface{} {
result["requestsHash"] = head.RequestsHash
}
if head.SlotNumber != nil {
result["slotNumber"] = head.SlotNumber
result["slotNumber"] = hexutil.Uint64(*head.SlotNumber)
}
return result
}