Commit Graph

3676 Commits

Author SHA1 Message Date
Alva Swanson
af6b664548
desktop: Switch to 'bisq.javafx' Gradle Plugin 2023-08-04 13:31:10 +02:00
Alva Swanson
41eafd2b31
desktop: Move build configuration to its own build.gradle 2023-08-04 13:30:46 +02:00
Alejandro García
85a457c6f1
Merge branch 'master' into release/v1.9.12 2023-07-13 15:11:38 +00:00
Alejandro García
3f2d55a356
Revert to SNAPSHOT version 2023-07-13 17:06:14 +02:00
Gabriel Bernard
02e87d545d
Merge pull request #6767 from bisq-network/release/v1.9.11
Release/v1.9.11
2023-07-13 11:32:14 +00:00
jmacxx
089d4e9237
Show more available UTXOs in Send Funds screen. 2023-07-03 13:44:07 -05:00
Alejandro García
67182ca41f
Merge pull request #6738 from HenrikJannsen/add_bm_accounting_preferences
Add reset buttons for BM accounting
2023-07-01 21:52:41 +00:00
Alejandro García
323399647c
Merge pull request #6679 from napoly/fix_hide_edit_button_bsq_offer
Remove edit button for BSQ offers
2023-07-01 21:51:08 +00:00
HenrikJannsen
1ebc92e5b8
Add reset buttons for BM accounting 2023-07-01 14:25:43 +02:00
Alejandro García
d95dc58a06
Bump version number for v1.9.12 2023-06-30 23:55:18 +02:00
jmacxx
da9caf56a2
Seednode accounting set by command line, overrides UserPreferences. 2023-06-30 20:02:53 +02:00
Alejandro García
1cc2b35c89
Merge pull request #6744 from jmacxx/fix_seednode_accounting_pref
Seednode accounting option is by command line, overrides UserPreferences.
2023-06-30 18:00:50 +00:00
Alejandro García
6b0f32f8e7
Merge pull request #6742 from jmacxx/csv_export_proof_of_burn
Add CSV export for Proof of Burn table.
2023-06-30 18:00:12 +00:00
jmacxx
a9bc45c173
Seednode accounting set by command line, overrides UserPreferences. 2023-06-30 10:10:23 -05:00
jmacxx
aa79b01fd3
Add CSV export for Proof of Burn table. 2023-06-26 18:20:13 -05:00
jmacxx
8024b72860
Add burned BSQ column in monthly burningman status report. 2023-06-26 13:31:55 -05:00
Alejandro García
31b427c92e
Bump version number for v1.9.11 2023-06-22 14:35:22 +03:00
jmacxx
b486522c89
Allow dispute agent to resend ticket, fixes #6690. 2023-06-05 15:27:14 -05:00
Gabriel Bernard
f4368b3185
Merge pull request #6675 from HenrikJannsen/clone_offer_with_shared_maker_fee
Add feature for cloning an offer with shared maker fee
2023-05-25 11:08:08 +00:00
Alejandro García
df6fe57423
Merge pull request #6708 from helixx87/refactor-radio
Refactor "remove radio" logic in JFXRadioButtonSkinBisqStyle
2023-05-23 09:06:15 +00:00
Alejandro García
25908771c7
Merge pull request #6705 from HenrikJannsen/remove_sleep_warning_popup
Remove warning popup when UI thread is blocked for > 20 sec.
2023-05-23 09:05:42 +00:00
HenrikJannsen
1cbdf043cd
Fix bug with selection of account combobox
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2023-05-22 19:17:22 +02:00
helixx87
8d7af70fad
Refactor "remove radio" logic in JFXRadioButtonSkinBisqStyle 2023-05-20 14:37:23 +02:00
HenrikJannsen
a7ade008d0
Do not reset content in case the currentTab is editOpenOfferTab, duplicateOfferTab or cloneOpenOfferTab
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2023-05-20 08:34:46 +02:00
HenrikJannsen
dbd1098ebb
Add isCloneOfferViewActivated flag to avoid repeated code execution in doActivate.
Do not create a new observableArrayList in filterPaymentAccounts.

The reason why the wrong account gets selected is not completely clear to me. The selection handler gets called when the combobox gets filled and that overwrites the selected account from the data. It seems that the new observableArrayList in filterPaymentAccounts triggered that un-expected behaviour.
2023-05-20 08:31:52 +02:00
HenrikJannsen
8c37ddd57b
Use trigger price from model instead from sourceOpenOffer
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2023-05-20 06:36:38 +02:00
HenrikJannsen
4475857db3
Remove popup when UI thread is blocked for > 20 sec.
Fixes https://github.com/bisq-network/bisq/issues/6703

Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2023-05-17 16:42:27 +07:00
HenrikJannsen
95023216ec
Use new getReceiverAddress methods instead of getMostRecentAddress
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2023-05-17 13:05:36 +07:00
Alejandro García
ac8ad24807
Merge pull request #6697 from stejbac/speed-up-burningman-and-statistics-view-loads
Speed up burningman and statistics view loads
2023-05-16 15:53:44 +00:00
HenrikJannsen
13f7b39fbd
Do not show BSQ accounts in CloneOfferView
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2023-05-13 22:55:03 +07:00
HenrikJannsen
b11511e037
Do not use sourceOfferPayload for extraDataMap
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2023-05-13 22:15:38 +07:00
HenrikJannsen
e6dc26a26a
Further restrict cloning
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2023-05-12 21:02:19 +07:00
HenrikJannsen
63ca40db5c
Remove code for adjusting the security deposit.
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2023-05-12 19:30:27 +07:00
HenrikJannsen
f843345dcc
Use sourceOfferPayload when cloning the OfferPayload for the fields which must not get changed (like security deposit could get adjusted by the UI).
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2023-05-12 19:26:32 +07:00
Steven Barclay
f0b011e0ac
Optimise Price.getVolumeByAmount to speed up USD & BSQ conversions
Short circuit the BigInteger arithmetic in 'AltcoinExchangeRate' &
'org.bitcoinj.utils.ExchangeRate' (from which the former is adapted), by
using ordinary long arithmetic when it is guaranteed not to overflow due
to the two quantities to be multiplied fitting in an int. This will be
the case most of the time. Also remove duplicated logic, to ensure that
all conversions of BTC amounts to volumes happen via the 'Price'
instance methods, so that the optimisation always applies.

In particular, this speeds up the BTC -> BSQ conversions in the burning
man view, as well as the USD price calculations for the candles in the
trades charts view via 'TradeStatistics3.getTradeVolume()'.

Additionally, fix the lazy initialisation pattern in TradeStatistics3 to
ensure that it is thread safe (that is, it only has benign data races),
by making it of the form:

  Foo foo = this.foo;
  if (foo == null) {
      this.foo = foo = computeFoo();
  }
  return foo;

This avoids the problem that 'foo' is a nonvolatile field and can
therefore be seen to alternate any number of times between null and
nonnull from the PoV of the thread initialising it (at least when the
initialisation is racy).
2023-05-10 19:41:27 +01:00
Steven Barclay
9ce9ffc694
Use TemporalAdjusterModel cache to speed up BSQ supply view
Use the previously added 'ChartDataModel.toCachedTimeIntervalFn' to
additionally speed up some of the charts in the BSQ supply view, in
particular the trade fees & total burned BSQ, via the DaoChartDataModel
methods 'getBsqTradeFeeByInterval' & 'getTotalBurnedByInterval'. (The
other changes in the BSQ supply, such as proofs of burn or issuance, are
too infrequent to benefit from the LocalDate caching.)

For this to work, the filtered BSQ txs must be streamed in chronological
order, so provide local methods 'get[Burnt|Trade]FeeTxStream()', to use
in place of the DaoStateService methods 'get[Burnt|Trade]FeeTxs()',
which return unordered HashSets.
2023-05-10 19:41:25 +01:00
Steven Barclay
f3fd555ced
Add caches to TemporalAdjusterModel to speed up BSQ dashboard view
Now that the trade statistics are retrieved in chronological order,
optimise the per-interval BSQ & USD price and volume calculations in
PriceChartDataModel & VolumeChartDataModel, by adding caches to avoid
relatively expensive timezone calculations in TemporalAdjusterModel,
similarly to the cache added for 'ChartCalculations.roundToTick' (as
profiling shows 'TemporalAdjusterModel.toTimeInteval' is a hotspot).

Add a cache to speed up Instant -> LocalDate mappings by storing the
unix time (Instant) range of the last seen day (LocalDate) in a tuple,
then just returning that day if the next Instant falls in range. Also
add a cache of the last temporal adjustment (start of month, week, etc.)
of that day. In this way, successive calls to 'toTimeInteval(Instant)'
with input times on the same day are sped up.

Since TemporalAdjusterModel is used by multiple threads simultaneously,
store the caches in instance fields and add a 'withCache' method which
clones the model and enables the caching, since otherwise the separate
threads keep invalidating one another's caches, making it slower than it
would be without them. (We could use ThreadLocals, but profiling
suggests they are too heavyweight to be very useful here, so instead use
unsynchronised caching with nonfinal fields and benign data races.)

Provide the method 'ChartDataModel.toCachedTimeIntervalFn' which returns
a method reference to a cloned & cache-enabled TemporalAdjustedModel, to
use in place of the delegate method 'ChartDataModel.toTimeInterval' when
the caching is beneficial.
2023-05-10 19:41:25 +01:00
Steven Barclay
964321a1e1
Use parallelStream to speed up fillTradeCurrencies
As profiling shows a hotspot mapping the set of trade statistics to a
list of currencies to pass to 'CurrencyList.updateWithCurrencies',
attempt to speed this up with a parallel stream. For this to work
correctly, take care to use the backing set (with unmodifiable wrapper)
in place of 'tradeStatisticsManager.getObservableTradeStatisticsSet()',
as ObservableSetWrapper doesn't delegate calls to its spliterator.
2023-05-10 19:41:24 +01:00
Steven Barclay
6e330e4a14
Speed up SortedList creation in TradesChartsView.fillList
Reduce a hotspot sorting the trade statistics table, triggered by the
'sortedList.bind(comparatorProperty)' call upon completion of the
'fillList' future. Profiling shows that repeated invocation of the cell
value factory over the entries of the sorted column is a bottleneck, so
speed this up by caching the returned cell value (given by calling
'new ReadOnlyObjectWrapper<>(listItem)') as an instance field of
TradeStatistics3ListItem.

As a further significant optimisation, stream the trade statistics in
reverse chronological order, when collecting into a list wrapped by
SortedList, as this matches the default display order, reducing the
number of comparisons done by SortedList's internal mergesort to O(n).
2023-05-10 19:41:24 +01:00
Steven Barclay
a489697a54
Speed up candle data creation in getUpdateChartResult
Optimise (further) the ChartCalculations methods 'getItemsPerInterval' &
'getCandleData' by replacing HashSets in the former with sorted sets,
which avoids relatively expensive calls to 'TradeStatistics3.hashCode'
and needless subsequent re-sorting by date in 'getCandleData'. (Forming
the trade statistics into an ImmutableSortedSet, OTOH, is cheap since
they are already encountered in chronological order.)

Further optimise the latter by using a primitive array sort of the trade
prices to calculate their median, instead of needlessly boxing them and
using 'Collections.sort'.
2023-05-10 19:41:23 +01:00
Steven Barclay
0f52b65daa
Further speedups to getUsdAveragePriceMapsPerTickUnit
Avoid calculating average prices for ticks that won't ever be part of a
visible chart candle, as only the last 90 ticks can fit on the chart. To
this end, stream the trade statistics in reverse chronological order
(which requires passing them as a NavigableSet), so that once more than
MAX_TICKS ticks have been encountered for a given tick unit, the
relevant map (and all lower granularity maps) can stop being filled up.

Also add a 'PriceAccumulator' static class to save time and memory when
filling up the intermediate maps, by avoiding the addition of each trade
statistics object to (multiple) temporary lists prior to average price
calculation.
2023-05-10 19:41:23 +01:00
Steven Barclay
372f92d7aa
Add cache to speed up ChartCalculations.roundToTick
Now that the trade statistics are encountered in chronological order,
speed up 'roundToTick(LocalDateTime, TickUnit)' by caching the last
calculated LocalDateTime -> Date mapping from the tick start (with one
cache entry per tick unit), as multiple successive trades will tend to
have the same tick start.

This avoids a relatively expensive '.atZone(..).toInstant()' call, which
was slowing down 'ChartCalculations.getUsdAveragePriceMapsPerTickUnit',
as it uses 'roundToTick' in a tight loop (#trades * #tick-units calls).

Also unqualify 'TradesChartsViewModel.TickUnit' references for brevity.
2023-05-10 19:41:22 +01:00
Steven Barclay
914d75682c
Cache enum.values() in ChartCalculations & TradeStatistics3
Cache enum arrays 'TickUnit.values()' & 'PaymentMethodWrapper.values()'
as the JVM makes defensive copies of them every time they are returned,
and they are both being used in tight loops. In particular, profiling
suggests this will make 'TradeStatistics3.isValid' about twice as fast.
2023-05-10 19:41:22 +01:00
Steven Barclay
835593f2c9
Fix broken test in TradesChartsViewModelTest that passed accidentally
The test was erroneously passing a candle tick start time (as a long) to
'ChartCalculations.getCandleData', which expects a tick index from 0 to
MAX_TICKS + 1 (91) inclusive. Since this is out of range, the method
skipped an 'itemsPerInterval' map lookup which would have thrown an NPE
prior to the last commit. Fix the test by making 'itemsPerInterval'
nonempty and passing 0 as the tick index. Also check the now correctly
populated 'date' field in the returned candle data.

Additionally, tidy up the class a little and avoid an unnecessary temp
directory creation.
2023-05-10 19:41:22 +01:00
Steven Barclay
47776b3836
Speed up ChartCalculations.getItemsPerInterval & return as List
Avoid scanning all the ticks backwards from 90 to 1 repeatedly, to find
the one with the correct date interval for each item in the
'tradeStatisticsByCurrency' list. Instead, for each item, remember the
last found tick index and move forwards if necessary, then scan
backwards from that point to find the correct tick. As the trade
statistics are now in chronological order, this is much faster (though
it will still work correctly regardless of the order of the list items).

Also, hold 'itemsPerInterval' as a 'List<Pair<..>>' instead of a
'Map<Long, Pair<..>>', since the keys are just tick indices from 0 to 91
inclusive, so it is cleaner and more efficient to use an array than a
hash table.
2023-05-10 19:41:21 +01:00
Steven Barclay
5846095b6b
Minor cleanup of ChartCalculations & TradesChartsView
1) Change statement lambdas to expression lambdas;
2) Replace 'Map.putIfAbsent' then 'Map.get' with 'Map.computeIfAbsent';
3) Add missing @VisibleForTesting annotation or make private.
2023-05-10 19:41:21 +01:00
Steven Barclay
b417e36a28
Make TradeStatistics3 comparable & hold in a TreeSet
Make TradeStatistics3 implement the previously added ComparableExt
interface and make TradeStatisticsManager hold them as a TreeSet instead
of a HashSet, to support fast retrieval of statistics in any given date
range. (Even though red-black trees are generally slower than hash
tables, this should not matter here since the set is only being iterated
over and infrequently appended, and does not benefit from O(1) lookups/
additions/removals.)

Add a 'TradeStatisticsManager.getNavigableTradeStatisticsSet' accessor,
which returns the backing TreeSet of the current ObservableSet field, so
that callers can access its NavigableSet interface where needed (as
there is no ObservableSortedSet or similar in JavaFX). Use this to
optimise 'AveragePriceUtil.getAveragePriceTuple',
'DisputeAgentSelection.getLeastUsedDisputeAgent' and
'MutableOfferDataModel.getSuggestedSecurityDeposit', to obtain a narrow
date range of trade statistics without streaming over the entire set.

Additionally optimise & simplify the price collation in
'TradeStatisticsManager.onAllServicesInitialised', by exploiting the
fact that the statistics are now sorted in order of date (which is the
presently defined natural order).
2023-05-10 19:41:20 +01:00
Alva Swanson
2e63d2f0ca
Remove empty VerifyTaskTest class 2023-05-08 16:35:36 +10:00
napoly
fc42044949
Remove edit button for BSQ offers 2023-05-06 20:06:58 +02:00
HenrikJannsen
13bcfb3121
Use new offerId and fresh data at clone offer
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2023-05-05 19:41:24 +07:00