* Mark Sweep Pruner
* add `unload` method on Node interface, which is a noop everywhere but on `StoredNode`
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
This reverts commit 814b36e4
The needed chantes to get rid of Instant.now (which is also needed to get rid
of the wall clock dependency) are too deep and intrusive into IBFT to try and
speed patch them in that some APIs require re-work, so in the interst of test
stability this gets sheleved until it is all ready.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
To allow us to reset the timestamp in the blockchain for Retesteth support
we need to pass a Clock to affected APIs and use that instead of the static method
System.currentTimeMillis(). The most consistent way to do this that will ensure
that the API does not sneak back in is to ban the method via ErrorProne.
TestClock.fixed() was altered to return the "now" time of the first time the fixed clock was requested, needed for many header validation tasks validating headers are not from the future.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* [PAN-1683] Limit the fraction of wire connections initiated by peers
To protect against eclipse attacks, we should not allow all of our wire connections to be initiated from network peers. Some fraction of wire connections should be initiated by our node by connecting to peers in our discovery peer table. This PR ensures the fraction abides the limit.
* change fraction default value and add tests
* make fraction of remote wire connections configurable
- add a cli option to configure the fraction: `--fraction-remote-connections-allowed`
- introduce `Fraction` class to handle the conversion of the CLI option to a double and check if the value is between 0.0 and 1.0
- add tests
- fix broken tests
* remove unused local variable
* fix RunnerTest
* set fraction to 1.0 in PantheonFactoryConfigurationBuilder
* update test
* Introduce --limit-remote-wire-connections-enabled
* fix unused field
* fix conflict
* Update ethereum/p2p/src/main/java/tech/pegasys/pantheon/ethereum/p2p/rlpx/RlpxAgent.java
Co-Authored-By: Danno Ferrin <danno.ferrin@shemnon.com>
* Update ethereum/p2p/src/main/java/tech/pegasys/pantheon/ethereum/p2p/rlpx/RlpxAgent.java
Co-Authored-By: Danno Ferrin <danno.ferrin@shemnon.com>
* Update ethereum/p2p/src/main/java/tech/pegasys/pantheon/ethereum/p2p/rlpx/RlpxAgent.java
Co-Authored-By: Danno Ferrin <danno.ferrin@shemnon.com>
* fix PR discussion and tests
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Update PantheonCommand to accept minTransactionGasPriceWei as an integer (not String)
* update config file and documentation
* fix format violation
* add the Wei type in the TomlConfigFileDefaultProvider
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Add support for working within Network Address Translation (NAT) environments.
This adds a CLI flag `--nat-method` with two options, `NONE` (the default and
current behavior) and `UPNP.` `--nat-method` will affect what IP address and
ports are advertised via the P2P discovery and other APIs that report the
address and port for P2P actions.
`UPNP` is intended for a typical home or small office environment where a
wireless router or modem provides NAT isolation.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* add dump sub command
* add getBlockHash method for the dump sub command
* Resolve review issues : Add the ability to export multiple blocks, Rename dump command to export command, Improve tests for the export command
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Ensure the environment variable default provider is always used even if there is no config file.
* Remove static block.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
- refactor packages
- remove `PantheonExceptionHandler` inner class and create a separate class
- introduce subcommand package
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* [PIE-1736] Implement incoming transaction messages CLI option as an unstable command.
`--tx-pool-keep-alive-seconds` should be a `-X` option.
- `tx-pool-keep-alive-seconds` is renamed to `incoming-tx-messages-keep-alive-seconds`
- `incoming-tx-messages-keep-alive-seconds` is an unstable command not visible for the user (`--Xincoming-tx-messages-keep-alive-seconds`)
* fix unit test & spotless apply
* use TransactionPoolConfiguration to hold unstable option.
* add tests
* remove unecessary mock stubbing
* spotless apply
* use real builder instead of mock
* remove commented code
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* [PAN-2850] Create a transaction pool configuration object
* fix unit test by adding equals and hash code methods
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* [PIE-1710] Expose a CLI option to configure the life time of transaction messages.
- add a cli option `--tx-pool-message-keep-alive-seconds`
* rename cli option
* change cli option description
* spotless apply
* Update everything_config.toml
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* [PAN-2803] Update generate-blockchain-config CLI help
- provide more accurate description of the command
- update help ( FILE ==> DIRECTORY )
* fix unit tests on help command
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Make MetricCategory an interface so it isn't locked into the pantheon specific categories.
* Split categories into StandardMetricCategory and PanteonMetricCategory to separate the common and Pantheon specific categories.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Query params can be used to adjust the number of peers required and number of blocks tolerance to be considered in sync.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Renaming local config ATˆ
* Base work for account permissioning
* Updating simple account permissioning smart contract and genesis file
runtime bytecode
* Updating account ATs to use account object
* Fix isAllowed account permissioning transaction
* Fix allow/forbid account tx
* Updated node builder for account permissioningˆ
* Updated threaded and process AT node runners for account permissioning
* Created condition for checking balance not changing after some time
* Smart contract based account permissioning ATs
* Spotless
* Moved AccPermController build into RunnerBuilder
* Fix ProcessPantheonNodeRunner account permissioning setup
* Spotless
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>