From 59732d1209c7ab86d1e3a50ff5b376a4af887984 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Tue, 17 Dec 2024 17:07:50 +0100 Subject: [PATCH] core/types, internal/ethapi: rename requestsRoot -> requestsHash in JSON --- core/types/block.go | 2 +- core/types/gen_header_json.go | 4 ++-- internal/ethapi/api.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/types/block.go b/core/types/block.go index ad6c86398d..c3db4d89e8 100644 --- a/core/types/block.go +++ b/core/types/block.go @@ -105,7 +105,7 @@ type Header struct { ParentBeaconRoot *common.Hash `json:"parentBeaconBlockRoot" rlp:"optional"` // RequestsHash was added by EIP-7685 and is ignored in legacy headers. - RequestsHash *common.Hash `json:"requestsRoot" rlp:"optional"` + RequestsHash *common.Hash `json:"requestsHash" rlp:"optional"` } // field type overrides for gencodec diff --git a/core/types/gen_header_json.go b/core/types/gen_header_json.go index 322c5d5642..0af12500bd 100644 --- a/core/types/gen_header_json.go +++ b/core/types/gen_header_json.go @@ -36,7 +36,7 @@ func (h Header) MarshalJSON() ([]byte, error) { BlobGasUsed *hexutil.Uint64 `json:"blobGasUsed" rlp:"optional"` ExcessBlobGas *hexutil.Uint64 `json:"excessBlobGas" rlp:"optional"` ParentBeaconRoot *common.Hash `json:"parentBeaconBlockRoot" rlp:"optional"` - RequestsHash *common.Hash `json:"requestsRoot" rlp:"optional"` + RequestsHash *common.Hash `json:"requestsHash" rlp:"optional"` Hash common.Hash `json:"hash"` } var enc Header @@ -88,7 +88,7 @@ func (h *Header) UnmarshalJSON(input []byte) error { BlobGasUsed *hexutil.Uint64 `json:"blobGasUsed" rlp:"optional"` ExcessBlobGas *hexutil.Uint64 `json:"excessBlobGas" rlp:"optional"` ParentBeaconRoot *common.Hash `json:"parentBeaconBlockRoot" rlp:"optional"` - RequestsHash *common.Hash `json:"requestsRoot" rlp:"optional"` + RequestsHash *common.Hash `json:"requestsHash" rlp:"optional"` } var dec Header if err := json.Unmarshal(input, &dec); err != nil { diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 3f9ce46ddb..a983d4ecc9 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -895,7 +895,7 @@ func RPCMarshalHeader(head *types.Header) map[string]interface{} { result["parentBeaconBlockRoot"] = head.ParentBeaconRoot } if head.RequestsHash != nil { - result["requestsRoot"] = head.RequestsHash + result["requestsHash"] = head.RequestsHash } return result }