A decentralized bitcoin exchange network
Go to file
Steven Barclay 6487f92d84
Make serialisation in FileManager::saveToFile thread-safe
Add toProtoMessageSynchronized() default method to PersistableEnvelope,
which performs (blocking) protobuf serialisation in the user thread,
regardless of the calling thread. This should prevent data races like
the ConcurrentModificationException observed in #3752, under the
reasonable assumption that shared persistable objects are only mutated
in the user thread.

Also add a ThreadedPersistableEnvelope sub-interface overriding the
default method above, to let objects which are expensive to serialise
(like DaoStateStore) be selectively serialised in the 'save-file-task-X'
thread as before, but directly synchronised with each mutating op. As
most objects are cheap to serialise, this avoids a noticeable perf drop
without having to track down every mutating method for each store.

In all cases but one, classes implementing ThreadedPersistableEnvelope
are stores like TradeStatistic2Store, with a single ConcurrentHashMap
field. These require no further serialisation, since the map entries are
immutable, so the only mutating operations are map.put(..) calls which
are already synchronised with map reads. (Even if map.values().stream()
sees updates @ different keys happen out-of-order, it should be benign.)

The remaining case is DaoStateStore, which is only ever reset or
modified via a single persist(..) call with a cloned DaoState instance
and hash chain from DaoStateSnapshotService, so there is no aliasing
risk from the various DAO state mutations done in DaoStateService and
elsewhere.

This should fix #3752.
2020-03-04 15:10:20 +08:00
.github Protect priority issues from stale bot 2020-02-18 12:35:53 +01:00
.idea
assets/src Add test for Liquid Bitcoin and improve error handling 2020-02-11 17:31:43 +01:00
cli/src/main/java/bisq/cli/app
common/src Make serialisation in FileManager::saveToFile thread-safe 2020-03-04 15:10:20 +08:00
core Make serialisation in FileManager::saveToFile thread-safe 2020-03-04 15:10:20 +08:00
daemon/src/main/java
desktop Revert "Vote Reveal - Silent Fail" 2020-02-28 16:01:03 +01:00
docs
gradle
monitor Add pricenode one-command installer script, systemd service, README (#3997) 2020-02-26 12:16:26 +01:00
p2p/src Make serialisation in FileManager::saveToFile thread-safe 2020-03-04 15:10:20 +08:00
pricenode Add pricenode one-command installer script, systemd service, README (#3997) 2020-02-26 12:16:26 +01:00
relay Revert to SNAPSHOT version 2020-02-14 13:02:52 +01:00
scripts
seednode Monitoring install scripts (#3985) 2020-02-20 16:48:56 +01:00
statsnode/src/main
.editorconfig
.gitattributes
.gitignore
.travis.yml
build.gradle Revert to SNAPSHOT version 2020-02-14 13:02:52 +01:00
CODEOWNERS Add wiz as codeowner for seednode configuration changes 2020-01-27 16:50:15 +01:00
CONTRIBUTING.md Reference critical bugs process 2020-02-21 12:17:09 +01:00
gradle.properties
gradlew
gradlew.bat
LICENSE
Makefile
pull_request_template.md
README.md
settings.gradle

Bisq

Build Status

What is Bisq?

Bisq is a safe, private and decentralized way to exchange bitcoin for national currencies and other digital assets. Bisq uses peer-to-peer networking and multi-signature escrow to facilitate trading without a third party. Bisq is non-custodial and incorporates a human arbitration system to resolve disputes.

To learn more, see the doc and video at https://bisq.network/intro.

Get started using Bisq

Follow the step-by-step instructions at https://bisq.network/get-started.

Contribute to Bisq

See CONTRIBUTING.md and the developer docs.