From 4e187166ef38254d33167e9e02d180b4f88fef77 Mon Sep 17 00:00:00 2001 From: Peter Miller Date: Fri, 22 Nov 2024 14:03:46 +0000 Subject: [PATCH 1/3] Remove request type byte in T8N --- src/ethereum_spec_tools/evm_tools/t8n/t8n_types.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ethereum_spec_tools/evm_tools/t8n/t8n_types.py b/src/ethereum_spec_tools/evm_tools/t8n/t8n_types.py index e811b57218..ecdf294186 100644 --- a/src/ethereum_spec_tools/evm_tools/t8n/t8n_types.py +++ b/src/ethereum_spec_tools/evm_tools/t8n/t8n_types.py @@ -354,6 +354,8 @@ def to_json(self) -> Any: assert self.requests is not None data["requestsHash"] = encode_to_hex(self.requests_hash) - data["requests"] = [encode_to_hex(req) for req in self.requests] + # T8N doesn't consider the request type byte to be part of the + # request + data["requests"] = [encode_to_hex(req[1:]) for req in self.requests] return data From 34f100d00f552fd286b2d1de831bbd94f0f2a5e1 Mon Sep 17 00:00:00 2001 From: danceratopz Date: Mon, 25 Nov 2024 08:23:19 +0100 Subject: [PATCH 2/3] style: fix black --- src/ethereum_spec_tools/evm_tools/t8n/t8n_types.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ethereum_spec_tools/evm_tools/t8n/t8n_types.py b/src/ethereum_spec_tools/evm_tools/t8n/t8n_types.py index ecdf294186..8e02291aec 100644 --- a/src/ethereum_spec_tools/evm_tools/t8n/t8n_types.py +++ b/src/ethereum_spec_tools/evm_tools/t8n/t8n_types.py @@ -356,6 +356,8 @@ def to_json(self) -> Any: data["requestsHash"] = encode_to_hex(self.requests_hash) # T8N doesn't consider the request type byte to be part of the # request - data["requests"] = [encode_to_hex(req[1:]) for req in self.requests] + data["requests"] = [ + encode_to_hex(req[1:]) for req in self.requests + ] return data From 6e3cb10fd23d0a9f09248a8960142a894086583d Mon Sep 17 00:00:00 2001 From: danceratopz Date: Mon, 25 Nov 2024 08:23:39 +0100 Subject: [PATCH 3/3] chore: fix mypy; requests is a list --- src/ethereum_spec_tools/evm_tools/t8n/t8n_types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ethereum_spec_tools/evm_tools/t8n/t8n_types.py b/src/ethereum_spec_tools/evm_tools/t8n/t8n_types.py index 8e02291aec..724df86f94 100644 --- a/src/ethereum_spec_tools/evm_tools/t8n/t8n_types.py +++ b/src/ethereum_spec_tools/evm_tools/t8n/t8n_types.py @@ -307,7 +307,7 @@ class Result: excess_blob_gas: Optional[U64] = None blob_gas_used: Optional[Uint] = None requests_hash: Optional[Hash32] = None - requests: Optional[Bytes] = None + requests: Optional[List[Bytes]] = None def to_json(self) -> Any: """Encode the result to JSON"""