Commit Graph

7207 Commits

Author SHA1 Message Date
Alejandro García
5a3a7071f9
Merge pull request #6980 from alvasw/core_do_not_add_old_fitler_to_invalid_filters_if_new_signer_banned
core: Don't add old filter to invalid filters if new signer banned
2023-12-31 13:46:06 +00:00
Alejandro García
f12069aeeb
Merge pull request #6979 from alvasw/FilterManagerMockedPrivilegeKeysTests
Add FilterManagerMockedPrivilegeKeysTests
2023-12-31 13:45:13 +00:00
Alejandro García
1f072bf774
Merge pull request #6977 from alvasw/FilterManagerAddFilterToNetworkTests
Add FilterManagerAddFilterToNetworkTests
2023-12-31 13:44:07 +00:00
Alejandro García
143628b5a0
Merge pull request #6976 from alvasw/FilterManagerInitializationTests
Add FilterManagerInitializationTests
2023-12-31 13:42:53 +00:00
Alejandro García
e5ed806235
Merge pull request #6952 from jmacxx/fee_validation_reason_codes
Display the reason for auto-disabling an open offer.
2023-12-31 13:35:44 +00:00
Alva Swanson
d6aa5b16f6
core: Don't add old filter to invalid filters if new signer banned
Before this change, the currentFilter will be added to the
invalidFilters list after comparing both filters creation date and
before checking whether the new filter was created by a banned signer.

Note: The invalid filters list is only used on the security manager Bisq
instances. This list is never read by regular user clients.
2023-12-28 15:00:21 +01:00
Alva Swanson
78ac425414
Write FilterManagerMockedPrivilegeKeysTests 2023-12-28 15:00:21 +01:00
Alva Swanson
b255dad5c3
Write FilterManagerAddFilterToNetworkTests 2023-12-28 08:50:13 +01:00
Alva Swanson
8a978a2c14
DevEnv: Add static getDevPrivilegePubKeys() method 2023-12-28 08:50:13 +01:00
Alva Swanson
bf98531c46
Config: Make configFile field private and add getter 2023-12-28 08:50:13 +01:00
Alva Swanson
e7cb152e11
DevEnv: Make DEV_PRIVILEGE_PRIV_KEY private and add getter 2023-12-28 08:50:13 +01:00
Alva Swanson
c96b7d2ade
DevEnv: Make DEV_PRIVILEGE_PUB_KEY private and add getter 2023-12-28 08:50:13 +01:00
Alva Swanson
ff15d5a066
Write FilterManagerInitializationTests 2023-12-28 08:50:10 +01:00
Alejandro García
70a15ceb06
Merge pull request #6965 from yonson2023/pix_add_holder_name
Update Pix payment account, add HolderName
2023-12-20 05:05:18 +00:00
Alejandro García
d9ac3340b0
Merge pull request #6964 from yonson2023/update_transferwise
Update Wise payment account (was TransferWise)
2023-12-20 05:03:27 +00:00
Alejandro García
99d45f720d
Merge pull request #6955 from yonson2023/fix_npe_persistence
Fix potential NPE in persistence of Contract.
2023-12-20 05:00:57 +00:00
Alejandro García
237c7054be
Merge pull request #6949 from stejbac/change-burning-man-capping-algorithm
Change burning man capping algorithm
2023-12-20 04:59:40 +00:00
yonson2023
d899e84ddc
Add HolderName to Pix account. 2023-12-15 15:20:18 -06:00
yonson2023
01dc89edc5
Update Wise (TransferWise) account.
TransferWise has rebranded to Wise, rename user-facing parts.
Add HolderName (mandatory for new accounts).
2023-12-15 15:05:11 -06:00
yonson2023
5e0803a392
Add accessors for HolderName. 2023-12-11 10:57:10 -06:00
yonson2023
b9fcbd4ee8
Detect and handle corrupted SPV state allowing user-initiated resync. 2023-12-09 10:50:04 -06:00
jmacxx
265ca17e32
Check live Tx as part of BSQ fee validation process. 2023-12-07 13:01:25 -06:00
yonson2023
c7f36b255b
Fix potential NPE in persistence of Contract. 2023-12-03 10:14:53 -06:00
jmacxx
0ad71fc680
Fee validation refactor. 2023-11-28 12:26:38 -06:00
Steven Barclay
32d4a8f50d
Replace deprecated 'initMocks' calls with MockitoSession
Since the 'MockitoAnnotations.initMocks' method used to initialise
@Mock, @Spy, etc. fields is deprecated, use MockitoSession instead, as
suggested by the Javadoc. (Or just remove the call, if the test class is
not actually using any Mockito annotations.)

This allows strict stubbing (the default for Mockito 4), though it must
be configured to be lenient in the P2P test classes, to prevent failures
due to unused stubs.
2023-11-28 03:36:25 +08:00
Steven Barclay
4c0c11bb27
Implement BM capping algorithm change (with delayed activation)
Change the algorithm used to adjust & cap the burn share of each BM
candidate to use an unlimited number of 'rounds', as described in:

  https://github.com/bisq-network/proposals/issues/412

That is, instead of capping the shares once, then distributing the
excess to the remaining BM, then capping again and giving any excess to
the Legacy Burning Man, we cap-redistribute-cap-redistribute-... an
unlimited number of times until no more candidates are capped. This has
the effect of reducing the LBM's share and increasing everyone else's,
alleviating the security risk of giving too much to the LBM (who is
necessarily uncapped).

Instead of implementing the new algorithm directly, we simply enlarge
the set of candidates who should be capped to include those who would
eventually be capped by the new algorithm, in order to determine how
much excess burn share should go to the remaining BM. Then we apply the
original method, 'candidate.calculateCappedAndAdjustedShares(..)', to
set each share to be equal to its respective cap or uniformly scaled
upwards from the starting amount accordingly.

To this end, the static method 'BurningManService.imposeCaps' is added,
which determines which candidates will eventually be capped, by sorting
them in descending order of burn-share/cap-share ratio, then marking all
the candidates in some suitable prefix of the list as capped, iterating
through them one-by-one & gradually increasing the virtual capping round
(starting at zero) until the end of the prefix is reached. (The method
also determines what the uncapped adjusted burn share of each BM should
be, but that only affects the BM view & burn targets.) In this way, the
new algorithm runs in guaranteed O(n * log n) time.

To prevent failed trades, the new algorithm is set to activate at time
'DelayedPayoutTxReceiverService.PROPOSAL_412_ACTIVATION_DATE', with a
placeholder value of 12am, 1st January 2024 (UTC). This simply toggles
whether the for-loop in 'imposeCaps' should stop after capping round 0,
since doing so will lead to identical behaviour to the original code
(even accounting for FP rounding errors).
2023-11-26 21:54:20 +08:00
Steven Barclay
7dfd6aa5e1
Use TreeMap to prevent potential nondeterminism in BM share summation
Replace HashMap in 'BurningManService.getBurningManCandidatesByName'
result construction with a TreeMap, to ensure that the map values are
ordered deterministically (alphabetically by candidate name) when
computing floating point sums. The map values are streamed over in a few
places in this method and elsewhere in 'DelayedPayoutTxReceiverService',
when performing double precision summation to compute the DPT. This
introduces potential nondeterminism due to the nonassociativity of FP
addition, making sums dependent on the term order.

(Note that 'DoubleStream::sum' uses compensated (Kahan) summation, which
makes it effectively quad precision internally, so the chance of term
reordering causing the result to differ by even a single ULP is probably
quite low here. So there might not be much problem in practice.)
2023-11-26 03:41:03 +08:00
Steven Barclay
c234c2351c
Add adjusted burn share assertions + test for inactive/expired BM
Add a missing test case for burning man candidates with fully expired
compensation issuance or proofs-of-burn, or who are inactive because
they have never carried out a proof-of-burn, to prevent regressions in
the forthcoming capping algorithm code changes.

Also add missing assertions for the expected 'adjustedBurnAmountShare'
property of each candidate to the test cases. Note that these only
affect the UI, including the displayed burn targets, not the actual BM
revenue (DPT outputs or fee recipient selection), so we use approximate
equality in the test assertions as usual for floating point expressions.
2023-11-26 00:47:38 +08:00
Alejandro García
95e74937c1
Merge pull request #6947 from djing-chan/fix-initial-data-request-handling
Fix initial data request handling
2023-11-24 08:02:18 +00:00
Steven Barclay
23f93fc0ec
Add tests for share calculations by 'getBurningManCandidatesByName'
Add an inner class to 'BurningManServiceTest' to test the cap shares &
(capped + uncapped) burn shares allocated to each candidate found upon
calling 'BurningManService.getBurningManCandidatesByName'. To this end,
set up mocks of 'DaoStateService' and the other injected dependencies of
'BurningManService' to return skeletal proof-of-burn & compensation
issuance txs & payloads for the test users supplied for each case.

Ensure the test cases exercise the capping algorithm fairly thoroughly,
which is to be changed in the proceeding commits, per the proposal:

  https://github.com/bisq-network/proposals/issues/412

In particular, provide test cases where more than two capping rounds
would be applied by the new algorithm, as opposed to the current
algorithm which always applies at most two. (This leads to strictly
lower shares for the Legacy Burning Man and non-strict increases in the
shares of all the other burning men.)
2023-11-21 23:11:22 +08:00
djing chan
34857c9d89
Add flag to avoid multiple calls of onDataReceived
Only start requesting blocks after wallet is synced.
Update connection state when doing repeated block requests.
Improve logs.
2023-11-19 16:42:37 +07:00
djing chan
536a29f76a
Improve logs for block requests 2023-11-19 15:22:38 +07:00
djing chan
08118e387e
Use onDataReceived instead of onUpdatedDataReceived for considering p2p network state as initialized 2023-11-19 14:47:52 +07:00
Alejandro García
dd3f1341cd
Merge pull request #6931 from jmacxx/refactor_fee_service
Refactor & simplify fee service.
2023-11-15 21:41:41 +00:00
jmacxx
15617ae5a0
Apply code review change. 2023-11-09 21:41:42 -06:00
Alejandro García
1280aa0e57
Merge pull request #6938 from HenrikJannsen/remove_pricenode_and_seednodes_of_wiz
Remove price node and seed nodes from wiz
2023-10-31 19:25:54 +00:00
HenrikJannsen
bfed79019e
Remove price node and seed nodes from wiz
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2023-10-29 15:31:43 +07:00
jmacxx
6b42bb9657
Adapt fee service client calls to simplified interface.
Obsolete async requests removed, replaced by getTxFee().
2023-10-25 17:07:03 -05:00
jmacxx
7f4bde8669
Fix deviation in open portfolio offers & history. 2023-10-24 10:43:16 -05:00
jmacxx
f1af9d84ff
Refactor fee service.
Use fees retrieved from getAllMarketPrices.
More frequent fee updates (was 5 minutes, now 1).
Saves one socket connection.
Saves one threadpool.
Service failover to new node works (previously did not).
Uses POJO data transfer object instead of parsing Json in a tree.
Code footprint is reduced.
Clients no longer need to request fee updates.
See issue 5509.
2023-10-18 15:10:22 -05:00
Alejandro García
e9bdee6400
Merge branch 'master' into release/v1.9.14 2023-10-16 19:47:43 +00:00
Alva Swanson
e08445dd40
Support dockerized regtest seednodes 2023-10-13 21:49:20 +02:00
HenrikJannsen
4b48ce079b
Add CheckRestrictions task
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2023-10-09 20:37:36 +02:00
HenrikJannsen
f4fe66a103
Fix test
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2023-10-09 20:37:35 +02:00
HenrikJannsen
01bd8bb86e
Delay payout if buyers account got flagged as risky by filter data
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2023-10-09 20:37:35 +02:00
HenrikJannsen
3a25eef64a
Add sellerConfirmedPaymentReceiptDate to Trade
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2023-10-09 20:37:35 +02:00
HenrikJannsen
57ef8bedc7
Add delayedPayoutPaymentAccounts to Filter
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2023-10-09 20:37:35 +02:00
HenrikJannsen
a2340f640b
Add CheckRestrictions task
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2023-10-09 21:27:36 +07:00
HenrikJannsen
6e1b6a7840
Fix test
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2023-10-08 19:08:52 +07:00
HenrikJannsen
ef6335ab62
Delay payout if buyers account got flagged as risky by filter data
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2023-10-08 19:08:52 +07:00