We are growing our list of metrics by the day, and some of them we don't
always need. So we should provide a way to trim them.
* If metrics are not enabled we supply a no-op metrics
* If only select metric categories are enabled we supply real metrics
for the selected metrics and no-op metrics for all the rest
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Use a single thread to persist received world state nodes to avoid RocksDB timeouts due to contention on the write lock.
* Fix RocksDbTaskQueue so it doesn't read stale data when resuming a transfer.
* Skip downloading empty trie nodes.
* Log unhandled errors from world state download requests
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Sometimes we get very short and unhelpful exceptions from deep in
pantheon ('null' for example). This change makes it so that if
--logging is at DEBUG, TRACE, or ALL then the stack trace that caused
the exit will also be printed.
This is done by providing our own impl of defaultExceptionHandler that
is aware of the logLevel in PantheonCommand.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Add RLP encoding subcommand for at least ibftExtraData to be inserted in genesis file.
There's only one encodable type for the moment, however the `--type` option is already there with a default value on this type. We'll add more possible types later if needed and the current type will remain the default one.
The file output is optional and it writes to standard output by default, same for
standard input or a file.
Tests and doc change.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Instantiate individual metrics where they're used
* Cache prometheus metrics to allow "duplicate" creation of metrics
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Adds a PeerValidator that, when the Dao fork milestone is in use, checks that the Dao block is present on each peer when they connect and disconnects them if they are on the wrong chain.
Also:
* Make GetHeadersFromPeer task stricter in validating response matches.
* Update BlockHeadersMessage to return a list of headers
* Add more controls to DeterministicEthScheduler test util
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* RocksDB uses synchronized methods so can use plain long instead of AtomicLong.
* Synchronize close method and use simple boolean instead of AtomicBoolean.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* RTD activated custom 404 a few days ago and our custom 404 broke
This custom template was never tested on RTD before as it was not taken in
account but now that it is, we can see it fails.
* update the url to use config
* removed issue tracker link as we will change it soon.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
add public key address export subcommand
make the file output optional and write to standard output by default
code, tests and doc changes
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Do parallel extract signatures in the parallel block importer.
* remove the extraction from FullSyncBlockHandler
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
There's an issue with the world state downloader where the download process could stall. The sequence goes like:
1. Inside requestDataFromPeer thread A takes out the sendingRequests lock
2. Thread A checks shouldRequestNodeData which returns true
3. Thread A sends a request for data
4. Thread A checks shouldRequestNodeData which returns false so it exits the while loop
5. Thread B receives the response to the (only) outstanding request
6. Thread B enters shouldRequestNodeData but fails to get the sendingRequests lock so exits the method
7. Thread A releases the sendingRequests lock and exits the methods
There are now no threads checking if they should send new requests and no outstanding requests to trigger a check in the future so the download is stuck and will never make anymore progress.
The fix is to switch the order of taking out the sendingRequests lock and checking shouldRequestNodeData so we release the sendingRequests lock before we go back round the loop to check shouldRequestNodeData.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>