[bisq-network/bisq] Persist changes to ProtectedStoragePayload objects implementing PersistablePayload (#3640)

Julian Knutsen notifications at github.com
Wed Nov 20 02:58:58 UTC 2019


New commits start at 0d0fe73

With the addition of `ProtectedStorageEntrys`, there are now persistable
maps that have different payloads and the same keys. In the
`ProtectedDataStoreService` case, the value is the `ProtectedStorageEntry`
which has a `createdTimeStamp`, `sequenceNumber`, and `signature` that can
all change, but still contain an identical payload.

Previously, the service was only updating the on-disk representation on
the first object and never again. So, when it was recreated from disk it
would not have any of the updated metadata. This was just copied from the
append-only implementation where the value was the Payload
which was immutable.

This hasn't caused any issues to this point, but it causes strange behavior
such as always receiving seqNr==1 items from seednodes on startup. It
is good practice to keep the in-memory objects and on-disk objects in
sync and removes an unexpected failure in future dev work that expects
the same behavior as the append-only on-disk objects.
You can view, comment on, or merge this pull request online at:

  https://github.com/bisq-network/bisq/pull/3640

-- Commit Summary --

  * [PR COMMENTS] Make maxSequenceNumberBeforePurge final
  * [TESTS] Clean up 'Analyze Code' warnings
  * [REFACTOR] HashMapListener::onAdded/onRemoved
  * [REFACTOR] removeFromMapAndDataStore can operate on Collections
  * Change removeFromMapAndDataStore to signal listeners at the end in a batch
  * Update removeExpiredEntries to remove all items in a batch
  * ProposalService::onProtectedDataRemoved signals listeners once on batch removes
  * Remove HashmapChangedListener::onBatch operations
  * [TESTS] Regression test for #3629
  * [BUGFIX] Reconstruct HashMap using 32-byte key
  * [BUGFIX] Use 32-byte key in requestData path
  * [DEAD CODE] Remove getProtectedDataStoreMap
  * [TESTS] Allow tests to validate SequenceNumberMap write separately
  * Implement remove-before-add message sequence behavior
  * [TESTS] Introduce MapStoreServiceFake
  * Persist changes to ProtectedStorageEntrys
  * [DEADCODE] Remove protectedDataStoreListener
  * [DEADCODE] Remove unused methods in ProtectedDataStoreService

-- File Changes --

    M core/src/main/java/bisq/core/alert/AlertManager.java (32)
    M core/src/main/java/bisq/core/dao/governance/proposal/ProposalListPresentation.java (49)
    M core/src/main/java/bisq/core/dao/governance/proposal/ProposalService.java (65)
    M core/src/main/java/bisq/core/filter/FilterManager.java (31)
    M core/src/main/java/bisq/core/offer/OfferBookService.java (37)
    M core/src/main/java/bisq/core/support/dispute/agent/DisputeAgentManager.java (23)
    A core/src/test/java/bisq/core/dao/governance/proposal/ProposalServiceP2PDataStorageListenerTest.java (127)
    M p2p/src/main/java/bisq/network/p2p/P2PModule.java (1)
    M p2p/src/main/java/bisq/network/p2p/P2PService.java (13)
    M p2p/src/main/java/bisq/network/p2p/peers/getdata/RequestDataHandler.java (2)
    M p2p/src/main/java/bisq/network/p2p/storage/HashMapChangedListener.java (14)
    M p2p/src/main/java/bisq/network/p2p/storage/P2PDataStorage.java (133)
    M p2p/src/main/java/bisq/network/p2p/storage/persistence/MapStoreService.java (5)
    D p2p/src/main/java/bisq/network/p2p/storage/persistence/ProtectedDataStoreListener.java (26)
    M p2p/src/main/java/bisq/network/p2p/storage/persistence/ProtectedDataStoreService.java (16)
    M p2p/src/test/java/bisq/network/p2p/storage/P2PDataStoragePersistableNetworkPayloadTest.java (1)
    M p2p/src/test/java/bisq/network/p2p/storage/P2PDataStorageProtectedStorageEntryTest.java (59)
    M p2p/src/test/java/bisq/network/p2p/storage/P2PDataStorageRemoveExpiredTest.java (14)
    M p2p/src/test/java/bisq/network/p2p/storage/P2PDataStoreDisconnectTest.java (5)
    M p2p/src/test/java/bisq/network/p2p/storage/TestState.java (197)
    R p2p/src/test/java/bisq/network/p2p/storage/mocks/MapStoreServiceFake.java (43)
    M p2p/src/test/java/bisq/network/p2p/storage/mocks/ProtectedStoragePayloadStub.java (2)

-- Patch Links --

https://github.com/bisq-network/bisq/pull/3640.patch
https://github.com/bisq-network/bisq/pull/3640.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/3640
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20191119/e01d8e07/attachment-0001.html>


More information about the bisq-github mailing list