Commit Graph

57 Commits

Author SHA1 Message Date
Kris Nuttycombe 0cf08c6a59 Update to zcash-light-client-ffi version 0.8.0. 2024-04-17 17:21:37 -06:00
Jack Grigg 006861595d Fetch and store Orchard subtree roots 2024-03-28 10:52:17 -04:00
Lukas Korba eb2ebeaf97 [#1404] Release 2.1.2
- fix for a bug in note selection when sending to a transparent recipient
2024-03-27 23:18:57 +01:00
Lukas Korba e3cb722db8 [#1402] Release 2.1.1
- FFI bump

[#1402] Release 2.1.1

- changelog updated
2024-03-27 16:47:24 +01:00
Jack Grigg 43534d26d9 Integrate Orchard support and latest Rust updates 2024-03-25 23:19:44 -04:00
Jack Grigg a5a0ef0ac1 Migrate to latest in-progress revision of Rust crates
- New backend method `ZcashRustBackend.isSeedRelevantToWallet`
- `ZcashRustBackend.scanBlocks` now takes a `fromState` argument.

Co-authored-by: Lukas Korba <lukas.korba@seznam.cz>
2024-03-15 16:01:39 +00:00
Jack Grigg 86defc8b4a Remove `AccountRepository`
This removes the last direct access to the `accounts` table; all access
now goes through the Rust FFI.
2024-03-15 15:26:44 +00:00
Jack Grigg 23fd0698d4 Migrate to FFI 0.6.0 release 2024-03-08 00:26:02 +00:00
Jack Grigg e9177a28f7 Migrate to in-progress version of FFI backend 0.6.0
Includes:
- Multi-step transaction proposals.
- Changes to support `Synchronizer.proposeShielding` API changes.
2024-03-06 03:06:57 +00:00
Kris Nuttycombe 20c4e2f8b0 Release version 2.0.8 2024-01-30 18:03:52 -08:00
Kris Nuttycombe 59cf3570dd Update to zcash-light-client-ffi version 0.5.0 2024-01-30 08:44:47 -08:00
Jack Grigg ded20fe7b0 Migrate to in-progress version of FFI backend 0.5.0
Includes:
- Exposed `WalletSummary`.
- Exposed transaction proposals.
- `ScanSummary` returned from `ZcashRustBackend.scanBlocks`.

Closes Electric-Coin-Company/zcash-swift-wallet-sdk#1259.
Closes Electric-Coin-Company/zcash-swift-wallet-sdk#1299.
2024-01-29 09:47:14 -08:00
Lukas Korba fb7eb1978d [#1310] Release 2-0-3
- checkpoints updated

[#1310] Release 2-0-3

- FFI version bumped
- other dependencies bumped as well

[#1310] Release 2-0-3

- checkpoints mentioned in the changelog
2023-10-20 12:46:15 +02:00
Kris Nuttycombe 71a6f580fc Update `zcash-light-client-ffi` for 2.0.0 final release. 2023-09-25 15:55:49 -06:00
Kris Nuttycombe d8b069fd15 Update librustzcash to fix transparent balance issues. 2023-09-22 18:18:10 -06:00
Kris Nuttycombe 404eff21b1 Update to zcash-light-client-ffi version 0.4.0-rc.3 2023-09-19 15:43:52 -06:00
Kris Nuttycombe 4b754c5378 Update zcash-light-client-ffi package revision. 2023-09-19 12:09:28 -06:00
Kris Nuttycombe 2c526dbcd6 Update `zcash-light-client-ffi` to adopt fix for missing transparent history.
Fixes #1271

Co-Authored-By: Jack Grigg <jack@electriccoin.co>
Co-Authored-By: Lukas Korba <lukas.korba@seznam.cz>
2023-09-19 08:26:03 -06:00
Kris Nuttycombe 2ac984a0dd Update zcash-light-client-ffi to version 0.4.0-rc.2 2023-09-12 10:06:25 -06:00
Kris Nuttycombe 457cc9a9e7 Update zcash-light-client-ffi to fix an error with checkpoint depths.
See [zcash/librustzcash#963]
2023-09-11 19:16:17 -06:00
Kris Nuttycombe e28035292f Release 2.0.0-rc1
* Updates to `zcash-light-client-ffi 0.4.0-rc.1`
* Makes some cleanup updates to the CHANGELOG; a complete changelog will
  be prepared for the 2.0.0 final release.
2023-09-11 19:10:55 -06:00
Kris Nuttycombe 6c3dd362b6 Update Rust dependencies with bugfixes.
The previous `zcash-light-client-ffi` revisions should be treated as
ephemeral; they will be removed upon creation of the SDK 2.0.0 release
candidate.
2023-09-07 23:16:26 -06:00
Jack Grigg 01436c9a93 Update Rust dependencies with bugfixes
The previous FFI repo revisions no longer exist; commits between
87faf91096 and here will not build.
2023-09-07 19:54:12 +01:00
Lukas Korba 7e2e787aef [#1223] Requested height [over latestheight] does not exist in the block cache
- the end of scan range is now properly filled

[#1223] Requested height [over latestheight] does not exist in the block cache

- the end of scan range is now properly filled
- unit tests for this change, checking if range.upperBound is set as expected

[#1223] Requested height [over latestheight] does not exist in the block cache

- code cleanup
2023-09-07 13:23:50 +02:00
Lukas Korba 95536638e5 [#1176] Cover Spend before Sync with tests
- WIP

[#1176] Cover Spend before Sync with tests

- next batch of updates

[#1176] Cover Spend before Sync with tests

- last batch of fixes and new tests

[#1176] Cover Spend before Sync with tests

- package.resolved updated

[#1176] Cover Spend before Sync with tests (#1212)

- added tests for brand new actions related Spend before Sync
- RewindActionTests
- UpdateChainTipActionTests
- UpdateSubtreeRootsActionTests
- ProcessSuggestedScanRangesActionTests
2023-09-07 13:23:50 +02:00
Jack Grigg e7621204e5 Update Rust dependencies with account birthdays and scan progress
The previous FFI repo revisions no longer exist; commits between
87faf91096 and here will not build.

Update Rust dependencies with account birthdays and scan progress

- fixes for SampleApp
2023-09-07 09:26:48 +02:00
Kris Nuttycombe 8f2962f060 Update the `zcash-light-client-ffi` dependency version. 2023-08-28 10:08:12 -06:00
Jack Grigg bc052872fd Update Rust dependencies with scanning and spending bugfixes
The previous FFI repo revisions no longer exist; commits between
87faf91096 and here will not build.
2023-08-17 21:47:27 -07:00
Jack Grigg cddf6891fd Update Rust dependencies with checkpoint and memo bugfixes
The previous FFI repo revisions no longer exist; commits between
87faf91096 and here will not build.
2023-08-08 12:30:28 +01:00
Jack Grigg ea3281edde Update Rust dependencies with bugfixes
The previous FFI repo revision no longer exists; commits between
87faf91096 and here will not build.
2023-07-31 09:56:40 +02:00
Lukas Korba 5e8985d24e [#1162] Remove duplicated SubtreeRoot
- SubtreeRoot placeholder removed, we can rely on the generated one from the gprc
2023-07-21 13:52:58 +02:00
Francisco Gindre f33280c8c4
[#1108] Instrument rust backend tracing (#1109)
* [#1108] Instrument rust backend tracing

This adds a parameter to the `Initializer` constructor that allows
developers to turn on performance trancing tooling on the Rust
backend. It can't be disabled on the fly. It's either OFF or ON
all the life-span for the Synchronizer.

Closes #1108

Update ffi framework commit hash

* update resolved filed
2023-05-23 13:31:30 -03:00
Matthew Watt 58b99c8fb1
[#1013] - Enable more granular control over logging behavior (#1014)
* Add new model for logging configuration

* Fix the example app and update the changelog
2023-05-02 16:59:49 -03:00
Michal Fousek 08d9d3986e Upgrade SPM packages in the SDK sample app 2023-04-20 15:21:09 +02:00
Francisco Gindre 802aaa437d
[#959] Fix `v_transactions` view issues with value (#963)
This change switches to a new (future) version of the rust crates
that will get rid of the sent and received transactions Views in
favor of a `v_transaction` view that will do better accounting of
outgoing and incoming funds. Additionally it will support an
outputs view for seeing the inner details of transactions enabling
the SDKs tell the users the precise movement of value that a tx
causes in its multiple possible ways according to the protocol.

the `v_tx_outputs` view is not yet implemented.

Sent and Received transaction sub-types are kept for compatibility
purposes but they are generated from Overviews instead of queried
from a specific view.

In the transaction Overview the value represents the whole value
transfer for the transaction from the point of view of a given
account including fees. This means that the value for a single
transaction Overview struct represents the addition or subtraction
of ZEC value to the account's balance.

Future updates will give clients the possibility to drill into the
inner workings of those value changes in a per-output basis for
each transaction.

Also, the field `pending_unmined` field was added to `v_transactions`
so that wallets can query `DataDb` for pending but yet unmined txs

This will prepare the field for removing the notion of a "PendingDb"
and its nuances.

Also updated test database `darkside_data.db`

Closes #959

Closes #971 ZcashLightClientKitSample main target broken swiftlint script

Demo App improvements: Show Short date and value on transaction list
2023-04-18 09:10:56 -03:00
Michal Fousek be8afabec4 [#770] Update GRPC swift library
Closes #770
2023-02-09 19:55:46 +01:00
Michal Fousek 1a03fa6f7c [#743] Refactor blocks validation in CompactBlockProcessor
Closes #743

- Added new protocol `BlockValidator` and `BlockValidatorImpl` class. All the code related to blocks validation is extracted to `BlockValidatorImpl`.
- Fixed `testSingleDownloadAndScan()` test.
- Changed how validation error are handled. Previously validation error were handled directly next to validation code. And when some validation
errors happened method from `CompactBlockProcessor` were called. Now validation errors are handled in `CompactBlockProcessor.processNewBlocks`
in a same way as any other error that can occur during sync process.
2023-02-03 09:58:36 +01:00
Francisco Gindre fad3aae174
- [#679] Implementation of the File-system based block cache (#679)
Closes https://github.com/zcash/ZcashLightClientKit/issues/697
Closes https://github.com/zcash/ZcashLightClientKit/issues/720
Closes https://github.com/zcash/ZcashLightClientKit/issues/587
Closes https://github.com/zcash/ZcashLightClientKit/issues/667
Closes https://github.com/zcash/ZcashLightClientKit/issues/443
Closes https://github.com/zcash/ZcashLightClientKit/issues/754

- [#790] Fix ShieldFundsTests

Closes #790
Removes comments on `ShieldFundsTests` since those issues have been fixed

Depends on zcash-light-client-ffi changes that adopt newer versions of
 librustzcash crates `zcash_primitives 0.10`, `zcash_client_backend 0.7`,
`zcash_proofs 0.10`, `zcash_client_sqlite 0.5.0`.

Also allows wallets to define a shielding_threshold and will set
foundations to customize minimum confirmations for balances, spends
and shielding operations.

**Test Bootstrapping**

- `ZcashCompactBlockDescriptor`: struct that holds functions to
describe blocks as filenames and compare those filenames

`ZcashCompactBlockDescriptor.live` has the actual implementation
but it can be replaced by mocks if needed on Tests

main implementations are held under `FSCompactBlockRepository.filenameDescription` and `FSCompactBlockRepository.filenameComparison` on a separate extention

`DirectoryListingProviders` provide two default implementations of listing a
directory deterministically. `FileManager` does not define a sorting and needs to be done in-memory by calling `.sorted()` on the resulting collection. If this
is a big toll on performance it can be changed to a POSIX implementation but
this is good for now.

`ZcashCompactBlockDescriptor` adds a `height` helper function to
turn a filename into the height of the block stored.

Implemented `func latestHeight() throws -> BlockHeight ` that
returns the blockheight by querying the cache directory in a sorted
fashion and getting the last value and turning the filename into a
`BlockHeight`

Added `Meta` struct to ZcashCompactBlock.

Tests implemented:
- `filterBlockFiles`
- `testClearTheCache`
- `testLatestHeightEmptyCacheThrows`
- `testLatestHeightEmptyCacheThrowsAsync`
- `testRewindEmptyCacheDoesNothing`
- `testRewindEmptyCacheDoesNothingAsync`
- `testWhenBlockIsStoredItFollowsTheDescribedFormat`
- `testWhenBlockIsStoredItFollowsTheFilenameConvention`
- `testGetLatestHeight`
- `testRewindDeletesTheRightBlocks` test
- `testPerformanceExample` test. This isn't a real performance test because the API doesn't work with async/await yet

adopts `shield_funds` shielding threshold parameter

Implements `initBlockMetadataDb` and fix tests
Renames dbCache parameter to `fsBlockDbRoot`. Builds but tests don't pass.
Removes cacheDb uses from code. Testing utilities still persist.
Added needed information in  MIGRATING and CHANGELOG.
Added helper to perform deletion of legacy db and creation a the
new file system backed cache.

Renames parameters and changes code where needed.
Network Constants turned into `enum` with static methods.
DeletelastDownloadedBlock helper from initializer
Removes CompactBlockStorage and CompactBlockEntity.
Implements `latestCachedBlockHeight` on rustbackend.

*Replaces dependencies on ZcashRustWelding with `FSMetadataStore`*

This allows the tests to not depend in a particular implementation
of either the MockRustBackend of or ZcashRustBackend. Also provides
a way to test errors properly and switch implementations of critical
areas like `writeBlocks`.
2023-02-02 13:58:12 -03:00
Michal Fousek bb57d5d9fe [#728] Remove Swiftilint SPM package plugin
Closes #728
2023-01-20 09:24:50 +01:00
Lukas Korba 372ea5af70
[#711] Add Swiftlint plug in to SDK (#722)
- plugin integrated
- errors resolved
- warnings resolved
- package.swift macos platform version 10_15 -> 12
2023-01-18 17:09:04 +01:00
Lukas Korba 3c3b97ca42
[#663] Create a benchmarking section on the Demo App that can be automated (#681)
- SDKMetrics singleton for the measurement
- download, validate and scan blocks supported
- Sample app refactored to use SDKMetrics, connected to appropriate notifications and labels
- enhancement metric added
- total sync time metric added
- sample app extended to show summary time and operations summaries
- unit tests for the SDKMetrics
- doc for the SDKMetrics and our approach for the performance testing in general
- changelog update
2022-12-21 13:30:05 +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
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 bb015008cf 0.17.0-alpha.4 2022-11-04 15:28:13 -03:00
Michal Fousek d3291a6664 Fix Package.resolved file for Sample SDK app 2022-11-03 17:12:09 +01:00
Francisco Gindre dbd4b8934c Merge branch 'master' into merge-master 2022-10-31 09:34:38 -03:00
Francisco Gindre 245f2324b5 [#597] SDK does not build with SQLite 0.14 2022-10-28 14:20:52 -03:00
Francisco Gindre b5d659e8a8 Fix various tests and deleted some that are not useful anymore
Closes #588
Closes #584
Closes #589
Closes #591
2022-10-27 20:09:08 -03:00
Francisco Gindre 1d97ad920b [#581] getTransparentBalanceForAccount error not handled 2022-10-26 20:26:37 -03:00
Michal Fousek d4dc571f27 Fix compilation 2022-10-04 17:32:32 +02:00