Skip to content

Commit 12abdc2

Browse files
authored
feat: rewrite, fix and improve the sync architecture (#411)
Modular, parallel, manager-based sync architecture. Each sync concern (`BlockHeadersManager`, `FilterHeadersManager`, `FiltersManager`, `BlocksManager`, `MasternodesManager`, `ChainLockManager`, `InstantSendManager`) has its own manager implementing a common `SyncManager` trait while the `SyncCoordinator` orchestrates them and coordinates the communication between them through a `SyncEvent` system. Progress reporting is streamlined with each manager reporting its own progress through a unified SyncProgress system which updates the subscribers for every change in progress. Event handling follows the same pattern, with a consistent event model across sync, wallet, and network layers. The FFI can now subscribe to all events from sync progress, wallet, and network. Filter sync got a lot of fixes and now processes filters and blocks in ordered batches. When gap limit maintenance generates new addresses a rescan is triggered automatically to pick up any transactions that match the new addresses. Post sync is working stable now too, i was constantly running this branch in the last couple weeks monitoring things and didnt run into any more issues by now.
1 parent edb18bb commit 12abdc2

File tree

96 files changed

+15284
-3496
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+15284
-3496
lines changed

dash-spv-ffi/FFI_API.md

Lines changed: 284 additions & 19 deletions
Large diffs are not rendered by default.

dash-spv-ffi/dash_spv_ffi.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ int32_t dash_spv_ffi_client_update_config(struct FFIDashSpvClient *client,
336336
* 0 on success, error code on failure
337337
*/
338338

339-
int32_t dash_spv_ffi_client_sync_to_tip(struct FFIDashSpvClient *client,
339+
int32_t dash_spv_ffi_client_start_sync(struct FFIDashSpvClient *client,
340340
void (*completion_callback)(bool, const char*, void*),
341341
void *user_data)
342342
;
@@ -382,7 +382,7 @@ int32_t dash_spv_ffi_client_sync_to_tip(struct FFIDashSpvClient *client,
382382
* 0 on success, error code on failure
383383
*/
384384

385-
int32_t dash_spv_ffi_client_sync_to_tip_with_progress(struct FFIDashSpvClient *client,
385+
int32_t dash_spv_ffi_client_start_sync_with_progress(struct FFIDashSpvClient *client,
386386
void (*progress_callback)(const struct FFIDetailedSyncProgress*,
387387
void*),
388388
void (*completion_callback)(bool,

0 commit comments

Comments
 (0)