* Skip requesting data we already have but continue to walk the tree to ensure we have all child nodes.
* Don't delete fast sync state on stop. Allow resuming world state downloads.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* added JsonRpcHttpService.isPermitted(User, JsonRpcMethod) and JsonRpcMethod.getPermissions() and unit tests
* 401 if no auth token
* added DSL condition for NetVersion to fail because Unauthorized
* Added DSL conditions to do login and set auth token, and AwaitLoginResponse
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Allow fast sync to resume if chain head is not genesis but a fast sync is still in progress.
If present, use the stored pivot block header when restarting.
Extract the fast sync logic out of DefaultSynchronizer into it's own class.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Modify EthScheduler to use shutdownNow immediately instead of trying shutdown first.
EthScheduler executes a lot of tasks which wait for responses from the network and may have a significant number of tasks queued. Using shutdown would wait for all network responses and all queued tasks to complete before exiting which almost always reaches the 2 minute timeout allowed before switching to shutdownNow. All tasks have to cope with being unexpectedly terminated (as would happen with a kill -9) so there's no reason to have this extra delay.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Return world states as an optional to allow code to handle world states not be available cleanly.
A world state is considered available if it's root node is available.
Delay storing the root hash when fast syncing a world state until the download completes so it isn't considered available and skip downloading world states that are already available.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* register sub tasks in ParalellImportChainSegmentTask
* rememger and shutdown eth services in EthScheduler
Fixes#768
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* make sure we don't put the password in the jwt payload
* Made sure password doesn't appear in jwt payload
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Add Message Frame to Pre compiled contracts
* Wire up Private Transaction Processor
* Add Privacy Precompiled contract Test
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Exceptions that serve more as flow control than error reporting should not log stack traces.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
ParallelImportChainSegmentTask, an explicitly parallel re-implementation
of PipelinedImportChainSegmentTask. Data is passed between stages
via BlockingQueues.
Pipeline stages are implemented in AbstractPipelinePeerTask and the
parent task assembles and initiates the pipeline execution.
Other changes to support this:
* Move ethTaskTimer to abstract root
* Don't use deterministic scheduler for downloader tests, this depends on explicit parallelism
* Change download segment size = 200
* Increase timeout in recoversFromSyncTargetDisconnect, the chain downloader
may stall for 10 seconds looking for an alternative target.
* Use a blocking queue instead of fixed wait period for the test peers
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Introduce GetReceiptsForHeadersTask to retry requests for receipts until they have all been received.
* Avoid requesting empty receipts from the network. (#802)
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Two changes:
* Stream chains now take up less vertical lines, only breaking on
stream operations.
* Long annotations that span multiple lines no longer have a dangling
parentesis and indent 4 spaces.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Add the services thread pool and a computation thread pool to the
EthScheduler.
* Services are long running, sequential, and infrequently start tasks
such as Full Sync and Fast Sync.
* Computations are short and high CPU intensity tasks such as ECDSA
signature extractions and POW validation. The intent is that each
runnable represents one such extraction and the extractions from a
block are saturated across available processing power. These
computations should have zero dependencies outside their object and
thread.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Log the milestone blocks in use at startup.
* Remove duplicate word "key" in log message when new key is generated.
* Don't log that mining is paused while behind chain head when mining is not enabled.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>