Skip to content

Commit 34097a0

Browse files
authored
Merge pull request #1046 from marioevz/eip-7685-devnet-5-updates
EIP-7685: exclude empty requests in requests list
2 parents 61da51b + d212a25 commit 34097a0

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

src/ethereum/prague/fork.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,8 @@ def process_general_purpose_requests(
890890
"""
891891
# Requests are to be in ascending order of request type
892892
requests_from_execution: List[Bytes] = []
893-
requests_from_execution.append(DEPOSIT_REQUEST_TYPE + deposit_requests)
893+
if len(deposit_requests) > 0:
894+
requests_from_execution.append(DEPOSIT_REQUEST_TYPE + deposit_requests)
894895

895896
system_withdrawal_tx_output = process_system_transaction(
896897
WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS,
@@ -907,9 +908,10 @@ def process_general_purpose_requests(
907908
excess_blob_gas,
908909
)
909910

910-
requests_from_execution.append(
911-
WITHDRAWAL_REQUEST_TYPE + system_withdrawal_tx_output.return_data
912-
)
911+
if len(system_withdrawal_tx_output.return_data) > 0:
912+
requests_from_execution.append(
913+
WITHDRAWAL_REQUEST_TYPE + system_withdrawal_tx_output.return_data
914+
)
913915

914916
system_consolidation_tx_output = process_system_transaction(
915917
CONSOLIDATION_REQUEST_PREDEPLOY_ADDRESS,
@@ -926,9 +928,11 @@ def process_general_purpose_requests(
926928
excess_blob_gas,
927929
)
928930

929-
requests_from_execution.append(
930-
CONSOLIDATION_REQUEST_TYPE + system_consolidation_tx_output.return_data
931-
)
931+
if len(system_consolidation_tx_output.return_data) > 0:
932+
requests_from_execution.append(
933+
CONSOLIDATION_REQUEST_TYPE
934+
+ system_consolidation_tx_output.return_data
935+
)
932936

933937
return requests_from_execution
934938

src/ethereum_spec_tools/evm_tools/t8n/t8n_types.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,6 @@ def to_json(self) -> Any:
356356
data["requestsHash"] = encode_to_hex(self.requests_hash)
357357
# T8N doesn't consider the request type byte to be part of the
358358
# request
359-
data["requests"] = [
360-
encode_to_hex(req[1:]) for req in self.requests
361-
]
359+
data["requests"] = [encode_to_hex(req) for req in self.requests]
362360

363361
return data

0 commit comments

Comments
 (0)