Skip to content

Commit fc9bd81

Browse files
committed
[docs]: combine sumeragi and block_sync
Signed-off-by: Dmitry Balashov <a.marcius26@gmail.com>
1 parent e9aa302 commit fc9bd81

File tree

4 files changed

+114
-109
lines changed

4 files changed

+114
-109
lines changed

.vitepress/config.mts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,10 +425,6 @@ export default defineConfig({
425425
text: 'Logger',
426426
link: '/api/config/logger-params',
427427
},
428-
{
429-
text: 'Block Sync',
430-
link: '/api/config/block-sync-params',
431-
},
432428
{
433429
text: 'WSV',
434430
link: '/api/config/wsv-params',

src/api/config/block-sync-params.md

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

src/api/config/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ TODO: list each section (sumeragi, torii, kura etc) with links and short explana
115115
- **[Queue](queue-params):** _explain_
116116
- **[Kura](kura-params):** _explain_
117117
- **[Logger](logger-params):** _explain_
118-
- **[Block Sync](block-sync-params):** _explain_
119118
- **[WSV](wsv-params):** _explain_
120119
- **[Telemetry](telemetry-params):** _explain_
121120
- **[Snapshot](./snapshot-params)**

src/api/config/sumeragi-params.md

Lines changed: 114 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -2,89 +2,44 @@
22

33
TODO Explain sumeragi module
44

5-
## `sumeragi.trusted_peers`
6-
7-
<!--
8-
9-
Hey, is sumeragi.trusted_peers actually required to be set in the config?
10-
11-
I guess that's the only way to specify the relevant topology and let the nodes know what addresses to communicate with as well as what public keys to use to verify respective node signatures
12-
13-
> Other peers might specify it as a trusted one
14-
15-
it should be bi-directional to support the consensus I guess
16-
17-
> or clients might commit transactions which will register a new peer
18-
19-
right.. actually Iroha v1 relies on that more, such a transaction was defined in the genesis (instead of the config), though it might be tricky if all of these peers are not relevant (unregistered in the post-genesis state) anymore and that's why there was an alternative needed (e.g. config) to contain a set of at least one peer (to sync from), once the WSV is relevant, the topology can be recovered from the blockstore/wsv
20-
21-
I guess it is, at least for a private chain, excluding a scenario of the only node in a network. Otherwise how would a node understand whom to trust (where to get the public key from)
22-
23-
-->
24-
25-
- **Type:** Array of Peer Ids
26-
- **Optional**
27-
28-
Optional list of predefined trusted peers.
29-
30-
Each Peer Id consists of:
31-
32-
- **`address`:** Address of the peer.
33-
- **Type:** String, [Socket-Address](glossary#type-socket-address)
34-
- **Required**
35-
- **`public_key`:** Public key of the peer.
36-
- **Type:** String, [Multi-hash](glossary#type-multi-hash)
37-
- **Required**
38-
39-
```toml
40-
peer_id = { address = "localhost:1338", public_key = "ed0120FAFCB2B27444221717F6FCBF900D5BE95273B1B0904B08C736B32A19F16AC1F9" }
41-
```
42-
43-
An array can be defined in two ways. Like this:
5+
## `sumeragi.block_time`
446

45-
```toml
46-
[[sumeragi.trusted_peers]]
47-
address = "localhost:1338"
48-
public_key = "ed012067C02E340AADD553BCF7DB28DD1F3BE8BE3D7581A2BAD81580AEE5CC75FEBD45"
7+
- **Type:** String or Number, [Duration](glossary#type-duration)
8+
- **Default:** 2 seconds
499

50-
[[sumeragi.trusted_peers]]
51-
address = "localhost:1339"
52-
public_key = "ed0120236808A6D4C12C91CA19E54686C2B8F5F3A786278E3824B4571EF234DEC8683B"
10+
Time since the round start[^1] by which a new block should be created regardless if there were enough transactions or
11+
not. Used to force block commits when there is a small influx of new transactions.
5312

54-
[[sumeragi.trusted_peers]]
55-
address = "localhost:1340"
56-
public_key = "ed0120FAFCB2B27444221717F6FCBF900D5BE95273B1B0904B08C736B32A19F16AC1F9"
57-
```
13+
A block might be created earlier if there is enough transactions in the [Queue](queue-params). The limit of transactions
14+
is configured by [`sumeragi.transactions_in_block`](#sumeragi-transactions-in-block).
5815

59-
Or like this:
16+
**Example:**
6017

6118
```toml
6219
[sumeragi]
63-
trusted_peers = [
64-
{ address = "localhost:1338", public_key = "ed012067C02E340AADD553BCF7DB28DD1F3BE8BE3D7581A2BAD81580AEE5CC75FEBD45" },
65-
{ address = "localhost:1339", public_key = "ed0120236808A6D4C12C91CA19E54686C2B8F5F3A786278E3824B4571EF234DEC8683B" },
66-
{ address = "localhost:1340", public_key = "ed0120FAFCB2B27444221717F6FCBF900D5BE95273B1B0904B08C736B32A19F16AC1F9" },
67-
]
20+
block_time = "2s"
6821
```
6922

70-
## `sumeragi.block_time`
23+
## `sumeragi.block_gossip_period`
7124

7225
- **Type:** String or Number, [Duration](glossary#type-duration)
73-
- **Default:** 2 seconds
26+
- **Default:** 10 seconds
7427

75-
Time since the round start[^1] by which a new block should be created regardless if there were enough transactions or
76-
not. Used to force block commits when there is a small influx of new transactions.
77-
78-
A block might be created earlier if there is enough transactions in the [Queue](queue-params). The limit of transactions
79-
is configured by [`sumeragi.max_transactions_in_block`](#sumeragi-max-transactions-in-block).
28+
The time interval between requests to peers for the most recent block.
8029

8130
**Example:**
8231

8332
```toml
8433
[sumeragi]
85-
block_time = "2s"
34+
block_gossip_period = "5s"
8635
```
8736

37+
::: warning
38+
39+
More frequent gossiping shortens the time to sync, but can overload the network.
40+
41+
:::
42+
8843
## `sumeragi.commit_time`
8944

9045
- **Type:** String or Number, [Duration](glossary#type-duration)
@@ -94,7 +49,7 @@ Time by which a newly created block should be committed. Prevents malicious node
9449
participating in consensus.
9550

9651
The block creation is configured with [`sumeragi.block_time`](#sumeragi-block-time) and
97-
[`sumeragi.max_transactions_in_block`](#sumeragi-max-transactions-in-block).
52+
[`sumeragi.transactions_in_block`](#sumeragi-transactions-in-block).
9853

9954
**Example:**
10055

@@ -103,17 +58,18 @@ The block creation is configured with [`sumeragi.block_time`](#sumeragi-block-ti
10358
commit_time = "4s"
10459
```
10560

106-
## `sumeragi.gossip_period`
61+
## `sumeragi.max_blocks_per_gossip`
10762

108-
- **Type:** String or Number, [Duration](glossary#type-duration)
109-
- **Default:** 1 second
63+
- **Type:** Number
64+
- **Default:** $4$
11065

111-
Period in milliseconds for pending transaction gossiping between peers. More frequent gossiping shortens the time to
112-
sync, but can overload the network.
66+
The amount of blocks that can be sent in a single synchronization message.
67+
68+
**Example:**
11369

11470
```toml
11571
[sumeragi]
116-
gossip_period = "1s"
72+
max_blocks_per_gossip = 4
11773
```
11874

11975
## `sumeragi.max_transactions_per_gossip`
@@ -131,7 +87,27 @@ you have high packet loss.
13187
max_transactions_per_gossip = 500
13288
```
13389

134-
## `sumeragi.max_transactions_in_block`
90+
## `sumeragi.transaction_gossip_period`
91+
92+
- **Type:** String or Number, [Duration](glossary#type-duration)
93+
- **Default:** 1 second
94+
95+
Period for pending transaction gossiping between peers.
96+
97+
**Example:**
98+
99+
```toml
100+
[sumeragi]
101+
transaction_gossip_period = "1s"
102+
```
103+
104+
::: warning
105+
106+
More frequent gossiping shortens the time to sync, but can overload the network.
107+
108+
:::
109+
110+
## `sumeragi.transactions_in_block`
135111

136112
- **Type:** u32
137113
- **Default:** $2^9 = 512$
@@ -144,7 +120,72 @@ elapsed since the round start[^1].
144120

145121
```toml
146122
[sumeragi]
147-
max_transactions_in_block = 512
123+
transactions_in_block = 512
124+
```
125+
126+
## `sumeragi.trusted_peers`
127+
128+
<!--
129+
130+
Hey, is sumeragi.trusted_peers actually required to be set in the config?
131+
132+
I guess that's the only way to specify the relevant topology and let the nodes know what addresses to communicate with as well as what public keys to use to verify respective node signatures
133+
134+
> Other peers might specify it as a trusted one
135+
136+
it should be bi-directional to support the consensus I guess
137+
138+
> or clients might commit transactions which will register a new peer
139+
140+
right.. actually Iroha v1 relies on that more, such a transaction was defined in the genesis (instead of the config), though it might be tricky if all of these peers are not relevant (unregistered in the post-genesis state) anymore and that's why there was an alternative needed (e.g. config) to contain a set of at least one peer (to sync from), once the WSV is relevant, the topology can be recovered from the blockstore/wsv
141+
142+
I guess it is, at least for a private chain, excluding a scenario of the only node in a network. Otherwise how would a node understand whom to trust (where to get the public key from)
143+
144+
-->
145+
146+
- **Type:** Array of Peer Ids
147+
- **Optional**
148+
149+
Optional list of predefined trusted peers.
150+
151+
Each Peer Id consists of:
152+
153+
- **`address`:** Address of the peer.
154+
- **Type:** String, [Socket-Address](glossary#type-socket-address)
155+
- **Required**
156+
- **`public_key`:** Public key of the peer.
157+
- **Type:** String, [Multi-hash](glossary#type-multi-hash)
158+
- **Required**
159+
160+
```toml
161+
peer_id = { address = "localhost:1338", public_key = "ed0120FAFCB2B27444221717F6FCBF900D5BE95273B1B0904B08C736B32A19F16AC1F9" }
162+
```
163+
164+
An array can be defined in two ways. Like this:
165+
166+
```toml
167+
[[sumeragi.trusted_peers]]
168+
address = "localhost:1338"
169+
public_key = "ed012067C02E340AADD553BCF7DB28DD1F3BE8BE3D7581A2BAD81580AEE5CC75FEBD45"
170+
171+
[[sumeragi.trusted_peers]]
172+
address = "localhost:1339"
173+
public_key = "ed0120236808A6D4C12C91CA19E54686C2B8F5F3A786278E3824B4571EF234DEC8683B"
174+
175+
[[sumeragi.trusted_peers]]
176+
address = "localhost:1340"
177+
public_key = "ed0120FAFCB2B27444221717F6FCBF900D5BE95273B1B0904B08C736B32A19F16AC1F9"
178+
```
179+
180+
Or like this:
181+
182+
```toml
183+
[sumeragi]
184+
trusted_peers = [
185+
{ address = "localhost:1338", public_key = "ed012067C02E340AADD553BCF7DB28DD1F3BE8BE3D7581A2BAD81580AEE5CC75FEBD45" },
186+
{ address = "localhost:1339", public_key = "ed0120236808A6D4C12C91CA19E54686C2B8F5F3A786278E3824B4571EF234DEC8683B" },
187+
{ address = "localhost:1340", public_key = "ed0120FAFCB2B27444221717F6FCBF900D5BE95273B1B0904B08C736B32A19F16AC1F9" },
188+
]
148189
```
149190

150191
[^1]:

0 commit comments

Comments
 (0)