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>
* move to an offer() instead of a put() on the downloader so that when
the task is stopped the put will see that it is done and not wait
forever.
* remove peer based focus of the task. Let subtasks pick their peers.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
There is a failure mode of IBFT whereby a validator fails to import
a block, and also fails to receive the NewBlock message from its
peers. This means said validator is unable to participate in
subsequent rounds, and may cause the network to halt.
To overcome this issue, if an IBFT validator receives messages from
a future height, it will update the "BestEstimatedHeight" of the
corresponding EthPeer object, such that the Synchroniser will
(eventually) download the requisite blocks - thus allowing the
IBFT network to continue to operate.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
It was identified during a demonstration that Pantheon, when running
in IBFT would show a "Bad Block Import" when a validator was added or
removed from the validator pool.
It was determined this was due to IBFT maintaining a single, 'global'
copy of the curent list of validators, which was updated when a block
was imported - thus when a block which had been imported vi IBFT
was then received via Eth block propogation, the validator list would
not align with the global list (as it had been updated in the IBFT
import).
The solution has been to utilise the VoteTallyCache as used in the
Clique implementation.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Gives approximately a 10% perf improvement in isolation and in real-world tests allows the world state requests to actually reach the concurrent limit.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
--> adapt `BlockBroadcaster` to use `send` method on `EthPeer`
--> adapt `EthProtocolMamnager` to utilize `BlockBroadcaster` to disseminate newly mined block
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Fix for the _“The input line is too long”_ error on Windows.
This fix makes Gradle generate a shortened but operational command in `pantheon.bat`.
The modified `pantheon.bat`, instead of explicitly referencing each .jar individually when initializing the classpath, uses the wildcard character `*` instead.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
When using the data-path internally use an absolute version instead of the path instead of a relative form.
This fixes a null pointer exception when the data-path is set to an empty string (in a TOML config using `data-path=""` or CLI using `--data-path=`) and interprets that empty string to be the current working directory.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>