Skip to content

Commit

Permalink
[refactor]: change parameters to more optimal values determined with …
Browse files Browse the repository at this point in the history
…perf testing

Signed-off-by: Marin Veršić <[email protected]>
  • Loading branch information
mversic committed Nov 6, 2023
1 parent e692e19 commit f716ca8
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ The environment variables replacing `config.json` should be passed as JSON strin
<details> <summary>Expand to see the example</summary>

``` bash
IROHA_TORII="{\"P2P_ADDR\": \"127.0.0.1:1339\", \"API_URL\": \"127.0.0.1:8080\"}" IROHA_SUMERAGI="{\"TRUSTED_PEERS\": [{\"address\": \"127.0.0.1:1337\",\"public_key\": \"ed01201C61FAF8FE94E253B93114240394F79A607B7FA55F9E5A41EBEC74B88055768B\"},{\"address\": \"127.0.0.1:1338\",\"public_key\": \"ed0120CC25624D62896D3A0BFD8940F928DC2ABF27CC57CEFEB442AA96D9081AAE58A1\"},{\"address\": \"127.0.0.1:1339\",\"public_key\": \"ed0120FACA9E8AA83225CB4D16D67F27DD4F93FC30FFA11ADC1F5C88FD5495ECC91020\"},{\"address\": \"127.0.0.1:1340\",\"public_key\": \"ed01208E351A70B6A603ED285D666B8D689B680865913BA03CE29FB7D13A166C4E7F1F\"}]}" IROHA_KURA="{\"INIT_MODE\": \"strict\",\"BLOCK_STORE_PATH\": \"./storage\"}" IROHA_BLOCK_SYNC="{\"GOSSIP_PERIOD_MS\": 10000,\"BATCH_SIZE\": 2}" IROHA_PUBLIC_KEY="ed01201C61FAF8FE94E253B93114240394F79A607B7FA55F9E5A41EBEC74B88055768B" IROHA_PRIVATE_KEY="{\"digest_function\": \"ed25519\",\"payload\": \"282ED9F3CF92811C3818DBC4AE594ED59DC1A2F78E4241E31924E101D6B1FB831C61FAF8FE94E253B93114240394F79A607B7FA55F9E5A41EBEC74B88055768B\"}" IROHA_GENESIS="{\"ACCOUNT_PUBLIC_KEY\": \"ed01204CFFD0EE429B1BDD36B3910EC570852B8BB63F18750341772FB46BC856C5CAAF\",\"ACCOUNT_PRIVATE_KEY\": {\"digest_function\": \"ed25519\",\"payload\": \"D748E18CE60CB30DEA3E73C9019B7AF45A8D465E3D71BCC9A5EF99A008205E534CFFD0EE429B1BDD36B3910EC570852B8BB63F18750341772FB46BC856C5CAAF\"}}" ./iroha
IROHA_TORII="{\"P2P_ADDR\": \"127.0.0.1:1339\", \"API_URL\": \"127.0.0.1:8080\"}" IROHA_SUMERAGI="{\"TRUSTED_PEERS\": [{\"address\": \"127.0.0.1:1337\",\"public_key\": \"ed01201C61FAF8FE94E253B93114240394F79A607B7FA55F9E5A41EBEC74B88055768B\"},{\"address\": \"127.0.0.1:1338\",\"public_key\": \"ed0120CC25624D62896D3A0BFD8940F928DC2ABF27CC57CEFEB442AA96D9081AAE58A1\"},{\"address\": \"127.0.0.1:1339\",\"public_key\": \"ed0120FACA9E8AA83225CB4D16D67F27DD4F93FC30FFA11ADC1F5C88FD5495ECC91020\"},{\"address\": \"127.0.0.1:1340\",\"public_key\": \"ed01208E351A70B6A603ED285D666B8D689B680865913BA03CE29FB7D13A166C4E7F1F\"}]}" IROHA_KURA="{\"INIT_MODE\": \"strict\",\"BLOCK_STORE_PATH\": \"./storage\"}" IROHA_BLOCK_SYNC="{\"GOSSIP_PERIOD_MS\": 1000,\"BATCH_SIZE\": 2}" IROHA_PUBLIC_KEY="ed01201C61FAF8FE94E253B93114240394F79A607B7FA55F9E5A41EBEC74B88055768B" IROHA_PRIVATE_KEY="{\"digest_function\": \"ed25519\",\"payload\": \"282ED9F3CF92811C3818DBC4AE594ED59DC1A2F78E4241E31924E101D6B1FB831C61FAF8FE94E253B93114240394F79A607B7FA55F9E5A41EBEC74B88055768B\"}" IROHA_GENESIS="{\"ACCOUNT_PUBLIC_KEY\": \"ed01204CFFD0EE429B1BDD36B3910EC570852B8BB63F18750341772FB46BC856C5CAAF\",\"ACCOUNT_PRIVATE_KEY\": {\"digest_function\": \"ed25519\",\"payload\": \"D748E18CE60CB30DEA3E73C9019B7AF45A8D465E3D71BCC9A5EF99A008205E534CFFD0EE429B1BDD36B3910EC570852B8BB63F18750341772FB46BC856C5CAAF\"}}" ./iroha
```

</details>
Expand Down
6 changes: 3 additions & 3 deletions config/iroha_test_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"public_key": "ed01208E351A70B6A603ED285D666B8D689B680865913BA03CE29FB7D13A166C4E7F1F"
}
],
"COMMIT_TIME_LIMIT_MS": 2000,
"MAX_TRANSACTIONS_IN_BLOCK": 8192,
"COMMIT_TIME_LIMIT_MS": 120000,
"MAX_TRANSACTIONS_IN_BLOCK": 20,
"ACTOR_CHANNEL_CAPACITY": 100,
"GOSSIP_BATCH_SIZE": 500,
"GOSSIP_PERIOD_MS": 1000,
Expand All @@ -47,7 +47,7 @@
"FETCH_SIZE": 10
},
"BLOCK_SYNC": {
"GOSSIP_PERIOD_MS": 10000,
"GOSSIP_PERIOD_MS": 1000,
"BLOCK_BATCH_SIZE": 4,
"ACTOR_CHANNEL_CAPACITY": 100
},
Expand Down
2 changes: 1 addition & 1 deletion config/src/block_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use iroha_config_base::derive::{Documented, Proxy};
use serde::{Deserialize, Serialize};

const DEFAULT_BLOCK_BATCH_SIZE: u32 = 4;
const DEFAULT_GOSSIP_PERIOD_MS: u64 = 10000;
const DEFAULT_GOSSIP_PERIOD_MS: u64 = 1000;
const DEFAULT_ACTOR_CHANNEL_CAPACITY: u32 = 100;

/// Configuration for `BlockSynchronizer`.
Expand Down
6 changes: 3 additions & 3 deletions config/src/sumeragi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ use self::default::*;
/// Module with a set of default values.
pub mod default {
/// Default number of miliseconds the peer waits for transactions before creating a block.
pub const DEFAULT_BLOCK_TIME_MS: u64 = 2000;
pub const DEFAULT_BLOCK_TIME_MS: u64 = 1000;
/// Default amount of time allocated for voting on a block before a peer can ask for a view change.
pub const DEFAULT_COMMIT_TIME_LIMIT_MS: u64 = 4000;
pub const DEFAULT_COMMIT_TIME_LIMIT_MS: u64 = 120000;
/// Unused const. Should be removed in the future.
pub const DEFAULT_ACTOR_CHANNEL_CAPACITY: u32 = 100;
/// Default duration in ms between every transaction gossip.
pub const DEFAULT_GOSSIP_PERIOD_MS: u64 = 1000;
/// Default maximum number of transactions sent in single gossip message.
pub const DEFAULT_GOSSIP_BATCH_SIZE: u32 = 500;
/// Default maximum number of transactions in block.
pub const DEFAULT_MAX_TRANSACTIONS_IN_BLOCK: u32 = 2_u32.pow(9);
pub const DEFAULT_MAX_TRANSACTIONS_IN_BLOCK: u32 = 20;

/// Default estimation of consensus duration.
#[allow(clippy::integer_division)]
Expand Down
8 changes: 4 additions & 4 deletions configs/peer/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"SUMERAGI": {
"KEY_PAIR": null,
"PEER_ID": null,
"BLOCK_TIME_MS": 2000,
"BLOCK_TIME_MS": 1000,
"TRUSTED_PEERS": null,
"COMMIT_TIME_LIMIT_MS": 4000,
"MAX_TRANSACTIONS_IN_BLOCK": 512,
"COMMIT_TIME_LIMIT_MS": 120000,
"MAX_TRANSACTIONS_IN_BLOCK": 20,
"ACTOR_CHANNEL_CAPACITY": 100,
"GOSSIP_BATCH_SIZE": 500,
"GOSSIP_PERIOD_MS": 1000
Expand All @@ -28,7 +28,7 @@
"FETCH_SIZE": 10
},
"BLOCK_SYNC": {
"GOSSIP_PERIOD_MS": 10000,
"GOSSIP_PERIOD_MS": 1000,
"BLOCK_BATCH_SIZE": 4,
"ACTOR_CHANNEL_CAPACITY": 100
},
Expand Down
6 changes: 3 additions & 3 deletions configs/peer/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,17 @@
"Sequence": [
{
"NewParameter": {
"Parameter": "?MaxTransactionsInBlock=512"
"Parameter": "?MaxTransactionsInBlock=20"
}
},
{
"NewParameter": {
"Parameter": "?BlockTime=2000"
"Parameter": "?BlockTime=1000"
}
},
{
"NewParameter": {
"Parameter": "?CommitTimeLimit=4000"
"Parameter": "?CommitTimeLimit=120000"
}
},
{
Expand Down
24 changes: 12 additions & 12 deletions docs/source/references/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ The following is the default configuration used by Iroha.
"SUMERAGI": {
"KEY_PAIR": null,
"PEER_ID": null,
"BLOCK_TIME_MS": 2000,
"BLOCK_TIME_MS": 1000,
"TRUSTED_PEERS": null,
"COMMIT_TIME_LIMIT_MS": 4000,
"MAX_TRANSACTIONS_IN_BLOCK": 512,
"COMMIT_TIME_LIMIT_MS": 120000,
"MAX_TRANSACTIONS_IN_BLOCK": 20,
"ACTOR_CHANNEL_CAPACITY": 100,
"GOSSIP_BATCH_SIZE": 500,
"GOSSIP_PERIOD_MS": 1000
Expand All @@ -59,7 +59,7 @@ The following is the default configuration used by Iroha.
"FETCH_SIZE": 10
},
"BLOCK_SYNC": {
"GOSSIP_PERIOD_MS": 10000,
"GOSSIP_PERIOD_MS": 1000,
"BLOCK_BATCH_SIZE": 4,
"ACTOR_CHANNEL_CAPACITY": 100
},
Expand Down Expand Up @@ -141,7 +141,7 @@ Has type `Option<block_sync::ConfigurationProxy>`[^1]. Can be configured via env
{
"ACTOR_CHANNEL_CAPACITY": 100,
"BLOCK_BATCH_SIZE": 4,
"GOSSIP_PERIOD_MS": 10000
"GOSSIP_PERIOD_MS": 1000
}
```

Expand Down Expand Up @@ -172,7 +172,7 @@ The period of time to wait between sending requests for the latest block.
Has type `Option<u64>`[^1]. Can be configured via environment variable `BLOCK_SYNC_GOSSIP_PERIOD_MS`

```json
10000
1000
```

## `disable_panic_terminal_colors`
Expand Down Expand Up @@ -522,12 +522,12 @@ Has type `Option<Box<sumeragi::ConfigurationProxy>>`[^1]. Can be configured via
```json
{
"ACTOR_CHANNEL_CAPACITY": 100,
"BLOCK_TIME_MS": 2000,
"COMMIT_TIME_LIMIT_MS": 4000,
"BLOCK_TIME_MS": 1000,
"COMMIT_TIME_LIMIT_MS": 120000,
"GOSSIP_BATCH_SIZE": 500,
"GOSSIP_PERIOD_MS": 1000,
"KEY_PAIR": null,
"MAX_TRANSACTIONS_IN_BLOCK": 512,
"MAX_TRANSACTIONS_IN_BLOCK": 20,
"PEER_ID": null,
"TRUSTED_PEERS": null
}
Expand All @@ -550,7 +550,7 @@ The period of time a peer waits for the `CreatedBlock` message after getting a `
Has type `Option<u64>`[^1]. Can be configured via environment variable `SUMERAGI_BLOCK_TIME_MS`

```json
2000
1000
```

### `sumeragi.commit_time_limit_ms`
Expand All @@ -560,7 +560,7 @@ The period of time a peer waits for `CommitMessage` from the proxy tail.
Has type `Option<u64>`[^1]. Can be configured via environment variable `SUMERAGI_COMMIT_TIME_LIMIT_MS`

```json
4000
120000
```

### `sumeragi.gossip_batch_size`
Expand Down Expand Up @@ -600,7 +600,7 @@ The upper limit of the number of transactions per block.
Has type `Option<u32>`[^1]. Can be configured via environment variable `SUMERAGI_MAX_TRANSACTIONS_IN_BLOCK`

```json
512
20
```

### `sumeragi.peer_id`
Expand Down

0 comments on commit f716ca8

Please sign in to comment.