* Add rewind button to Demo app
To be able to test refactored CompactBlockProcessor rewind feature.
* Rename non-linear to spend-before-sync
* [#1129] Refactor lastSyncRange lastSyncedHeight
* Fix updateRange function
As the overallSyncRange needs to be reset in case of all ranges are processed.
* [#1166] Remove alsoClearBlockCache parameter
* [#1083] Detekt Compose 0.1.10
* [#1066] Detekt - MaxLineLength rule turn on
* Remove default values
As we keep only those that differ from the default in the latest Detekt update.
* [#1086] Improve TODO inline occurrence pattern
* [#1009] Change CompactBlockProcessor methods signature
* Remove withContext {}
Since our networking, RustBackend, and CompactBlockRepository all use coroutines internally by implementing `suspend` for their APIs, we don’t need withContext() anymore. (If we discover something does do blocking IO on the thread, we should deal with it at the point the IO is occurring rather than at the top level)
* Sort FileExt functions
* Add isDirectorySuspend
- To avoid strict mode disc IO violation warning
* Omit try/catch on block files delete action
* Refactor scan batch function
- Removed retry mechanisms, as it’s not needed now after the previous switch from the database-based blocks persisting to file-based blocks persisting
- scan function now works with the current processing range of blocks size instead of hardcoded constant value
* Eliminate duplicate processorInfo object
* Change log text
* MutableList instead of ArrayList
* Eliminate sync range nullability
* Rewind not scanned blocks
If we find out that we previously downloaded, but not validated and scanned persisted blocks, we need to rewind the blocks above the last scanned height first.
* Fix ktlint warning
---------
Co-authored-by: Carter Jernigan <git@carterjernigan.com>
* [#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>
* [#789] Add Benchmark module to Demo-app
* Code cleanup
* Opti-in experimental coroutines api in tests
* Add Testing documentation
* Documentation update + ktlint
* Check screen on and keyguard unlocked in each test
* Introduce UiAutomator extensions
* Enhance BenchmarkTrace events definition
* Remove unnecessary mutex
* Change blocks range
* Increase sync blockchain timeout
- To always fit in the Balances screen timeout for the selected blocks range
* Remove unnecessary fun suspend modifiers
* Macrobenchmark lib bump to 1.2.0-alpha8
* Remove duplicate label attr in app/manifest
* File and link benchmark on CI task
* Add proguard keep rules
* Documentation update
The Android and Rust code have previously managed joint custody of the derived data database. With more complex migrations now required, we need to make the Android side read-only. To achieve that, the Android side will remove Room and instead rely on more primitive SQLite APIs for read-only access.
As part of implementing this change, database management throughout the SDK is being refactored.
There will be multiple representations of the data:
- Database representation (and some Entity representations in the places that Room hasn’t been removed yet). These representations are not as type safe and don’t match Kotlin best practices in all cases.
- Once #615 is implemented there will also be network representations
- Type safe models, which often appear in the public API The Database and Network representations will be converted to and from the type safe model representation.
We need the transparent account privkey in order to be able to derive
the secret key for any leaf transparent address under the ZIP 316
diversified address tree.
UnifiedViewingKey had a bug that made it incompatible with ZIP 316.
For compatibility with the current `zcash/librustzcash` revision we use
a temporary fake UFVK encoding that stores sufficient information to use
the current APIs, and a superset of the actual ZIP 316 FVK information.
- Replace int with type safe BlockHeight(Long) object
- Fix down casting bug, as BlockHeight is uint32 but Java only supports int32 or int64
- Rename WalletBirthday to Checkpoint and hide from the public API
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
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.
Simplifies running the SDK test suite versus darkside tests (which require special environment setup).
Note that the darkside tests are still broken. This is not a regression, as they were broken before. This is an intermediate step towards fixing those tests.