mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
A decentralized bitcoin exchange network
6487f92d84
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. |
||
---|---|---|
.github | ||
.idea | ||
assets/src | ||
cli/src/main/java/bisq/cli/app | ||
common/src | ||
core | ||
daemon/src/main/java | ||
desktop | ||
docs | ||
gradle | ||
monitor | ||
p2p/src | ||
pricenode | ||
relay | ||
scripts | ||
seednode | ||
statsnode/src/main | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.travis.yml | ||
build.gradle | ||
CODEOWNERS | ||
CONTRIBUTING.md | ||
gradle.properties | ||
gradlew | ||
gradlew.bat | ||
LICENSE | ||
Makefile | ||
pull_request_template.md | ||
README.md | ||
settings.gradle |
Bisq
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.