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 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..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[1:]) for req in self.requests - ] + data["requests"] = [encode_to_hex(req) for req in self.requests] return data