Adrian Sutton
ae09385641
[PAN-2386] Report the correct tcp port in PING packets when it differs from the UDP port ( #1019 )
...
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Adrian Sutton
779136599a
Prefix log messages from pantheon nodes running as separate processes with the node name. ( #1018 )
...
Remove duplicate logging of outgoing peer discovery packets.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Adrian Sutton
fc2b1331d5
Change EthNetworkConfig bootnodes to always be URIs instead of accepting either URI or Peer ( #1027 )
...
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Adrian Sutton
b81ad01b0f
Change ExpectBlockNumber to require at least the specified block number instead of exactly that block number ( #981 )
...
Otherwise tests fail if the miner finds a new block before the check runs.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Adrian Sutton
9d06ec2fcf
Create peer discovery packets on a worker thread. ( #955 )
...
The signing process is potentially slow causing the Vertx queue to back up.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
mbaxter
1b0a749ca6
[PAN-2312] Validate DAO block ( #939 )
...
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>
6 years ago
Adrian Sutton
1e1f6e7023
Add metrics for netty queue length. ( #932 )
...
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Adrian Sutton
72581162d2
Handle PeerNotConnected exceptions when sending wire keep alives. ( #918 )
...
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Sally MacFarlane
84d998130e
[PAN-2182] admin addpeers: error if node not whitelisted ( #917 )
...
* added error for when addPeer is called for a non-whitelisted node
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Sally MacFarlane
6d90cffccf
refactoring to introduce deleteOnExit() for temp files ( #920 )
...
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Lucas Saldanha
3f95178e7b
[PAN-2117] Error when removing bootnodes from nodes whitelist ( #912 )
...
* [PAN-2117] Error when removing bootnodes from nodes whitelist
* Fixing AT
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Adrian Sutton
5eb2ee01db
Limit the number of times we retry peer discovery interactions. ( #908 )
...
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Adrian Sutton
708e866c21
Reduce logging noise from invalid peer discovery packets and handshaking ( #876 )
...
* Reduce logging for invalid peer discovery packets. The message is enough to locate the source of the rejection.
* Reduce ECIESHandshaker logging to trace since it documents a normal flow through the handshake process.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Chris Mckay
a2e187340d
More bootnodes for goerli ( #880 )
...
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Lucas Saldanha
406c7f32f6
[PAN-2239] Disconnect peer removed from node whitelist ( #877 )
...
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Adrian Sutton
463fc3994e
Introduce FutureUtils to reduce duplicated code around CompletableFuture ( #868 )
...
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Chris Mckay
48986b70c2
[BUG] admin_addPeer isn't periodically checking maintained connections ( #871 )
...
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
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>
6 years ago
S. Matthew English
1174e77873
Integration of RecursivePeerRefreshState and PeerDiscoveryController ( #420 )
...
* minimal changeset
* candidate.getPeer().getStatus().equals(PeerDiscoveryStatus.BONDED)
* update
* fix peerSeenTwice
* update++
* update
* update
* update
* yaya
g
* yaya
g
* Ensure round timers are cancelled and many other cleanups.
* Shutdown peer refresh state executors on stop.
* Trigger new recursive peer search when refreshing peer table. Reduce round timeout to 5 seconds.
* tests passing
* cleaning up
* remove useless, inbhibitive artifact from nearestPeers method
* add round cieling
* remove mock from test
* working
* revision to RecursivePeerRefreshStateTest
* test
* Use TimerUtil to schedule timeout instead of our own ScheduledExecutorService.
* Remove isBootstrap from Interaction. Start adding tests for RecursivePeerRefreshState.
* update to bootstrapPeersRetriesSent
* fics helper method
* cleaning up
* cleaning up tests
* implement shouldOnlyQueryClosestThreeNeighbours
* update to tests
* shouldBondWithNewNeighboursWhenSomeRequestsTimeOut
* increase test coverage
* spotless
* test update
* adding tests
* shouldNotQueryNodeThatIsAlreadyQueried
* shouldBondWithPeersInNeighboursResponseReceivedAfterTimeout
* simplification
* add tests
* Fix tests to handle whitelisting.
* Ensure late bonding or neighbours responses don't kick off a new round.
* cleaning up
* add for loop
* respoins with pong
* concis
* failing test
* test passing
* update
* fix to tableRefreshSingleNode
* update coment
* Update ethereum/p2p/src/test/java/tech/pegasys/pantheon/ethereum/p2p/discovery/internal/PeerDiscoveryControllerTest.java
Co-Authored-By: s-matthew-english <s.matthew.english@gmail.com>
* update
* tableRefreshSingleNode
* deconstructedIncrementalUpdateBootstrapPeersList
* setKeccak256
* Update ethereum/p2p/src/test/java/tech/pegasys/pantheon/ethereum/p2p/discovery/internal/RecursivePeerRefreshStateTest.java
Co-Authored-By: s-matthew-english <s.matthew.english@gmail.com>
* Update ethereum/p2p/src/test/java/tech/pegasys/pantheon/ethereum/p2p/discovery/internal/RecursivePeerRefreshStateTest.java
Co-Authored-By: s-matthew-english <s.matthew.english@gmail.com>
* Update ethereum/p2p/src/test/java/tech/pegasys/pantheon/ethereum/p2p/discovery/internal/RecursivePeerRefreshStateTest.java
Co-Authored-By: s-matthew-english <s.matthew.english@gmail.com>
* Update ethereum/p2p/src/test/java/tech/pegasys/pantheon/ethereum/p2p/discovery/internal/RecursivePeerRefreshStateTest.java
Co-Authored-By: s-matthew-english <s.matthew.english@gmail.com>
* synchronized
* update
* merge
* filtering out known peers
* update
* update
* update II
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
mbaxter
026d157680
Remove unnecessary sleep ( #842 )
...
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
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>
6 years ago
mark-terry
7622541714
[NC-1968] Permissioning whitelist persistence. ( #763 )
...
* [NC-1968] Initial commit.
* [NC-1968] Acceptance tests.
* [NC-1968] PR fixes.
* [NC-1968] Merge conflicts.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Danno Ferrin
aaeaa59f31
Upgrade GoogleJavaFormat to 1.7 ( #795 )
...
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>
6 years ago
Lucas Saldanha
3f5c41722e
[NC-2247] Fixing node whitelist isPermitted check ( #766 )
...
* [NC-2247] Fixing node whitelist isPermitted check
* Typos
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
mark-terry
52d6675f63
[FIX] Refactored permissioning components to be Optional. ( #747 )
...
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Lucas Saldanha
4a32c72268
Error response handling for permissions APIs ( #736 )
...
* Generifying account/node result object
* Added null/empty check on whitelist ops
* Updating successful whitelist operation to return Success instead of true
* Updating error messages
* Moving Success string into JsonRpcSuccessful response
* Updating unit tests
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Sally MacFarlane
a5afe34e34
[NC-2119] permissioning config path CLI ( #729 )
...
* added CLI for permissioning config file path
* added test for --permissions-config-file without param value
* merged changes from NC-1968 and set the config path on the PermissioningConfiguration object when it's created
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Adrian Sutton
75f147503a
Update goerli config to launch network. ( #717 )
...
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Lucas Saldanha
0557c3c50e
NC-1930: Handling duplicate nodes/accounts in permissioning api requests ( #707 )
...
* NC-1930: Handling duplicate nodes/accounts in permissioning api requests
* Fixing json rpc error messages
* Fixing acceptance test
* PR comments
* Renaming add/remove node result objects
* Spotless
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Adrian Sutton
b3e64c4f7c
[NC-1273] Consider peer count insufficient until minimum peers for fast sync are connected ( #629 )
...
Makes Synchronizer responsible for deciding if it has enough peers or not rather than ProtocolManager.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Sally MacFarlane
7deda4eaa6
NC 2004 no discovery still talk to bootnodes ( #624 )
...
* added test and DSL for node with --no-discovery
* reversed boolean for discovery
* changed to Boolean and arity = 1
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
mark-terry
2bebbf2a95
[NC-2005] CLI fixes. ( #630 )
...
* [NC-2005] CLI fixes.
* [NC-2005] Updated configuration to disable synchronizer when p2p disabled.
* [NC-2005] Added a test.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
mark-terry
a1ef038865
[NC-2005] Implemented --p2p-enabled configuration item ( #619 )
...
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Chris Mckay
cbbdedc057
[NC-1970] admin_addPeer ( #622 )
...
new JSON rpc call admin_addPeer that lists a peer as a node we should always be connected to
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Sally MacFarlane
824c41b8f7
NC-2013 devp2p whitelist ( #430 )
...
* check peer against whitelist for incoming DevP2P messages
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
mbaxter
3f31db8645
[NC-2056] Remove vertx from discovery tests ( #539 )
...
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Chris Mckay
2f54f99dfc
[NC-1909] IBFT message gossiping ( #501 )
...
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
mark-terry
6c6165b8a3
[NC-1938] Nodes whitelist JSON-RPC APIs ( #476 )
...
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
mbaxter
7bfad2681a
Ignore flaky test ( #480 )
...
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Michael Connor
27c3ad5f78
Nc 1942 Add account whitelisting and refactor into permissioning package ( #460 )
...
* WS sync subscription delay added
* WS sync subscription delay added with unit testing
* WS sync subscription delay added with unit testing
* changed number to a constant in constructor
* Use default from websocket class instead of making new one
* Removed magic numbers
* Added Controller
* Refactor permissioning config and account whitelist into permissioning package
* Refactor permissioning config and account whitelist into permissioning package
* Refactor permissioning config and account whitelist into permissioning package
* Merge branch 'master' of https://github.com/PegaSysEng/pantheon into NC-1942
# Conflicts:
# consensus/ibft/src/test/java/tech/pegasys/pantheon/consensus/ibft/statemachine/IbftControllerTest.java
# docs/Getting-Started/ExplorerBlockDetails.png
# docs/Getting-Started/ExplorerSearch.png
# docs/Getting-Started/ExplorerSummary.png
# ethereum/permissioning/src/main/java/tech/pegasys/pantheon/ethereum/permissioning/PermissioningConfiguration.java
# ethereum/permissioning/src/test/java/tech/pegasys/pantheon/ethereum/permissioning/PermissioningConfigurationTest.java
# pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java
# pantheon/src/test/java/tech/pegasys/pantheon/cli/PantheonCommandTest.java
* Merge branch 'master' of https://github.com/PegaSysEng/pantheon into NC-1942
# Conflicts:
# consensus/ibft/src/test/java/tech/pegasys/pantheon/consensus/ibft/statemachine/IbftControllerTest.java
# docs/Getting-Started/ExplorerBlockDetails.png
# docs/Getting-Started/ExplorerSearch.png
# docs/Getting-Started/ExplorerSummary.png
# ethereum/permissioning/src/main/java/tech/pegasys/pantheon/ethereum/permissioning/PermissioningConfiguration.java
# ethereum/permissioning/src/test/java/tech/pegasys/pantheon/ethereum/permissioning/PermissioningConfigurationTest.java
# pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java
# pantheon/src/test/java/tech/pegasys/pantheon/cli/PantheonCommandTest.java
* Iron out merge conflict introduced bugs
* Iron out merge conflict introduced bugs
* Iron out merge conflict introduced bugs
* PR Change request actioned
* PR Change request actioned
* PR Change request actioned
* PR Change request actioned
* updated node whitelist acceptance test to conform to refactored permissioning package
* text change
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Sally MacFarlane
33c6b50d66
NC-1930 ensure bootnodes are a subset of node whitelist ( #414 )
...
* ensure bootnodes are in nodes-whitelist
* added test for network config eg ropsten with --node-whitelist
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
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>
6 years ago
Lucas Saldanha
498b23bd00
Validate enodeurl syntax from command line ( #403 )
...
* Creating EnodeURLProperty and custom converter
* Replacing String for URI when parsing EnodeURL
* Fixing acceptance test bootnode config
* Removing invalid empty bootnode property from docker script
* Validating nodeId in Enode URL
* Adding final to method param
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Danno Ferrin
b876ca2b69
Metrics for messages ( #369 )
...
Metrics for Inbound and outbound messages, with capability, name, and message code.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
S. Matthew English
4d114072e4
[NC-875] Implement iterative peer search ( #268 )
...
* basic updatdes
* spotless inter alia
* building successfully
* funtioning
* minor update to docs
* rebased in previous commit, attempt to pass build server
* eliminate distanceSortedPeers
* spotless update
* revamp outstanding requests
* implementation of timeoutTask and corresponding test
* use setPeriodic
* testing with DiscoveryPeer
* remove commenceTimeoutTask from constructor
* isolate clock functionality out of recursive state
* update to docs
* validate size of outstandingrequestlist
* improve sanity check test
* remove extraneous copy
* add accurate interface parameters
* finalize
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Anton Nashatyrev
a7c55dc776
Add --goerli CLI option ( #370 )
...
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Sally MacFarlane
2326a35687
NC-1936 discovery wiring for --node-whitelist ( #365 )
...
* use Peer for enode not String
* moved NodeWhitelistController and PermissionConfig to p2p/permissioning
* reject messages if not from a whitelisted peer
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
mbaxter
21ffa54558
Add an UNKNOWN DisconnectReason representing disconnects with no reason ( #359 )
...
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Danno Ferrin
6f549c2808
Plumb in three more metrics ( #344 )
...
* Plumb in three more metrics
* add blockchain_height gauge
* add blockchain_difficulty_total gauge
* add blockchain_announcedBlock_ingest histogram
This involved some deep pluming such that the metrics system needs to be
created in the PantheonCommand, along with trickle down effects into other
consensus engines. This is likely where it should live anyway.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago
Danno Ferrin
ec373eaccc
[MINOR] no fixed ports in tests ( #340 )
...
* [MINOR] no fixed ports in tests
First enable "0" port in PeerDiscoveryAgent so it binds to
an open port. Then change the test to use two PeerDiscoveryAgents
The change to zero is accomplished by populating the endpoint with
the actual bound socket instead of the value passed in. If it is
zero the value will change otherwise it will be the value passed in.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
6 years ago