Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
22 changes: 22 additions & 0 deletions src/eth/state.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,25 @@
name: Bytecode
schema:
$ref: '#/components/schemas/bytes'
- name: eth_getProof
summary: Returns the merkle proof for a given account and optionally some storage keys.
params:
- name: Address
required: true
schema:
$ref: '#/components/schemas/address'
- name: StorageKeys
required: true
schema:
title: Storage keys
type: array
items:
$ref: '#/components/schemas/hash32'
- name: Block
required: true
schema:
$ref: '#/components/schemas/BlockNumberOrTag'
result:
name: Account
schema:
$ref: '#/components/schemas/AccountProof'
10 changes: 7 additions & 3 deletions src/schemas/base-types.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ bytes8:
bytes32:
title: 32 hex encoded bytes
type: string
pattern: ^0x[0-9a-f]{64}$
pattern: ^0x([0-9a-f][0-9a-f]){0,32}$
bytes256:
title: 256 hex encoded bytes
type: string
Expand All @@ -35,11 +35,15 @@ uint:
title: hex encoded unsigned integer
type: string
pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
uint64:
title: hex encoded unsigned integer
type: string
pattern: ^0x([1-9a-f][0-9a-f]{0,31})|0$
uint256:
title: hex encoded unsigned integer
type: string
pattern: ^0x[0-9a-f]{64}$
pattern: ^0x[0-9a-f]{0,64}$
hash32:
title: 32 byte hex value
type: string
pattern: ^0x[0-9a-f]{64}$
pattern: ^0x([0-9a-f][0-9a-f]){0,32}$
56 changes: 56 additions & 0 deletions src/schemas/state.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
AccountProof:
title: Account proof
type: object
required:
- address
- accountProof
- balance
- codeHash
- nonce
- storageHash
- storageProof
properties:
address:
title: address
$ref: '#/components/schemas/address'
accountProof:
title: accountProof
type: array
items:
$ref: '#/components/schemas/bytes'
balance:
title: balance
$ref: '#/components/schemas/uint256'
codeHash:
title: codeHash
$ref: '#/components/schemas/hash32'
nonce:
title: nonce
$ref: '#/components/schemas/uint64'
storageHash:
title: storageHash
$ref: '#/components/schemas/hash32'
storageProof:
title: storageProof
type: array
items:
$ref: '#/components/schemas/StorageProof'
StorageProof:
title: Storage proof
type: object
required:
- key
- value
- proof
properties:
key:
title: key
$ref: '#/components/schemas/hash32'
value:
title: value
$ref: '#/components/schemas/uint256'
proof:
title: proof
type: array
items:
$ref: '#/components/schemas/bytes'
Binary file modified tests/chain.rlp
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/eth_getBlockByNumber/get-block-n.io
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
>> {"jsonrpc":"2.0","id":3,"method":"eth_getBlockByNumber","params":["0x2",true]}
<< {"jsonrpc":"2.0","id":3,"result":{"baseFeePerGas":"0x2db08786","difficulty":"0x20000","extraData":"0x","gasLimit":"0x4c4b40","gasUsed":"0x5208","hash":"0x8b21a4d87bf85d7ca0c3246c4614f0aa52830e8cb7269bb15aeed5dd8381a472","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0x0000000000000000000000000000000000000000","mixHash":"0xccccb39e7b45085a4856f2981160e15d38c1f6eec387b28785b5888a254f7590","nonce":"0x380ad30e24588170","number":"0x2","parentHash":"0x8654633e8c5d422d5dfa79ff9a07a467d650fca786cfd38b69c157e2d4e7eb22","receiptsRoot":"0x056b23fbba480696b65fe5a59b8f2148a1299103c4f57df839233af2cf4ca2d2","sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","size":"0x26c","stateRoot":"0x730a6f5dbff0b86dd73ff3f2ba05e0e117129514002c742c716e88ee64426019","timestamp":"0x14","totalDifficulty":"0x40001","transactions":[{"blockHash":"0x8b21a4d87bf85d7ca0c3246c4614f0aa52830e8cb7269bb15aeed5dd8381a472","blockNumber":"0x2","from":"0x658bdf435d810c91414ec09147daa6db62406379","gas":"0x5208","gasPrice":"0x2db08786","hash":"0x7603a79471ee4ec11532a908d57a13ade4795d5c64c0ef1b7cea452c77859a8b","input":"0x","nonce":"0x1","to":"0x658bdf435d810c91414ec09147daa6db62406379","transactionIndex":"0x0","value":"0x3e8","type":"0x0","chainId":"0x539","v":"0xa96","r":"0x8970676a591fb2be4f71e4579ae4fba8f39076796b6a971f3b9266bfb0beda0","s":"0x1e4c79bd916d3f56f87ce59443c521280cf1bea83832c957870b14332f16b932"}],"transactionsRoot":"0x2fb4fd1c080aed4da105cdd18757e31742a496f27319d54b8e3e393fea41a736","uncles":[]}}
<< {"jsonrpc":"2.0","id":3,"result":{"baseFeePerGas":"0x2db08786","difficulty":"0x20000","extraData":"0x","gasLimit":"0x4c4b40","gasUsed":"0x5208","hash":"0x5f51f456295441f9414970e0d91018b8cfc8a431367c9ddcfb964b5e8374d97e","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0x0000000000000000000000000000000000000000","mixHash":"0xd0cc28a3fe975d7812825c5850a2a9c9d0d99a96c7402fd7a099811bba0adfe1","nonce":"0x574a4e8f21d29cd1","number":"0x2","parentHash":"0x10738a73bd29f6755839152fa32e6cab14d84b31c69d32276f5503cf3b3628d1","receiptsRoot":"0x056b23fbba480696b65fe5a59b8f2148a1299103c4f57df839233af2cf4ca2d2","sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","size":"0x26c","stateRoot":"0xa11b4c086e91defd929b062c76da4815e75aa87a7c7cc1ba2d81fab5065bb40d","timestamp":"0x14","totalDifficulty":"0x40001","transactions":[{"blockHash":"0x5f51f456295441f9414970e0d91018b8cfc8a431367c9ddcfb964b5e8374d97e","blockNumber":"0x2","from":"0x658bdf435d810c91414ec09147daa6db62406379","gas":"0x5208","gasPrice":"0x2db08786","hash":"0x7603a79471ee4ec11532a908d57a13ade4795d5c64c0ef1b7cea452c77859a8b","input":"0x","nonce":"0x1","to":"0x658bdf435d810c91414ec09147daa6db62406379","transactionIndex":"0x0","value":"0x3e8","type":"0x0","chainId":"0x539","v":"0xa96","r":"0x8970676a591fb2be4f71e4579ae4fba8f39076796b6a971f3b9266bfb0beda0","s":"0x1e4c79bd916d3f56f87ce59443c521280cf1bea83832c957870b14332f16b932"}],"transactionsRoot":"0x2fb4fd1c080aed4da105cdd18757e31742a496f27319d54b8e3e393fea41a736","uncles":[]}}
2 changes: 1 addition & 1 deletion tests/eth_getBlockByNumber/get-genesis.io
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
>> {"jsonrpc":"2.0","id":2,"method":"eth_getBlockByNumber","params":["0x0",true]}
<< {"jsonrpc":"2.0","id":2,"result":{"baseFeePerGas":"0x3b9aca00","difficulty":"0x1","extraData":"0x","gasLimit":"0x4c4b40","gasUsed":"0x0","hash":"0x4fdbf686aa0f43f0e8445bd047c42edd208e5a0d653f5cb8742160a163053c54","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0x0000000000000000000000000000000000000000","mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000","nonce":"0x0000000000000000","number":"0x0","parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000","receiptsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","size":"0x1fd","stateRoot":"0x21b036e39374a278109134aa04d153e16999e838316561a114a563d6ff9e6707","timestamp":"0x0","totalDifficulty":"0x1","transactions":[],"transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","uncles":[]}}
<< {"jsonrpc":"2.0","id":2,"result":{"baseFeePerGas":"0x3b9aca00","difficulty":"0x1","extraData":"0x","gasLimit":"0x4c4b40","gasUsed":"0x0","hash":"0x0c3e1714ef711da1150e2cd2a3fe561c14023246bb5a43bd5d8470a88f51d3ab","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0x0000000000000000000000000000000000000000","mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000","nonce":"0x0000000000000000","number":"0x0","parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000","receiptsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","size":"0x1fd","stateRoot":"0x047563f23a159598622ab8819d88e0aca94cf5cc92fa6ae45cc4ccb6fa87351d","timestamp":"0x0","totalDifficulty":"0x1","transactions":[],"transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","uncles":[]}}
2 changes: 2 additions & 0 deletions tests/eth_getProof/get-account-proof-with-storage.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {"jsonrpc":"2.0","id":5,"method":"eth_getProof","params":["0xaa00000000000000000000000000000000000000",["0x01"],"0x3"]}
<< {"jsonrpc":"2.0","id":5,"result":{"address":"0xaa00000000000000000000000000000000000000","accountProof":["0xf8718080808080a0c00495e5033c7515e8873ad194ed58261fbb8370ddac6ed641c3fc5e9361175c80a054ce42bae14d637d9328d46bd0fbebb8121808e2702a5e073e9248df6c9c46b0a0f81ae66fafcda39922df492e29e2fab19d7f66cc20865addd5b9a4f7af14ba348080808080808080","0xf869a0335649db80be637d281db0cc5896b0ff9869d08379a80fdc38dd073bba633949b846f8440101a002ad600f031449f2b67a245c683461817612b337fffb1e9805f9b17c8b10a106a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"],"balance":"0x1","codeHash":"0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470","nonce":"0x1","storageHash":"0x02ad600f031449f2b67a245c683461817612b337fffb1e9805f9b17c8b10a106","storageProof":[{"key":"0x01","value":"0x0","proof":["0xf851808080a0ce028e108cf5c832b0a9afd3ed101183857b3b9ddaea5670c4f09b62e4d38d05a0de3ecad66628a5743ed089e3a35ebeedc25a922fb0ac346304613403911c18e0808080808080808080808080"]}]}}
2 changes: 2 additions & 0 deletions tests/eth_getProof/get-account-proof.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {"jsonrpc":"2.0","id":4,"method":"eth_getProof","params":["0xaa00000000000000000000000000000000000000",[],"0x3"]}
<< {"jsonrpc":"2.0","id":4,"result":{"address":"0xaa00000000000000000000000000000000000000","accountProof":["0xf8718080808080a0c00495e5033c7515e8873ad194ed58261fbb8370ddac6ed641c3fc5e9361175c80a054ce42bae14d637d9328d46bd0fbebb8121808e2702a5e073e9248df6c9c46b0a0f81ae66fafcda39922df492e29e2fab19d7f66cc20865addd5b9a4f7af14ba348080808080808080","0xf869a0335649db80be637d281db0cc5896b0ff9869d08379a80fdc38dd073bba633949b846f8440101a002ad600f031449f2b67a245c683461817612b337fffb1e9805f9b17c8b10a106a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"],"balance":"0x1","codeHash":"0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470","nonce":"0x1","storageHash":"0x02ad600f031449f2b67a245c683461817612b337fffb1e9805f9b17c8b10a106","storageProof":[]}}
9 changes: 9 additions & 0 deletions tests/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@
"alloc": {
"658bdf435d810c91414ec09147daa6db62406379": {
"balance": "0x487a9a304539440000"
},
"aa00000000000000000000000000000000000000": {
"storage": {
"0x0000000000000000000000000000000000000000000000000000000000000000": "0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0100000000000000000000000000000000000000000000000000000000000000": "0x0100000000000000000000000000000000000000000000000000000000000000",
"0x0200000000000000000000000000000000000000000000000000000000000000": "0x0200000000000000000000000000000000000000000000000000000000000000"
},
"balance": "0x1",
"nonce": "0x1"
}
},
"number": "0x0",
Expand Down
1 change: 1 addition & 0 deletions wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ethereum
interop
json
mempool
merkle
npm
ommers
openrpc
Expand Down