-
Notifications
You must be signed in to change notification settings - Fork 130
Feature/pie 1502 ewp options cli #1246
Feature/pie 1502 ewp options cli #1246
Conversation
- 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
pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java
Outdated
Show resolved
Hide resolved
pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java
Outdated
Show resolved
Hide resolved
pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java
Outdated
Show resolved
Hide resolved
pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java
Outdated
Show resolved
Hide resolved
pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java
Outdated
Show resolved
Hide resolved
.../eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/EthereumWireProtocolConfiguration.java
Outdated
Show resolved
Hide resolved
pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java
Outdated
Show resolved
Hide resolved
pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java
Outdated
Show resolved
Hide resolved
@@ -1100,6 +1097,114 @@ public void parsesInvalidFastSyncMinPeersOptionWrongFormatShouldFail() { | |||
.contains("Invalid value for option '--fast-sync-min-peers': 'ten' is not an int"); | |||
} | |||
|
|||
@Test |
There was a problem hiding this comment.
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.
…nd.java Co-Authored-By: abdelhamidbakhta <[email protected]>
…nd.java Co-Authored-By: abdelhamidbakhta <[email protected]>
…nd.java Co-Authored-By: abdelhamidbakhta <[email protected]>
…nd.java Co-Authored-By: abdelhamidbakhta <[email protected]>
…/abdelhamidbakhta/pantheon into feature/pie-1502-ewp-options-cli
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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.
@@ -156,7 +156,11 @@ private CliquePantheonController( | |||
syncConfig.downloaderParallelism(), | |||
syncConfig.transactionsParallelism(), | |||
syncConfig.computationParallelism(), | |||
metricsSystem); | |||
metricsSystem, | |||
syncConfig.getEthereumWireProtocolConfiguration().getMaxGetBlockHeaders(), |
There was a problem hiding this comment.
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
fromSyncConfiguration
- Just pass a single
EthProtocolConfiguration
to the protocol manager rather than extracting out each option and passing it individually to the constructor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see PR
#1255
* 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)
* 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
* 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)
* 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
* 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)
PR description
Expose Ethereum Wire Protocol request limits as hidden CLI options.
Acceptance Criteria
The following options are exposed as hidden CLI options
Fixed Issue(s)
fixes PIE-1502