This has required the MessageValidatorFactory used as part of the
RoundChangeMessageValidator to be renamed, which in turn has had
renaming knock on effects through the code.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
An abstraction existed which allowed for the differentiation of IBFT
messages which were used 'in-round' (Proposal, Prepare, Commit) and
those that were inter-round (RoundChange, NewRound).
This abstraction has not proven useful now that actual capability has
been developed, and as such is being removed.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
IbftBlockCreator is required to correctly set the MixHash, and also ensure the IbftBlockHashing function used to hash the block includes the round number, but not the commit seals.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* ensure bootnodes are in nodes-whitelist
* added test for network config eg ropsten with --node-whitelist
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
The IbftRound is responsible for sequencing the transmission of
network packets based on received data.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* fix rpcNodeShouldReturnCorrectVersion to be JVM/OS tolerant
* make sure "servicesShouldBeUp" is the first test run
* First have tests executed by sort order rather than quasi-random order
* add an underscore so that "_servicesShouldBeUp" runs first.
* increase first timeout to 90 sec as a general hedge.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* 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>
The IBFT RoundState is responsible for determining if sufficient
valid messages have been received to deem the node "Prepared" or
"Committed".
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Received New Round messages require significant validation to ensure their content is consistent and valid with regard the current state of the system.
This commit includes a class (and tests) which ensures illegally constructed NewRound messages are identified.
This does not include the action to be taken upon detection of an illegal New Round message.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* basic updatdes
* spotless inter alia
* building successfully
* funtioning
* minor update to docs
* rebased in previous commit, attempt to pass build server
* eliminate distanceSortedPeers
* spotless update
* revamp outstanding requests
* implementation of timeoutTask and corresponding test
* use setPeriodic
* testing with DiscoveryPeer
* remove commenceTimeoutTask from constructor
* isolate clock functionality out of recursive state
* update to docs
* validate size of outstandingrequestlist
* improve sanity check test
* remove extraneous copy
* add accurate interface parameters
* finalize
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
The classes used around the IBFT Messaging classes have all been renamed to make their use less cumbersome throughout the codebase.
Other issues are yet to be found (not all variable names and function names have been captured in this sweep).
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>
A problem was identified whereby the vote in a child block was applied to the parent, this was resolved by
duplicating the parent VoteTally before modifying it, and injecting to the child block.
Some refactoring was also conducted to make VoteTally logic simpler.
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>
* [MINOR] no fixed ports in tests
First enable "0" port in PeerDiscoveryAgent so it binds to
an open port. Then change the test to use two PeerDiscoveryAgents
The change to zero is accomplished by populating the endpoint with
the actual bound socket instead of the value passed in. If it is
zero the value will change otherwise it will be the value passed in.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Reverts #339
Görli's testnet regularly has proposers miss their turn and their
genesis block actually had a bad validator specified (that was voted out
as soon as they could) So many blocks do not have the proper "proposer"
as their block generator. As a consequence the
CliqueDifficultyValidationRule fails regularly, in fact it fails at
block 3, so this should be easy to re-create locally.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>