chimp1984
4aecd75d4f
Add bytes sent/received to ConnectionStatistics
...
Do check for closed socket after blocking read.
Move throttle code after blocking read.
2021-01-06 14:01:04 -05:00
chimp1984
d8f9581ee8
Ignore test
...
It reports "Wanted but not invoked:" but when debugging
into it it is called. So seems to be some mock setup issue
2021-01-06 12:18:45 -05:00
chimp1984
1dc71c9b3a
Increase delay for reset
...
Improve statistic logging
2021-01-06 11:14:47 -05:00
chimp1984
63a87def20
Add missing stub to mock
2021-01-06 11:05:16 -05:00
chimp1984
14008a670a
Add formatDurationAsWords to Utilities in common
...
to be accessible to the statistics log.
2021-01-06 01:49:38 -05:00
chimp1984
a996754e06
Improve log
2021-01-06 01:11:37 -05:00
chimp1984
082cc33ba4
Fix wrong param in addToMap
...
Also track BundleOfEnvelopes
2021-01-06 01:09:24 -05:00
chimp1984
d13b7e70fa
Add seed node info, add line break
2021-01-06 00:58:40 -05:00
chimp1984
a346db696f
Handle BundleOfEnvelopes in ConnectionState
...
Add ConnectionStatistics
Print statistics of all live connections periodically
2021-01-06 00:18:56 -05:00
chimp1984
347e68004c
Use OS independent double line breaks for better readability
2021-01-05 22:20:09 -05:00
chimp1984
3fa22427c7
Set expectedRequests to 5 in case of fullDaoNode as
...
it does not do the getBlocksRequest.
2021-01-05 22:19:26 -05:00
chimp1984
c7bc7720d8
Add safety filter to removeAnonymousPeers
...
Cleanups
2021-01-05 21:42:19 -05:00
chimp1984
769a78fe52
Behaviour change: Remove setAllowDisconnectSeedNodes method
...
We handle it in ConnectionState by counting
requests and responses and adding a timer
2021-01-05 21:42:18 -05:00
chimp1984
7414df0951
Behaviour change: Remove removeSuperfluousSeedNodes method
...
We handle the connections by INITIAL_DATA_EXCHANGE which
cover the seed nodes as well. Do have an parallel routine
is risky and make things more complex.
2021-01-05 21:41:57 -05:00
chimp1984
34230f43f6
Fix wrong return value for getMaxConnections
2021-01-05 21:21:58 -05:00
chimp1984
5628b7b85c
Refactor:
...
Rename maxConnectionsPeer to outBoundPeerTrigger
Rename maxConnectionsNonDirect to initialDataExchangeTrigger
Update comment
2021-01-05 21:21:17 -05:00
chimp1984
cf4d89dea2
Behaviour change:
...
In the 3rd attempt we filter for
INITIAL_DATA_EXCHANGE peers.
Before we excluded 2 types and as PEER have been
already filtered earlier we would look up for SEED_NODE.
This was only called by non-seedNodes.
2021-01-05 21:10:45 -05:00
chimp1984
4d64fac401
Refactor: Rename lastInitialDataExchangeMessageTimeStamp to lastInitialDataMsgTimeStamp
2021-01-05 21:03:16 -05:00
chimp1984
acad31fa63
Do sorting at candidates stream.
...
At INITIAL_DATA_EXCHANGE we sort
by lastInitialDataExchangeMessageTimeStamp
2021-01-05 21:02:09 -05:00
chimp1984
e1b1781e66
Remove PeerType.SEED_NODE
...
Fix typo
2021-01-05 20:56:04 -05:00
chimp1984
5f977ffe6f
Use isSeedNode
2021-01-05 20:55:29 -05:00
chimp1984
86d0f96c6c
Remove PeerType from Connection. Use ConnectionState instead.
...
Remove unnecessary setPeerType calls. ConnectionState is handling that.
Only PeerManager does the setting of isSeedNode as we do not have the
required dependency in ConnectionState.
2021-01-05 20:50:46 -05:00
chimp1984
0f7a69d1b7
Add ConnectionState class
2021-01-05 20:42:14 -05:00
chimp1984
809484e65d
Refactoring: Rename INITIAL_DATA_REQUEST to INITIAL_DATA_EXCHANGE
2021-01-05 20:40:37 -05:00
chimp1984
15cd42de0c
Add InitialDataRequest and InitialDataResponse marker interface for
...
relevant classes
2021-01-05 20:39:52 -05:00
chimp1984
2c8c9ac519
Add onMessageSent method to MessageListener
2021-01-05 20:36:51 -05:00
chimp1984
f169cf1309
Refactoring: Move PeerType outside of Connection
2021-01-05 20:34:28 -05:00
sqrrm
4da1bb0c10
Merge pull request #5041 from chimp1984/request-only-not-seeds-if-no-seed-available
...
Request only non-seed nodes if no seed nodes are available
2021-01-04 10:50:10 +01:00
chimp1984
77c405530d
Add comment, remove pointless code.
2021-01-03 18:48:07 -05:00
chimp1984
a2d6b52483
In case requests to all seed nodes fail we take
...
persisted and reported peers for requests.
Before we added also the seed nodes which would
delay connection to other nodes a lot.
2021-01-01 20:36:27 -05:00
chimp1984
818c797f97
Refactor sendMessage method: Inline debug value
2021-01-01 16:51:25 -05:00
chimp1984
f57d4e041b
Refactor sendMessage method: Return early
2021-01-01 16:51:25 -05:00
chimp1984
cc433ab57d
Add checks if peer is banned at send msg and InputHandlers
2021-01-01 16:51:24 -05:00
chimp1984
c8bf1d469e
Add support to filter manager for network wide banned nodes
2021-01-01 16:51:24 -05:00
chimp1984
851a44ccb8
Make code more readable
2021-01-01 16:51:05 -05:00
chimp1984
3cf6c60354
Add NetworkFilter, remove BanList
2021-01-01 16:51:05 -05:00
chimp1984
9dfcc01acd
Improve logging of received data
...
The numbers did not match up from delivered response size and items as we did not count
in the overhead of the ProtectedStorageEntry (pub key+sig) and did estimate the size
with taking only first item and multiplying it. A measurement resulted in 20 ms costs
for the exact calculation (toProtoMessage().getSerializedSize() has some costs).
I guess that is acceptable to get correct metrics.
2021-01-01 14:07:17 -05:00
chimp1984
0aeaa5386c
Improve logs, optimize stream
2021-01-01 14:06:16 -05:00
chimp1984
15b8f64d91
Do not shutDown with CloseConnectionReason.PEER_BANNED if we received a
...
CloseConnectionMessage as it would trigger a wrong log on the peers side,
that he got banned.
2021-01-01 14:05:21 -05:00
chimp1984
28dd8404f7
Merge branch 'access-concrete-data-stores' into add-filter-support-on-network-level
2021-01-01 13:50:46 -05:00
sqrrm
d633d13b88
Merge pull request #5032 from chimp1984/check-for-duplicates-at-onBundleOfEnvelopes
...
[1.5.4] Check for duplicate hashes at onBundleOfEnvelopes
2020-12-31 11:52:36 +01:00
sqrrm
4c14d4e232
Merge pull request #5030 from chimp1984/fix-incorrect-map-lookup-forhistorical-data-stores
...
[1.5.4] We need to use the getMapOfAllData method for HistoricalDataStoreServices
2020-12-31 11:28:30 +01:00
chimp1984
35c6a9aca4
Force travis for rebuild
2020-12-31 00:56:21 -05:00
chimp1984
203a6e0681
Force travis for rebuild
2020-12-31 00:44:57 -05:00
chimp1984
b9ca29988f
Check for duplicate hashes at onBundleOfEnvelopes
...
Set log level to debug to not spam logs with it.
2020-12-30 20:56:51 -05:00
chimp1984
6a35410c69
Log error (and throw exception if in devMode) if
...
HistoricalDataStoreService.getMap is called.
HistoricalDataStoreService.getMap should not be used by domain
clients but rather the custom methods getMapOfAllData,
getMapOfLiveData or getMapSinceVersion.
As we have not removed the calls from ProposalService and
other domains we return getMapOfAllData() instead of the live map.
This was prevented earlier for performance reasons. It is more safe
thought to return in case of an illegal access all data instead of
live data only.
2020-12-30 20:47:15 -05:00
chimp1984
4489e57849
Use concrete dataStorageServices instead
...
p2PService.getP2PDataStorage().getAppendOnlyDataStoreMap().
p2PService.getP2PDataStorage().getAppendOnlyDataStoreMap() iterates
over all services including the historical data store service. It used the
getMap method which should not be used at historical data store service as
it is not clear if the live data or all data should be accessed.
2020-12-30 20:38:42 -05:00
chimp1984
85caf88913
We need to use the getMapOfAllData method for HistoricalDataStoreServices
2020-12-30 20:20:57 -05:00
chimp1984
ae65da2861
Revert dev values for NUM_SEEDS_FOR_PRELIMINARY_REQUEST and NUM_ADDITIONAL_SEEDS_FOR_UPDATE_REQUEST
2020-12-30 14:27:33 -05:00
sqrrm
9f50dcae2f
Merge pull request #5026 from chimp1984/add-dos-protection
...
Add dos protection
2020-12-30 12:57:53 +01:00