Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EIP-7685: exclude empty requests in requests list #1046

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions src/ethereum/prague/fork.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/ethereum_spec_tools/evm_tools/t8n/t8n_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading