* GraphQL library upgrade changes.
one more NPE path for GraphQL sniffed out. With more tests.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Adds metrics to expose:
* height of best known block
* synchronizer in sync flag
* max peers
* Timestamp of current chain head
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Most libraries with newer stable versions were upgraded to their
newest stable version
* One exception is RocksDB, where a previous update caused a performance
regression. the 6.0.1 update will be tested in another PR
* GraphQL got stingier about null variable maps, so empty maps were passed instead
* errorprone plugin got stricter with it's variable access
* There was a license that was slightly different, creating 2 MIT licenses in the license report.
* Gradle wanted a new almost identical wrapper jar.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
When looking for a specific block and failing we should explain why
in the error message.
Also, clean up test names and grouping
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Validate private transaction nonce before submitting to Transaction Pool
* Update tests for Incorrect Nonce and Nonce Too Low exceptions
* Differentiate Incorrect Nonce and Nonce Too Low error messages
* Fixed flaky tests
* Change log level from Info to Debug
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
In most places the RPC gets dropped. In a few places it made more sense
to rename to GraphQLHttp when we are talking about the HTTP Server and
service.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* It returns for any block we would broadcast to other peers, when
we would broadcast them.
* It returns a JSON String containing hash, number, and timestamp
* This event data is not set in stone, it may change in type or content.
* Acceptance tests and unit tests got a re-work away from the assumption
that there is only one plugin type.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Per the eth JSON-RPC spec all values are strings, not raw json numbers, hence eth_protocolVersion is a Quantity ("0x3f"), not an Integer (63)
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
{blocks(from:7777777) {number}} should work, instead it is requiring a to: argument when it should be implied as latest
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
When we are asking for an account at an address that does not exist the
error message should state that the account doesn't exist.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Reduce the amount of work done within synchronized blocks in PendingTransactions.
In particular getTransactionByHash and notifying listeners of added or removed transactions are no longer in synchronized blocks.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Bail out of addRemoteTransactions immediately if we're not in sync instead of after we sort by nonce and begin iterating.
* Don't sort transactions by nonce. This was only required because we previously rejected transactions where the nonce was too high.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Don't copy collections if we don't need to. Change types higher up if needed.
* Don't use Guava's Object.equal, use Java's Objects.equals.
** add errorprone test to enforce the banning of Guava's Objects class.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
* Change all Stream<?> getX() and Stream<?> x() methods to Stream<?> streanX methods, such as `Stream<Peer> streamIdlePeers()`
* Update coding conventions to reflect this.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Implements a GraphQL interface to expose data that conforms to EIP-1767. As the EIP specifies, the implementation should allow “a complete replacement to the read-only information exposed via the present JSON-RPC interface”.
Supported CLI options:
* `--graphql-http-enabled` to enable GraphQL
* `--graphql-http-host` and `--graphql-http-port` to configure the host and port.
* `--graphql-http-cors-origins` to set the CORS-origin policies
* The `--host-whitelist` option is respected. This option also applies to JSON-RPC and WS-RPC endpoints.
Default port is 8547. The endpoint is `/graphrpc`, so the default URL is typically `http://127.0.0.1:8547/graphql`
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
Replaces the RocksDB based queue for pending world state download tasks with one that uses a simple file. Added tasks are appended to the file while the reader starts from the beginning of the file and reads forwards.
Periodically a new file is started to limit the disk space used. The reader deletes files it has completed reading.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>