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

Added eip 7702 schema and authlist in receipt schema #575

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
118 changes: 116 additions & 2 deletions src/schemas/transaction.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,90 @@
Transaction7702Unsigned:
type: object
title: EIP-7702 transaction
required:
- type
- nonce
- to
- gas
- value
- input
- maxPriorityFeePerGas
- maxFeePerGas
- accessList
- chainId
- authorizationList
properties:
type:
title: type
type: string
pattern: ^0x4$
nonce:
title: nonce
$ref: '#/components/schemas/uint'
to:
title: to address
$ref: '#/components/schemas/address'
gas:
title: gas limit
$ref: '#/components/schemas/uint'
value:
title: value
$ref: '#/components/schemas/uint'
input:
title: input data
$ref: '#/components/schemas/bytes'
maxPriorityFeePerGas:
title: max priority fee per gas
description: Maximum fee per gas the sender is willing to pay to miners in wei
$ref: '#/components/schemas/uint'
maxFeePerGas:
title: max fee per gas
description: The maximum total fee per gas the sender is willing to pay (includes the network / base fee and miner / priority fee) in wei
$ref: '#/components/schemas/uint'
accessList:
title: accessList
description: EIP-2930 access lists
$ref: '#/components/schemas/AccessList'
chainId:
title: chainId
description: Chain ID that this transaction is valid on
$ref: '#/components/schemas/uint'
authorizationList:
Redidacove marked this conversation as resolved.
Show resolved Hide resolved
title: authorizationList
$ref: '#/components/schemas/AuthorizationList'
AuthorizationList:
title: Authorization List
description: List of authorizations for the transaction
type: array
items:
type: object
properties:
chainId:
title: chainId
description: Chain ID on which this transaction is valid
$ref: '#/components/schemas/uint'
nonce:
title: nonce
$ref: '#/components/schemas/uint'
address:
$ref: '#/components/schemas/address'
yParity:
title: yParity
description: The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature
$ref: '#/components/schemas/uint'
r:
title: r
$ref: '#/components/schemas/uint'
s:
title: s
$ref: '#/components/schemas/uint'
required:
- chainId
- nonce
- address
- yParity
- r
- s
Transaction4844Unsigned:
type: object
title: EIP-4844 transaction.
Expand Down Expand Up @@ -51,13 +138,13 @@ Transaction4844Unsigned:
$ref: '#/components/schemas/AccessList'
blobVersionedHashes:
title: blobVersionedHashes
description: List of versioned blob hashes associated with the transaction's EIP-4844 data blobs.
description: List of versioned blob hashes associated with the transaction's EIP-4844 data blobs
type: array
items:
$ref: '#/components/schemas/hash32'
chainId:
title: chainId
description: Chain ID that this transaction is valid on.
description: Chain ID that this transaction is valid on
$ref: '#/components/schemas/uint'
AccessListEntry:
title: Access list entry
Expand Down Expand Up @@ -225,10 +312,32 @@ TransactionLegacyUnsigned:
$ref: '#/components/schemas/uint'
TransactionUnsigned:
oneOf:
- $ref: '#/components/schemas/Transaction7702Unsigned'
- $ref: '#/components/schemas/Transaction4844Unsigned'
- $ref: '#/components/schemas/Transaction1559Unsigned'
- $ref: '#/components/schemas/Transaction2930Unsigned'
- $ref: '#/components/schemas/TransactionLegacyUnsigned'
Transaction7702Signed:
title: Signed 7702 Transaction
type: object
allOf:
- $ref: '#/components/schemas/Transaction7702Unsigned'
- title: EIP-7702 transaction signature properties.
required:
- yParity
- r
- s
properties:
yParity:
title: yParity
description: The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature.
$ref: '#/components/schemas/uint'
r:
title: r
$ref: '#/components/schemas/uint'
s:
title: s
$ref: '#/components/schemas/uint'
Transaction4844Signed:
title: Signed 4844 Transaction
type: object
Expand Down Expand Up @@ -322,6 +431,7 @@ TransactionLegacySigned:
$ref: '#/components/schemas/uint'
TransactionSigned:
oneOf:
- $ref: '#/components/schemas/Transaction7702Signed'
- $ref: '#/components/schemas/Transaction4844Signed'
- $ref: '#/components/schemas/Transaction1559Signed'
- $ref: '#/components/schemas/Transaction2930Signed'
Expand Down Expand Up @@ -421,3 +531,7 @@ GenericTransaction:
title: chainId
description: Chain ID that this transaction is valid on.
$ref: '#/components/schemas/uint'
authorizationList:
title: authorizationList
description: EIP-7702 authorization list
$ref: '#/components/schemas/AuthorizationList'
3 changes: 3 additions & 0 deletions tests/eth_getTransactionByHash/get-authlist-tx.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// gets a authorization list transaction
>> {"jsonrpc":"2.0","id":1,"method":"eth_getTransactionByHash","params":["0x3025fd75c0ac8a05f4c50fb15225d7d8ce17ba0aa60b560d02805ae97b6c033e"]}
<< {"jsonrpc":"2.0","id":1,"result":{"blockHash":"0x5204c8e7c8a14bcbd6031520d70b2531999f4f8d587603659f1fb1c82935bcd4","blockNumber":"0x3","from":"0x7435ed30a8b4aeb0877cef0c6e8cffe834eb865f","gas":"0x186a0","gasPrice":"0x281d620e","maxFeePerGas":"0x281d620e","maxPriorityFeePerGas":"0x1","hash":"0x3025fd75c0ac8a05f4c50fb15225d7d8ce17ba0aa60b560d02805ae97b6c033e","input":"0x3f446a7c4145b1f0656d6974","nonce":"0x9","to":"0x7dcd17433742f4c0ca53122ab541d0ba67fc27df","transactionIndex":"0x1","value":"0x3","type":"0x4","accessList":[{"address":"0x7dcd17433742f4c0ca53122ab541d0ba67fc27df","storageKeys":["0x0000000000000000000000000000000000000000000000000000000000000000","0xb52248fb459b43720abbf1d5218c4ede9036a623653b31c2077991e04da9a456"]}],"chainId":"0xc72dd9d5e883e","authorizationList":[{"chainId":"0x1","address":"0x7dcd17433742f4c0ca53122ab541d0ba67fc27df","nonce":"0x1","yParity":"0x0","r":"0xb9a9724fca45b21dbc84ac9c0be479e2780a83c96b579877eaf256c5005811c0","s":"0x36e39cca69a5256235f38cb2f8cd7a61829aff39439fca1c1cf5b55dfbb116a"}],"v":"0x1","r":"0xcd2bc1d83a0aed04c06b641e5c93a3112c29a45edab4b12f834b2f41c269e0d5","s":"0xcd7d25d1c29fa7f722865ba3aae5a88651eddfeadc88dc37d6c0ec6b9be77d7","yParity":"0x1"}}
3 changes: 3 additions & 0 deletions tests/eth_getTransactionReceipt/get-auth-list.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// gets an authorization list transaction
>> {"jsonrpc":"2.0","id":1,"method":"eth_getTransactionReceipt","params":["0x3025fd75c0ac8a05f4c50fb15225d7d8ce17ba0aa60b560d02805ae97b6c033e"]}
<< {"jsonrpc":"2.0","id":1,"result":{"blockHash":"0x5204c8e7c8a14bcbd6031520d70b2531999f4f8d587603659f1fb1c82935bcd4","blockNumber":"0x3","contractAddress":null,"cumulativeGasUsed":"0x1f6e0","effectiveGasPrice":"0x281d620e","from":"0x7435ed30a8b4aeb0877cef0c6e8cffe834eb865f","gasUsed":"0x12c44","logs":[{"address":"0x7dcd17433742f4c0ca53122ab541d0ba67fc27df","topics":["0x00000000000000000000000000000000000000000000000000000000656d6974","0xb52248fb459b43720abbf1d5218c4ede9036a623653b31c2077991e04da9a456"],"data":"0x0000000000000000000000000000000000000000000000000000000000000003","blockNumber":"0x3","transactionHash":"0x3025fd75c0ac8a05f4c50fb15225d7d8ce17ba0aa60b560d02805ae97b6c033e","transactionIndex":"0x1","blockHash":"0x5204c8e7c8a14bcbd6031520d70b2531999f4f8d587603659f1fb1c82935bcd4","logIndex":"0x1","removed":false}],"logsBloom":"0x00000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000200000000000000004000000000002000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000","status":"0x1","to":"0x7dcd17433742f4c0ca53122ab541d0ba67fc27df","transactionHash":"0x3025fd75c0ac8a05f4c50fb15225d7d8ce17ba0aa60b560d02805ae97b6c033e","transactionIndex":"0x1","type":"0x4"}}
3 changes: 3 additions & 0 deletions tests/eth_sendRawTransaction/send-authorization-list-tx.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// sends a authorization list transaction
>> {"jsonrpc":"2.0","id":1,"method":"eth_sendRawTransaction","params":["0x04f90131870c72dd9d5e883e808201f48404419d3e83013880947dcd17433742f4c0ca53122ab541d0ba67fc27df8080f85bf859947dcd17433742f4c0ca53122ab541d0ba67fc27dff842a00000000000000000000000000000000000000000000000000000000000000000a00100000000000000000000000000000000000000000000000000000000000000f863f861870c72dd9d5e883e947dcd17433742f4c0ca53122ab541d0ba67fc27df8080a08074cb63170a7bd4df6c3a6d9a16c11fab4fa036c9ae75d3b66b1d91672f9757a00dcf14df506fe8e636266602e0f95be6c61f52b316d7c4ebece6ddc25079d56e80a0b60ff0cda09fd67894d4f9923badc8a8efa82a3d0f09c8fb954b70d5d2de614ea04cf7436b81a664533d3c912c54d2300dbb9d326716302a382068a62af1244ad3"]}
<< {"jsonrpc":"2.0","id":1,"result":"0x69b856be7b1ee3c82820bf8b8f98a1d69b5b1d9574c87995091cc7d755464504"}
Loading