Commit Graph

775 Commits

Author SHA1 Message Date
Christoph Atteneder
d3233bac7a
Update data stores for v1.6.0 2021-03-24 10:53:24 +01:00
Steven Barclay
f21379160b
Merge branch 'release/v1.6.0' into implement-segwit-for-bsq 2021-03-20 23:18:49 +00:00
jmacxx
f936210717
fix mailbox bootstrap issue 2021-03-02 14:34:03 -06:00
jmacxx
b3263be5e9
Fix initialization ordering issue
TradeManager must be inited before MailboxMessageService
2021-02-24 09:13:52 +01:00
Christoph Atteneder
a691b26de4
Update witness stores 2021-02-23 11:16:29 +01:00
Christoph Atteneder
8e78cfa2b7
Update data stores for v1.5.7 2021-02-22 15:52:18 +01:00
chimp1984
3c38fd67eb
Remove boolean return value for requestPreliminaryData
and call onNoSeedNodeAvailable instead.
2021-02-19 10:09:05 +01:00
chimp1984
f73408a79e
Call onNoSeedNodeAvailable if return value from requestPreliminaryData is false
We did not do all the calls before (like on p2pDataStorage), so that changes behaviour.
2021-02-19 10:09:05 +01:00
chimp1984
e57c26ecb0
Refactor: Extract method from duplicated code 2021-02-19 10:09:05 +01:00
chimp1984
1e6744ddc0
Use same behaviour in onNoSeedNodeAvailable as in onUpdatedDataReceived 2021-02-19 10:09:04 +01:00
chimp1984
45e4aaa24d
Refactor: Rename onBootstrapComplete to onBootstrapped 2021-02-19 10:09:04 +01:00
chimp1984
c6868f1bed
Call p2PDataStorage.onBootstrapComplete() before
mailboxMessageService.onBootstrapped(); and onUpdatedDataReceived

mailboxMessageService depends on p2PDataStorage so we make sure the
p2PDataStorage is updated before we update the mailboxMessageService state.
2021-02-19 10:09:04 +01:00
chimp1984
49e9f72d6e
Merge onUpdatedDataReceived and onNoSeedNodeAvailable to onBootstrapped 2021-02-19 10:09:04 +01:00
chimp1984
44fcfb86bb
Call onNoSeedNodeAvailable on mailboxMessageService at onNoSeedNodeAvailable 2021-02-19 10:09:04 +01:00
chimp1984
d39cdaa33e
Fixes https://github.com/bisq-network/bisq/issues/5204
Remove SetupListener implementation from MailboxMessageService.
Remove requestDataManager
Add onNoSeedNodeAvailable method
Call onNoSeedNodeAvailable from P2PService
2021-02-19 10:09:03 +01:00
chimp1984
fcaad5580b
Use readableFileSize instead of division by 1024 for kb display in statistic logs 2021-02-18 11:40:10 -05:00
Steven Barclay
b4ad6bf637
Upgrade jsonrpc4j & Jackson; simplify BitcoindClient
Change jsonrpc4j version from 1.5.3 to 1.6.0.bisq.1, forked to the Bisq
repo from the recent 1.6.0 release. The forked version changes the class
'com.googlecode.jsonrpc4j.HttpException' to be public, instead of (prob.
mistakenly) package private, so we can avoid using reflection to catch
it and re-throw as a 'bisq.network.http.HttpException'. Remove the now
unused constructors from the latter.

As part of this, upgrade Jackson to the latest stable (2.12.1) release,
since jsonrpc4j now depends on a newer version than the previous 2.8.10.
2021-02-04 07:51:38 +00:00
chimp1984
9041bf4938
onUpdatedDataReceived must be called in the correct order.
We cannot use a listener at RequestDataManager as the order
is not defined if doing so.
So we use P2PService as our controlling entity to call
further clients in the correct order.
2021-01-31 19:38:46 +01:00
Christoph Atteneder
60fc17be2c
Update data stores for v1.5.5 2021-01-25 14:18:21 +01:00
Steven Barclay
f34231abb6
Factor out failure callback logic into new Utilities method 2021-01-21 10:08:23 +00:00
Steven Barclay
dbe4953f63
Add replacement bitcoind RPC client using jsonrpc4j
Create a new 'BitcoindClient' interface and a corresponding builder, to
replace the old 'com.neemre.btcdcli4j.core.client.BtcdClientImpl' class
from the btcdcli4j library. This is instantiated by jsonrpc4j using a
dynamic proxy. It provides only a cut down version of the bitcoind RPC
API, exposing the methods 'getblock', 'getblockcount' & 'getblockhash',
as they are the only ones currently being used by RpcService.

Add corresponding Jackson-annotated DTO classes to model the JSON
structures returned by bitcoind, very similar to the classes provided by
btcdcli4j. Note that we use Double instead of BigDecimal to represent
fractional fields (difficulties + coin amounts in BTC), as they have
more consistent Jackson (de)serialisation and appear to be able to
faithfully round-trip numeric fields produced by bitcoind. Also note
that doubles can faithfully represent any valid decimal BTC amount (that
is, with 8 d.p. of precision) up to 21 million.

For now, keep the old BtcdClientImpl instance used by RpcService in
place, as the btcdcli4j block notification daemon is dependent upon it
and would also need to be replaced.

Also add unit tests for BitcoindClient which test against sample regtest
responses, using a mock HttpURLConnection.
2021-01-21 10:08:22 +00:00
chimp1984
5d13fdcdbb
Return early 2021-01-14 20:42:36 -05:00
chimp1984
7ba5ab5a4e
Change prio for mailboxMessageList persitence 2021-01-13 20:48:52 -05:00
chimp1984
d434cb3022
Sort persisted mail box messages by age and limit total number.
Add size limit.
Add log for number of persisted mailbox msg per day
2021-01-12 22:59:44 -05:00
chimp1984
2fb3bba74d
Use MailboxMessage as param type in sendEncryptedMailboxMessage 2021-01-12 17:47:44 -05:00
chimp1984
3834785828
Bugfix: Add processing of SendersNodeAddressMessage to
onBundleOfEnvelopes method.

In case we received a SendersNodeAddressMessage
inside a BundleOfEnvelope we did not set the
peers address.
2021-01-12 17:40:40 -05:00
chimp1984
3e69edeb9e
Remove comment 2021-01-12 17:34:54 -05:00
chimp1984
a21d79ad63
Refactor: rename 2021-01-12 17:34:28 -05:00
chimp1984
364a7f524c
Add toString 2021-01-12 16:14:32 -05:00
chimp1984
2b05ed54fc
Let MailboxMessage extend ExpirablePayload:
For all MailboxMessage we want to be sure they have an expire date.
Add getTTL methods and TTL value.
We use 7 days for ChatMessages and 30 days for PrivateNotificationMessages.
All others use default 15 days.
We prefer to keep them explicit and not use a default method in
ExpirablePayload or MailboxMessage.
The value in PrefixedSealedAndSignedMessage will not be used as the
sender use the TTL of the payload and pass that to the MailboxStoragePayload
where we store it in the extraMap. That way we can use different TTL even the
payload message is encrypted and we would not be able to look it up.
2021-01-12 16:14:13 -05:00
chimp1984
46f60260dc
Remove outdated code
Remove outdated comment
Add checkNotNull for senderNodeAddress
2021-01-12 15:46:33 -05:00
chimp1984
4c003cded6
Clone reportedPeers to avoid ConcurrentModificationExceptions 2021-01-12 15:33:31 -05:00
chimp1984
5c429bb3a7
Add containsKey check 2021-01-12 14:48:45 -05:00
chimp1984
d353140e7a
Refactor: rename getMyDecryptedMessages method to make it more explicit
that its only used for MailboxMsg
2021-01-12 13:54:54 -05:00
chimp1984
575196c16d
Refactor handleDecryptedMessageWithPubKey to use MailboxMessage
instead of decryptedMessageWithPubKey.
Here we change a bit the behaviour as now we check also if the
TradeMessage is a MailboxMessage. As that method is only called
from MailboxMessageService domain we never get a non MailboxMessage
here anyway and it would have been a bug.

Remove removeMailboxMsg(DecryptedMessageWithPubKey decryptedMessageWithPubKey) as not used anymore
2021-01-12 13:53:20 -05:00
chimp1984
3875bd85d1
Add removeMailboxMsg with MailboxMessage as argument 2021-01-12 13:24:42 -05:00
chimp1984
337ea89ce6
Add program argument flag republishMailboxEntries
Only republish if that flag is set, not depending if its a seedNode
2021-01-12 12:42:50 -05:00
chimp1984
b4ab8a4a0d
Fix incorrect comparison at RemovedPayloadsService.readPersisted
Add comments
Cleanups
2021-01-12 10:59:11 -05:00
chimp1984
d39a697611
Fix wrong delay, increase timeout 2021-01-12 10:48:29 -05:00
chimp1984
a9802e60cd
Refactor: return early 2021-01-12 10:48:29 -05:00
chimp1984
8d866d5d06
Improve logs, rename methods, variables 2021-01-12 10:48:29 -05:00
chimp1984
e933bfd281
Add temp. ignore to a failing test.
By debugging I could not see why it fails, behaviour seems correct.
I guess its a mock setup issue. Will look into it to fix it soon...
2021-01-12 10:48:28 -05:00
chimp1984
8e0181e528
Add republishExistingProtectedMailboxStorageEntry method
Seed nodes republish the persisted mailbox messages after
startup in chunks of 50 items with a 2 minute delay.

Move check for hasSequenceNrIncreased in addProtectedStorageEntry
earlier so we return earlier. This is a very common case for return
if we receive outdated data (like republished mailbox data we have
already received).

Mark logs with ## for easier find/replace for dev testing...
2021-01-12 10:48:28 -05:00
chimp1984
a54813a015
Increase timout for BroadcastHandler to 120 sec 2021-01-12 10:48:28 -05:00
chimp1984
320e5f1aef
Refactor: Rename method 2021-01-12 10:48:28 -05:00
chimp1984
659fe15b8d
Add comment 2021-01-12 10:48:28 -05:00
chimp1984
35ef3b842f
Add support for TTL defined by payload message so we can use
different TTL for lower prio mailbox messages like AckMessages.

As we cannot add a field without breaking signatures we
need to use the extraMap in MailboxStoragePayload
2021-01-12 10:48:28 -05:00
chimp1984
7a2501ea1b
Set uid inside constructor 2021-01-12 10:48:28 -05:00
chimp1984
873b557ce8
Add logs 2021-01-12 10:48:28 -05:00
chimp1984
026858d8b1
Refactor: move duplicated method
capabilityRequiredAndCapabilityNotSupported to CapabilityUtils
2021-01-12 10:48:27 -05:00