Commit Graph

733 Commits

Author SHA1 Message Date
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
chimp1984
a6413e4c6f
Filter out AccountAgeWitness data if it appears to be a dos attack or caused from a bug 2020-12-30 06:13:57 -05:00
chimp1984
510a941cb4
Disconnect nodes at RequestDataManager.onMessage < 1.5.1 2020-12-30 06:12:37 -05:00
Christoph Atteneder
aaad74fbf0
Merge pull request #5009 from chimp1984/improve-log-of-initial-data-response
Add estimated size to log of initial data response
2020-12-29 20:00:54 +01:00
Christoph Atteneder
94cf02303e
Merge pull request #4950 from chimp1984/improve-offer-publishing
Improve offer publishing
2020-12-29 19:51:21 +01:00
chimp1984
0be451a136
Fix typos 2020-12-28 12:24:35 -05:00
chimp1984
fd8fc8f9ac
Add estimated size to log of initial data response 2020-12-27 22:27:10 -05:00
sqrrm
442d65a730
Merge pull request #4973 from chimp1984/improve-logs
[1.5.2] Improve logs
2020-12-19 23:36:21 +01:00
chimp1984
d24d05d08d
Fix nullpointer
A Nullpointer can happen if app get shut down very early.
2020-12-19 15:37:02 -05:00
chimp1984
1e0dcfbcbc
Change log level to debug to reduce verbosity 2020-12-19 15:07:26 -05:00
chimp1984
19ef0a2b40
Remove log 2020-12-19 14:51:11 -05:00
chimp1984
55b2cf6259
Change period for statistics log to 5 min instead of 1 min to make it less verbose 2020-12-19 14:34:34 -05:00
chimp1984
dc19e31fe5
Change log level to debug. Fix wrong method name in log.
We request each min. the price feed so that get very verbose
2020-12-19 14:33:28 -05:00
Christoph Atteneder
6384753332
Update data stores for v1.5.2 2020-12-17 15:48:05 +01:00
chimp1984
f270b9c6fa
Call completeHandler if services in store services is empty.
If oen starts with --daoActivated=false there is no service
set up in one of the data store services so it never calls
the result handler and the app never starts up.
2020-12-16 22:25:06 +01:00
chimp1984
4c575098b7
Call completeHandler if services in store services is empty.
If oen starts with --daoActivated=false there is no service
set up in one of the data store services so it never calls
the result handler and the app never starts up.
2020-12-16 16:21:10 -05:00
chimp1984
24f53e0c01
Add flush method.
Call flush at openOfferManager shutdown.
Remove unused method.

Force broadcaster to send out immediately, otherwise we could
have a 2 sec delay until the bundled messages sent out.
2020-12-16 09:01:12 -05:00
sqrrm
9b8073b94a
Merge pull request #4954 from chimp1984/various-small-improvements
Various small improvements
2020-12-15 23:04:15 +01:00
chimp1984
f7a706518c
Use PRIVATE_LOW_PRIO instead of PRIVATE for sequenceNumberMap
to reduce cpu load for persistence.
2020-12-15 01:03:52 -05:00
chimp1984
7f73fa10af
Add support for data post 2020-12-14 11:24:49 -05:00
chimp1984
664ebc13b5
Add constructor with responseCode 2020-12-14 11:24:07 -05:00
Christoph Atteneder
810c0da0f9
Merge pull request #4930 from chimp1984/use-historical-data-store-for-account-age
Use HistoricalDataStoreService for AccountAgeWitnessStorageService
2020-12-14 11:28:18 +01:00
chimp1984
3b0ad356b4
Fix incorrect checkArgument 2020-12-13 17:18:07 -05:00
chimp1984
d61a07f6bb
- Add hasPendingRequest() getter and block repeated requests
while hasPendingRequest is true
- Throw exception if we get a request before previous request is
terminated (happens with priceFee at startup, on regtest as
startup is fast, but can happen also on mainnet)
- Improve shutDown
- Improve finally clause
2020-12-13 17:03:45 -05:00
chimp1984
9496691f76
Refactor: Rename 'requestWithGET' to 'get' 2020-12-13 15:23:36 -05:00
chimp1984
de2ba82b3d
Add post method. Add doRequest method 2020-12-13 15:20:26 -05:00
chimp1984
3cf97c706a
Rename httpclient (make it more distinct to Bisq Httpclient) 2020-12-13 15:14:07 -05:00
chimp1984
5a1a9006e2
Improve logging 2020-12-13 15:13:45 -05:00
chimp1984
b9d72b5185
Add baseUrl as param, extract variable 2020-12-13 15:04:27 -05:00
chimp1984
b480f26f81
Add HttpMethod enum
Use HttpMethod as param
Add getHttpUriRequest method
2020-12-13 15:00:48 -05:00
chimp1984
138019ed25
Rearrange: move method down 2020-12-13 14:54:47 -05:00
chimp1984
7f85fd9b7d
Refactor getSocks5Proxy method: Return early, make flow more clear 2020-12-13 14:54:28 -05:00
chimp1984
3a2e4f1d69
Refactor: Extract method getSocks5Proxy 2020-12-13 14:52:06 -05:00
chimp1984
77f46a0a5e
Remove requestWithGETNoProxy methods from interface (not used outside) 2020-12-13 14:50:53 -05:00
chimp1984
4c81c442ee
Update toString method 2020-12-13 14:49:38 -05:00
chimp1984
8122cab77a
Use Lombok setter and getters 2020-12-13 14:48:58 -05:00
chimp1984
a9eb99c252
Remove warning log (is logged before already) 2020-12-09 23:46:14 -05:00
chimp1984
a2d2e6c4fb
Shutdown PriceFeedService and related services
at shutdown routine
2020-12-09 18:33:15 -05:00
chimp1984
f8ebd075cd
Revert TTL to original value of 15 days. 2020-12-08 16:46:37 -05:00
Christoph Atteneder
11b0a466ce
Merge branch 'master' of github.com:bisq-network/bisq into release/v1.5.0
# Conflicts:
#	core/src/main/java/bisq/core/provider/fee/FeeService.java
#	core/src/main/resources/i18n/displayStrings.properties
#	seednode/src/main/java/bisq/seednode/SeedNodeMain.java
2020-11-25 14:05:37 +01:00
Christoph Atteneder
dd55beabac
Update data stores for v1.5.0 (update 2) 2020-11-23 11:23:15 +01:00
Steven Barclay
88d7d96427
Fix failing OpenOfferManagerTest & PeerManagerTest
These are failing on the tip of release/1.5.0 currently due to extra
validation added to PersistenceManager, causing the build to fail upon
merging upstream. Add missing PersistenceManager.shutDown calls to the
tearDown methods of the affected tests to fix.
2020-11-19 16:47:21 +01:00
chimp1984
9517f427b6
Refactoring: Extract requestPersistence method 2020-11-18 12:12:59 -05:00
Christoph Atteneder
19432e4a1e
Update data stores for v1.5.0 2020-11-13 13:00:46 +01:00
chimp1984
ee5fca9532
Revert timeout changes and MAX_PERMITTED_MESSAGE_SIZE change 2020-11-12 16:01:30 -05:00
chimp1984
1b7c1ce49a
Only reset numAllConnectionsLostEvents if we have nodes connected 2020-11-12 15:58:57 -05:00
chimp1984
a1c84741f3
Add comments, revert TTL change at AckMessage as it has no effect anyway 2020-11-12 15:58:56 -05:00
chimp1984
b002c93d78
Increase SOCKET_TIMEOUT to 6 min 2020-11-12 15:58:56 -05:00
chimp1984
4bececeb4c
Increase MAX_PERMITTED_MESSAGE_SIZE to 15 MB, increase SOCKET_TIMEOUT to 6 min 2020-11-12 15:58:56 -05:00
chimp1984
f10d2318f3
Log when we remove expired entries 2020-11-12 15:58:56 -05:00
chimp1984
ac955e1875
Reduce TTL for ack and mailbox messages 2020-11-12 15:58:55 -05:00
chimp1984
23df53e61b
Always try to prune live map with historical data
It should be only needed in case we get the historical data from resources,
but as I have seen multiple times that some nodes have duplicated entries
in the live data I think its more safe to clean up always. If no entries are
removed the call is very cheap. Even with 60k entries to be pruned it takes
only about 20 ms.
2020-11-12 12:19:24 -05:00
chimp1984
eea1203ec5
Fix issue with immutable maps.
As we might have same keys in multiple maps and merge those to 1 map we
cannot use an immutable map when merging the maps. Instead we copy our merged map
at the end into a immutable map.

Fix issue with immutable maps.
As we might have same keys in multiple maps and merge those to 1 map we
cannot use an immutable map when merging the maps. Instead we copy our merged map
at the end into a immutable map.
2020-11-12 12:19:24 -05:00
chimp1984
9cd5dc9e26
Add support for persisting MailboxMessageList 2020-11-11 22:19:44 -05:00
chimp1984
8b738796db
Remove mailbox msg early from network 2020-11-11 20:31:42 -05:00
chimp1984
ab5645b864
Fix issue with getting complete handler called twice from P2PService
We used a delegate method in P2PService for calling readPersisted on p2PDataStorage and peerManager.
This was from old times when those classed have not been injected classes. The complete handlers got
called from both p2PDataStorage and peerManager but we counted only P2PService as host, so the
countdown completed before the last host was really completed, leading to a nullpointer in
MainView (not always).

We removed now PersistedDataHost interface from P2PService and use P2PDataStorage and PeerManager to be added to hosts.
2020-11-03 13:01:35 -05:00
chimp1984
4161ecf239
Fix bugs with reading historical data
- Use fileName not getFileName() in readHistoricalStoreFromResources
- use complete handler once reading of all historical data is completed where we
build the ImmutableMaps and complete the readFromResources method
2020-11-03 11:48:58 -05:00
Christoph Atteneder
9da7100ef2
Merge pull request #4734 from chimp1984/show-past-deviation-in-monitor
Show past deviation in monitor
2020-11-03 09:03:14 +01:00
sqrrm
f03be6ad3d
Merge pull request #4628 from chimp1984/improve-read-file-handling
Use a thread in PersistenceManager for reading persisted files instead of using threads in client code
2020-11-02 17:36:21 +01:00
chimp1984
baaa100c01
Reset NumAllConnectionsLostEvents once we sent it to inventory monitor 2020-10-31 11:23:24 -05:00
chimp1984
0c4eb14077
Only log and increase numAllConnectionsLostEvents if we have not called shutDown
We also do not call listeners in that case as some listeners have some restart routines
on that event which is not what we want at shut down
2020-10-23 01:17:34 -05:00
chimp1984
5bdc5abe34
Add numAllConnectionsLostEvents 2020-10-23 01:17:34 -05:00