-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(wallet): Beignet Migration #1450
Conversation
Migrates a majority of the on-chain wallet logic out of Bitkit.
* fix(profile): fix crash when saving profile (Android) * chore: update Podfile
Will start posting as I go now for the initial click-through test:
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-01-04.at.16.28.37.mp4 |
Coming from the main scanner and "Paste QR Code" the "total required" in coin selection is not updated correctly, seems to be a regression: EDIT: it works with max amount but not when I type in a custom amount Also the review screen is broken thereafter, looks like |
Electrum Server settings falsely say "disconnected", when I switch to my local regtest the balance doesn't update (to 0) no matter what: EDIT: also when I kill my local regtest network it doesn't give me the toasts for 'disconnected' & 'reconnected', regression (I am cross-testing everything with current master) Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-01-04.at.17.28.13.mp4 |
This is intentional and due to a check added here. Some Electrum servers will not broadcast such low fee transactions for small transactions at 1 satPerVByte. This can sometimes be seen on our own regtest server as well for small 1 satPerVByte txs. We can tweak the min byte size lower, but need to be careful to avoid failed broadcasts. |
I'll add an update to the Electrum config component to wipe the transaction history and balance/utxo information when specifying a new server on regtest. |
# Conflicts: # src/components/Money.tsx # src/utils/lightning/index.ts
Updates beignet to 0.0.5. Adjusts several methods accordinly. Updates fee calculations on Amount screen for coin control. Updated getCurrentAddressIndex method to work with beignet.
Removed unneeded params.
Bumps beignet version to 0.0.6.
@limpbrains Electrum is now handled through the beignet library. Any thoughts on how the tests should be re-wired to handle this update in Bitkit? |
Looks like electrum instance is already available through getOnChainWalletElectrum. So I believe waiting for connection and closing it after tests would be enought. |
Fixes wallet-restore tests.
I'm trying to run e2e tests and they are failing because of We need a way to set fees during e2e tests.
Also, now we have 2 places where we fetch fees from mempool.space: in beignet and in bitkit getFeeEstimates function. This is confusing. We also have fee override in dev settings, would be nice to have to working again |
Send flow doesn't work for me Simulator.Screen.Recording.-.iPhone.14.Pro.-.2024-01-11.at.10.53.32.mp4 |
@limpbrains Fix incoming for the send flow. |
All e2e tests are now working on my machine! |
While using the wallet I often can see |
My wallet only has 2 incoming transactions for 2 first addresses. I've sent some sats to address with index 19. Wallet can't see it. pull-to-refresh doesn't help. If I go to Address Viewer and tap check balances, it works and it finds the output |
This is consistent with the master branch of Bitkit, but needs to be addressed/expanded on in the beignet library. Specifically, the gap limit is respected in that it will not let the user create more than 20 empty addresses, but the look-ahead is limited to one in order to reduce the number of queries made to Electrum on startup. However, we should be able to adjust this to suit our needs. For example, we may want to increase the look-ahead to 20 when restoring from a seed and bring it back down to 1 thereafter. We could also bring the look-ahead back to 20 when pulling to refresh, etc. So these params will need to be added in beignet for us to utilize in Bitkit accordingly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are passing, I can't find any major issues. I think we can merge it.
Or maybe @pwltr wants to take another look
I can't switch Electrum server and the UI is behaving buggy still: Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-01-29.at.14.14.36.mp4 |
Fee calculation is still off and sometimes shown incorrectly in the UI, also having issues sending transactions: Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-01-29.at.14.24.36.mp4Coin selection UI is showing 2 utxos at first and then only one: Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-01-29.at.14.25.46.mp4Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-01-29.at.14.32.51.mp4Also 'max' button font should be orange |
Seems to be still the case |
From a new wallet, using testnet I have received funds with a bech32 address. However, when I change to Native Segwit or legacy and try to send sats, there is $0.00 available. |
@coreyphillips Corey, I don't understand why the issues Phil raised last month still exist. Yet it was merged. |
What issue are you referring to? The custom Electrum server UI issue is the only one I know of as being unresolved, is considered minor and will take some time to resolve once we address the more immediate bugs/issues. |
This one is a major issue:
This one is still there, sending tx seems fine, fees are off in calculation and UI shows something different from calc also:
and the mentioned Electrum UI bugs:
Comment here is more up-to-date |
Description
This PR migrates a majority of the on-chain wallet logic out of Bitkit.
Implementation details:
Instead of migrating existing user wallet data to match Beignet's data structure I've opted instead to map Bitkit's existing data structure to Beignet's using the setWalletData & getWalletData methods. The mapping can be seen here in
UPDATE_WALLET_DATA
. This allows all existing calls to Bitkit's store/state to remain intact and reduces the footprint of this PR.Effectively, everything in the wallet store here is mapped accordingly with the exception of header, exchangeRates & feeEstimates that Beignet uses, but is stored elsewhere in Bitkit.
This PR is meant to act as a 1:1 migration. Updating Bitkit to use the higher level tx and fee API's from Beignet will arrive in a separate PR once this migration is complete.
Regarding the tests. I'm honestly not sure how we should proceed here. I'll need @limpbrains input on the damage I've inflicted once he returns.
Type of change