Remove metrics from plugin registration. Doing it this way here always results in a
NoOpsMetrics being inited because CLI options have not been parsed.
Add an acceptance test for metrics. This is what should have been in place and
would have detected metrics not working earlier.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Add a generalized genesis config override facility for command line use. Only useful for string or integer config values, not object values.
Sample use - enable Istanbul fork on block 99 million
--override-genesis-config=istanbulFork=99000000
Overriding a value with an empty string unsets the value
Sample use - disable Istanbul fork by un-setting istanbulFork:
--override-genesis-config=istanbulFork=
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Ensure `plugin-api` module gets published at the correct maven path
* Move `plugins` to `plugin-api`
Signed-off-by: Edward Evans <edward.evans@consensys.net>
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Return plugin-api to the main repo
* Spotless
* Migrate all external plugin-api references to the project in this repo
* Add licence header
* Update repo reference for publish, even if commented
* Use real configuration for publishing plugin-api
This was tested with the
`:plugins:publishMavenJavaPublicationToMavenLocal` task and checking the
local Maven repo to make sure it was using the correct paths
Signed-off-by: Edward Evans <edward.evans@consensys.net>
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Interally we use a `BigInteger` for ChainID, but currently use an `int` for
NetworkID. Because the default for NetworkID is the same value as ChainID there
are some chains where this will be very problematic, and there is at least
one other long-living chain outside the 32 bit int value range.
This is a large commit because the type is baked fairly deep into some of
the other APIs and very much in the test code testing the type.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Rich Data for Events Plugin
* plugin-api -> api
* use BinaryData as a root and add getValue to UInt256Value
* bring rick data changes in line with proposed APIs.
Undo orthagonal naming changes.
* add size
* use log and transaction interfaces from rich data api
* update to released plugin api version and add new event listener.
* add tests
* fix acceptance tests
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Allow comment fields json import files. Use "secretKey" for consistency with reference tests.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
As part of the plugin events service we need to support adding and removing
listeners for events. TransactionPool only supports adding pending and dropped
transactions. To support removing we need to pass around the subscription id.
To make it consistent some APIs were renamed.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* sweep state roots before child nodes
* Adds long removeAccountStateTrieNode(key) method to WorldStateStorage.Updater
* remove assertj assertions from `AbstractKeyValueStorageTest`
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* 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>