Skip to content

Commit 83fd2b6

Browse files
committed
Organize spec/test by folders via network type
1 parent 5e32156 commit 83fd2b6

12 files changed

+86
-174
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,17 +180,17 @@ This network is a pure gossip network and does not implement any form of content
180180
## Network Specifications
181181

182182
- [Portal Wire Protocol](./portal-wire-protocol.md)
183-
- [uTP over DiscoveryV5](./discv5-utp.md)
184-
- [State Network](./state-network.md)
183+
- [uTP over DiscoveryV5](./utp/discv5-utp.md)
184+
- [State Network](./state/state-network.md)
185185
- Prior work: https://ethresear.ch/t/scalable-gossip-for-state-network/8958/4
186-
- [History Network](./history-network.md)
186+
- [History Network](./history/history-network.md)
187187
- Prior work: https://notes.ethereum.org/oUJE4ZX2Q6eMOgEMiQPkpQ?view
188188
- Prior Python proof-of-concept: https://github.com/ethereum/ddht/tree/341e84e9163338556cd48dd2fcfda9eedec3eb45
189189
- This POC should NOT be considered representative of the end goal. It incorporates mechanisms that aren't likely to be apart of the actual implementation, specifically the "advertisement" system which proved to be a big bottleneck, as well as the SSZ merkle root system which was a workaround for large data transfer which we now intend to solve with uTP.
190190
- [Beacon Chain Network](./beacon-chain/beacon-network.md)
191191
- [Canonical Transaction Index Network](./canonical-transaction-index-network.md)
192192
- Spec is preliminary.
193193
- Network design borrows heavily from history network.
194-
- [Transaction Gossip Network](./transaction-gossip.md):
194+
- [Transaction Gossip Network](./transaction-gossip/transaction-gossip.md):
195195
- Spec is preliminary
196196
- Prior work: https://ethresear.ch/t/scalable-transaction-gossip/8660

content-keys-test-vectors.md

Lines changed: 0 additions & 125 deletions
This file was deleted.

header-gossip-network-test-vectors.md renamed to history/epoch-accumulator-test-vectors.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Header Gossip Network Test Vectors
1+
# Epoch Accumulator Test Vectors
22

3-
This document contains test vectors for the Header Gossip Network to help implementations conform to the specification.
3+
This document contains test vectors Epoch Accumulator for the Header Network to help implementations conform to the specification.
44

55
## Header Accumulator Encodings
66

history-network-test-vectors.md renamed to history/history-network-test-vectors.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,64 @@ Includes both a pre and post Shapella upgrade test vector.
6666
}
6767
}
6868
```
69+
70+
## Content Id Derivations
71+
72+
Following the testing of the encoding and decoding of the keys, we also test the proper derivation
73+
of the corresponding `content-id`. This is given as both the hex string and corresponding raw U256 integer.
74+
75+
#### Block Header Key
76+
77+
##### Input Parameters
78+
```
79+
block_hash = 0xd1c390624d3bd4e409a61a858e5dcc5517729a9170d014a6c96530d64dd8621d
80+
```
81+
82+
##### Expected Output
83+
```
84+
content_key = 0x00d1c390624d3bd4e409a61a858e5dcc5517729a9170d014a6c96530d64dd8621d
85+
content_id = 0x3e86b3767b57402ea72e369ae0496ce47cc15be685bec3b4726b9f316e3895fe
86+
content_id: U256 = 28281392725701906550238743427348001871342819822834514257505083923073246729726
87+
```
88+
89+
#### Block Body Key
90+
91+
##### Input Parameters
92+
```
93+
block_hash = 0xd1c390624d3bd4e409a61a858e5dcc5517729a9170d014a6c96530d64dd8621d
94+
```
95+
96+
##### Expected Output
97+
```
98+
content_key = 0x01d1c390624d3bd4e409a61a858e5dcc5517729a9170d014a6c96530d64dd8621d
99+
content_id = 0xebe414854629d60c58ddd5bf60fd72e41760a5f7a463fdcb169f13ee4a26786b
100+
content_id: U256 = 106696502175825986237944249828698290888857178633945273402044845898673345165419
101+
```
102+
103+
#### Receipt Key
104+
105+
##### Input Parameters
106+
```
107+
block_hash = 0xd1c390624d3bd4e409a61a858e5dcc5517729a9170d014a6c96530d64dd8621d
108+
```
109+
110+
##### Expected Output
111+
```
112+
content_key = 0x02d1c390624d3bd4e409a61a858e5dcc5517729a9170d014a6c96530d64dd8621d
113+
content_id = 0xa888f4aafe9109d495ac4d4774a6277c1ada42035e3da5e10a04cc93247c04a4
114+
content_id: U256 = 76230538398907151249589044529104962263309222250374376758768131420767496438948
115+
```
116+
117+
#### Epoch Accumulator Key
118+
119+
##### Input Parameters
120+
```
121+
epoch_hash = 0xe242814b90ed3950e13aac7e56ce116540c71b41d1516605aada26c6c07cc491
122+
```
123+
124+
##### Expected Output
125+
```
126+
content_key = 0x03e242814b90ed3950e13aac7e56ce116540c71b41d1516605aada26c6c07cc491
127+
content_id = 0x9fb2175e76c6989e0fdac3ee10c40d2a81eb176af32e1c16193e3904fe56896e
128+
content_id: U256 = 72232402989179419196382321898161638871438419016077939952896528930608027961710
129+
```
File renamed without changes.

portal-bridge-nodes.md

Lines changed: 0 additions & 43 deletions
This file was deleted.

state-network-test-vectors.md renamed to state/state-network-test-vectors.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ All relevant data (extracted using `eth_getProof` and `eth_getCode`):
7272

7373
The leaf node of the account trie that holds the account state.
7474

75+
##### Content Key Input Parameters
76+
```
77+
path = [8, 6, 7, 9, 14, 8, 14, 13]
78+
node_hash = 0x6225fcc63b22b80301d9f2582014e450e91f9b329b7cc87ad16894722fff5296
79+
```
80+
7581
```json
7682
{
7783
"content_key": "0x20240000006225fcc63b22b80301d9f2582014e450e91f9b329b7cc87ad16894722fff5296008679e8ed",
@@ -86,6 +92,13 @@ The leaf node of the account trie that holds the account state.
8692
The leaf node of the contract storage trie that holds the number of decimal
8793
points used by the token.
8894

95+
##### Content Key Input Parameters
96+
```
97+
address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
98+
path = [4, 0, 5, 7, 8, 7]
99+
node_hash = 0xeb43d68008d216e753fef198cf51077f5a89f406d9c244119d1643f0f2b19011
100+
```
101+
89102
```json
90103
{
91104
"content_key": "0x21c02aaa39b223fe8d0a0e5c4f27ead9083c756cc238000000eb43d68008d216e753fef198cf51077f5a89f406d9c244119d1643f0f2b1901100405787",
@@ -97,6 +110,12 @@ points used by the token.
97110

98111
## Contract Bytecode
99112

113+
##### Content Key Input Parameters
114+
```
115+
address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
116+
code_hash = 0xd0a06b12ac47863b5c7be4185c2deaad1c61557033f56c7d4ea74429cbb25e23
117+
```
118+
100119
```json
101120
{
102121
"content_key": "0x22c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2d0a06b12ac47863b5c7be4185c2deaad1c61557033f56c7d4ea74429cbb25e23",
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)