Commit Graph

745 Commits

Author SHA1 Message Date
Francisco Gindre 64c9df0fc0
Merge pull request #682 from Chlup/677_cantsync_after_wipe
[#677] Add support for wipe into SDK
2022-12-20 15:00:22 -03:00
Michal Fousek 6c5bf8de27 [#677] Add support for wipe into SDK
Closes #677

- Previously when keychain wanted to do wipe wallet had to do it on it's
  own. Which isn't good. Now wallet can simply call
  `synchronizer.wipe()` and it's done.
- This change brings support for wipe. `Synchronizer` has new method
  `wipe()` which takes care of everything. All the database connections
  are closed. Databases are removed. `InternalSyncProgress` is reset.

Change condition when wipe can run
2022-12-20 13:41:20 +01:00
Michal Fousek 349148cd38 [#657] Change how blocks are downloaded and processed
Closes #657

- Now SDK downloads N downloads and scan those. And repeat until sync is
  done. This safes lot of space of disk used to store downloaded blocks.
- Most changes are done in `CompactBlockProcessor.processNewBlocks`.
- `SyncRanges` structure is changed a bit.
- `SyncStatus` is changed. SDK now report that it's syncing with
  progress. It doesn't report each phase of the sync process separately.
  Also appropriate notifications were updated.

Address review comments

- Small changes
- Add tests to check computation of processing ranges for single loop
2022-12-19 09:35:09 +01:00
Francisco Gindre be3ff4299d
Merge pull request #676 from zcash/release/0.17.4-beta
[#675] release 0.17.4-beta
2022-12-15 09:09:05 -03:00
Francisco Gindre d54ea493fa [#675] release 0.17.4-beta
updates `libzcashlc` to `0.1.1` to fix an error where getting a
transparent balance on an empty database would fail.

closes #675
2022-12-14 18:12:11 -03:00
Francisco Gindre e9c93f88c2
Merge pull request #673 from zcash/fix_get_transparent_balance
[#665] Fix testShieldFunds() `get_transparent_balance` error
2022-12-14 17:48:21 -03:00
Francisco Gindre b01127bd84 [#665] Fix testShieldFunds() `get_transparent_balance` error
This commit adopts libzcashlc 0.1.1 which fixes this error

Closes #665
2022-12-13 19:12:22 -03:00
Francisco Gindre 81d24b100a
Merge pull request #670 from zcash/release/0.17.3-beta
Release/0.17.3 beta
2022-12-12 18:39:13 -03:00
Francisco Gindre 2dfd096948 Add CHANGELOG.md entry and bump cocoapods version 2022-12-12 17:44:56 -03:00
Francisco Gindre 50e63232e3 New Checkpoints + CHANGELOG.md 2022-12-12 17:39:05 -03:00
Michal Fousek 2112be8dad
Merge pull request #648 from Chlup/646_fix_resume
[#646] SDK sync process resumes correctly
2022-12-12 14:49:15 +01:00
Michal Fousek e01c83690f [#646] SDK sync process resumes correctly
- Previously we had one range for each sync which was used for each
  phase of sync process. Newly there is separate range for each phase of
  the sync process.
- I added `InternalSyncProgress` utility. This utility tracks progress
  of some phases. And it is able to compute right ranges which should be
  used for syncing.
- Some unused download code from `CompactBlockProcessor` is removed.

Fix tests

Address review comments

- Rebase to master
- Update how range for `processBatchFinished()` is computed.
- Refactor `InternalSyncProgress`
- Add tests for `InternalSyncProgress`

Address review comments

Change how latest downloaded block is tracked

- Cache DB is no longer used to track which block was downloaded as
  latest. `InternalSyncProgress` is used to do that.
- Thanks to that #660 is fixed. And cache DB can be completely removed
  after sync process.
- Added sleep(1) to some darkside tests when latest block height is set.
  Otherwise lightwalletd in darkside mode doesn't have time to setup and
  tests are flaky.

Fix TransactionEnhancementTests.testBasicEnhancement test
2022-12-12 14:27:30 +01:00
Francisco Gindre 3b7202c922
Fix `testShieldFunds()` dataset loading issue. (#659)
There's a problem withstanding:

````
▿ RustWeldingError
  ▿ genericError : 1 element
    - message : "Error while fetching transparent balances for AccountId(0): Invalid column type Null at index: 0, name: address"
````

Which is fixed by commit `d0297bff0cdaaff42ad26f3be5bc261f6c828e8f` of "https://github.com/zcash/librustzcash".

nil-coalesce thrown errors on test so it reaches the end.

Make balance calls throwing to show underlying errors but nil-coalesce in non-throwing APIs

Add missing fulfill() calls

Add changelog entry

document and handle errors on getting shielded balance before
attempting to download sapling parameters.
2022-12-12 10:00:31 -03:00
Francisco Gindre 50f0bb4e99
Merge pull request #662 from zcash/release/0.17.2
Release/0.17.2
2022-12-06 19:43:34 -03:00
Michal Fousek cc2c0ffa65 [#660] Fix the situation when any rewind causes full rescan
This is just hotfix that disables removing of cache DB.

Bump Cocoapods version to 0.17.2-beta
2022-12-06 15:12:34 -03:00
Francisco Gindre d1d3dae2c5
Merge pull request #658 from zcash/release/0.17.1
[#625] Release 0.17.1-beta
2022-12-05 17:29:15 -03:00
Francisco Gindre 1c672cad59 [#625] Release 0.17.1-beta
Closes #625

See CHANGELOG.md for details
2022-11-30 11:08:48 -03:00
Lukas Korba ce6a417154
[#585] Fix RewindRescanTests (#656)
- test fixed, the saplingActivation wasn't passed to the block processor just like to the service, there's the mismatch
2022-11-29 19:59:16 -03:00
Michal Fousek a4e5e082c1
Merge pull request #654 from Chlup/651_fix_rewind
[#651] Fix rewind when it's called during sync
2022-11-29 09:10:46 +01:00
Michal Fousek 7c07b91c5b [#651] Fix rewind when it's called during sync
- When rewind is called during sync then exception is thrown.
2022-11-29 08:33:18 +01:00
Michal Fousek a7fe75c11e
Cleanup warnings (#655)
- TestCoordinator doesn't need to be used in async manner.
2022-11-29 07:40:45 +01:00
Lukas Korba 6029a75038
[#637] Make sapling parameter download part of processing blocks (#650)
- sync process enhanced to try to download sapling params if needed
- tests fixed
- failing import Crypto -> import CryptoKit
- download params only if there are sapling funds
2022-11-29 07:38:28 +01:00
Francisco Gindre 7c9fddedf4
Add benchmarking info to SyncBlocksViewController (#649)
Fix Github action
2022-11-28 13:42:07 -03:00
Lukas Korba cc99fbad30
[#590] Fix or delete CompactBlockProcessorTests disabled tests it not needed (#653)
- The tests were fine in the end but Stream needed to be finished in any way, caused "for await" syntax to never finish
2022-11-28 15:08:55 +01:00
Lukas Korba d36c1fbc14
[#631] Verify SHA1 correctness of Sapling files after downloading (#643)
- Verification of the SHA1 after downloading the file(s)
- Private API is encapsulated in private extension
2022-11-23 09:47:56 +01:00
Michal Fousek 96a205644a
Merge pull request #642 from Chlup/sdksynchronizer_status_publisher
Change lastState property to Publisher from Subject in SDKSynchronizer
2022-11-23 09:11:36 +01:00
Francisco Gindre b350f6b220
[#639] Provide an API to estimate TextMemo length limit correctly (#640)
This provides a method for clients to handle UI for text memo
limit correctly handling memos that are visibly fit within the
capacity defined in ZIP-302 but when encoded into UTF-8 bytes
their size exceeds such limit.

Closes #639
2022-11-22 14:02:39 -03:00
Michal Fousek 1f2ea5e716 Change lastState property to Publisher from Subject in SDKSynchronizer
It's not good practice to make internal combine subjects accessible from
outside of SDK. So `lastState` is changed from `CurrentValueSubject` to
`Publisher`. This doesn't have any effect on public API. It just makes
SDK safer.
2022-11-22 14:10:27 +01:00
Michal Fousek 58b59bc9b3
Merge pull request #641 from Chlup/616_notifications_not_main_thread
[#616] Dont send notification from SDK on main thread
2022-11-22 09:59:18 +01:00
Michal Fousek 44a6970b73 [#616] Dont send notification from SDK on main thread
Closes #616

- Added small helper `NotificationSender` which is used to send
  notifications.
- No notificaiton is sent on main thread.
- Change how `status` is stored and update in `SDKSynchronizer`. It is
  now protected by lock. Before this wasn't needed because status was
  updated from main thread everywhere.
- `SyncBlocksViewController` in the sample app now uses
  `SDKSynchronizer` instead of `CompactBlockProcessor` directly.
2022-11-21 16:33:42 +01:00
Francisco Gindre bfaa20e384
[#597] Bump up SQLite Swift to 0.14.1 (#638)
Closes #597
2022-11-21 08:56:04 -03:00
Francisco Gindre 667bda24a7
Merge pull request #618 from Chlup/488_delete_cache
[#488] Delete cache db when sync ends
2022-11-17 08:24:53 -03:00
Francisco Gindre d9b85b40ad
Merge pull request #635 from zcash/release/0.17.0-beta
[#420] release 0.17.0-beta
2022-11-17 08:21:29 -03:00
Francisco Gindre d15cd5e33c [#420] release 0.17.0-beta
Closes #420
    Closes #634
2022-11-16 20:44:10 -03:00
Francisco Gindre 725e5ff291 [#634] Set ZIP-317 flag on sending and shielding as false for 0.17.0
Closes #634

    This turns off ZIP-317 fee strategy in favor of ZIP-313 fixed fees
    until this can be tested thoroughly
2022-11-16 20:27:12 -03:00
Francisco Gindre 07d918bd0d Add checkpoints update to CHANGELOG.md 2022-11-15 09:39:34 -03:00
Francisco Gindre caccafe190 change podspec version to 0.17.0-beta 2022-11-15 09:37:07 -03:00
Francisco Gindre a85787ff59 Add Checkpoints for Testnet and Mainnet 2022-11-15 09:31:34 -03:00
Michal Fousek 4e5cb505fa [#488] Delete cache db when sync ends
Closes #488

- When sync process is finished cache DB is removed from disk.
- Latest downloaded block is preserved becuase it's required to computes
  in which phase to resume sync process.
- `SDKSynchronizer.latestDownloadedHeight` public API is removed
  it makes no longer sense. This API was reading from cache DB.
2022-11-15 10:31:59 +01:00
Francisco Gindre f872cd9444
Merge pull request #624 from zcash/621_add_state_property
[#621] Adds a synchronizer state subject with the last available
2022-11-14 15:33:44 -03:00
Francisco Gindre 6208beec5c [#621] Adds a synchronizer state subject with the last available
state for this synchronizer.

also reports the SychronizerState on synchonizerStarted notification.

Add tests that verify the state being reported properly

Fix `BlockBatchValidationTests`
2022-11-14 14:44:33 -03:00
Francisco Gindre 4e07a2093f
Merge pull request #615 from zcash/prepare_sync
[#614] make prepare(with:) and get{pool_type}Address() synchronous
2022-11-11 14:08:21 -03:00
Francisco Gindre b9e00055e9 [#614] make prepare(with:) and get{pool_type}Address() synchronous
Closes #614

fixes travis ci

Removed `setStartHeight` function

I’m going back in time and this setHeight is not something we are using anywhere else than in the prepare function. This comes from the times we had `initialize(seed:birthday) and we don’t have that anymore

See diff 246d10edaa (diff-414771774e10bc81260094ffcdc7b310a3be48758b2abd2bfae831c83912c02c)

The `func setStartHeight(_ startHeight: BlockHeight)` function assumes that
there might not be a wallet birthday set up or that it might be changed
in-flight which are things that are no longer happening.

remove test warning

Fix test compiler error
2022-11-11 14:07:45 -03:00
Michal Fousek 6407820f77
Merge pull request #622 from Chlup/619_fix_incorrect_resume
[#619] Correctly resume syncing process in scanning phase
2022-11-11 15:11:50 +01:00
Michal Fousek 5e723566ba [#619] Correctly resume syncing process in scanning phase
Closes #619

- When computing next action in `NextStateHelper.nextStateAsync` now
  scanning state is also taken into consideration.
- When processing blocks download phase is skipped when it's detected
  that everything is already downloaded.
2022-11-11 14:54:44 +01:00
Francisco Gindre eb9696b186
Merge pull request #499 from zcash/feature/zip-316-and-latest-upstream
Implement ZIP 316 (Unified Addresses) and update to the latest librustzcash.
2022-11-09 14:44:21 -03:00
Francisco Gindre 3efe956c08 Update CHANGELOG.md to summarize changes on 0.17.0-beta 2022-11-08 14:06:39 -03:00
Francisco Gindre 99835bfba7 Add additional notes on structured concurrency 2022-11-08 13:51:40 -03:00
Francisco Gindre 8f83a558e4
Merge pull request #611 from zcash/release/0.17.0-beta.rc1
Release/0.17.0 beta.rc1
2022-11-07 16:40:37 -03:00
Francisco Gindre 9607f0cefa - [#610] Release 0.17.0-beta.rc1 2022-11-07 14:21:22 -03:00