Commit c22ed358 authored by Éloïs's avatar Éloïs

[fix] ws2pv2 : add request chunk by hash & req response msg

parent fbc5f3c6
......@@ -223,7 +223,8 @@ _*the `null` value is essential, it allows the user to synchronize his node with
| FLAGS | 0x0002 | yes | [1] |
| OK | 0x0003 | yes | [1] |
| KO | 0x0004 | yes | [1] |
| REQUEST | 0x0010 | yes | [1] |
| REQUEST | 0x0010 | no | [1] |
| REQUEST_RESPONSE | 0x0011 | no | [1] |
| PEERS | 0x0100 | no | [1, u16::MAX] |
| HEADS v2 | 0x0102 | no | [1, u16::MAX] |
| HEADS v3 | 0x0103 | no | [1, u16::MAX] |
......@@ -613,17 +614,20 @@ WARNING : Exception with the ABF api feature : In a WS2P connection between two
#### request_type interpretation
| value | significance | param_1 (type) | param_2 (type) |
|:-----:|---------------------|----------------------|--------------------|
| 0 | EMPTY_REQUEST | - | - |
| 1 | CURRENT_BLOCKSTAMP | - | - |
| 2 | BLOCKS_HASHS | begin_block_id (u32) | blocks_count (u16) |
| 3 | CHUNK | begin_block_id (u32) | blocks_count (u16) |
| 4 | WOT_POOL | folders_count (u16) | min_cert (u8) |
| value | significance | param_1 (type) | param_2 (type) |
|:-----:|--------------------|-------------------------|--------------------|
| 0 | EMPTY_REQUEST | - | - |
| 1 | CURRENT_BLOCKSTAMP | - | - |
| 2 | BLOCKS_HASHS | begin_block_id (u32) | blocks_count (u16) |
| 3 | CHUNK | begin_block_id (u32) | blocks_count (u16) |
| 4 | CHUNK_BY_HASH | chunkstamp (Blockstamp) | - |
| 5 | WOT_POOL | folders_count (u16) | min_cert (u8) |
BLOCKS_HASHS := In case of fork, to quickly find the fork point, the node will request the hashes of the ForkWindowsSize of the local blockchains of the other nodes.
It would be counterproductive to ask directly for the entire blocks, when you will only need them if you actually decide to stack the corresponding branch.
CHUNK_BY_HASH : During synchronization, chunk is requested by Chunkstamp (= Blockstamp of the last block of the chunk).
WOT_POOL := For network performance reasons, a Duniter-Rust* node never shares its entire wot pool at once. It randomly selects `folders_count` folders among those having received at least `min_cert` certifications. It's the requesting node that sets the values of `min_cert` and `folders_count` according to its connection rate, its configuration and the rate of new folders it has obtained in these previous requests.
_*This is part of the specificities of WS2P requests in binary format, which will be introduced in all implementations in the future._
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment