Commit Graph

1396 Commits

Author SHA1 Message Date
Bisq GitHub Admin
60522218a7
Merge pull request #6412 from bisq-network/release/v1.9.6
Merge release branch
2022-11-15 21:03:40 +01:00
HenrikJannsen
b5df4afd40
Remove DevEnv.isDaoActivated method as not used anymore
Remove daoActivatedToggleButton from PreferencesView and NewsView

Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2022-11-03 11:16:10 -05:00
HenrikJannsen
008cfaac57
Remove daoActivated options
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
2022-11-03 10:46:26 -05:00
jmacxx
797bfe5cd5
Store the build's commit hash in Jarfile manifest. 2022-10-29 22:12:31 -05:00
Christoph Atteneder
80246e5d66
Update data stores for v1.9.6 2022-10-20 12:19:30 +02:00
Christoph Atteneder
3580b648c8
Bump version number for v1.9.6 2022-10-13 09:54:32 +02:00
Christoph Atteneder
7cddb74168
Update data stores for v1.9.5 2022-08-22 11:34:59 +02:00
Christoph Atteneder
15aaa77b91
Bump version number for v1.9.5 2022-08-21 21:32:26 +02:00
Christoph Atteneder
2561de9951
Merge pull request #6285 from jmacxx/tor_log_level
Set Tor logging to DEBUG level at startup
2022-07-12 09:53:10 +02:00
jmacxx
9893f52e57
Set Tor logging to DEBUG level at startup. 2022-07-08 12:26:58 -05:00
Christoph Atteneder
efe306aae6
Bump version number for v1.9.4 2022-07-04 09:52:27 +02:00
Christoph Atteneder
9bd1fd1423
Update data stores for v1.9.3 2022-06-27 17:00:56 +02:00
Christoph Atteneder
791ad62a51
Bump version number for v1.9.3 2022-06-23 09:39:04 +02:00
Christoph Atteneder
56d8842092
Merge branch 'master' of github.com:bisq-network/bisq into release/v1.9.2
Conflicts:
	build.gradle
	desktop/package/linux/Dockerfile
	desktop/package/macosx/finalize.sh
	desktop/package/macosx/insert_snapshot_version.sh
	relay/src/main/resources/version.txt
2022-06-23 09:03:33 +02:00
Christoph Atteneder
043f1e4c70
Bump version number for v1.9.2 2022-06-21 20:39:23 +02:00
chimp1984
61b91e0511
Add params for url:port 2022-06-14 12:53:06 +02:00
Christoph Atteneder
0e4d25f007
Bump version number for v1.9.1 2022-05-02 09:50:46 +02:00
Christoph Atteneder
cbc1a6f43b
Update data stores for v1.9.0 2022-04-28 13:11:05 +02:00
Christoph Atteneder
dd6c8d1c30
Bump version number for v1.9.0 2022-04-22 11:36:43 +02:00
jmacxx
c6209e0142
Use Locale.ENGLISH when accessing directories and JAR resource paths. 2022-04-12 18:25:06 -05:00
Christoph Atteneder
8136f0a6ca
Bump version number for v1.8.4 2022-03-07 16:42:10 +01:00
Christoph Atteneder
05f4f68356
Update data stores for v1.8.3 2022-02-24 20:48:17 +01:00
Christoph Atteneder
602101c117
Bump version number for v1.8.3 2022-02-17 10:49:55 +01:00
sqrrm
f315bd299e
Merge pull request #5993 from bisq-network/release/v1.8.2
Release/v1.8.2
2022-01-24 16:26:35 +01:00
Christoph Atteneder
c4fa58db78
Bump version number for v1.8.2 2022-01-24 09:40:46 +01:00
Christoph Atteneder
06ab4dfa2a
Update data stores for v1.8.1 2022-01-18 11:38:30 +01:00
jmacxx
684fd39c75
Force persistence write when editing Tor Bridge settings.
This is necessary because Tor settings are edited before the app has
completed startup and normally persistence is prohibited.
2022-01-16 11:52:44 -06:00
Christoph Atteneder
9d39f16d35
Bump version number for v1.8.1 2022-01-12 10:41:29 +01:00
Christoph Atteneder
a1d0e570d1
Apply minor improvements and clean-ups 2022-01-11 12:36:44 +01:00
jmacxx
9334cffc89
Feature enabling log file upload to mediators 2022-01-06 13:22:44 -06:00
Steven Barclay
34409638f7
Avoid enumerating every jar entry in FileUtil::listResourceDirectory
Use 'java.nio.file.FileSystem' in place of 'java.util.jar.JarFile' to
list all the resources under a given classpath (on Windows & Linux), as
that is a bit neater and potentially more efficient than scanning the
entire ZIP directory structure.
2021-12-09 09:52:30 +01:00
Steven Barclay
e07c7b5d4b
Fix BSQ blocks resync from resources on Windows & Linux
Prevent a "URI is not hierarchical" IllegalArgumentException from the
expression, 'new File(dirUrl.toURI())', which occurs on Linux & Windows
when listing the resource directory of BSQ blocks. Adapt a solution from
StackOverflow which uses two separate code paths depending on the
environment, into the new method 'FileUtil::listResourceDirectory'.

The issue is caused by the resource URL taking one of the two forms:

  file:/Users/[USER]/Java/bisq/bisq/p2p/out/production/resources/BsqBlocks_BTC_MAINNET
  jar:file:...p2p.jar!/BsqBlocks_BTC_MAINNET

depending on whether the system is OSX or not.
2021-12-09 09:52:30 +01:00
chimp1984
81d112bdf3
Add null checks
Return early at connection if stopped
Cleanup logs
2021-12-08 19:39:37 +01:00
Steven Barclay
d5839bc6b2
Add separate ProofOfWork.solution proto field for Equihash
Avoid repurposing the 'ProofOfWork.payload' field for Equihash puzzle
solutions, as that may be of later use in interactive PoW schemes such
as P2P network DoS protection (where the challenge may be a random nonce
instead of derived from the offer ID). Instead, make the payload the
UTF-8 bytes of the offer ID, just as with Hashcash.

Also, make the puzzle seed the SHA-256 hash of the payload concatenated
with the challenge, instead of just the 256-bit challenge on its own, so
that the PoW is tied to a particular payload and cannot be reused for
other payloads in the case of future randomly chosen challenges.
2021-12-07 09:35:46 +01:00
Steven Barclay
ceb9b9acbd
Code cleanup: proto fields, duplicated expr & null char separator
1. Reorder the PoW fields in the 'Filter' proto by field index, instead
 of contextually.
2. Deduplicate expression for 'pow' & replace if-block with boolean op
 to simplify 'FilterManager::isProofOfWorkValid'.
3. Avoid slightly confusing use of null char as a separator to prevent
 hashing collisions in 'EquihashProofOfWorkService::getChallenge'. Use
 comma separator and escape the 'itemId' & 'ownerId' arguments instead.

(based on PR #5858 review comments)
2021-12-07 09:35:45 +01:00
Steven Barclay
c9c2be6dcd
Fix bug in Equihash.IntListMultimap & adjust constants
Fix a trivial bug in the iterator returned by 'IntListMultimap::get',
caused by mistaken use of the iterator index in place of the key when
doing lookups into the overspill map. This was causing puzzle solutions
to be invalid about 3% of the time, as well as substantially reducing
the average number of solutions found per nonce.

As the fix increases the mean solution count per nonce to the correct
value of 2.0 predicted by the paper (regardless of puzzle params k & n),
inline the affected constants to simplify 'Equihash::adjustDifficulty'.
2021-12-07 09:35:45 +01:00
Steven Barclay
92209c3ed7
Inline predicates to simplify HashCashService & FilterManager
Remove all the 'challengeValidation', 'difficultyValidation' and
'testDifficulty' BiPredicate method params from 'HashCashService' &
'ProofOfWorkService', to simplify the API. These were originally
included to aid testing, but turned out to be unnecessary.

Patches committed on behalf of @chimp1984.
2021-12-07 09:35:45 +01:00
Steven Barclay
772cd74ab2
Store difficulty as floating point in Filter & PoW
Change the type of the 'difficulty' field in the Filter & ProofOfWork
proto objects from int32/bytes to double and make it use a linear scale,
in place of the original logarithmic scale which counts the (effective)
number of required zeros.

This allows fine-grained difficulty control for Equihash, though for
Hashcash it simply rounds up to the nearest power of 2 internally.

NOTE: This is a breaking change to PoW & filter serialisation (unlike
the earlier PR commits), as the proto field version nums aren't updated.
2021-12-07 09:35:44 +01:00
Steven Barclay
266a7ccea4
Add+enable service to mint/verify Equihash proofs of work
Add an abstract base class, 'ProofOfWorkService', for the existing PoW
implementation 'HashCashService' and a new 'EquihashProofOfWorkService'
PoW implementation based on Equihash-90-5 (which has 72 byte solutions &
5-10 MB peak memory usage). Since the current 'ProofOfWork' protobuf
object only provides a 64-bit counter field to hold the puzzle solution
(as that is all Hashcash requires), repurpose the 'payload' field to
hold the Equihash puzzle solution bytes, with the 'challenge' field
equal to the puzzle seed: the SHA256 hash of the offerId & makerAddress.

Use a difficulty scale factor of 3e-5 (derived from benchmarking) to try
to make the average Hashcash & Equihash puzzle solution times roughly
equal for any given log-difficulty/numLeadingZeros integer chosen in the
filter.

NOTE: An empty enabled-version-list in the filter defaults to Hashcash
(= version 0) only. The new Equihash-90-5 PoW scheme is version 1.
2021-12-07 09:35:44 +01:00
Steven Barclay
eb435a9513
Add difficulty adjustment & benchmarking to Equihash(Test)
Provide a utility method, 'Equihash::adjustDifficulty', to linearise and
normalise the expected time taken to solve a puzzle, as a function of
the provided difficulty, by taking into account the fact that there
could be 0, 1, 2 or more puzzle solutions for any given nonce. (Wagner's
algorithm is supposed to give 2 solutions on average, but the observed
number is fewer, possibly due to duplicate removal.) For tractability,
assume that the solution count has a Poisson distribution, which seems
to have good agreement with the tests.

Also add some (disabled) benchmarks to EquihashTest. These reveal an
Equihash-90-5 solution time of ~146ms per puzzle per unit difficulty on
a Core i3 laptop, with a verification time of ~50 microseconds.
2021-12-07 09:35:43 +01:00
Steven Barclay
c3e5dfd19e
Add PoW version(-list) fields to ProofOfWork & Filter
Add a numeric version field to the 'ProofOfWork' protobuf object, along
with a list of allowed version numbers, 'enabled_pow_versions', to the
filter. The versions are taken to be in order of preference from most to
least preferred when creating a PoW, with an empty list signifying use
of the default algorithm only (that is, version 0: Hashcash).

An explicit list is used instead of an upper & lower version bound, in
case a new PoW algorithm (or changed algorithm params) turns out to
provide worse resistance than an earlier version.

(The fields are unused for now, to be enabled in a later commit.)
2021-12-07 09:35:43 +01:00
Steven Barclay
998a0e0aaf
Further Equihash optimisation: partial parallelisation
Run the initial XorTable fillup in 'Equihash::computeAllHashes' in
parallel, using a parallel stream, to get an easy speed up. (The solver
spends about half its time computing BLAKE2b hashes before iteratively
building tables of partial collisions using 'Equihash::findCollisions'.)

As part of this, replace the use of 'java.nio.ByteBuffer' array wrapping
in 'Utilities::(bytesToIntsBE|intsToBytesBE)' with manual for-loops, as
profiling reveals an unexpected bottleneck in the former when used in a
multithreaded setting. (Lock contention somewhere in unsafe code?)
2021-12-07 09:35:43 +01:00
Steven Barclay
0a603167f1
Further Equihash optimisation: avoid lambda+stream in tight loop
Manually iterate over colliding table rows using a while- loop and a
custom 'PrimitiveIterator.OfInt' implementation, instead of a foreach
lambda called on an IntStream, in 'Equihash::findCollisions'. Profiling
shows that this results in a slight speedup.
2021-12-07 09:35:42 +01:00
Steven Barclay
3130d9329c
Add Equihash.IntListMultimap (private) class for speedup
Provide a (vastly cut down) drop-in replacement for the Guava multimap
instance 'indexMultimap', of type 'ListMultimap<Integer, Integer>', used
to map table row indices to block values, to detect collisions at a
given block position (that is, in a given table column).

The replacement stores (multi-)mappings from ints to ints in a flat int-
array, only spilling over to a ListMultimap if there are more than 4
values added for a given key. This vastly reduces the amount of boxing
and memory usage when running 'Equihash::findCollisions' to build up the
next table as part of Wagner's algorithm.
2021-12-07 09:35:42 +01:00
Steven Barclay
95637e0fa0
Add Equihash implementation for use in ASIC-resistant PoW
Implement the Equihash (https://eprint.iacr.org/2015/946.pdf) algorithm
for solving/verifying memory-hard client-puzzles/proof-of-work problems
for ASIC-resistant DoS attack protection. The scheme is asymmetric, so
that even though solving a puzzle is slow and memory-intensive, needing
100's of kB to MB's of memory, the solution verification is instant.

Instead of a single 64-bit counter/nonce, as in the case of Hashcash,
Equihash solutions are larger objects ranging from 10's of bytes to a
few kB, depending on the puzzle parameters used. These need to be
stored in entirety, in the proof-of-work field of each offer payload.

Include logic for fine-grained difficulty control in Equihash with a
double-precision floating point number. This is based on lexicographic
comparison with a target hash, like in Bitcoin, instead of just
counting the number of leading zeros of a hash.

The code is unused at present. Also add some simple unit tests.
2021-12-07 09:35:42 +01:00
Steven Barclay
484afbc522
Code cleanup: replace (Bi)Function<..,Boolean> with (Bi)Predicate<..>
Replace 'BiFunction<T, U, Boolean>' with the primitive specialisation
'BiPredicate<T, U>' in HashCashService & FilterManager.

As part of this, replace similar predicate constructs found elsewhere.
NOTE: This touches the DAO packages (trivially @ VoteResultService).
2021-12-07 09:35:41 +01:00
Steven Barclay
b3f7cb5c76
Code cleanup: remove unused PoW class & test
Remove (possible draft) 'ProofOfWorkService(Test)', which is a near
duplicate of the class 'HashCashService' but is currently unused.
2021-12-07 09:35:41 +01:00
Christoph Atteneder
dd6af18350
Update data stores for v1.8.0 2021-11-24 11:47:53 +01:00
Christoph Atteneder
aacc1105e3
Bump version number for v1.8.0 2021-11-19 18:35:56 +01:00
Christoph Atteneder
284eaf2c11
Merge pull request #5817 from chimp1984/fix-incorrect-app-initialisation
Fix incorrect app initialisation
2021-11-10 19:22:03 +01:00
chimp1984
ae38a54f11
Add util for logger to log by threadname
Helpful for debugging
2021-11-10 12:34:29 +01:00
chimp1984
5c2199ff49
Add freeMemory to log
Cleanup
2021-11-10 12:32:18 +01:00
chimp1984
faa8bd2ab2
Extract code in CommonSetup which uses a timer
to startPeriodicTasks.
Call that from BisqExecutable.onApplicationLaunched

We have created a non-UI timer before for the
printSystemLoadPeriodically as that was called
before the configUserThread was called (where we
define the UI timer for desktop)
2021-11-10 12:26:54 +01:00
chimp1984
67741f0d0e
Add DEFAULT_LOG_LEVEL field 2021-11-09 20:00:34 +01:00
chimp1984
cf9e49134a
Add shutDown method to ClockWatcher and shut it down at shutdown 2021-11-09 20:00:34 +01:00
chimp1984
c209da7c66
Fix package statement 2021-11-09 19:32:44 +01:00
chimp1984
603e9fde17
Add CompletableFutureUtils
Convenience util for CompletableFuture.allOf method
2021-11-09 19:20:34 +01:00
chimp1984
62b3e51b22
Cleanups, change log levels 2021-11-09 13:01:19 +01:00
chimp1984
7c32587453
Persist bsq blocks as buckets of 1000 blocks
Improve logging

Add BsqBlockStore to protobuf

Remove DaoStateMonitoringService field

Do not persist the blocks in daoState anymore.

This improves persistence performance and reduces memory
requirements for snapshots.
2021-11-09 13:01:19 +01:00
chimp1984
7b68686b28
Improve GcUtil
Increase duration for autoReleaseMemory from 60 to 120 sec.
Improve logging.
Add print stack trace when in dev mode to show caller for debugging/tuning.
Remove inefficient GC calls (based on test runs when no reduction occurred at those calls).
2021-11-04 12:48:08 +01:00
chimp1984
bcf54d4eb7
Add log 2021-11-02 16:18:50 +01:00
chimp1984
74789b1cc5
Move Utilities.objectToJson to JsonUtil.objectToJson
Move inner class AnnotationExclusionStrategy to JsonUtil
Next commit includes changes why that move to core is needed.
2021-11-02 16:18:50 +01:00
chimp1984
f7fcaa915e
Add BSQ swap code 2021-11-02 16:18:50 +01:00
chimp1984
82c1be1d97
Change log level 2021-10-20 22:51:44 +02:00
Christoph Atteneder
8fbccb7547
Bump version number for v1.7.5 2021-10-19 11:32:09 +02:00
sqrrm
5e84713520
Merge pull request #5730 from bisq-network/release/v1.7.4
Release/v1.7.4
2021-09-28 15:05:42 +02:00
chimp1984
3b97f96515
Disable GC calls if fullDaoNode is set (like in case of seed nodes)
Seed nodes have 4 GB allocated so the attempt to reduce memory
footprint is not needed for those cases. We use the fullDaoNode
prog arg as its expected that any full node will have allocated
sufficient memory and thus the intended reduction of memory by
calling the GC is not required and counter productive.
2021-09-27 13:18:44 +02:00
Christoph Atteneder
29ede5f3c4
Update data stores for v1.7.4 2021-09-23 10:01:04 +02:00
Christoph Atteneder
64274cf82e
Bump version number for v1.7.4 2021-09-21 09:24:26 +02:00
chimp1984
2419e1dae5
Add dao activated toggle to preferences
We write the value to the properties file not to
the preferences as we need the value early at startup
before the preferences are loaded.
2021-09-21 01:31:13 +02:00
sqrrm
fae1852220
Merge pull request #5685 from ghubstan/1-fix-api-payacct-ccy-support
Let API user set currencies in some payment account json forms
2021-09-17 14:07:09 +02:00
jmacxx
3430055144
add SWIFT payment method
rebased to master
2021-09-08 14:57:08 -05:00
ghubstan
f39e611150
Wrap long i18n strings for use in API
Some i18n property values can be used by the API if long strings are
wrapped before written as commments to json payment account forms, or
written to the CLI console.

This change anticipates the addition of the more complex Swift payment
method (PR 5672). PR 5672's i18n property value for key "payment.swift.info"
will be wrapped and appended to the comments of the Swift payment account's
json form.
2021-09-06 12:12:09 -03:00
Christoph Atteneder
ad95e5b3be
Bump version number for v1.7.3 2021-08-23 11:20:09 +02:00
Christoph Atteneder
b92d1c25ac
Update data stores for v1.7.2 2021-07-19 20:06:02 +02:00
Christoph Atteneder
12b0a5bf80
Bump version number for v1.7.2 2021-07-16 20:37:10 +02:00
Christoph Atteneder
ef5ff1249b
Merge branch 'master' of github.com:bisq-network/bisq into release/v1.7.1
# Conflicts:
#	build.gradle
#	desktop/package/linux/Dockerfile
#	desktop/package/macosx/finalize.sh
#	desktop/package/macosx/insert_snapshot_version.sh
#	relay/src/main/resources/version.txt
2021-07-16 13:02:18 +02:00
Christoph Atteneder
dfb97ca05f
Bump version number for v1.7.1 2021-07-12 14:52:38 +02:00
chimp1984
28a8116997
Add gc calls at areas where memory usage spikes are expected 2021-07-08 01:06:20 +02:00
Christoph Atteneder
e5765aeef2
Delay sending of payment account information during trade by @chimp1984
It also removes the op return from the multisig transaction
2021-06-28 09:47:52 +02:00
Christoph Atteneder
9f42035108
Bump version number for v1.7.0 2021-06-23 14:27:22 +02:00
jmacxx
e901e398ea
add mempool fees to the getAllMarketPrices endpoint 2021-06-07 18:14:50 -05:00
Christoph Atteneder
3be0795eea
Update data stores for v1.6.5 2021-05-25 10:40:45 +02:00
Christoph Atteneder
59de78c332
Bump version number for v1.6.5 2021-05-21 20:00:49 +02:00
Christoph Atteneder
33aba27e97
Rename the BTC default value for the provided nodes option 2021-05-21 19:58:18 +02:00
Christoph Atteneder
2fd5f40239
Reduce the number of connected BTC nodes from 9 to 7 2021-05-21 19:58:09 +02:00
Christoph Atteneder
9c4137bc11
Not update the historical resource file 2021-05-05 14:29:52 +02:00
Christoph Atteneder
dba59138df
Bump version number for v1.6.4 2021-05-05 10:27:42 +02:00
Christoph Atteneder
b5d772bc48
Update data stores for v1.6.3 2021-04-26 11:11:29 +02:00
Christoph Atteneder
2c5e785a1e
Bump version number for v1.6.3 2021-04-22 10:36:37 +02:00
Christoph Atteneder
e516992173
Merge pull request #5374 from cd2357/mathutils-test
Handle rounding of infinite Doubles
2021-04-13 09:37:09 +02:00
cd2357
5e7377479e
Handle rounding of infinite Doubles
In certain situations we deal with infinite (or NaN) doubles. This causes issues when trying to instantiate a BigDecimal from it, which is an intermediary step in the process of rounding the double.

This commit checks for such non-finite doubles and throws a specific exception if their rounding is attempted.
2021-04-03 09:18:32 +02:00
Christoph Atteneder
8623b7b546
Bump version number for v1.6.2 2021-04-01 09:41:07 +02:00
Christoph Atteneder
b7524270dd
Bump version number for v1.6.1 2021-03-28 20:11:26 +02:00
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
Christoph Atteneder
378fd026bf
Bump version number for v1.6.0 2021-03-18 19:19:26 +01:00
jmacxx
47ad4219e2
Merge branch 'master' into mempool_check_maker_tx 2021-03-17 16:26:38 -05:00
jmacxx
9fcd65f320
Validate maker/taker fees using mempool lookup
apply @chimp1984 patch.txt code review suggestions
taker tx check moved to trade step 2, after confirmation
solve issue with calculating expected fees for unconfirmed tx
resolve conflict with PR5207 (Disputes UI)
check new offers after 1 block; check Json string not null; warn -> info
remove unused parameter
remove debugging log.warn message
2021-03-17 16:23:18 -05:00
Christoph Atteneder
38a9bf0277
Merge branch 'master' of github.com:bisq-network/bisq into hotfix/v1.5.9
# Conflicts:
#	build.gradle
#	desktop/package/linux/Dockerfile
#	desktop/package/linux/package.sh
#	desktop/package/linux/release.sh
#	desktop/package/macosx/create_app.sh
#	desktop/package/macosx/finalize.sh
#	desktop/package/macosx/insert_snapshot_version.sh
#	desktop/package/windows/package.bat
#	desktop/package/windows/release.bat
#	relay/src/main/resources/version.txt
2021-03-11 16:26:50 +01:00