Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

NC-2206 Remove-- max-trailing-peers option #680

2 changes: 0 additions & 2 deletions docs/Configuring-Pantheon/Networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ Limiting peers reduces the bandwidth used by Pantheon. It also reduces the CPU t

Use the [`--max-peers`](../Reference/Pantheon-CLI-Syntax.md#max-peers) command line option to reduce the maximum number of peers. The default is 25.

Use the [`--max-trailing-peers`](../Reference/Pantheon-CLI-Syntax.md#max-trailing-peers) option to reduce the maximum P2P peer connections for peers that are trailing behind the local chain head. The default is unlimited but the number of trailing peers cannot exceed the value specified by [`--max-peers`](../Reference/Pantheon-CLI-Syntax.md#max-peers).

Trailing peers cannot be used to get new blocks and are more likely to be requesting blocks from you. Limiting trailing peers may reduce the time taken to catch up to the chain head when synchronizing.
NicolasMassart marked this conversation as resolved.
Show resolved Hide resolved

## No Discovery
Expand Down
21 changes: 0 additions & 21 deletions docs/Reference/Pantheon-CLI-Syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,27 +200,6 @@ max-peers=42
Specifies the maximum P2P peer connections that can be established.
The default is 25.

### max-trailing-peers

!!!important
This option is deprecated in favor of a intelligent default setting and will be removed in 0.9
release.

```bash tab="Syntax"
--max-trailing-peers=<INTEGER>
```

```bash tab="Example Command Line"
--max-trailing-peers=2
```

```bash tab="Example Configuration File"
max-trailing-peers=2
```

Specifies the maximum P2P peer connections for peers that are trailing behind the local chain head.
The default is unlimited but the number of trailing peers cannot exceed the value specified by [`--max-peers`](#max-peers).

### metrics-enabled

```bash tab="Syntax"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ interface DefaultCommandValues {
// but we use FULL for the moment as Fast is still in progress
SyncMode DEFAULT_SYNC_MODE = SyncMode.FULL;
int DEFAULT_MAX_PEERS = 25;
int MAX_TRAILING_PEERS = Integer.MAX_VALUE;

static Path getDefaultPantheonDataPath(final Object command) {
// this property is retrieved from Gradle tasks or Pantheon running shell script.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,20 +195,6 @@ public static class RpcApisConversionException extends Exception {
)
private final Integer maxPeers = DEFAULT_MAX_PEERS;

/**
* @deprecated This option is not exposed anymore even if still available as it's bounded by
* max-peers value. It's not useful enough to figure in the help. Will probably completely
* removed in next version.
*/
@Deprecated
@Option(
names = {"--max-trailing-peers"},
paramLabel = MANDATORY_INTEGER_FORMAT_HELP,
description =
"Maximum p2p peer connections for peers that are trailing behind our chain head (default: unlimited)"
)
private final Integer maxTrailingPeers = Integer.MAX_VALUE;

@Option(
names = {"--banned-node-ids", "--banned-node-id"},
paramLabel = MANDATORY_NODE_ID_FORMAT_HELP,
Expand Down Expand Up @@ -699,7 +685,7 @@ private PrivacyParameters orionConfiguration() {

private SynchronizerConfiguration buildSyncConfig() {
synchronizerConfigurationBuilder.syncMode(syncMode);
synchronizerConfigurationBuilder.maxTrailingPeers(maxTrailingPeers);
synchronizerConfigurationBuilder.maxTrailingPeers(MAX_TRAILING_PEERS);
return synchronizerConfigurationBuilder.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -931,15 +931,6 @@ public void syncModeOptionMustBeUsed() {
assertThat(commandErrorOutput.toString()).isEmpty();
}

@Test
public void maxTrailingPeersMustBeUsed() {
parseCommand("--max-trailing-peers", "3");
verify(mockSyncConfBuilder).maxTrailingPeers(3);

assertThat(commandOutput.toString()).isEmpty();
assertThat(commandErrorOutput.toString()).isEmpty();
}

@Test
public void jsonRpcEnabledPropertyDefaultIsFalse() {
parseCommand();
Expand Down
1 change: 0 additions & 1 deletion pantheon/src/test/resources/everything_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ banned-node-id=["0x6f8a80d14311c39f35f516fa664deaaaa13e85b2f7493f37f6144d86991ec
p2p-host="1.2.3.4"
p2p-port=1234
max-peers=42
max-trailing-peers=5
host-whitelist=["all"]

# chain
Expand Down