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

Feature/pie 1502 ewp options cli #1246

Merged

Conversation

AbdelStark
Copy link
Contributor

PR description

Expose Ethereum Wire Protocol request limits as hidden CLI options.

Acceptance Criteria

The following options are exposed as hidden CLI options

  • --ewp-max-get-headers
  • --ewp-max-get-bodies
  • --ewp-max-get-receipts
  • --ewp-max-get-node-data

Fixed Issue(s)

fixes PIE-1502

- create `EthereumWireProtocolConfiguration` object to hold per request limits
- add `EthereumWireProtocolConfiguration` in `SynchronizerConfiguration`
- create `PositiveNumber` class to handle command line options representing a positive number (a request limit for example)
- add unit tests to cover the new options
fixes PIE-1502
@@ -1100,6 +1097,114 @@ public void parsesInvalidFastSyncMinPeersOptionWrongFormatShouldFail() {
.contains("Invalid value for option '--fast-sync-min-peers': 'ten' is not an int");
}

@Test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have a testing pattern yet for validating these unstable/hidden options, so this is an opportunity to feel it out. It doesn't feel like they should be in PantheonCommandTest but each mixin class should have its own. Where that class lives is I'm not sure about. We could do it in the module the builder live in, or we could do it in this module.

Copy link
Contributor

@shemnon shemnon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of scope for this PR, but I think we should investigate Guava's AutoValue (https://github.com/google/auto/blob/master/value/userguide/builders.md) for builders. Possibly compare it to Lombok, the main difference being AutoValue doesn't directly interface with the compiler and uses code generation instead.

private PositiveNumber maxGetNodeData =
PositiveNumber.fromInt(EthereumWireProtocolConfiguration.DEFAULT_MAX_GET_NODE_DATA);

public Builder maxGetBlockHeaders(final PositiveNumber maxGetBlockHeaders) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we change the method to just int, and then set the value to a PositiveNumber? That reduces the friction for API consumers while preserving the error checking.

@AbdelStark AbdelStark merged commit 5db601e into PegaSysEng:master Apr 9, 2019
@@ -156,7 +156,11 @@ private CliquePantheonController(
syncConfig.downloaderParallelism(),
syncConfig.transactionsParallelism(),
syncConfig.computationParallelism(),
metricsSystem);
metricsSystem,
syncConfig.getEthereumWireProtocolConfiguration().getMaxGetBlockHeaders(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @abdelhamidbakhta - Just seeing this. Can we update 2 things here:

  • Remove EthProtocolConfiguration from SyncConfiguration
  • Just pass a single EthProtocolConfiguration to the protocol manager rather than extracting out each option and passing it individually to the constructor

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see PR
#1255

AbdelStark added a commit to AbdelStark/pantheon that referenced this pull request Apr 10, 2019
AbdelStark added a commit that referenced this pull request Apr 10, 2019
* EWP options management

- create `EthereumWireProtocolConfiguration` object to hold per request limits
- add `EthereumWireProtocolConfiguration` in `SynchronizerConfiguration`
- create `PositiveNumber` class to handle command line options representing a positive number (a request limit for example)
- add unit tests to cover the new options
fixes PIE-1502

* Update EthereumWireProtocolConfiguration.java

* Update PantheonCommandTest.java

* fix tests

* spotlessApply

* fix tests and javadoc

* Update pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java

Co-Authored-By: abdelhamidbakhta <[email protected]>

* Update pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java

Co-Authored-By: abdelhamidbakhta <[email protected]>

* Update pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java

Co-Authored-By: abdelhamidbakhta <[email protected]>

* Update pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java

Co-Authored-By: abdelhamidbakhta <[email protected]>

* fix

* fix PR discussion

* Update EthereumWireProtocolConfiguration.java

* fix PR 1246 discussion

#1246 (comment)
notlesh pushed a commit to notlesh/pantheon that referenced this pull request Apr 24, 2019
* EWP options management

- create `EthereumWireProtocolConfiguration` object to hold per request limits
- add `EthereumWireProtocolConfiguration` in `SynchronizerConfiguration`
- create `PositiveNumber` class to handle command line options representing a positive number (a request limit for example)
- add unit tests to cover the new options
fixes PIE-1502

* Update EthereumWireProtocolConfiguration.java

* Update PantheonCommandTest.java

* fix tests

* spotlessApply

* fix tests and javadoc

* Update pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java

Co-Authored-By: abdelhamidbakhta <[email protected]>

* Update pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java

Co-Authored-By: abdelhamidbakhta <[email protected]>

* Update pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java

Co-Authored-By: abdelhamidbakhta <[email protected]>

* Update pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java

Co-Authored-By: abdelhamidbakhta <[email protected]>

* fix

* fix PR discussion

* Update EthereumWireProtocolConfiguration.java
notlesh pushed a commit to notlesh/pantheon that referenced this pull request Apr 24, 2019
* EWP options management

- create `EthereumWireProtocolConfiguration` object to hold per request limits
- add `EthereumWireProtocolConfiguration` in `SynchronizerConfiguration`
- create `PositiveNumber` class to handle command line options representing a positive number (a request limit for example)
- add unit tests to cover the new options
fixes PIE-1502

* Update EthereumWireProtocolConfiguration.java

* Update PantheonCommandTest.java

* fix tests

* spotlessApply

* fix tests and javadoc

* Update pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java

Co-Authored-By: abdelhamidbakhta <[email protected]>

* Update pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java

Co-Authored-By: abdelhamidbakhta <[email protected]>

* Update pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java

Co-Authored-By: abdelhamidbakhta <[email protected]>

* Update pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java

Co-Authored-By: abdelhamidbakhta <[email protected]>

* fix

* fix PR discussion

* Update EthereumWireProtocolConfiguration.java

* fix PR 1246 discussion

PegaSysEng#1246 (comment)
notlesh pushed a commit to notlesh/pantheon that referenced this pull request May 4, 2019
* EWP options management

- create `EthereumWireProtocolConfiguration` object to hold per request limits
- add `EthereumWireProtocolConfiguration` in `SynchronizerConfiguration`
- create `PositiveNumber` class to handle command line options representing a positive number (a request limit for example)
- add unit tests to cover the new options
fixes PIE-1502

* Update EthereumWireProtocolConfiguration.java

* Update PantheonCommandTest.java

* fix tests

* spotlessApply

* fix tests and javadoc

* Update pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java

Co-Authored-By: abdelhamidbakhta <[email protected]>

* Update pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java

Co-Authored-By: abdelhamidbakhta <[email protected]>

* Update pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java

Co-Authored-By: abdelhamidbakhta <[email protected]>

* Update pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java

Co-Authored-By: abdelhamidbakhta <[email protected]>

* fix

* fix PR discussion

* Update EthereumWireProtocolConfiguration.java
notlesh pushed a commit to notlesh/pantheon that referenced this pull request May 4, 2019
* EWP options management

- create `EthereumWireProtocolConfiguration` object to hold per request limits
- add `EthereumWireProtocolConfiguration` in `SynchronizerConfiguration`
- create `PositiveNumber` class to handle command line options representing a positive number (a request limit for example)
- add unit tests to cover the new options
fixes PIE-1502

* Update EthereumWireProtocolConfiguration.java

* Update PantheonCommandTest.java

* fix tests

* spotlessApply

* fix tests and javadoc

* Update pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java

Co-Authored-By: abdelhamidbakhta <[email protected]>

* Update pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java

Co-Authored-By: abdelhamidbakhta <[email protected]>

* Update pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java

Co-Authored-By: abdelhamidbakhta <[email protected]>

* Update pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java

Co-Authored-By: abdelhamidbakhta <[email protected]>

* fix

* fix PR discussion

* Update EthereumWireProtocolConfiguration.java

* fix PR 1246 discussion

PegaSysEng#1246 (comment)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants