You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: The function is_valid_block_hash is modified to include the additional inclusion_list_transactions.
defis_valid_block_hash(self: ExecutionEngine,
execution_payload: ExecutionPayload,
parent_beacon_block_root: Root,
execution_requests_list: Sequence[bytes],
inclusion_list_transactions: Sequence[Transaction]) ->bool:
""" Return ``True`` if and only if ``execution_payload.block_hash`` is computed correctly. """
...
Modified notify_new_payload
Note: The function notify_new_payload is modified to include the additional inclusion_list_transactions.
defnotify_new_payload(self: ExecutionEngine,
execution_payload: ExecutionPayload,
parent_beacon_block_root: Root,
execution_requests_list: Sequence[bytes],
inclusion_list_transactions: Sequence[Transaction]) ->bool:
""" Return ``True`` if and only if ``execution_payload`` and ``execution_requests_list`` are valid with respect to ``self.execution_state``. """# TODO: move this outside of notify_new_payload.# If execution client returns block does not satisfy inclusion list transactions, cache the block# store.unsatisfied_inclusion_list_blocks.add(execution_payload.block_root)
...
Modified verify_and_notify_new_payload
Note: The function verify_and_notify_new_payload is modified to pass the additional parameter inclusion_list_transactions when calling notify_new_payload in EIP-7805.
defverify_and_notify_new_payload(self: ExecutionEngine,
new_payload_request: NewPayloadRequest) ->bool:
""" Return ``True`` if and only if ``new_payload_request`` is valid with respect to ``self.execution_state``. """execution_payload=new_payload_request.execution_payloadparent_beacon_block_root=new_payload_request.parent_beacon_block_rootexecution_requests_list=get_execution_requests_list(new_payload_request.execution_requests)
inclusion_list_transactions=new_payload_request.inclusion_list_transactions# [New in EIP-7805]ifb''inexecution_payload.transactions:
returnFalseifnotself.is_valid_block_hash(
execution_payload,
parent_beacon_block_root,
execution_requests_list):
returnFalseifnotself.is_valid_versioned_hashes(new_payload_request):
returnFalse# [Modified in EIP-7805]ifnotself.notify_new_payload(
execution_payload,
parent_beacon_block_root,
execution_requests_list,
inclusion_list_transactions):
returnFalsereturnTrue
Modified process_execution_payload
defprocess_execution_payload(state: BeaconState, body: BeaconBlockBody, execution_engine: ExecutionEngine) ->None:
payload=body.execution_payload# Verify consistency of the parent hash with respect to the previous execution payload headerassertpayload.parent_hash==state.latest_execution_payload_header.block_hash# Verify prev_randaoassertpayload.prev_randao==get_randao_mix(state, get_current_epoch(state))
# Verify timestampassertpayload.timestamp==compute_timestamp_at_slot(state, state.slot)
# Verify commitments are under limitassertlen(body.blob_kzg_commitments) <=MAX_BLOBS_PER_BLOCK_ELECTRA# Verify the execution payload is validversioned_hashes= [kzg_commitment_to_versioned_hash(commitment) forcommitmentinbody.blob_kzg_commitments]
# Verify inclusion list transactionsinclusion_list_transactions: Sequence[Transaction] = [] # TODO: where do we get this?assertlen(inclusion_list_transactions) <=MAX_TRANSACTIONS_PER_INCLUSION_LIST# Verify the payload with the execution engineassertexecution_engine.verify_and_notify_new_payload(
NewPayloadRequest(
execution_payload=payload,
versioned_hashes=versioned_hashes,
parent_beacon_block_root=state.latest_block_header.parent_root,
execution_requests=body.execution_requests,
inclusion_list_transactions=inclusion_list_transactions,
)
)
# Cache execution payload headerstate.latest_execution_payload_header=ExecutionPayloadHeader(
parent_hash=payload.parent_hash,
fee_recipient=payload.fee_recipient,
state_root=payload.state_root,
receipts_root=payload.receipts_root,
logs_bloom=payload.logs_bloom,
prev_randao=payload.prev_randao,
block_number=payload.block_number,
gas_limit=payload.gas_limit,
gas_used=payload.gas_used,
timestamp=payload.timestamp,
extra_data=payload.extra_data,
base_fee_per_gas=payload.base_fee_per_gas,
block_hash=payload.block_hash,
transactions_root=hash_tree_root(payload.transactions),
withdrawals_root=hash_tree_root(payload.withdrawals),
blob_gas_used=payload.blob_gas_used,
excess_blob_gas=payload.excess_blob_gas,
)
The text was updated successfully, but these errors were encountered:
Engine APIs
Modified
is_valid_block_hash
Note: The function
is_valid_block_hash
is modified to include the additionalinclusion_list_transactions
.Modified
notify_new_payload
Note: The function
notify_new_payload
is modified to include the additionalinclusion_list_transactions
.Modified
verify_and_notify_new_payload
Note: The function
verify_and_notify_new_payload
is modified to pass the additional parameterinclusion_list_transactions
when callingnotify_new_payload
in EIP-7805.Modified
process_execution_payload
The text was updated successfully, but these errors were encountered: