* Upgrade errorprone
* Upgrade errorprone from 2.3.1 to 2.3.2
* Upgrade Jenkinsfile so that CI will use Java 11
* Suppress these new rules:
* EqualsGetClass
* ImmutableEnumChecker
* UnnecessaryParentheses
* Change code to conform to these new rules:
* BadImport
* BadInstanceof
* InconsistentHashCode
* LockNotBeforeTry
* MathAbsoluteRandom
* ModifiedButNotUsed
* UndefinedEquals
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Creating EnodeURLProperty and custom converter
* Replacing String for URI when parsing EnodeURL
* Fixing acceptance test bootnode config
* Removing invalid empty bootnode property from docker script
* Validating nodeId in Enode URL
* Adding final to method param
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* WS sync subscription delay added
* WS sync subscription delay added with unit testing
* WS sync subscription delay added with unit testing
* changed number to a constant in constructor
* Use default from websocket class instead of making new one
* Removed magic numbers
* Made error message use const as well
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* use Peer for enode not String
* moved NodeWhitelistController and PermissionConfig to p2p/permissioning
* reject messages if not from a whitelisted peer
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Time all tasks
This is fairly high touch consisting of 3 things:
* Moving to Prometheus's Summary for timers
* Timing at .2, .5, .8, .9, .99, and 1.0 (1.0 actually gets max I believe)
* Timing all abstract EthTasks
* The bulk of the changes: plumbing the timing context everywhere we need it
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* NC-1880 High TX volume swamps block processing
Move transaction processing into its own thread(s).
Size of txWorkerExecutor thread pool can be independently configured.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Plumb in three more metrics
* add blockchain_height gauge
* add blockchain_difficulty_total gauge
* add blockchain_announcedBlock_ingest histogram
This involved some deep pluming such that the metrics system needs to be
created in the PantheonCommand, along with trickle down effects into other
consensus engines. This is likely where it should live anyway.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Use the Idiomatic builder pattern for PantheonControllerBuilder and
RunnerBuilder. This reduces the number of test touch points when a new
object is added to the builder.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Metrics being captured initially:
Total number of peers ever connected to
Total number of peers disconnected, by disconnect reason and whether the disconnect was initiated locally or remotely.
Current number of peers
Timing for processing JSON-RPC requests, broken down by method name.
Generic JVM and process metrics (memory used, heap size, thread count, time spent in GC, file descriptors opened, CPU time etc).
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Upgrade dependency versions
* All version information is merged into one place
* Upgrade most version to their latest non-test version.
* dependencies are now sorted
Two dependencies were not upgraded:
errorprone - There are new checks that require build or source changes.
vertex - The license to eclipse 2.0 which is not in our current approved license list.
The change is trivial but for tracability it should be done alone.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
With the advent of "IBFT 2.0" the config file parsing needed to be
updated such that both the original IBFT, and the new variant can be
uniquely identified at execution time.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
The ProposerSelection logic has been reworked such that it now accepts
a BlockInterface, through which IBFT parameters can be accessed
directly from the block header, without requiring literal hashing etc.
This has required the VoteBlockInterface to be renamed to
BlockInterface.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
IBFT requires various aspects of the mining infrastructure in order
to create a proposed block.
This includes specifically the BlockCreator and MiningCoordinating,
the mining executor is not required at this stage, nor is the miner.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Throw FramingException when snappy decompression fails.
* Handle FramingException in DeFramer as a routine event representing a malformed message.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
The consensus-mechanism specific block values have been separated
from the VoteTallyUpdater such that there is a single updater rather
than one per consensus mechanism.
This has necessitated the creation of a custom serialiser/
deserialiser for each mechanism instead.
This change will ultimatley bleed through to the proposed votes and
their insertion to mined blocks.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Update value returned by web3_clientVersion to be ethstats friendly
* Version part starts with a v
* SNAPSHOT builds report 32 bits of the git hash
* OS and architecture are sniffed out and reported
* JVM version and branding are sniffed out and reported
Example values (not all real):
pantheon/v0.9.0-dev-f800a0b1/osx-x86_64/oracle-java-1.8
pantheon/v0.9.0-dev-27960b57/osx-x86_64/zulu-java-11
pantheon/v0.9.0/linux-arm64/openjdk-java-12
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
fixes#233 Allow nodekey to be specified separately to --datadir
Add a `--node-private-key <FILE>` option on CLI to enable the use of a custom key file.
if not set, uses the default "key" file in the data dir
if set but doesn't exist, creates a new key file
if set and exists, uses the specified key file
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Ban Peers via CLI
As part of working on #251 I needed to be able to ban certain nodes from my
connection pool and let others connect. This is a general solution to add
a --banned-nodeids CLI flag where the nodeIds of banned nodes are listed.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Introduce ProtocolScheduleBuilder and use it for Clique, MainNet, IBFT and dev.
* Remove default milestone blocks and simplify MainnetProtocolSchedule. All milestone blocks must now be defined in the genesis file (previously ethash chains would get Mainnet milestone blocks by default).
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Make GenesisConfigFile responsible for handling all the content in the genesis config file and rename GenesisConfig to GenesisState as it is now just responsible for creating the initial state at genesis.
* In CliqueProtocolController, pass the network ID to EthProtocolManager instead of the chain ID and use downloader parallelism setting instead of network ID for the number of threads.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* remove the import-blockchain command. Right now it's not useful
enough to support. Maybe it will return in the future.
* Remove the import-blockchain command.
Also remove BlockchainImporter that was backing the command.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Introduce classes to wrap JSON config instead of accessing it directly in multiple places.
* Fix discrepancy in how CliqueProtocolSchedule and CliquePantheonController loaded the block period configuration.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
We create our own instance of Clock. However the java.time.Clock
provides what is needed and already exists on the platform.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Introduce createInMemoryBlockchain test utility and use it everywhere appropriate.
* Inject BlockchainStorage into DefaultMutableBlockchain.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Replace explicit usages of RocksDbKeyValueStorage with the more generic but now just as capable KeyValueStorage.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>