From 6ac865b7f38f135ed8252e61e008497a93bcf6e4 Mon Sep 17 00:00:00 2001 From: lightclient Date: Fri, 30 Aug 2024 09:05:37 +0200 Subject: [PATCH 1/2] 7702: adjust tx validity --- EIPS/eip-7702.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/EIPS/eip-7702.md b/EIPS/eip-7702.md index 66960805c7812..97e9cc1393260 100644 --- a/EIPS/eip-7702.md +++ b/EIPS/eip-7702.md @@ -44,19 +44,19 @@ rlp([chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit, dest authorization_list = [[chain_id, address, nonce, y_parity, r, s], ...] ``` -Transaction is considered invalid if authorization list items can't be decoded as: - -* `chain_id`: unsigned 256-bit integer. -* `nonce`: unsigned 64-bit integer. -* `address`: 20 bytes array. -* `y_parity`: Value 0 or 1. -* `r`: unsigned 256-bit integer. -* `s`: unsigned 256-bit integer and value less or equal than `secp256k1n/2`, specified in [EIP-2](./eip-2.md). - The fields `chain_id`, `nonce`, `max_priority_fee_per_gas`, `max_fee_per_gas`, `gas_limit`, `destination`, `value`, `data`, and `access_list` of the outer transaction follow the same semantics as [EIP-4844](./eip-4844.md). *Note, this means a null destination is not valid.* The `authorization_list` is a list of tuples that store the address to code which the signer desires to execute in the context of their EOA. The transaction is considered invalid if the length of `authorization_list` is zero. +The transaction is also considered invalid when any integer field in an +authorization list cannot fit within the following bounds: + +* `chain_id`: `2**256-1` +* `nonce`:`2**64-1`. +* `y_parity`: `2**256-1`. +* `r`: `2**256-1`. +* `s`: `2**256-1`. + The [EIP-2718](./eip-2718.md) `ReceiptPayload` for this transaction is `rlp([status, cumulative_transaction_gas_used, logs_bloom, logs])`. #### Behavior From 303e4c8b8544889c2ad926d670c5dfeec4167863 Mon Sep 17 00:00:00 2001 From: lightclient Date: Fri, 30 Aug 2024 09:47:44 +0200 Subject: [PATCH 2/2] 7702: write checks in python instead --- EIPS/eip-7702.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/EIPS/eip-7702.md b/EIPS/eip-7702.md index 97e9cc1393260..a26738263d52c 100644 --- a/EIPS/eip-7702.md +++ b/EIPS/eip-7702.md @@ -48,14 +48,17 @@ The fields `chain_id`, `nonce`, `max_priority_fee_per_gas`, `max_fee_per_gas`, ` The `authorization_list` is a list of tuples that store the address to code which the signer desires to execute in the context of their EOA. The transaction is considered invalid if the length of `authorization_list` is zero. -The transaction is also considered invalid when any integer field in an -authorization list cannot fit within the following bounds: - -* `chain_id`: `2**256-1` -* `nonce`:`2**64-1`. -* `y_parity`: `2**256-1`. -* `r`: `2**256-1`. -* `s`: `2**256-1`. +The transaction is also considered invalid when any field in an authorization +tuple cannot fit within the following bounds: + +```python +assert auth.chain_id < 2**256 +assert auth.nonce < 2**64 +assert len(auth.address) == 20 +assert auth.y_parity < 2**256 +assert auth.r < 2**256 +assert auth.z < 2**256 +``` The [EIP-2718](./eip-2718.md) `ReceiptPayload` for this transaction is `rlp([status, cumulative_transaction_gas_used, logs_bloom, logs])`.