Commit Graph

17295 Commits

Author SHA1 Message Date
Alejandro García
b88cd58f24
Merge pull request #6593 from jmacxx/limit_min_max_deviation
Limit offer min/max amount deviation to 50%.
2023-03-11 15:11:12 +00:00
Alejandro García
4e4321e3a2
Merge pull request #6600 from stejbac/speed-up-bsq-tx-view-load
Speed up BSQ tx view load
2023-03-11 15:10:13 +00:00
Steven Barclay
fcbf96ceb9
Fix confirmation count bug in transactions CSV export
Move the 'confirmations' field from TransactionsListItem to the nested
'LazyFields' class, so that it is correctly lazily initialised when
'getNumConfirmations()' is called, instead of just returning 0 for
hidden list items with uninitialised tooltips + confidence indicators.

This makes the logic consistent with that in TxConfidenceListItem and
fixes a bug in the BTC transactions view CSV export, where only the
already rendered list items would have nonzero confirmation counts.
2023-03-08 18:12:41 +08:00
Steven Barclay
76c2781505
Short circuit confidence updates in DepositListItem
Add a 'lazyFields' volatile field to DepositListItem to detect
initialisation of the associated memoised 'LazyFields' supplier,
allowing confidence updates to be short-circuited when the corresponding
indicator has not yet been lazily loaded.

This is for consistency with the 'LazyFields' logic just added to
TxConfidenceListItem and should make the UI more responsive if a new
block arrives when the funds deposit list is in view, by avoiding the
entire list of item tooltips & confidence indicators from being force-
initialised.
2023-03-08 17:18:54 +08:00
Steven Barclay
04fae6d81e
Lazily load BsqTxListItem tooltips & confidence indicators
Add a 'LazyFields' static class and memoised supplier field to the base
class TxConfidenceListItem, similar to that added to the classes
DepositListItem & TransactionsListItem. This allows lazy loading of
tooltips & tx confidence indicators, just as for those classes.

This removes the current remaining bottleneck in the BSQ tx view load,
revealed by JProfiler. (Note that there is still a quadratic time bug
remaining due to the use of a confidence listener for each list item,
since the BSQ wallet internally uses a CopyOnWriteArrayList, whose
backing array is cloned for each listener addition or removal. However,
it isn't clear that fixing this will give a noticable speedup unless
there are an extremely large number of BSQ txs in the wallet.)

Take care to add the tx confirmation count to LazyFields, to prevent
issues when exporting the list as a CSV. Also add a volatile
'lazyFields' field to detect lazy initialisation of the supplier and
short circuit confidence updates for uninitialised indicators.
2023-03-08 16:14:04 +08:00
Steven Barclay
e18b1e833d
Avoid repeated scanning for swap trades via BsqTxListItem ctor
Precompute and pass a map of txIds to BsqSwapTrade instances to the
BsqTxListItem constructor in 'BsqTxView.updateList()', in place of the
tradable repository, so that the tradables don't need to be repeatedly
scanned to find the optional matching BSQ swap trade for each BSQ tx.

This fixes a quadratic time bug and significantly speeds up the BSQ tx
view load for users with many past trades.
2023-03-08 14:23:15 +08:00
Steven Barclay
3fa6b25789
Avoid calling BsqTxView.updateList() twice on view load
Remove the direct call to 'updateList' in the 'BsqTxView.activate()'
method, as it is later called indirectly via 'onUpdateAnyChainHeight()'.
This nearly doubles the loading speed of the BSQ tx list (in the DAO /
BSQ Wallet tab), since 'updateList' is very slow when there are many txs
in the wallet.
2023-03-08 13:50:41 +08:00
jmacxx
8a41637b58
Limit offer min/max amount deviation to 50%. 2023-02-27 20:24:52 -06:00
Alejandro García
cfeb597cf1
Merge pull request #6591 from bisq-network/dependabot/github_actions/gradle/gradle-build-action-2.4.0
Bump gradle/gradle-build-action from 2.3.3 to 2.4.0
2023-02-27 21:24:38 +00:00
Alejandro García
cbc30f497d
Merge pull request #6590 from yonson2023/fix_issue_5725
Payout tx confidence should be after block height of deposit.
2023-02-27 21:23:50 +00:00
dependabot[bot]
df6148fafe
Bump gradle/gradle-build-action from 2.3.3 to 2.4.0
Bumps [gradle/gradle-build-action](https://github.com/gradle/gradle-build-action) from 2.3.3 to 2.4.0.
- [Release notes](https://github.com/gradle/gradle-build-action/releases)
- [Commits](https://github.com/gradle/gradle-build-action/compare/v2.3.3...v2.4.0)

---
updated-dependencies:
- dependency-name: gradle/gradle-build-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-20 14:58:42 +00:00
yonson2023
030bb3f64c
Payout tx confidence should be after block height of deposit. 2023-02-19 16:21:54 -06:00
Alejandro García
d83a205fe2
Merge pull request #6586 from alvasw/implement_network_statistics_service
Decouple NetworkStatistics from UI thread [1/2]
2023-02-18 18:13:06 +00:00
Alejandro García
71615824a8
Merge pull request #6585 from yonson2023/fix_payment_started_bug
Fix NPE at trade payment started event.
2023-02-18 18:12:04 +00:00
Alva Swanson
4c6c9100b3
Implement NetworkStatisticsService
The NetworkStatisticsService is an attempt to decouple the network
statistic computation from the UI thread. Here, the
NetworkStatisticsService schedules repeating tasks on a
ScheduledExecutorService.
2023-02-15 20:35:58 +02:00
Alejandro García
bed76128b7
Merge pull request #6580 from alvasw/server_remove_redundant_is_stopped_bool
Server: Remove redundant isStopped boolean
2023-02-15 18:32:57 +00:00
Alejandro García
3dc3464114
Merge pull request #6581 from alvasw/rename_network_filter_to_ban_filter
Rename NetworkFilter to BanFilter
2023-02-15 18:24:55 +00:00
Alejandro García
9d091bea44
Merge pull request #6588 from jmacxx/fix_exception_accountingstore
Fix exception due to missing read lock.
2023-02-15 18:23:17 +00:00
jmacxx
6801ebfbd7
Fix exception due to missing read lock. 2023-02-15 10:48:59 -06:00
Christoph Atteneder
7d2e110a1d
Merge pull request #6582 from alvasw/remove_unused_connection_listener_on_error
Remove unused ConnectionListener.onError(...) method
2023-02-15 17:43:29 +01:00
Christoph Atteneder
229eeef024
Merge pull request #6583 from bisq-network/dependabot/github_actions/actions/setup-java-3.10.0
Bump actions/setup-java from 3.9.0 to 3.10.0
2023-02-15 16:38:13 +01:00
Christoph Atteneder
4f2a68acc4
Merge pull request #6584 from ghubstan/adjust-to-removed-daoactivated-opt
Adjust to removed --daoActivated opt
2023-02-15 16:34:37 +01:00
Christoph Atteneder
91f77ec722
Merge pull request #6587 from HenrikJannsen/reduce_height_of_bm_table
Reduce burningman table height to 5 rows
2023-02-15 16:30:13 +01:00
HenrikJannsen
c74319c969
Reduce burningman table height to 5 rows
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2023-02-15 17:34:25 +07:00
yonson2023
9d4d575739
Fix NPE at trade payment started event. 2023-02-13 21:29:41 -06:00
ghubstan
ade885e205
Ignore v1 protocol bsq offer test 2023-02-13 19:14:08 -03:00
ghubstan
e26955bf60
Adjust to removal of --daoActivated opt 2023-02-13 19:09:54 -03:00
ghubstan
f69fb3a959
Update for bticoind v23 + IDE format 2023-02-13 19:09:01 -03:00
dependabot[bot]
0507ce46b0
Bump actions/setup-java from 3.9.0 to 3.10.0
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 3.9.0 to 3.10.0.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v3.9.0...v3.10.0)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-13 14:59:39 +00:00
Alva Swanson
d411ae1252
Remove unused ConnectionListener.onError(...) method 2023-02-12 20:44:38 +02:00
Alva Swanson
f9a0e5d6d0
Rename NetworkFilter to BanFilter 2023-02-12 20:30:58 +02:00
Alva Swanson
81a224bfea
Server: Remove redundant isStopped boolean
We can track the server status with the interrupted status of the
server thread. The isStopped boolean is not needed.
2023-02-12 20:23:25 +02:00
Alejandro García
b4822761a8
Merge pull request #6578 from alvasw/server_extract_running_check_to_is_active_method
Server: Extract isStopped check to method
2023-02-12 18:13:49 +00:00
Alejandro García
f00152d42f
Merge pull request #6577 from alvasw/server_switch_to_atomic_is_stopped_bool
Server: Switch to atomic isStopped boolean
2023-02-12 18:13:05 +00:00
Alejandro García
4a4e13c5da
Merge pull request #6576 from alvasw/move_server_thread_to_server_class
NetworkNode: Move server threading logic to server
2023-02-12 18:12:13 +00:00
Alejandro García
581fbd1d2d
Merge pull request #6579 from stejbac/further-speed-up-transactions-view-load
Further speed up transactions view load
2023-02-12 14:05:36 +00:00
Alejandro García
3b1a5f0337
Merge pull request #6575 from yonson2023/fix_exception_governance
[1.9.10] Fix unhandled exception in DAO Governance view.
2023-02-12 14:04:39 +00:00
Alejandro García
0bdebb59e8
Merge pull request #6569 from alvasw/pass_connection_uid_to_executor_service_name
Connection: Pass uid to executor service name
2023-02-12 14:04:05 +00:00
Steven Barclay
6a84500710
Cache txo addresses to speed up isRefundPayoutTx in some cases
In the (hopefully rare) case that the user has multiple past trades that
end in arbitration, the entire wallet tx output set was scanned once for
every such trade (via 'TransactionAwareTrade.isRefundPayoutTx' calls),
to look for any outputs matching the payout address. This potentially
causes a slowdown of the Transaction view load for each new arbitration
case added. To avoid this problem, cache the last set of recipient
address strings of the provided tx, as the next call to
'isRefundPayoutTx' is likely to be for the same tx.

Also check that there is exactly one input (the multisig input) for any
candidate delayed payout tx, to speed up 'isDelayedPayoutTx' in case the
wallet contains many unusual txs with nonzero locktime.
2023-02-12 12:35:05 +08:00
Alva Swanson
2127e0745c
Server: Extract isStopped check to method 2023-02-11 22:19:43 +02:00
Alva Swanson
3cd24d67ed
Server: Switch to atomic isStopped boolean 2023-02-11 21:41:50 +02:00
Alva Swanson
ee2157aa24
NetworkNode: Move server threading logic to server 2023-02-11 21:40:55 +02:00
yonson2023
baad09bfc8
Fix unhandled exception when empty txId passed. 2023-02-11 08:55:08 -06:00
Steven Barclay
37b6a4becf
Cache formatters to speed up DisplayUtils.formatDateTime
Make 'FormattingUtils.formatDateTime(Date, boolean)' two or three times
faster by caching the 'java.text.DateFormat' objects used to format the
given date & time in either the local or UTC time zone. Since these
formatters are not thread safe (though they may be reused), use a
ThreadLocal to store them (as a tuple, along with the current locale to
make sure it hasn't changed since the last invocation).

This is a minor hotspot for the Transactions view load, since the date
strings in TransactionsListItem are formatted eagerly (via DisplayUtils)
for the purpose of filtering the items by substring match. (Other list
views seem to format dates lazily, though it's possible that there will
be speedups elsewhere in the UI.)
2023-02-11 15:47:04 +08:00
Steven Barclay
ee45202521
Remove redundant listener from TransactionsListItem
Eliminate a minor quadratic time bug, caused by the unnecessary addition
of a (BtcWalletService) TxConfidenceListener for each list item in the
Transactions view. (Since the confidence listeners are internally held
in a CopyOnWriteArraySet, this sadly runs in quadratic time, slowing
down the Transactions view load a little.)

The confidence listener is apparently redundant because of a set of
calls to 'TransactionsListItem.cleanup' immediately upon construction of
the item list, which removes all the listeners just added. (This code
appears to date from at least February 2016, in commit c70df86.)

(The confidence indicators are kept up to date by simply reloading the
entire list upon each wallet change event.)
2023-02-11 09:40:03 +08:00
Steven Barclay
2e8f03061e
TransactionsListItem cleanup: remove unused local variable
(This also avoids a redundant call to 'Tradable.getShortId', shaving off
another percent or two from the Transactions view load.)
2023-02-11 08:04:21 +08:00
Steven Barclay
97ef9c1308
Place filter in front of 'isRelatedToTransaction' for speedup
Use a crude Bloom filter (of sorts) to cut down the quadratic number of
calls to 'TransactionAwareTradable.isRelatedToTransaction' (that is, one
for each tx-tradable pair) during the Transactions view load. In this
way, we may reduce the number of calls roughly 40-fold, for a Bisq
instance with similar numbers of BSQ swap trades and escrow trades.

(Sadly, profiling does not show a 40-fold reduction in the size of the
'isRelatedToTransaction' hotspot, likely due to the remaining calls
being expensive ones involving disputed trades or unusual txs with
nonzero locktime, e.g. dust attacks or funds from Electrum wallets.)

To this end, partition the wallet transactions into 64 pseudo-randomly
chosen buckets (with a dedicated bucket for txs which might be delayed
payouts, namely those with nonzero locktime). Add an interface method,
'TransactionAwareTradable.getRelatedTransactionFilter', which returns an
IntStream of all the indices of buckets where a related tx may plausibly
be found. Where this is unclear, e.g. for trades involved in a dispute,
just return everything (that is, the range 0..63 inclusive).

Add a class, 'RelatedTransactionFilterSlices', that holds a provided
list of TransactionAwareTradable instances and 64 bitsets of all the
slices through their respective filters (each realised as 64-bit word
instead of a streams of integers). In this way, a list of tradables
plausibly related to any given tx may be quickly found by simply
selecting the appropriate bitset of the 64 (by the tx bucket index).
2023-02-11 07:55:36 +08:00
Steven Barclay
19a80d19bb
Short circuit txId hex encoding for BSQ swap offers
Inline a local variable, to eliminate another minor Sha256Hash.toString
hotspot in the Transactions view load, this time coming from
'TransactionsAwareOpenOffer.isRelatedToTransaction'. This is helpful in
the case that the user has a large number of (possibly disabled) BSQ
swap offers.
2023-02-10 10:28:02 +08:00
Steven Barclay
fb78345ba3
Avoid repeated Set<Tradable> build in transactions view load
Move the line,

   Set<Tradable> tradables = tradableRepository.getAll();

to the top level of 'TransactionsView.updateList', instead of needlessly
calling 'TradableRepository.getAll' (which builds a new set every
invocation) for each wallet transaction being iterated over.

This was causing a significant slowdown of the view load.
2023-02-09 21:35:32 +08:00
Steven Barclay
3aacc99f38
Tidy up TransactionsView slightly
1. Expression lambda -> method reference;
2. Statement lambda -> expression lambda;
3. Field -> local variable.
2023-02-09 21:16:40 +08:00