Commit Graph

1236 Commits

Author SHA1 Message Date
Jack Grigg cd6a8777e0 Migrate to latest RC of Rust crates 2023-09-22 18:05:52 -06:00
Honza bac5900f9e [#1261] SDK Release v2.0.0-rc.3
Closes #1261.
2023-09-21 08:20:56 -06:00
Honza Rychnovský c8e5a7e125
[#1249] Continuity error rewind
* [#1249] Continuity error rewind

- Fixed the Rust FFI bug that caused us to be unable to catch the Continuity error
- Improved logging
- Moved handling the Continuity error to the outer synchronization loop, which works better with synchronization mutex
- Closes #1249

* Resolve minor comments from older PR #1247
2023-09-21 16:11:02 +02:00
dependabot[bot] 48cace8f78
Bump actions/setup-java from 3.12.0 to 3.13.0 in /.github/actions/setup (#1259)
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 3.12.0 to 3.13.0.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](cd89f46ac9...0ab4596768)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-21 14:14:51 +02:00
Honza ea78f810dc [#1257] SDK Release v2.0.0-rc.2 2023-09-20 13:59:44 -06:00
Honza f56146fa05 [#1255] Checkpoints update 2023-09-20 12:59:42 -06:00
Kris Nuttycombe 30c84a71ea Merge branch 'rust-fix-table-views' 2023-09-20 12:05:41 -06:00
Kris Nuttycombe bcba2a9d51 Update to librustzcash patch with SQLite 3.19 support for Android API 27 2023-09-20 10:44:33 -06:00
Honza 9045acdce9 Changelog: BlockHeight 2023-09-20 08:56:29 -06:00
Honza 38ee6a80e9 Link fetchTransaction pass txId twice TODO 2023-09-20 08:56:29 -06:00
Honza 83c69fdd9f FirstClassByteArray toString formatting 2023-09-20 15:51:37 +02:00
Honza f5c0c442c4 Changelog 2023-09-20 15:51:06 +02:00
Honza 6a7175cafb Link transaction state TODO 2023-09-20 15:17:48 +02:00
Honza 55222aad50 Poll UTXOs regularly 2023-09-20 14:10:11 +02:00
Jack Grigg 5e40ff6920 Fix bugs in `TransactionOverview.transactionState` initialization
- Off-by-one in determining whether a transaction is confirmed.
- Expiry logic was inverted for non-zero expiry heights.
  - Transactions with zero (disabled) expiry heights happened to work
    because this case is currently detected in the database logic and
    mapped to `null`, which the old code mapped to `Long.MAX_VALUE`
    which gave the correct result for the old conditional expression.
2023-09-19 23:22:47 +01:00
Jack Grigg 89eb42e473 Fix `BlockHeight` difference type
Block heights are absolute, not relative. Adding heights does not make
sense, and the difference between two heights is an integer.
2023-09-19 23:22:47 +01:00
Jack Grigg 905fb1e1a8 Improve debug printing of `FirstClassByteArray` 2023-09-19 22:59:31 +01:00
Jack Grigg 233acebc2f Migrate to Rust revision with fixes to table views
With the fixes to `v_transactions` and `v_tx_outputs`, there are
several more data fields that may have no data (for rows corresponding
to purely-transparent transactions); their fields are made nullable.
2023-09-19 22:59:31 +01:00
Honza Rychnovský c0c4506664
[#1241][#1243][#1222] Rewinding when ContinuityError
* [#1241] Remove rewind for every verify scan range

- The original solution comes from the pseudocode requirement: Download the blocks in `scan_range` into the block source, overwriting any existing blocks in this range.
- Removed

* [#1243] Rewind only after continuity-error

- Rewind is done only when Continuity-error appears now. In case of other sync failures, the sync loop sleeps for a short time and then retries. Internal actions like fetching subtree roots, fetching chain tip, downloading, scanning, etc., still have their internal retry mechanisms.
- For the calculation of the rewind height, we use the existing checkContinuityErrorResult method, originally used only for validation use cases but later incorrectly used for other failures too.
- Closes #1243
- Closes #1222 as it was created to determine which failure type comes and don’t rewind for all of them
- Tested manually in several scenarios, e.g. lost internet connection or app going to background

* Handle Continuity and other sync errors

- Call handleContinutyError and its rewind logic directly without checking failed attempts. This ensures that we keep trying to reorg.
- And return the correct type of error in that case.
- Add fail logic to the handling of the other types of errors.
2023-09-19 15:47:56 +02:00
Honza Rychnovský 9869fd4300
[#1239] Post-v2.0.0-rc1 cleanup
* Add JniScanProgressTest

* Remove unnecessary testnet workaround

As this was fixed with the last rust changes.

* Simplify batchCount calculating

* Fix ratio typo

* Docummentation comments changes
2023-09-18 16:51:26 +02:00
Honza Rychnovský 62fc5d7cfa
[#1242] ScanRange fails when no matching priority (#1246)
Tests added
2023-09-18 08:15:18 -06:00
Kris Nuttycombe 57f3b7ada6 Extend the timeout for upload to Maven repositories to 10 minutes
Also extend the setup timeout by 10 minutes.
2023-09-13 08:57:55 -06:00
Kris Nuttycombe 4d99ad10ac Merge branch 'fast-spendability' 2023-09-12 16:20:44 -06:00
Kris Nuttycombe 82757353f6 Update version & changelog for 2.0.0-rc.1 release.
Fixes #1237
2023-09-12 13:08:34 -06:00
Kris Nuttycombe 5037102faf Update to zcash_client_sqlite-0.8.0-rc.3 2023-09-12 12:38:39 -06:00
Honza Rychnovský 9b18fe12d9
Add encode_scan_progress documentation
Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-09-12 19:36:39 +02:00
Honza Rychnovský 96aeec2e9d
Add throws documentation
Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-09-12 19:29:39 +02:00
Honza 11b031a6af Exit execution when retry limit reached 2023-09-12 19:27:20 +02:00
Jack Grigg d775421f5a rust: Migrate to `zcash_client_backend 0.10.0-rc.2` etc 2023-09-12 15:24:45 +00:00
Jack Grigg d162cdf35f rust: Migrate to `hdwallet 0.4` to de-duplicate dependencies 2023-09-12 15:15:58 +00:00
Jack Grigg 01e9b058cb rust: Handle zero-conf transparent funds the same way as iOS 2023-09-12 15:15:58 +00:00
Honza 39ba2b48b0 Fix ktlint warning 2023-09-11 20:22:41 +02:00
Honza c7125f4183 Update createAccountAndGetSpendingKey API
- TypesafeBackend.createAccountAndGetSpendingKey now works with a type-safe TreeState model class instead of ByteArray.
- New type-safe TreeState added. Once we get the TreeState object from the lightwalletd server, potential validation comes into this object.
2023-09-11 19:11:03 +02:00
Honza 916f9e957b Update PersistableWallet API
These required changes came from the latest SDK acceptance testing with Zashi wallet.
2023-09-11 13:37:12 +02:00
Honza Rychnovský a082fe9034
[#1231] GetConsensusBranchId works with chain tip (#1232)
* [#1231] GetConsensusBranchId works with chain tip

Closes #1231
2023-09-11 09:11:01 +02:00
Honza Rychnovský 4c38354f01
Update Changelog
Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-09-10 11:50:59 +02:00
Honza Rychnovský c9d3085001
Update Changelog
Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-09-10 11:47:46 +02:00
Honza Rychnovský fe7edf3ec5
Fix Changelog typos
Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-09-10 11:45:53 +02:00
Honza 4c8c32587b Add note on scan continuity error texts 2023-09-10 10:31:56 +02:00
Honza a8813277f7 retryUpToAndContinue exception wrapper trigger fix 2023-09-10 10:19:08 +02:00
Honza 95da0f25ab BlockHeight subtraction fix 2023-09-09 19:56:56 +02:00
Honza 5e85c39b78 Silent rust compile error
mismatched types: expected `&u64`, found integer
2023-09-09 19:32:35 +02:00
Honza 1b6039c368 Reverting denominator constraint back
The Rust layer now filters out the zero denominator but keeping the ScanProgress new safe ratio function with its test.
2023-09-09 19:11:58 +02:00
Honza ffc1c99738 JniScanRange height parameters constraint 2023-09-09 19:11:58 +02:00
Honza 79ba05f23b Change denominator requirement
- Added safe progress ratio calculating function
- Added test
2023-09-09 19:11:58 +02:00
Honza a43c5f130e Change createAccountAndGetSpendingKey API
The checkpoint parameter changed for treeState: ByteArray
2023-09-09 19:11:58 +02:00
Honza Rychnovský d3d54d7f15
Filter out zero denominator in Rust layer
Co-authored-by: Kris Nuttycombe <kris@electriccoin.co>
2023-09-09 19:07:52 +02:00
Jack Grigg 9284e60e2a rust: dlopen2 0.6 2023-09-08 21:49:01 +01:00
Jack Grigg ab6a831f50 Migrate to release candidates of Rust crates 2023-09-08 21:49:01 +01:00
Jack Grigg 1ef0304f92 rust: cargo update 2023-09-08 21:49:01 +01:00