127 Commits

Author SHA1 Message Date
Chris Mckay
0af0a4300b [PAN-2503] permission provider that allows bootnodes if you have no other connections (#1206)
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2019-04-04 12:06:19 +10:00
Chris Mckay
5107f63479 [PAN-2494] [PAN-2474] permissioning issues (#1174)
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2019-03-27 16:37:57 +10:00
Chris Mckay
bc5d6eb45a [PAN-2347] nodepermissioningcontroller used for devp2p connection filtering (#1132)
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2019-03-20 09:35:16 +10:00
Danno Ferrin
fbb731a8fe Errorprone 2.3.3 upgrades (#1110)
Biggest change is that UnusedVariable and UnusedMethod went to WARN by
default. Since our build is a no warning build this means we either need
to turn them off or fix them.  I mostly opted for the latter.  Test code
was mostly fixed, unused loggers were deleted, and other shipped code
was mostly suppressed.

Two less noisy fixes to not use `SortedSet` and to use zero based
comparable results instead of -1, 0, and 1.  Also a compiler nit in
errorprone was suppressed, per the description it won't affect us.

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2019-03-19 09:17:41 -06:00
Chris Mckay
82ced07835 [PAN-2343] refactor enodeurl to use inetaddr (#1032)
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2019-03-05 10:00:52 +10:00
Adrian Sutton
ae528fc7cb Ensure devp2p ports are written to ports file correctly (#1020)
Start P2P network synchronously so the ports are guaranteed to be known before we write the ports file
Include the P2P TCP port in ports file even when peer discovery is disabled.
Load information from the advertised peer rather than the discovery listening socket.
Fix admin_nodeInfo to include the ?discport param in the enode URI when the discovery port differs from the P2P port.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2019-03-05 07:21:07 +10:00
Adrian Sutton
8df9a9622b Ensure exceptions in suppliers passed to EthScheduler are propagated to the returned CompletableFuture. (#884)
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2019-02-19 06:03:44 +10:00
Adrian Sutton
463fc3994e Introduce FutureUtils to reduce duplicated code around CompletableFuture (#868)
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2019-02-16 06:42:54 +10:00
Lucas Saldanha
d3b9211b82 Moving NodeWhitelistController to permissioning package (#855)
* Moving NodeWhitelistController to permissioning package

* Refactoring unit tests

* Fix string.format

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2019-02-14 14:33:27 +13:00
Lucas Saldanha
6551183a8d [NC-2118] Method to reload permissions file (#834)
* Extracting EnodeURL logic to specific object

* Moving permissioning config builder to permissioning package

* Validating accounts in permissions file

* Implemented controller reload method

* Reload whitelist from file API method

* Spotless

* Refactoring account validation

* Errorprone

* Fixing tests after rebase

* Spotless

* PR review

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2019-02-12 17:27:50 +13:00
Adrian Sutton
b28258b8c4 Delegate getRootCause through to Guava's implementation to avoid re-implementing the wheel (keep our wrapper method to preserve null safe handling). (#692)
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2019-01-29 16:00:46 +10:00
Adrian Sutton
99bded7dd4 [NC-1977] Provide a better error message when RocksDB reports an unsupported operation system/jvm combination (like 32bit Java on Windows). (#547)
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2019-01-15 08:51:26 +10:00
Danno Ferrin
e73b339070 Update errorprone (#401)
* Upgrade errorprone

* Upgrade errorprone from 2.3.1 to 2.3.2
* Upgrade Jenkinsfile so that CI will use Java 11
* Suppress these new rules:
  * EqualsGetClass
  * ImmutableEnumChecker
  * UnnecessaryParentheses
* Change code to conform to these new rules:
  * BadImport
  * BadInstanceof
  * InconsistentHashCode
  * LockNotBeforeTry
  * MathAbsoluteRandom
  * ModifiedButNotUsed
  * UndefinedEquals

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2018-12-12 10:16:36 -07:00
Danno Ferrin
055d63f109 NC-1883 - IPv6 peers (#281)
* 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>
2018-11-21 09:48:19 -07:00
mbaxter
6209269eb6 Remove unnecessary RlpInput and RlpOutput classes (#287)
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2018-11-20 15:04:16 -05:00
Danno Ferrin
e11fec2346 The ShortHex of 0 should be '0x0', not '0x' (#272)
And some tests of toHexString and toShortHexString.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2018-11-19 12:42:41 -07:00
Adrian Sutton
39e05141fe Remove reference counting from MessageData (#264)
* Remove release/retain requirement from MessageData.

MessageData now wraps a BytesValue rather than a Netty ByteBuf so we no longer need to call release/retain and pass that through to the underlying ByteBuf.
Entirely removed support for a BytesValue wrapping a Netty ByteBuf as it does not provide any way to release the underlying ByteBuf.

* Add BytesValue.copyTo(byte[]) to avoid the need to call getArrayUnsafe() to copy the data.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2018-11-19 09:35:39 +10:00
Danno Ferrin
0716e6044b Update Client Version to be ethstats friendly (#258)
Update value returned by web3_clientVersion to be ethstats friendly

* Version part starts with a v
* SNAPSHOT builds report 32 bits of the git hash
* OS and architecture are sniffed out and reported
* JVM version and branding are sniffed out and reported

Example values (not all real):
pantheon/v0.9.0-dev-f800a0b1/osx-x86_64/oracle-java-1.8
pantheon/v0.9.0-dev-27960b57/osx-x86_64/zulu-java-11
pantheon/v0.9.0/linux-arm64/openjdk-java-12
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2018-11-14 08:08:45 -07:00
Danno Ferrin
770ce91779 Replace custom Clock with java.time.Clock (#220)
We create our own instance of Clock. However the java.time.Clock
provides what is needed and already exists on the platform.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2018-10-31 14:47:44 -06:00
mbaxter
0cf8f2e5b8 [NC-1561] Remove RLPUtils from RawBlockIterator (#179)
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2018-10-26 17:53:18 -04:00
Adrian Sutton
ebe9f3e36d [MINOR] Add missing finals. (#128)
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2018-10-24 08:04:23 +10:00
mark-terry
cb01231ac0 [NC-862] License headers applied to non-java files (#93)
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2018-10-19 07:26:11 +10:00
mark-terry
310bd4035c Nc 862 spotless license headers (#69)
* [NC-862] Added licenseHeader java rule to spotless.

* [NC-862] Spotless java headers applied.

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2018-10-17 12:54:46 +10:00
Christopher Mckay
cf66277a57 changed all the imports to tech.pegasys packaging
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2018-10-12 15:48:20 +11:00
Christopher Mckay
f6ed2d3d02 renamed package paths
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2018-10-12 15:48:20 +11:00
Chris Mckay
75ce3a4f02 [MINOR] removing executable from files (#14)
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2018-10-10 14:22:54 +11:00
PegaSys Admin
7dfc2e4085 Initial commit
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2018-10-09 15:17:20 +00:00