From feda402561a9bc52a9fbc473a1ad385334bf20b8 Mon Sep 17 00:00:00 2001 From: Mario Vega Date: Tue, 3 Dec 2024 23:56:42 +0000 Subject: [PATCH 1/3] prague: exclude empty requests in requests list --- src/ethereum/prague/fork.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/ethereum/prague/fork.py b/src/ethereum/prague/fork.py index d39183a9c0..aa3a4d7938 100644 --- a/src/ethereum/prague/fork.py +++ b/src/ethereum/prague/fork.py @@ -890,7 +890,8 @@ def process_general_purpose_requests( """ # Requests are to be in ascending order of request type requests_from_execution: List[Bytes] = [] - requests_from_execution.append(DEPOSIT_REQUEST_TYPE + deposit_requests) + if len(deposit_requests) > 0: + requests_from_execution.append(DEPOSIT_REQUEST_TYPE + deposit_requests) system_withdrawal_tx_output = process_system_transaction( WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS, @@ -907,9 +908,10 @@ def process_general_purpose_requests( excess_blob_gas, ) - requests_from_execution.append( - WITHDRAWAL_REQUEST_TYPE + system_withdrawal_tx_output.return_data - ) + if len(system_withdrawal_tx_output.return_data) > 0: + requests_from_execution.append( + WITHDRAWAL_REQUEST_TYPE + system_withdrawal_tx_output.return_data + ) system_consolidation_tx_output = process_system_transaction( CONSOLIDATION_REQUEST_PREDEPLOY_ADDRESS, @@ -926,9 +928,11 @@ def process_general_purpose_requests( excess_blob_gas, ) - requests_from_execution.append( - CONSOLIDATION_REQUEST_TYPE + system_consolidation_tx_output.return_data - ) + if len(system_consolidation_tx_output.return_data) > 0: + requests_from_execution.append( + CONSOLIDATION_REQUEST_TYPE + + system_consolidation_tx_output.return_data + ) return requests_from_execution From 5ab9df458bc6189a6608f8cb673c00362fff0d95 Mon Sep 17 00:00:00 2001 From: Mario Vega Date: Tue, 3 Dec 2024 23:56:59 +0000 Subject: [PATCH 2/3] t8n: include request_type byte in result.requests --- 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 724df86f94..6c805f80e0 100644 --- a/src/ethereum_spec_tools/evm_tools/t8n/t8n_types.py +++ b/src/ethereum_spec_tools/evm_tools/t8n/t8n_types.py @@ -357,7 +357,7 @@ def to_json(self) -> Any: # 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 + encode_to_hex(req) for req in self.requests ] return data From d212a25b9c60284925227f8e15656a598524c873 Mon Sep 17 00:00:00 2001 From: Peter Miller Date: Fri, 6 Dec 2024 11:41:59 +0000 Subject: [PATCH 3/3] Fix lints --- src/ethereum_spec_tools/evm_tools/t8n/t8n_types.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 6c805f80e0..4b1231c07d 100644 --- a/src/ethereum_spec_tools/evm_tools/t8n/t8n_types.py +++ b/src/ethereum_spec_tools/evm_tools/t8n/t8n_types.py @@ -356,8 +356,6 @@ 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) for req in self.requests - ] + data["requests"] = [encode_to_hex(req) for req in self.requests] return data