You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: p2p/readme.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -151,6 +151,37 @@ to propagate and we keep sending the next (+ jumping to the next index)
151
151
until we reach the end of the pool. This way we have to keep minimal data
152
152
with each peer and it efficiently avoids sending the same data twice.
153
153
154
+
## Appendix: Future Ideas
155
+
156
+
### Leveraging Local Pools for Smaller Blocks
157
+
158
+
Nodes already maintain local pools of transactions and snarks. Many of these stored items later appear in blocks. By using data the node already has, we reduce the amount of information needed for each new block.
159
+
160
+
#### Motivation
161
+
As nodes interact with the network, they receive, verify, and store transactions and snarks in local pools. When a new block arrives, it often includes some of these items. Because the node already has them, the sender need not retransmit the data. This approach offers:
162
+
163
+
1.**Reduced Bandwidth Usage:**
164
+
Eliminating redundant transmissions of known snarks and transactions reduces block size and prevents wasted data exchange.
165
+
166
+
2.**Decreased Parsing and Validation Overhead:**
167
+
With fewer embedded items, nodes spend less time parsing and validating large blocks and their contents, and can more quickly integrate them into local state.
168
+
169
+
3.**Memory Footprint Optimization:**
170
+
By avoiding duplicate data, nodes can maintain more stable memory usage.
171
+
172
+
#### Practical Considerations
173
+
-**Snarks:**
174
+
Snarks, being large, benefit most from this approach. Skipping their retransmission saves significant bandwidth.
175
+
176
+
-**Ensuring Synchronization:**
177
+
This approach assumes nodes maintain consistent local pools. The poll-based model and eventual consistency ensure nodes receive needed items before they appear in a block, making it likely that a node has them on hand.
178
+
179
+
-**Adjusting the Block Format:**
180
+
This idea may require altering the protocol so the block references, rather than embeds, items nodes probably have. The node would fetch only missing pieces if a reference does not match its local data.
181
+
182
+
#### Outcome
183
+
By using local data, the network can propagate smaller blocks, improving scalability, reducing resource usage, and speeding propagation.
184
+
154
185
# OCaml node compatibility
155
186
In order to be compatible with the current OCaml node p2p implementation,
156
187
we have [libp2p implementation](./libp2p.md) as well. So communication between OCaml
0 commit comments