Update to Kotlin 1.6 and enable the new memory model#299
Merged
Conversation
Compose is updated to 1.2.1 which require sdk 32.
preventFreeze() and makeShared() methods have been removed from io.ktor.utils.io with ktor 2.0.
The old memory model based on freezing objects that moved between threads caused a lot of issues on iOS. With the upgrade to kotlin 1.6, ktor 2.x and coroutines 1.6 it makes sense to also move to the new model which is much more workable than the old one. To do so we enable an experimental flag and use the adequate kotlinx coroutine library version. See https://github.com/JetBrains/kotlin/blob/master/kotlin-native/NEW_MM.md This commit is a work in progress, because several changes are needed for the iOS app to be fully functional. Several thread checks will have to be removed, for example in SyncTxManager. However a lot of the app works right away.
Member
Author
|
Latest commit enables the new kotlin Memory Model. For context, see this comment in lightning-kmp repo. Some more changes are required before this can be merged, especially where we check what thread we're on, or when we use the freeze API (for example Note that we do not upgrade to SQLDelight 2.0.0-alpha03 yet, because that does not seem needed for now. |
The swap-in address now belongs to the wallet. It is generated by lightning-kmp using an address on account 1. The swap-in flow has also changed. Swap-ins can be accepted or rejected by Phoenix or the peer (for example if the fee is too low or the swapped amount below a given threshold). There are new events for channel creation (that are triggered by swap-ins but also by regular pay-to-opens).
phoenix-android/src/main/kotlin/fr/acinq/phoenix/android/components/Buttons.kt
Outdated
Show resolved
Hide resolved
robbiehanson
suggested changes
Oct 11, 2022
...src/commonMain/kotlin/fr.acinq.phoenix/controllers/config/ChannelsConfigurationController.kt
Show resolved
Hide resolved
phoenix-shared/src/commonMain/kotlin/fr.acinq.phoenix/db/cloud/CloudData.kt
Show resolved
Hide resolved
robbiehanson
approved these changes
Oct 12, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR updates Phoenix to kotlin
1.6.21. Several dependencies are also updated:0.7.01.5+2.0.31.6.30.3.2(transitive from lightning-kmp)1.3.3The Android app is affected and jetpack compose must be updated.
This pull request depends on ACINQ/lightning-kmp#370