* 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>
* render error message to System.err instead of .out
* log and check exception type
* add else
* simplification of explanitory comment
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Clique Proposer Selection would choose an incorrect peer
when a signer was removed from the pool, as the algorithm worked
purely on the block count.
The algorithm has now been updated to ensure the next proposer is
incrementally the next signer in the ordered list, based on the
parent's proposer
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>
RoundChangeValidator has been added which is responsible for
validating the content of a RoundChange message by using the
underlying MessageValidator capabilities.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Refactoring and removing the duplicate call to web3j
* Single shared variable for the private key for the first genesis account
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>
Clique was using integer arithmetic to calculate how much "wiggle"
delay should be added when the proposer is "out of turn".
This would mean when an odd number of validators was in use, the
max delay would be 250ms less than the expected value.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Avoids throwing java.util.concurrent.ExecutionException when handling other framing errors in DeFramer.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Add the ipV6 flag to the datagram socket options, this creates a socket that handles both
ipv4 and ipv6 socket connections.
* Set the IPv6 flag state based on the presence or absence of an IPv6 address.
i.e. if your machine runs IPv6 it will accept IPv6 bootnodes and peers. However link-local IPv6 is not fully supported (see issue #288).
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>
* EthGetTransactionReceipt Acceptance test added
* GetTransactionReceipt Acceptance Test updated to conform to new dsl
* Update to new dsl
* Update to new dsl
* Update to new dsl - spotless applied
* Naming convention corrected
* Naming convention corrected
Deleted obsolete test cases
added assertion for status code
* Naming convention corrected
Deleted obsolete test cases
added assertion for status code
* Naming convention corrected
* Removed sender field to make test more efficient
* Removed sender field to make test more efficient
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* IoC for deploying the smart contract
* Smart contract deploy as a Transaction
* Consistent transaction naming
* Avoiding a resource leak with lazy creation of Web3j connections
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>