Commit Graph

26 Commits

Author SHA1 Message Date
Carter Jernigan bc19797125
[#971] Refactor Rust FFI to separate module
---------

Co-authored-by: Honza <rychnovsky.honza@gmail.com>
2023-05-18 07:36:15 -04:00
Carter Jernigan 953042e982
[#239] Remove pending transaction database 2023-05-05 17:46:07 -04:00
Carter Jernigan fef809c015 [#978] Eliminate sent/received transaction APIs 2023-04-17 08:24:41 -04:00
Carter Jernigan 0930b6a32d Update version to 1.15.0 2023-04-11 07:42:31 -04:00
Francisco Gindre c7914d9584
[#904] Fetch all UXTOs per account
Co-authored-by: Honza <rychnovsky.honza@gmail.com>
Co-authored-by: Kris Nuttycombe <kris@electriccoin.co>
2023-03-09 17:07:59 -05:00
Alex 9ee5a4e568
[#765] Store blocks on disk instead of in SQLite
* Switch to FsBlockDb for caching CompactBlocks

* Add RustBackend.getLatestHeight() method

* Raise MSRV to 1.60

* Migrate to latest Rust crate API

* Add RustBackend.findBlockMetadata() method

* Add RustBackend.rewindBlockMetadataToHeight() method

* [#765] implementation of FileCompactBlockRepository

* writing block metadata to database

* split write function into smaller easier to test blocks

* testing for FileCompactBlockRepository

* fixed rewinding

* fixed tests

* fixed FileCompactBlockRepositoryTest and SynchronizerFactoryTest

* code review fixes

* updated proto files

* override all functions in FakeRustBackend

* code review fixes

* Fix function body formatting

* Improve clear function clarity

* Use length of string const

* Delete single file instead of directory

* Improve function clarity

* Refactor outputs counting

- Found a typo in intermediary model class JniBlockMeta parameter change of which does not impact encoding from rust to kotlin according to rust layer implementation.

* Check blocks mkdir result

* Remove unnecessary detekt warning suppression

* Refactor buffer size check

* Improve visibility annotations

* Make file finalise obvious and self documenting

* Remove prevHash logging

* Move instantiation to the object itself

* Enrich fixture with default values

* Extend eror message

* Rename benchmark blocks range fixture

* Fix rebase changes

* Improve FileCompactBlockRepositoryTest

- "De-integrated" the test suite - it now works with fixture blocks
- Created needed fixtures for a clear mocked blocks providing
- Enhanced getting of FileCompactBlockRepository in FileCompactBlockRepositoryTest to clarify that it works with mock components

* Fix ktlintFormat findings

* Bump actions/cache from 3.2.4 to 3.2.5 in /.github/actions/setup (#927)

Bumps [actions/cache](https://github.com/actions/cache) from 3.2.4 to 3.2.5.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](627f0f41f6...6998d139dd)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix incorrect dir checking

* More robust min/max checking

* Rewinding to more robust middle value

* Strengthen blocks counts after rewind

* Add check of temp finalized file

* Refactor DatabaseCoordinatorTest

* Rename cache files root directory

- To have the same unified variable name across our repositories - fsBlockDbRoot

* Refactor FileCompactBlockRepositoryTest

- To have these tests more clear
- Fixed FakeRustBackend instantiation bug

* Revert back JniBlockMeta param name

* Delete legacy Cache db files

- Deleted from both the older and the newer legacy locations
- All related db files deleted - rollback files included
- The deletion is run once we try to access the new store blocks on disk root directory
- The deletion check does not throw any exception in case of failure, we just log it in console and try it on the next time
- Related new test added too

* Test refactoring

- Made few changes to improve clarity of provided tests and fixtures
- Prepared few new "failure path" tests
- Enhanced existing tests

* Manual test case

* Simplify error printing

- As we had some commented out code there

* Reset manual tests steps numbering

* [#924] Remove alias from WalletCoordinator

Also make Compose UI the default.  The old UI is deprecated but is still used by the benchmarking tests

* Bump benchmark version

* Protect JniBlockMetadata agains minification

* Enable debuggable while benchmarking

* Enhance benchmark screen waiting

* Fix cache db files deletion

- With this construct we delete all blocks blob metadata files, as well as their sqlite file

* Add new benchmark results

* Remove benchmark operations receiver fix

- As it's not needed after the latest profiler dependency update

* Bump gradle/wrapper-validation-action from 1.0.5 to 1.0.6 (#928)

Bumps [gradle/wrapper-validation-action](https://github.com/gradle/wrapper-validation-action) from 1.0.5 to 1.0.6.
- [Release notes](https://github.com/gradle/wrapper-validation-action/releases)
- [Commits](55e685c48d...8d49e559aa)

---
updated-dependencies:
- dependency-name: gradle/wrapper-validation-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump actions/cache from 3.2.5 to 3.2.6 in /.github/actions/setup (#929)

Bumps [actions/cache](https://github.com/actions/cache) from 3.2.5 to 3.2.6.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](6998d139dd...69d9d449ac)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update DatabaseCoordinator.kt

Move if/else out from log message body

* Update Switch cache to store blocks on disk.md

Reset documentation bullets numbering

* Hide internal constants from public package

* Update manual test user with new UI requirement

* Comment out cargo.toml test values

* Inline fixture blocks metadata with its creation

* Switch to FsBlockDb for caching CompactBlocks

* Add RustBackend.getLatestHeight() method

* Raise MSRV to 1.60

* Migrate to latest Rust crate API

* Add RustBackend.findBlockMetadata() method

* Add RustBackend.rewindBlockMetadataToHeight() method

* Update cargo.lock

* Switch to FsBlockDb for caching CompactBlocks

* Migrate to latest Rust crate API

* [#765] implementation of FileCompactBlockRepository

* writing block metadata to database

* split write function into smaller easier to test blocks

* testing for FileCompactBlockRepository

* fixed rewinding

* fixed tests

* fixed FileCompactBlockRepositoryTest and SynchronizerFactoryTest

* code review fixes

* updated proto files

* override all functions in FakeRustBackend

* code review fixes

* Fix function body formatting

* Improve clear function clarity

* Use length of string const

* Delete single file instead of directory

* Improve function clarity

* Refactor outputs counting

- Found a typo in intermediary model class JniBlockMeta parameter change of which does not impact encoding from rust to kotlin according to rust layer implementation.

* Check blocks mkdir result

* Remove unnecessary detekt warning suppression

* Refactor buffer size check

* Improve visibility annotations

* Make file finalise obvious and self documenting

* Remove prevHash logging

* Move instantiation to the object itself

* Enrich fixture with default values

* Extend eror message

* Rename benchmark blocks range fixture

* Fix rebase changes

* Improve FileCompactBlockRepositoryTest

- "De-integrated" the test suite - it now works with fixture blocks
- Created needed fixtures for a clear mocked blocks providing
- Enhanced getting of FileCompactBlockRepository in FileCompactBlockRepositoryTest to clarify that it works with mock components

* Fix ktlintFormat findings

* Fix incorrect dir checking

* More robust min/max checking

* Rewinding to more robust middle value

* Strengthen blocks counts after rewind

* Add check of temp finalized file

* Refactor DatabaseCoordinatorTest

* Rename cache files root directory

- To have the same unified variable name across our repositories - fsBlockDbRoot

* Refactor FileCompactBlockRepositoryTest

- To have these tests more clear
- Fixed FakeRustBackend instantiation bug

* Revert back JniBlockMeta param name

* Delete legacy Cache db files

- Deleted from both the older and the newer legacy locations
- All related db files deleted - rollback files included
- The deletion is run once we try to access the new store blocks on disk root directory
- The deletion check does not throw any exception in case of failure, we just log it in console and try it on the next time
- Related new test added too

* Test refactoring

- Made few changes to improve clarity of provided tests and fixtures
- Prepared few new "failure path" tests
- Enhanced existing tests

* Manual test case

* Simplify error printing

- As we had some commented out code there

* Reset manual tests steps numbering

* Bump benchmark version

* Protect JniBlockMetadata agains minification

* Enable debuggable while benchmarking

* Enhance benchmark screen waiting

* Fix cache db files deletion

- With this construct we delete all blocks blob metadata files, as well as their sqlite file

* Add new benchmark results

* Remove benchmark operations receiver fix

- As it's not needed after the latest profiler dependency update

* Update DatabaseCoordinator.kt

Move if/else out from log message body

* Update Switch cache to store blocks on disk.md

Reset documentation bullets numbering

* Hide internal constants from public package

* Update manual test user with new UI requirement

* Comment out cargo.toml test values

* Inline fixture blocks metadata with its creation

* Update cargo.lock

* Update Cargo.lock

* Check and document JniBlockMeta params ranges

* Add assert for gradle property

* Use UInt internally

uint

* Change array API to list

* Fix for using correct SDK Synchronizer alias

- Only the older Demo-app UI was impacted.
- Thus also our benchmarking was impacted.

* Apply documentation suggestions from code review

Co-authored-by: Kris Nuttycombe <kris@electriccoin.co>

* Final manual test instructions update

* Fixture block hash deterministically generated from block height

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Jack Grigg <jack@electriccoin.co>
Co-authored-by: Jack Grigg <jack@z.cash>
Co-authored-by: Honza <rychnovsky.honza@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Carter Jernigan <git@carterjernigan.com>
Co-authored-by: Kris Nuttycombe <kris@electriccoin.co>
2023-03-08 16:04:04 +01:00
Carter Jernigan c0a2c11418
[#615] Refactor lightwalletd client
* [#615] Refactor lightwalletd client

This moves the lightwalletd client code to a separate Gradle module, but does not yet do much clean up the public API (e.g. hiding generated GRPC objects).  That will be a followon change via #673

I’ve prototyped a safer version of the API that would be implemented for #673 for two specific calls: obtaining the current block height and obtaining the light wallet info.  These were the easiest endpoints to update and they provide a useful exploration for the future changes needed.

* Fix benchmarking for networking module

- Moved to fixture and build type check components to the new networking module, so it's accessible from all needed parts of the projects
- Changed fixture return type to fit to all needed usages

* Align with previous review comment

* Fix wrong merge

* Add basic sanity test

- To satisfy tests requirements on emulators.wtf service

* Remove grpc dependency from sdk-lib module

* Repackage cash.z.wallet.sdk.rpc to cash.z.wallet.sdk.internal.rpc

* Fix BuildConfig path

* Update demo-app paths to rpc

* Fix broken grpc services locations

- Our aim here is to change only the local services location (package name), the server location can't be changed due to backward compatibility.

* Enhance GRPC Response model

* Adopt enhanced GRPC response model

- Adopted in a few endpoints

* Enhance Connection failure type

* Add simple fixture test

* Refactor fetchTransaction() to work with Response

- Refactored this server call to adopt our new Response mechanism
- GrpsStatusResolver.resolveFailureFromStatus() now accepts Throwable input
- Added Response.Failure.toThrowable() to satisfy subsequent server calls results processing
- A few other minor refactoring changes

* Remove commented out log

* Unify return type of collection returning methods

- Switched fetchUtxos() to return Sequence instead of List
- Added a check on empty tAddress input

* fetchUtxos returns flow

- Switched fetchUtxos() to return Flow of Service.GetAddressUtxosReply
- Internally it calls getAddressUtxosStream() instead of getAddressUtxos() from GRPC layer

* Update unsafe suffix documentation

* Address several minor change requests

* Remove code parameter

- Removed from the locally triggered failures with default codes.

* Rename local variable

* Switch from empty response to exception

- Our server calls now rather throw IllegalArgumentException than return an empty response
- Removed commented out log message
- Updated javadocs

* Update proto files

- Plus related api changes adoption

* Unify new clients instances name

* AGP 7.4.0 changes

-  packagingOptions -> androidComponents in sdk-lib and lightwallet-client-lib modules

* SDK version bump

* Response resolver tests

* Release build upload timeout increase

* Release build upload timeout increase fix

* Revert timeout

- As Github has some infrastructure troubles and we need to wait

* Add migrations documentation

* Sort packaging filters

* Remove private field from public documentation

* Hide private variables

* Remove package from Android Manifest

* Throw exception instead of custom error

- This step unify our approach to validation on client side across all server calls

* Replace setAddresses index const with number

* Fix indentation in proto file

---------

Co-authored-by: Honza <rychnovsky.honza@gmail.com>
2023-02-01 11:14:55 +01:00
Carter Jernigan 2ab6d038ed
[#742] Prevent multiple synchronizer instances
Co-authored-by: Honza <rychnovsky.honza@gmail.com>
2022-12-14 10:33:18 -05:00
Carter Jernigan b288b8cad9 Rename Synchronizer.getAddress APIs 2022-11-08 14:25:56 -05:00
Carter Jernigan d1e9b28c91 [#771] Update documentation for SDK 1.10.0 2022-11-08 09:32:07 -05:00
Carter Jernigan 61f1c1a9cb
[#753] Add API for querying recipients 2022-10-31 15:27:34 -04:00
Carter Jernigan 67f0b156ec [#525] Migrations documentation
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-08-22 20:57:41 +01:00
Carter Jernigan e01a906407
[#593] Refactor ZcashNetwork
Splits the ZcashNetwork and Lightwalletd server information, making it easier to configure different servers
2022-08-02 09:29:09 -04:00
Carter Jernigan 421f932bd5 Update changelog for 1.8 release 2022-07-28 17:07:02 -04:00
Carter Jernigan a6c223aaa5 Update changelog for version 1.7 2022-07-07 13:45:03 -04:00
Carter Jernigan a1cc8f0b69 [#477] Fixes for Zatoshi object 2022-07-07 13:45:03 -04:00
Carter Jernigan 823e8387cb
[#477] Typesafe Zatoshi APIs for amounts 2022-06-21 19:34:42 -04:00
Carter Jernigan 7a84fa3e8f Bump version to 1.4.0-beta01
The bump to 1.3.0-beta20 happened in a separate branch off of master and will be tagged.
2022-01-28 12:18:29 -05:00
Carter Jernigan 5f40d7a14e [#344] Minimize threads; reduce risk of SQLite issues
While there are a lot of changes, the most significant are:
 - Update the main entrypoint of the SDK to use a suspending function and eliminate lazy initialization.  This also resolves #310
 - Changing Dao methods to `suspend`, allowing Room to implicitly manage the threading model under the hood
 - Explicitly set the executor thread for the `CompactBlockDb` and `DerivedDataDb`, which is the same thread used when calling into the Rust native library.  Room will then use this thread for `suspend` fun calls into it
 - With the above set, remove unnecessary hops to Dispatchers.IO which is a thread pool
 - Eliminate lazy initialization in `PagedTransactionRepository` to make it easier to reason about the threading model and resolve #355 where the database was being touched from the UI thread

Note that `PendingTransactionsDb` is not opted into this single-threaded approach, because that database is not shared with the Rust code
2022-01-19 15:27:30 -05:00
Carter Jernigan 077e385855 [#357] Min API 19 2022-01-19 13:37:52 -05:00
Carter Jernigan 89d9a1916e
Prepare 1.3.0-beta19 release 2021-11-19 15:32:49 -05:00
Carter Jernigan 079229972f [#269] Convert blocking calls to suspend functions
To quickly get this implemented, some calls in the demo-app have been wrapped in `runBlocking {}`.  This is not ideal and will be addressed in followup issues.
2021-10-21 16:52:15 -04:00
Carter Jernigan 07a00dc376
[#294] Move twig to internal package 2021-10-13 10:20:13 -04:00
Kevin Gorham 3785e4dfd9
Summarize breaking changes in 1.3 2021-06-29 20:41:08 -04:00
Kevin Gorham 12ce30e305
Cleanup migration guide. 2021-06-29 01:53:37 -04:00
Kevin Gorham cbbad21f7b
Added a migration guide for troubleshooting v1.2.* issues. 2021-06-29 01:50:46 -04:00