Skip to content

Commit 057892b

Browse files
lightclientsmartprogrammer93acolytec3macfarla
authored
eth: EIP-4844 and EIP-4788 updates for cancun (#477)
* Add Parent Beacon Block Root to Block (#450) * Add EIP-4844 transaction and receipt (#398) * Add dataGasUsed to receipt * Make dataGasUsed optional * Add dataGasPrice * Update src/schemas/receipt.yaml Co-authored-by: Sally MacFarlane <[email protected]> * Update src/schemas/receipt.yaml Co-authored-by: Sally MacFarlane <[email protected]> * Update src/schemas/receipt.yaml Co-authored-by: Sally MacFarlane <[email protected]> * rename data gas to blob gas - eip 7354 * schemas/tx: add 4844 tx * schemas/tx: add 4844 blob fields to generic transaction * eth/submit: make note that 4844 txs must be in network form for sendRawTransaction * schemas: fix typo in 4844 tx uint ref * schemas: remove some extra spacing * schema: update required fields for blob tx repr --------- Co-authored-by: Sally MacFarlane <[email protected]> Co-authored-by: lightclient <[email protected]> * eth: add new 4844 header fields * tests: update for cancun * tests: non-zero parent beacon block root --------- Co-authored-by: Ahmad Bitar <[email protected]> Co-authored-by: acolytec3 <[email protected]> Co-authored-by: Sally MacFarlane <[email protected]>
1 parent 150a7b6 commit 057892b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+169
-39
lines changed

src/eth/submit.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
schema:
1111
$ref: '#/components/schemas/hash32'
1212
- name: eth_sendRawTransaction
13-
summary: Submits a raw transaction.
13+
summary: Submits a raw transaction. For EIP-4844 transactions, the raw form
14+
must be the network form. This means it includes the blobs, KZG
15+
commitments, and KZG proofs.
1416
params:
1517
- name: Transaction
1618
required: true

src/schemas/block.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,15 @@ Block:
7979
withdrawalsRoot:
8080
title: Withdrawals root
8181
$ref: '#/components/schemas/hash32'
82+
blobGasUsed:
83+
title: Blob gas used
84+
$ref: '#/components/schemas/uint'
85+
excessBlobGas:
86+
title: Excess blob gas
87+
$ref: '#/components/schemas/uint'
88+
parentBeaconBlockRoot:
89+
title: Parent Beacon Block Root
90+
$ref: '#/components/schemas/hash32'
8291
size:
8392
title: Block size
8493
$ref: '#/components/schemas/uint'

src/schemas/receipt.yaml

+9-1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ ReceiptInfo:
8484
title: gas used
8585
description: The amount of gas used for this specific transaction alone.
8686
$ref: '#/components/schemas/uint'
87+
blobGasUsed:
88+
title: blob gas used
89+
description: The amount of blob gas used for this specific transaction. Only specified for blob transactions as defined by EIP-4844.
90+
$ref: '#/components/schemas/uint'
8791
contractAddress:
8892
title: contract address
8993
description: The contract address created, if the transaction was a contract creation, otherwise null.
@@ -109,5 +113,9 @@ ReceiptInfo:
109113
$ref: '#/components/schemas/uint'
110114
effectiveGasPrice:
111115
title: effective gas price
112-
description: The actual value per gas deducted from the senders account. Before EIP-1559, this is equal to the transaction's gas price. After, it is equal to baseFeePerGas + min(maxFeePerGas - baseFeePerGas, maxPriorityFeePerGas).
116+
description: The actual value per gas deducted from the sender's account. Before EIP-1559, this is equal to the transaction's gas price. After, it is equal to baseFeePerGas + min(maxFeePerGas - baseFeePerGas, maxPriorityFeePerGas).
117+
$ref: '#/components/schemas/uint'
118+
blobGasPrice:
119+
title: blob gas price
120+
description: The actual value per gas deducted from the sender's account for blob gas. Only specified for blob transactions as defined by EIP-4844.
113121
$ref: '#/components/schemas/uint'

src/schemas/transaction.yaml

+100
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,64 @@
1+
Transaction4844Unsigned:
2+
type: object
3+
title: EIP-4844 transaction.
4+
required:
5+
- type
6+
- nonce
7+
- to
8+
- gas
9+
- value
10+
- input
11+
- maxPriorityFeePerGas
12+
- maxFeePerGas
13+
- maxFeePerBlobGas
14+
- accessList
15+
- blobVersionedHashes
16+
- chainId
17+
properties:
18+
type:
19+
title: type
20+
$ref: '#/components/schemas/byte'
21+
nonce:
22+
title: nonce
23+
$ref: '#/components/schemas/uint'
24+
to:
25+
title: to address
26+
$ref: '#/components/schemas/address'
27+
gas:
28+
title: gas limit
29+
$ref: '#/components/schemas/uint'
30+
value:
31+
title: value
32+
$ref: '#/components/schemas/uint'
33+
input:
34+
title: input data
35+
$ref: '#/components/schemas/bytes'
36+
maxPriorityFeePerGas:
37+
title: max priority fee per gas
38+
description: Maximum fee per gas the sender is willing to pay to miners in wei
39+
$ref: '#/components/schemas/uint'
40+
maxFeePerGas:
41+
title: max fee per gas
42+
description: The maximum total fee per gas the sender is willing to pay (includes the network / base fee and miner / priority fee) in wei
43+
$ref: '#/components/schemas/uint'
44+
maxFeePerBlobGas:
45+
title: max fee per blob gas
46+
description: The maximum total fee per gas the sender is willing to pay for blob gas in wei
47+
$ref: '#/components/schemas/uint'
48+
accessList:
49+
title: accessList
50+
description: EIP-2930 access list
51+
$ref: '#/components/schemas/AccessList'
52+
blobVersionedHashes:
53+
title: blobVersionedHashes
54+
description: List of versioned blob hashes associated with the transaction's EIP-4844 data blobs.
55+
type: array
56+
items:
57+
$ref: '#/components/schemas/hash32'
58+
chainId:
59+
title: chainId
60+
description: Chain ID that this transaction is valid on.
61+
$ref: '#/components/schemas/uint'
162
AccessListEntry:
263
title: Access list entry
364
type: object
@@ -164,9 +225,31 @@ TransactionLegacyUnsigned:
164225
$ref: '#/components/schemas/uint'
165226
TransactionUnsigned:
166227
oneOf:
228+
- $ref: '#/components/schemas/Transaction4844Unsigned'
167229
- $ref: '#/components/schemas/Transaction1559Unsigned'
168230
- $ref: '#/components/schemas/Transaction2930Unsigned'
169231
- $ref: '#/components/schemas/TransactionLegacyUnsigned'
232+
Transaction4844Signed:
233+
title: Signed 4844 Transaction
234+
type: object
235+
allOf:
236+
- $ref: '#/components/schemas/Transaction4844Unsigned'
237+
- title: EIP-4844 transaction signature properties.
238+
required:
239+
- yParity
240+
- r
241+
- s
242+
properties:
243+
yParity:
244+
title: yParity
245+
description: The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature.
246+
$ref: '#/components/schemas/uint'
247+
r:
248+
title: r
249+
$ref: '#/components/schemas/uint'
250+
s:
251+
title: s
252+
$ref: '#/components/schemas/uint'
170253
Transaction1559Signed:
171254
title: Signed 1559 Transaction
172255
type: object
@@ -239,6 +322,7 @@ TransactionLegacySigned:
239322
$ref: '#/components/schemas/uint'
240323
TransactionSigned:
241324
oneOf:
325+
- $ref: '#/components/schemas/Transaction4844Signed'
242326
- $ref: '#/components/schemas/Transaction1559Signed'
243327
- $ref: '#/components/schemas/Transaction2930Signed'
244328
- $ref: '#/components/schemas/TransactionLegacySigned'
@@ -313,10 +397,26 @@ GenericTransaction:
313397
title: max fee per gas
314398
description: The maximum total fee per gas the sender is willing to pay (includes the network / base fee and miner / priority fee) in wei
315399
$ref: '#/components/schemas/uint'
400+
maxFeePerBlobGas:
401+
title: max fee per blob gas
402+
description: The maximum total fee per gas the sender is willing to pay for blob gas in wei
403+
$ref: '#/components/schemas/uint'
316404
accessList:
317405
title: accessList
318406
description: EIP-2930 access list
319407
$ref: '#/components/schemas/AccessList'
408+
blobVersionedHashes:
409+
title: blobVersionedHashes
410+
description: List of versioned blob hashes associated with the transaction's EIP-4844 data blobs.
411+
type: array
412+
items:
413+
$ref: '#/components/schemas/hash32'
414+
blobs:
415+
title: blobs
416+
description: Raw blob data.
417+
type: array
418+
items:
419+
$ref: '#/components/schemas/bytes'
320420
chainId:
321421
title: chainId
322422
description: Chain ID that this transaction is valid on.

tests/bad.rlp

35 Bytes
Binary file not shown.

tests/chain.rlp

431 Bytes
Binary file not shown.
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
>> {"jsonrpc":"2.0","id":1,"method":"debug_getRawBlock","params":["0x3"]}
2-
<< {"jsonrpc":"2.0","id":1,"result":"0xf90276f90218a0b019ea73504c933a601125fc37ebfd9629a2119a91792a5653365ed73ec56acba01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a0f17a0db4c6c1d9461d74a6c8d9426769b68d1146ca14a9175cb629b7aaeb600da0b7123db22d2b11088a0c80e4e44e0740ce7965754b75e366b9d1f297e5ea8181a0223f7b7cb197a5886eb3ffc6d05896b38539cefbbf8c3da4855a61e7a854bf4ab90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008003834c4b4082cf501e80a00000000000000000000000000000000000000000000000000000000000000000880000000000000000842806be9da056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421f857f85502842806be9d82cf6c80808460806040820a95a030e29b76d4ce26f1f5c69e6fb814d9a138ee5f5238f0bf7ed80ede0db82406bfa07e81c4c6d80b3e5a333bb16ff95dca3f11d9f33421bd8234ab54d57b35cbcb8bc0c0"}
2+
<< {"jsonrpc":"2.0","id":1,"result":"0xf90299f9023ba093249d84f3844ed3dd9746eb5bfec7b7f64174c3a68ce3751d9d1752c1590511a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a0bc29f1eff715d414be2201419a80f53599ffcf0951fb442bbc29297dd65aef60a0b7123db22d2b11088a0c80e4e44e0740ce7965754b75e366b9d1f297e5ea8181a0223f7b7cb197a5886eb3ffc6d05896b38539cefbbf8c3da4855a61e7a854bf4ab90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008003834c4b4082cf501e80a00000000000000000000000000000000000000000000000000000000000000000880000000000000000842806be9da056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b4218080a00200000000000000000000000000000000000000000000000000000000000000f857f85502842806be9d82cf6c80808460806040820a95a030e29b76d4ce26f1f5c69e6fb814d9a138ee5f5238f0bf7ed80ede0db82406bfa07e81c4c6d80b3e5a333bb16ff95dca3f11d9f33421bd8234ab54d57b35cbcb8bc0c0"}
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
>> {"jsonrpc":"2.0","id":1,"method":"debug_getRawBlock","params":["0x0"]}
2-
<< {"jsonrpc":"2.0","id":1,"result":"0xf9021cf90216a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a05db86e9a500ed3158bdd0e8a01927f070bbf6630f39118510283150efe9aa31ba056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000180834c4b40808080a00000000000000000000000000000000000000000000000000000000000000000880000000000000000843b9aca00a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421c0c0c0"}
2+
<< {"jsonrpc":"2.0","id":1,"result":"0xf9023ff90239a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a0f67fe3cde4dc2950fa5c1c58a7d5a62682e57e9400b494a9172fcd15311ed599a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000180834c4b40808080a00000000000000000000000000000000000000000000000000000000000000000880000000000000000843b9aca00a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b4218080a00000000000000000000000000000000000000000000000000000000000000000c0c0c0"}
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
>> {"jsonrpc":"2.0","id":1,"method":"debug_getRawHeader","params":["0x3"]}
2-
<< {"jsonrpc":"2.0","id":1,"result":"0xf90218a0b019ea73504c933a601125fc37ebfd9629a2119a91792a5653365ed73ec56acba01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a0f17a0db4c6c1d9461d74a6c8d9426769b68d1146ca14a9175cb629b7aaeb600da0b7123db22d2b11088a0c80e4e44e0740ce7965754b75e366b9d1f297e5ea8181a0223f7b7cb197a5886eb3ffc6d05896b38539cefbbf8c3da4855a61e7a854bf4ab90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008003834c4b4082cf501e80a00000000000000000000000000000000000000000000000000000000000000000880000000000000000842806be9da056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"}
2+
<< {"jsonrpc":"2.0","id":1,"result":"0xf9023ba093249d84f3844ed3dd9746eb5bfec7b7f64174c3a68ce3751d9d1752c1590511a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a0bc29f1eff715d414be2201419a80f53599ffcf0951fb442bbc29297dd65aef60a0b7123db22d2b11088a0c80e4e44e0740ce7965754b75e366b9d1f297e5ea8181a0223f7b7cb197a5886eb3ffc6d05896b38539cefbbf8c3da4855a61e7a854bf4ab90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008003834c4b4082cf501e80a00000000000000000000000000000000000000000000000000000000000000000880000000000000000842806be9da056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b4218080a00200000000000000000000000000000000000000000000000000000000000000"}
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
>> {"jsonrpc":"2.0","id":1,"method":"debug_getRawHeader","params":["0x0"]}
2-
<< {"jsonrpc":"2.0","id":1,"result":"0xf90216a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a05db86e9a500ed3158bdd0e8a01927f070bbf6630f39118510283150efe9aa31ba056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000180834c4b40808080a00000000000000000000000000000000000000000000000000000000000000000880000000000000000843b9aca00a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"}
2+
<< {"jsonrpc":"2.0","id":1,"result":"0xf90239a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a0f67fe3cde4dc2950fa5c1c58a7d5a62682e57e9400b494a9172fcd15311ed599a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000180834c4b40808080a00000000000000000000000000000000000000000000000000000000000000000880000000000000000843b9aca00a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b4218080a00000000000000000000000000000000000000000000000000000000000000000"}
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
>> {"jsonrpc":"2.0","id":1,"method":"eth_getBalance","params":["0xaa00000000000000000000000000000000000000","0x7cb4dd3daba1f739d0c1ec7d998b4a2f6fd83019116455afa54ca4f49dfa0ad4"]}
1+
>> {"jsonrpc":"2.0","id":1,"method":"eth_getBalance","params":["0xaa00000000000000000000000000000000000000","0x76734e0205d8c4b711990ab957e86d3dc56d129600e60750552c95448a449794"]}
22
<< {"jsonrpc":"2.0","id":1,"result":"0x1"}

0 commit comments

Comments
 (0)