diff --git a/docs/Configuring-Pantheon/Networking.md b/docs/Configuring-Pantheon/Networking.md index 11678d993c..e892210668 100644 --- a/docs/Configuring-Pantheon/Networking.md +++ b/docs/Configuring-Pantheon/Networking.md @@ -9,9 +9,12 @@ Pantheon uses the network to find and connect to peers. The default logging configuration does not list node connection and disconnection messages. -To enable listing of node connection and disconnection messages, specify the [`--logging`](../Reference/Pantheon-CLI-Syntax.md#logging) command line option `--logging=DEBUG`. For more verbosity, specify `--logging=TRACE`. +To enable listing of node connection and disconnection messages, specify the +[`--logging`](../Reference/Pantheon-CLI-Syntax.md#logging) command line option `--logging=DEBUG`. +For more verbosity, specify `--logging=TRACE`. -The console logs connection and disconnection events when the log level is `DEBUG` or higher. If `Successfully accepted connection from ...` is displayed, connections are getting through the firewalls. For example: +The console logs connection and disconnection events when the log level is `DEBUG` or higher. +If `Successfully accepted connection from ...` is displayed, connections are getting through the firewalls. !!! example "Example log output" `2018-10-16 12:37:35.479-04:00 | nioEventLoopGroup-3-1 | INFO | NettyP2PNetwork | Successfully accepted connection from 0xa979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c` @@ -26,13 +29,11 @@ for host and ==30303== for port. ## Limiting Peers -Limiting peers reduces the bandwidth used by Pantheon. It also reduces the CPU time and disk access used to manage and respond to peers. +Limiting peers reduces the bandwidth used by Pantheon. It also reduces the CPU time and disk access +used to manage and respond to peers. -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. +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. ## No Discovery @@ -42,4 +43,5 @@ Only set this option to `false` if you are running a test node or a test network ## Monitoring Peer Connections -Use the [`debug_metrics`](../Reference/JSON-RPC-API-Methods.md#debug_metrics) JSON-RPC API method to obtain information about peer connections. \ No newline at end of file +Use the [`debug_metrics`](../Reference/JSON-RPC-API-Methods.md#debug_metrics) JSON-RPC API method +to obtain information about peer connections. \ No newline at end of file diff --git a/docs/Reference/Pantheon-CLI-Syntax.md b/docs/Reference/Pantheon-CLI-Syntax.md index ba4e4a545b..3710e757ef 100644 --- a/docs/Reference/Pantheon-CLI-Syntax.md +++ b/docs/Reference/Pantheon-CLI-Syntax.md @@ -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= -``` - -```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" diff --git a/pantheon/src/main/java/tech/pegasys/pantheon/cli/DefaultCommandValues.java b/pantheon/src/main/java/tech/pegasys/pantheon/cli/DefaultCommandValues.java index 64fcb9f530..c5eceae825 100644 --- a/pantheon/src/main/java/tech/pegasys/pantheon/cli/DefaultCommandValues.java +++ b/pantheon/src/main/java/tech/pegasys/pantheon/cli/DefaultCommandValues.java @@ -50,6 +50,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. diff --git a/pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java b/pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java index d1ca964667..3823343484 100644 --- a/pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java +++ b/pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java @@ -193,20 +193,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, @@ -703,7 +689,7 @@ private PrivacyParameters orionConfiguration() { private SynchronizerConfiguration buildSyncConfig() { synchronizerConfigurationBuilder.syncMode(syncMode); - synchronizerConfigurationBuilder.maxTrailingPeers(maxTrailingPeers); + synchronizerConfigurationBuilder.maxTrailingPeers(MAX_TRAILING_PEERS); return synchronizerConfigurationBuilder.build(); } diff --git a/pantheon/src/test/java/tech/pegasys/pantheon/cli/PantheonCommandTest.java b/pantheon/src/test/java/tech/pegasys/pantheon/cli/PantheonCommandTest.java index 857d7c35ff..7c322e4231 100644 --- a/pantheon/src/test/java/tech/pegasys/pantheon/cli/PantheonCommandTest.java +++ b/pantheon/src/test/java/tech/pegasys/pantheon/cli/PantheonCommandTest.java @@ -768,15 +768,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(); diff --git a/pantheon/src/test/resources/everything_config.toml b/pantheon/src/test/resources/everything_config.toml index 3d68fc1b69..fd0ca59039 100644 --- a/pantheon/src/test/resources/everything_config.toml +++ b/pantheon/src/test/resources/everything_config.toml @@ -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