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 Oct 31, 2023
1 parent a04448e commit c15c2e3
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
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 c15c2e3

Please sign in to comment.