-
Notifications
You must be signed in to change notification settings - Fork 217
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
Add API endpoint to migrate funds from a legacy wallet. #779
Comments
795: Add skeletal Byron wallet API endpoints relating to migration. r=jonathanknowles a=jonathanknowles # Issue Number #778 #779 # Overview This PR adds skeletal migration-related API endpoints for Byron-style wallets. Further PRs will add actual implementations for these endpoints. Co-authored-by: Jonathan Knowles <[email protected]>
806: Add test example values for Byron API types. r=jonathanknowles a=jonathanknowles # Issue Number #778 #779 # Overview This PR adds example test values for the following Byron API types: * `ApiMigrateByronWalletData` * `ApiByronWalletMigrationInfo` Co-authored-by: Jonathan Knowles <[email protected]>
798: Stake pools changes to DB r=KtorZ a=paweljakubas # Issue Number <!-- Put here a reference to the issue this PR relates to and which requirements it tackles --> #712 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [x] I have added separate SQL schema - [x] I have added DBPoolLayer - [x] I have added impl of MVar version of DBPoolLayer - [x] I have added impl of Sqlite version of DBPoolLayer # Comments <!-- Additional comments or screenshots to attach if any --> Properties to check in the next PR: 1. `putPoolProduction` of sequence of `(poolId, SlotIdN)` where `N` is incrementing in Sqlite gives the same result upon `readPoolProduction` as when MVar impl 2. `putPoolProduction` slots being in given epoch and `readPoolProduction (Just epoch)` with this epoch should give proper results 3. `readPoolProduction (Just epoch)` for any epoch always should always only give values from a given epoch 4. When we `putPoolProduction` pools and non-duplicating slots in increasing order then we should have all pool values and all slot values when `readPoolProduction Nothing`. 5. When we `putPoolProduction` pools and non-duplicating slots in increasing order then for each pool id we have slots value that are diminishing in time 6. `rollbackTo slotIdN` should not have slot values later than slotIdN when `readPoolProduction Nothing) 7. `rollbackTo slotIdN` should not affect slots not later than slotIdN 8. `readPoolProduction` should not return pools with no slots, with or without rollback <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> 811: Provisional integration test code for migrate Byron wallets r=piotr-iohk a=piotr-iohk # Issue Number #778 #779 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [ ] Provisional integration test code for migrate Byron wallets + small swagger.yaml update (label `Estimate Migration Cost` for endpoint that estimates cost) # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Pawel Jakubas <[email protected]> Co-authored-by: Piotr Stachyra <[email protected]>
837: Change the return type of `migrateByronWallet` to be a list of transactions. r=KtorZ a=jonathanknowles # Issue Number #779 # Overview The result of migrating funds from a Byron wallet to a new-style wallet will be the creation of _one or more_ transactions. Therefore, it makes sense to report this set of transactions as the result of the `migrateByronWallet` call. This PR merely changes the return type of the call, in order to unblock testing work. Further PRs will actually implement this call. Co-authored-by: Jonathan Knowles <[email protected]>
838: Add --listen-address=127.0.0.1 option r=KtorZ a=rvl Relates to #833 # Overview The host option follows the specification here: http://hackage.haskell.org/package/streaming-commons-0.2.1.0/docs/Data-Streaming-Network.html#t:HostPreference # Comments CLI client can still only connect to localhost. 844: Add and 'implement' "listByronTransactions" to the API r=KtorZ a=KtorZ # Issue Number <!-- Put here a reference to the issue this PR relates to and which requirements it tackles --> #779 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [x] I have added a `GET /byron-wallets/{walletId}/transactions` to get the list of transactions for a byron wallet - [x] The implementation is actually the same as the one for sequential wallets, so we could consider testing done here 😅 ? @piotr-iohk ? # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> 859: Relocate C.W.Jormungandr.BlockHeaders to C.W.Network.BlockHeaders r=KtorZ a=Anviking # Issue Number #711 # Overview - [x] Relocate Cardano.Wallet.Jormungandr.BlockHeaders to Cardano.Wallet.Network.BlockHeaders. `Cardano.Pool.Metrics` needs them! # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Rodney Lorrimar <[email protected]> Co-authored-by: KtorZ <[email protected]> Co-authored-by: Johannes Lund <[email protected]>
844: Add and 'implement' "listByronTransactions" to the API r=KtorZ a=KtorZ # Issue Number <!-- Put here a reference to the issue this PR relates to and which requirements it tackles --> #779 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [x] I have added a `GET /byron-wallets/{walletId}/transactions` to get the list of transactions for a byron wallet - [x] The implementation is actually the same as the one for sequential wallets, so we could consider testing done here 😅 ? @piotr-iohk ? # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> 859: Relocate C.W.Jormungandr.BlockHeaders to C.W.Network.BlockHeaders r=KtorZ a=Anviking # Issue Number #711 # Overview - [x] Relocate Cardano.Wallet.Jormungandr.BlockHeaders to Cardano.Wallet.Network.BlockHeaders. `Cardano.Pool.Metrics` needs them! # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: KtorZ <[email protected]> Co-authored-by: Johannes Lund <[email protected]>
844: Add and 'implement' "listByronTransactions" to the API r=KtorZ a=KtorZ # Issue Number <!-- Put here a reference to the issue this PR relates to and which requirements it tackles --> #779 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [x] I have added a `GET /byron-wallets/{walletId}/transactions` to get the list of transactions for a byron wallet - [x] The implementation is actually the same as the one for sequential wallets, so we could consider testing done here 😅 ? @piotr-iohk ? # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> 859: Relocate C.W.Jormungandr.BlockHeaders to C.W.Network.BlockHeaders r=KtorZ a=Anviking # Issue Number #711 # Overview - [x] Relocate Cardano.Wallet.Jormungandr.BlockHeaders to Cardano.Wallet.Network.BlockHeaders. `Cardano.Pool.Metrics` needs them! # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: KtorZ <[email protected]> Co-authored-by: Johannes Lund <[email protected]>
844: Add and 'implement' "listByronTransactions" to the API r=KtorZ a=KtorZ # Issue Number <!-- Put here a reference to the issue this PR relates to and which requirements it tackles --> #779 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [x] I have added a `GET /byron-wallets/{walletId}/transactions` to get the list of transactions for a byron wallet - [x] The implementation is actually the same as the one for sequential wallets, so we could consider testing done here 😅 ? @piotr-iohk ? # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: KtorZ <[email protected]>
871: Special coin selection function for handling migration of legacy wallets r=jonathanknowles a=KtorZ # Issue Number <!-- Put here a reference to the issue this PR relates to and which requirements it tackles --> #778 #779 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [x] I have added a function to build a coin selection from an existing UTxO. The function yields multiple coin selections. Making transaction corresponding to these selection should empty the wallet. - [x] @jonathanknowles has implemented a series of property tests to check the correctness of the function. # Comments <!-- Additional comments or screenshots to attach if any --> I've measured how "good" the migration algorithm is by comparing the sum of all funds migrated (without taking fee into account) to the initial UTxO value. So for instance `99%` means that 99% of the wallet's value was selected for migration and 1% is left behind and won't be migrated. This has been tried for various dust ratio (1% of your wallet is dust, 5% is dust, 25% is dust etc...) and, with realistic values for the fee policy. (see https://github.com/input-output-hk/cardano-wallet/pull/871/files#diff-d067d3d9dbdfa81e932cc6fee6a9748cR66-R93) Then, I've tried using different approaches with regards to the way we arrange the UTxO set in the migration function: - The default one which just uses the UTxO in an arbitrary order - Sorting the UTxO with biggest coins first - Interleaving small and big coins Aaaaaand.. despite our intuition, here are the results: ``` Arbitrary Order Biggest UTxO first Interleaving of big and small dust=1% dust=1% dust=1% 93.5% PERFECT (== 100%) 46.5% OKAY (> 99%) 93.8% PERFECT (== 100%) 4.4% GREAT (> 99%) 43.5% PERFECT (== 100%) 4.9% OKAY (> 99%) 2.1% MEDIOCRE (<= 99%) 9.9% MEDIOCRE (<= 99%) 1.3% MEDIOCRE (<= 99%) dust=5% dust=5% dust=5% 93.3% PERFECT (== 100%) 58.7% OKAY (> 99%) 93.6% PERFECT (== 100%) 4.4% GREAT (> 99%) 32.9% PERFECT (== 100%) 5.0% OKAY (> 99%) 2.3% MEDIOCRE (<= 99%) 8.4% MEDIOCRE (<= 99%) 1.4% MEDIOCRE (<= 99%) dust=10% dust=10% dust=10% 92.8% PERFECT (== 100%) 66.4% OKAY (> 99%) 93.1% PERFECT (== 100%) 4.6% GREAT (> 99%) 24.1% PERFECT (== 100%) 5.1% OKAY (> 99%) 2.6% MEDIOCRE (<= 99%) 9.5% MEDIOCRE (<= 99%) 1.8% MEDIOCRE (<= 99%) dust=25% dust=25% dust=25% 91.5% PERFECT (== 100%) 75.0% OKAY (> 99%) 89.9% PERFECT (== 100%) 5.0% GREAT (> 99%) 14.4% PERFECT (== 100%) 6.1% OKAY (> 99%) 3.5% MEDIOCRE (<= 99%) 10.6% MEDIOCRE (<= 99%) 4.0% MEDIOCRE (<= 99%) dust=50% dust=50% dust=50% 86.9% PERFECT (== 100%) 74.4% OKAY (> 99%) 38.0% OKAY (> 99%) 8.2% MEDIOCRE (<= 99%) 14.8% MEDIOCRE (<= 99%) 34.7% PERFECT (== 100%) 4.9% GREAT (> 99%) 10.8% PERFECT (== 100%) 27.3% MEDIOCRE (<= 99%) ``` Sooooo... It seems that sometimes, doing less is better 😄 ... And it's already quite sufficient do not do anything and leave the UTxO in an arbitrary order). Now, if I play a bit more with the value for the `dust`, and use as a `dust` value, the constant part for the fees (the `b` in `a * x + b` in the fee equation), we end up with: ``` dust=1% +++ OK, passed 1000 tests (100.0% PERFECT (== 100%)). dust=5% +++ OK, passed 1000 tests (100.0% PERFECT (== 100%)). dust=10% +++ OK, passed 1000 tests (100.0% PERFECT (== 100%)). dust=25% +++ OK, passed 1000 tests (100.0% PERFECT (== 100%)). dust=50% +++ OK, passed 1000 tests: 99.6% PERFECT (== 100%) 0.4% OKAY (> 99%) ``` Which clearly gives us some indication about what a good value for the `dustThreshold` should be 😄 > ℹ️ It would be interesting to take the price of the migration into account too in the comparison. Perhaps one selects less coins, but, also generate less transactions which results in more money being transferred 🤔 ? <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Jonathan Knowles <[email protected]> Co-authored-by: KtorZ <[email protected]>
871: Special coin selection function for handling migration of legacy wallets r=KtorZ a=KtorZ # Issue Number <!-- Put here a reference to the issue this PR relates to and which requirements it tackles --> #778 #779 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [x] I have added a function to build a coin selection from an existing UTxO. The function yields multiple coin selections. Making transaction corresponding to these selection should empty the wallet. - [x] @jonathanknowles has implemented a series of property tests to check the correctness of the function. # Comments <!-- Additional comments or screenshots to attach if any --> I've measured how "good" the migration algorithm is by comparing the sum of all funds migrated (without taking fee into account) to the initial UTxO value. So for instance `99%` means that 99% of the wallet's value was selected for migration and 1% is left behind and won't be migrated. This has been tried for various dust ratio (1% of your wallet is dust, 5% is dust, 25% is dust etc...) and, with realistic values for the fee policy. (see https://github.com/input-output-hk/cardano-wallet/pull/871/files#diff-d067d3d9dbdfa81e932cc6fee6a9748cR66-R93) Then, I've tried using different approaches with regards to the way we arrange the UTxO set in the migration function: - The default one which just uses the UTxO in an arbitrary order - Sorting the UTxO with biggest coins first - Interleaving small and big coins Aaaaaand.. despite our intuition, here are the results: ``` Arbitrary Order Biggest UTxO first Interleaving of big and small dust=1% dust=1% dust=1% 93.5% PERFECT (== 100%) 46.5% OKAY (> 99%) 93.8% PERFECT (== 100%) 4.4% GREAT (> 99%) 43.5% PERFECT (== 100%) 4.9% OKAY (> 99%) 2.1% MEDIOCRE (<= 99%) 9.9% MEDIOCRE (<= 99%) 1.3% MEDIOCRE (<= 99%) dust=5% dust=5% dust=5% 93.3% PERFECT (== 100%) 58.7% OKAY (> 99%) 93.6% PERFECT (== 100%) 4.4% GREAT (> 99%) 32.9% PERFECT (== 100%) 5.0% OKAY (> 99%) 2.3% MEDIOCRE (<= 99%) 8.4% MEDIOCRE (<= 99%) 1.4% MEDIOCRE (<= 99%) dust=10% dust=10% dust=10% 92.8% PERFECT (== 100%) 66.4% OKAY (> 99%) 93.1% PERFECT (== 100%) 4.6% GREAT (> 99%) 24.1% PERFECT (== 100%) 5.1% OKAY (> 99%) 2.6% MEDIOCRE (<= 99%) 9.5% MEDIOCRE (<= 99%) 1.8% MEDIOCRE (<= 99%) dust=25% dust=25% dust=25% 91.5% PERFECT (== 100%) 75.0% OKAY (> 99%) 89.9% PERFECT (== 100%) 5.0% GREAT (> 99%) 14.4% PERFECT (== 100%) 6.1% OKAY (> 99%) 3.5% MEDIOCRE (<= 99%) 10.6% MEDIOCRE (<= 99%) 4.0% MEDIOCRE (<= 99%) dust=50% dust=50% dust=50% 86.9% PERFECT (== 100%) 74.4% OKAY (> 99%) 38.0% OKAY (> 99%) 8.2% MEDIOCRE (<= 99%) 14.8% MEDIOCRE (<= 99%) 34.7% PERFECT (== 100%) 4.9% GREAT (> 99%) 10.8% PERFECT (== 100%) 27.3% MEDIOCRE (<= 99%) ``` Sooooo... It seems that sometimes, doing less is better 😄 ... And it's already quite sufficient do not do anything and leave the UTxO in an arbitrary order). Now, if I play a bit more with the value for the `dust`, and use as a `dust` value, the constant part for the fees (the `b` in `a * x + b` in the fee equation), we end up with: ``` dust=1% +++ OK, passed 1000 tests (100.0% PERFECT (== 100%)). dust=5% +++ OK, passed 1000 tests (100.0% PERFECT (== 100%)). dust=10% +++ OK, passed 1000 tests (100.0% PERFECT (== 100%)). dust=25% +++ OK, passed 1000 tests (100.0% PERFECT (== 100%)). dust=50% +++ OK, passed 1000 tests: 99.6% PERFECT (== 100%) 0.4% OKAY (> 99%) ``` Which clearly gives us some indication about what a good value for the `dustThreshold` should be 😄 > ℹ️ It would be interesting to take the price of the migration into account too in the comparison. Perhaps one selects less coins, but, also generate less transactions which results in more money being transferred 🤔 ? <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Jonathan Knowles <[email protected]> Co-authored-by: KtorZ <[email protected]>
862: jormungandr launch: use --rest-listen instead of generating config.yaml r=KtorZ a=rvl Relates to #832 and #848. Supersedes #850. # Overview `cardano-wallet-jormungandr launch` specifies the REST API port and storage directory. The user provides the rest of the Jörmungandr configuration (e.g. trusted peers). # Comments The Jörmungandr P2P listen address, port, and log level are no longer configured by cardano-wallet. 864: nix: Provide derivations for Daedalus installer r=KtorZ a=rvl Relates to #863. Based on #828. # Overview - @disassembler @cleverca22 It's not exactly the same as before but should work ok I think. - Adds source filtering to avoid unnecessary rebuilds. # Comments To build: ``` nix-build -A cardano-wallet-jormungandr nix-build release.nix -A daedalus-jormungandr.windows -o daedalus-jormungandr-windows nix-build release.nix -A daedalus-jormungandr.macos -o daedalus-jormungandr-macos nix-build release.nix -A daedalus-jormungandr.linux -o daedalus-jormungandr-linux ``` Note that `daedalus-jormungandr.{windows,macos,linux}` from `release.nix` reference the same `cardano-wallet-jormungandr` derivation, only with different `system` or `crossSystem` arguments. So Daedalus may also import from `default.nix` rather than `release.nix`. 878: Support for legacy UTxO witness in Jörmungandr r=KtorZ a=KtorZ # Issue Number <!-- Put here a reference to the issue this PR relates to and which requirements it tackles --> #779 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [x] I have extended `mkStdTx` so that it would properly handle transactions coming from a `RndKey` and construct `legacy-utxo` witnesses for it. # Comments <!-- Additional comments or screenshots to attach if any --> Jörmungandr doesn't implement creating legacy utxo witnesses from jcli ... [jcli/src/jcli_app/transaction/mk_witness.rs](https://github.com/input-output-hk/jormungandr/blob/master/jcli/src/jcli_app/transaction/mk_witness.rs#L78-L82) ```rust WitnessType::OldUTxO => { // TODO unimplemented!() let _secret_key: SecretKey<Ed25519Bip32> = self.secret()?; Err(Error::MakeWitnessLegacyUtxoUnsupported)?; unimplemented!() } ``` so I had to construct them by hand according to: - The format defined in [chain-impl-mockchain#witnesses](https://github.com/input-output-hk/chain-libs/blob/incentive/chain-impl-mockchain/doc/format.md#witnesses) - The format from the source (double checking it matches the doc..) [chain-impl-mockchain/src/transaction/witness.rs](https://github.com/input-output-hk/chain-libs/blob/incentive/chain-impl-mockchain/src/transaction/witness.rs#L173-L176) It'd be nice to review our golden if / when the constructor for the witness type gets updated. <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> 879: Porting the rest of forget pending tx integration tests to CLI r=KtorZ a=paweljakubas # Issue Number <!-- Put here a reference to the issue this PR relates to and which requirements it tackles --> #836 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [x] I have ported the rest of forgetting pending tx integration tests to CLI # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Rodney Lorrimar <[email protected]> Co-authored-by: KtorZ <[email protected]> Co-authored-by: Pawel Jakubas <[email protected]>
862: jormungandr launch: use --rest-listen instead of generating config.yaml r=KtorZ a=rvl Relates to #832 and #848. Supersedes #850. # Overview `cardano-wallet-jormungandr launch` specifies the REST API port and storage directory. The user provides the rest of the Jörmungandr configuration (e.g. trusted peers). # Comments The Jörmungandr P2P listen address, port, and log level are no longer configured by cardano-wallet. 864: nix: Provide derivations for Daedalus installer r=KtorZ a=rvl Relates to #863. Based on #828. # Overview - @disassembler @cleverca22 It's not exactly the same as before but should work ok I think. - Adds source filtering to avoid unnecessary rebuilds. # Comments To build: ``` nix-build -A cardano-wallet-jormungandr nix-build release.nix -A daedalus-jormungandr.windows -o daedalus-jormungandr-windows nix-build release.nix -A daedalus-jormungandr.macos -o daedalus-jormungandr-macos nix-build release.nix -A daedalus-jormungandr.linux -o daedalus-jormungandr-linux ``` Note that `daedalus-jormungandr.{windows,macos,linux}` from `release.nix` reference the same `cardano-wallet-jormungandr` derivation, only with different `system` or `crossSystem` arguments. So Daedalus may also import from `default.nix` rather than `release.nix`. 878: Support for legacy UTxO witness in Jörmungandr r=KtorZ a=KtorZ # Issue Number <!-- Put here a reference to the issue this PR relates to and which requirements it tackles --> #779 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [x] I have extended `mkStdTx` so that it would properly handle transactions coming from a `RndKey` and construct `legacy-utxo` witnesses for it. # Comments <!-- Additional comments or screenshots to attach if any --> Jörmungandr doesn't implement creating legacy utxo witnesses from jcli ... [jcli/src/jcli_app/transaction/mk_witness.rs](https://github.com/input-output-hk/jormungandr/blob/master/jcli/src/jcli_app/transaction/mk_witness.rs#L78-L82) ```rust WitnessType::OldUTxO => { // TODO unimplemented!() let _secret_key: SecretKey<Ed25519Bip32> = self.secret()?; Err(Error::MakeWitnessLegacyUtxoUnsupported)?; unimplemented!() } ``` so I had to construct them by hand according to: - The format defined in [chain-impl-mockchain#witnesses](https://github.com/input-output-hk/chain-libs/blob/incentive/chain-impl-mockchain/doc/format.md#witnesses) - The format from the source (double checking it matches the doc..) [chain-impl-mockchain/src/transaction/witness.rs](https://github.com/input-output-hk/chain-libs/blob/incentive/chain-impl-mockchain/src/transaction/witness.rs#L173-L176) It'd be nice to review our golden if / when the constructor for the witness type gets updated. <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> 879: Porting the rest of forget pending tx integration tests to CLI r=KtorZ a=paweljakubas # Issue Number <!-- Put here a reference to the issue this PR relates to and which requirements it tackles --> #836 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [x] I have ported the rest of forgetting pending tx integration tests to CLI # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Rodney Lorrimar <[email protected]> Co-authored-by: KtorZ <[email protected]> Co-authored-by: Pawel Jakubas <[email protected]>
878: Support for legacy UTxO witness in Jörmungandr r=KtorZ a=KtorZ # Issue Number <!-- Put here a reference to the issue this PR relates to and which requirements it tackles --> #779 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [x] I have extended `mkStdTx` so that it would properly handle transactions coming from a `RndKey` and construct `legacy-utxo` witnesses for it. # Comments <!-- Additional comments or screenshots to attach if any --> Jörmungandr doesn't implement creating legacy utxo witnesses from jcli ... [jcli/src/jcli_app/transaction/mk_witness.rs](https://github.com/input-output-hk/jormungandr/blob/master/jcli/src/jcli_app/transaction/mk_witness.rs#L78-L82) ```rust WitnessType::OldUTxO => { // TODO unimplemented!() let _secret_key: SecretKey<Ed25519Bip32> = self.secret()?; Err(Error::MakeWitnessLegacyUtxoUnsupported)?; unimplemented!() } ``` so I had to construct them by hand according to: - The format defined in [chain-impl-mockchain#witnesses](https://github.com/input-output-hk/chain-libs/blob/incentive/chain-impl-mockchain/doc/format.md#witnesses) - The format from the source (double checking it matches the doc..) [chain-impl-mockchain/src/transaction/witness.rs](https://github.com/input-output-hk/chain-libs/blob/incentive/chain-impl-mockchain/src/transaction/witness.rs#L173-L176) It'd be nice to review our golden if / when the constructor for the witness type gets updated. <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: KtorZ <[email protected]>
882: Add handlers for Byron migration r=KtorZ a=paweljakubas # Issue Number #778 (`migrateByronWallet`) #779 (`getByronWalletMigrationInfo`) # Overview This PR: - [x] Adds a handler for `getByronWalletMigrationInfo`. - [x] Adds a handler for `migrateByronWallet`. # Not included in this PR (reserved for future PRs) - More user-friendly error handling for the case where a user attempts to migrate _**from**_ a known Shelley wallet, or _**to**_ a known Byron wallet. (We can only migrate from Byron to Shelley.) - A complete set of integration tests. We can add these in a further PR. <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> 884: More integration tests for Byron wallets r=KtorZ a=piotr-iohk # Issue Number <!-- Put here a reference to the issue this PR relates to and which requirements it tackles --> # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [ ] More integration tests for Byron wallets ensuring that Shelley endpoints/CLI cannot manage them # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Pawel Jakubas <[email protected]> Co-authored-by: KtorZ <[email protected]> Co-authored-by: Jonathan Knowles <[email protected]> Co-authored-by: Piotr Stachyra <[email protected]>
882: Add handlers for Byron migration r=KtorZ a=paweljakubas # Issue Number #778 (`migrateByronWallet`) #779 (`getByronWalletMigrationInfo`) # Overview This PR: - [x] Adds a handler for `getByronWalletMigrationInfo`. - [x] Adds a handler for `migrateByronWallet`. # Not included in this PR (reserved for future PRs) - More user-friendly error handling for the case where a user attempts to migrate _**from**_ a known Shelley wallet, or _**to**_ a known Byron wallet. (We can only migrate from Byron to Shelley.) - A complete set of integration tests. We can add these in a further PR. <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Pawel Jakubas <[email protected]> Co-authored-by: KtorZ <[email protected]> Co-authored-by: Jonathan Knowles <[email protected]>
849: Enable faucet random wallets r=piotr-iohk a=KtorZ # Issue Number <!-- Put here a reference to the issue this PR relates to and which requirements it tackles --> #779 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [x] I have added faucet random wallets for Jörmungandr - [x] Faucet wallets can be restored via `fixtureByronWallet`, although, we can't make transactions with them. # Comments <!-- Additional comments or screenshots to attach if any --> :warning: Somehow, I can't generate the genesis block from the genesis configuration, jcli isn't happy with the `legacy_fund`, am I missing something? <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: KtorZ <[email protected]> Co-authored-by: Piotr Stachyra <[email protected]>
916: Byron migration integration tests r=KtorZ a=jonathanknowles # Issue Number #778 #779 # Overview This PR adds integration tests to verify that: - [x] Calculating the migration cost of an empty wallet (with [`getByronWalletMigrateInfo`](#778)) returns a value of `0`. - [x] Migrating an empty wallet (with the [`migrateByronWallet`](#779) endpoint) should not generate any transactions. - [x] The actual cost incurred by a migration (with the [`migrateByronWallet`](#779) endpoint) **exactly** matches the cost returned by the [`getByronWalletMigrateInfo`](#778) endpoint. # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Jonathan Knowles <[email protected]> Co-authored-by: KtorZ <[email protected]>
950: Test that `migrateByronWallet` depletes all funds from a source wallet. r=KtorZ a=jonathanknowles # Issue Number #779 # Overview This PR tests that after a successful call to `migrateByronWallet`, all funds are debited from the source wallet, leaving a balance of `0`. # Further work A further PR will test that funds are appropriately credited to the target wallet. Co-authored-by: Jonathan Knowles <[email protected]> Co-authored-by: KtorZ <[email protected]> Co-authored-by: Johannes Lund <[email protected]>
950: Test that `migrateByronWallet` depletes all funds from a source wallet. r=KtorZ a=jonathanknowles # Issue Number #779 # Overview This PR tests that after a successful call to `migrateByronWallet`, all funds are debited from the source wallet, leaving a balance of `0`. # Further work A further PR will test that funds are appropriately credited to the target wallet. Co-authored-by: Jonathan Knowles <[email protected]> Co-authored-by: Johannes Lund <[email protected]> Co-authored-by: KtorZ <[email protected]>
950: Test that `migrateByronWallet` migrates funds correctly. r=jonathanknowles a=jonathanknowles # Issue Number #779 # Overview This PR tests that after a successful call to `migrateByronWallet`: - [x] all funds are debited from the source wallet, leaving a balance of `0`. - [x] all funds are eventually credited to the target wallet, minus the fee. - [x] the resultant fee is the same as the fee predicted by `getByronWalletMigrateInfo`. Co-authored-by: Jonathan Knowles <[email protected]> Co-authored-by: Johannes Lund <[email protected]> Co-authored-by: KtorZ <[email protected]>
I have reviewed integration tests, they are quite nice. I would like to add few more mostly around negative cases (BYRON_MIGRATE and BYRON_CALCULATE in the file): https://docs.google.com/spreadsheets/d/1fadIA_j4nCd3FbylPo5J8K9Fy6tixSC2T9V3xHKuUvU/edit#gid=0 Also testing of of big wallet with many transactions and fragmented utxo from genesis file would be beneficial. Also response codes might be not complete for byron migrate (https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/migrateByronWallet) I think |
966: More tests for byron wallets migration, in particular migrating from big wallets r=piotr-iohk a=KtorZ # Issue Number <!-- Put here a reference to the issue this PR relates to and which requirements it tackles --> #779 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [x] I have added an extra integration scenario to test migrating a big wallet with a lot of dust - [x] I have revised byron migrate response behavior when trying to migrate an empty wallet to return a 403. Two reasons for this: this is more semantically correct. It prevents some extra code needed to handle possible errors that could have occurred if we indeed tried migrating (like, an invalid passphrase). - [x] enable a currently pending test in BYRON_TX_LIST which required faucet - [x] Added extra negative scenario to check migrating with a wrong passphrase - [x] Revised endpoints status in swagger.yaml + added missing error code in migration response # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: KtorZ <[email protected]>
@piotr-iohk wrote:
Good point. It's true that we don't have many tests to trigger a migration cost calculation in the integration layer. Though have you seen the property tests for migration coin selection? The Can you see any deficiencies in the set of property tests above? If so, perhaps we can flesh them out a bit more. |
973: Make large numbers more readable. r=Anviking a=jonathanknowles # Issue Number Related to #779. # Overview Just a tiny PR to make some large numbers more readable. Co-authored-by: Jonathan Knowles <[email protected]>
973: Make large numbers more readable. r=Anviking a=jonathanknowles # Issue Number Related to #779. # Overview Just a tiny PR to make some large numbers more readable. Co-authored-by: Jonathan Knowles <[email protected]>
@jonathanknowles I think property tests look good. I have added a few more integration tests in #989. |
989: re-organize and add few new integration tests for byron calculate/migrate r=KtorZ a=piotr-iohk # Issue Number #779 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [ ] I have re-organized a bit and added few new integration test cases for byron migration/fee calculation to match with https://docs.google.com/spreadsheets/d/1fadIA_j4nCd3FbylPo5J8K9Fy6tixSC2T9V3xHKuUvU # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Piotr Stachyra <[email protected]>
I have added yet additional tests in #1008 and an issue #1007 that actually was inspired by this comment #989 (comment). Closing this one. |
1008: Additional tests for migrating and calculating migration cost for wallets containing only dust r=piotr-iohk a=piotr-iohk # Issue Number #779 #1007 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [ ] Added additional tests for attempting to migrate and calculate migration cost for dust wallets. Those special wallets added to `genesis.yaml` # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Piotr Stachyra <[email protected]> Co-authored-by: Pawel Jakubas <[email protected]>
916: Byron migration integration tests r=KtorZ a=jonathanknowles # Issue Number #778 #779 # Overview This PR adds integration tests to verify that: - [x] Calculating the migration cost of an empty wallet (with [`getByronWalletMigrateInfo`](cardano-foundation/cardano-wallet#778)) returns a value of `0`. - [x] Migrating an empty wallet (with the [`migrateByronWallet`](cardano-foundation/cardano-wallet#779) endpoint) should not generate any transactions. - [x] The actual cost incurred by a migration (with the [`migrateByronWallet`](cardano-foundation/cardano-wallet#779) endpoint) **exactly** matches the cost returned by the [`getByronWalletMigrateInfo`](cardano-foundation/cardano-wallet#778) endpoint. # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Jonathan Knowles <[email protected]> Co-authored-by: KtorZ <[email protected]>
916: Byron migration integration tests r=KtorZ a=jonathanknowles # Issue Number #778 #779 # Overview This PR adds integration tests to verify that: - [x] Calculating the migration cost of an empty wallet (with [`getByronWalletMigrateInfo`](cardano-foundation/cardano-wallet#778)) returns a value of `0`. - [x] Migrating an empty wallet (with the [`migrateByronWallet`](cardano-foundation/cardano-wallet#779) endpoint) should not generate any transactions. - [x] The actual cost incurred by a migration (with the [`migrateByronWallet`](cardano-foundation/cardano-wallet#779) endpoint) **exactly** matches the cost returned by the [`getByronWalletMigrateInfo`](cardano-foundation/cardano-wallet#778) endpoint. # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Jonathan Knowles <[email protected]> Co-authored-by: KtorZ <[email protected]>
916: Byron migration integration tests r=KtorZ a=jonathanknowles # Issue Number #778 #779 # Overview This PR adds integration tests to verify that: - [x] Calculating the migration cost of an empty wallet (with [`getByronWalletMigrateInfo`](cardano-foundation/cardano-wallet#778)) returns a value of `0`. - [x] Migrating an empty wallet (with the [`migrateByronWallet`](cardano-foundation/cardano-wallet#779) endpoint) should not generate any transactions. - [x] The actual cost incurred by a migration (with the [`migrateByronWallet`](cardano-foundation/cardano-wallet#779) endpoint) **exactly** matches the cost returned by the [`getByronWalletMigrateInfo`](cardano-foundation/cardano-wallet#778) endpoint. # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Jonathan Knowles <[email protected]> Co-authored-by: KtorZ <[email protected]>
916: Byron migration integration tests r=KtorZ a=jonathanknowles # Issue Number #778 #779 # Overview This PR adds integration tests to verify that: - [x] Calculating the migration cost of an empty wallet (with [`getByronWalletMigrateInfo`](cardano-foundation/cardano-wallet#778)) returns a value of `0`. - [x] Migrating an empty wallet (with the [`migrateByronWallet`](cardano-foundation/cardano-wallet#779) endpoint) should not generate any transactions. - [x] The actual cost incurred by a migration (with the [`migrateByronWallet`](cardano-foundation/cardano-wallet#779) endpoint) **exactly** matches the cost returned by the [`getByronWalletMigrateInfo`](cardano-foundation/cardano-wallet#778) endpoint. # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Jonathan Knowles <[email protected]> Co-authored-by: KtorZ <[email protected]>
916: Byron migration integration tests r=KtorZ a=jonathanknowles # Issue Number #778 #779 # Overview This PR adds integration tests to verify that: - [x] Calculating the migration cost of an empty wallet (with [`getByronWalletMigrateInfo`](cardano-foundation/cardano-wallet#778)) returns a value of `0`. - [x] Migrating an empty wallet (with the [`migrateByronWallet`](cardano-foundation/cardano-wallet#779) endpoint) should not generate any transactions. - [x] The actual cost incurred by a migration (with the [`migrateByronWallet`](cardano-foundation/cardano-wallet#779) endpoint) **exactly** matches the cost returned by the [`getByronWalletMigrateInfo`](cardano-foundation/cardano-wallet#778) endpoint. # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Jonathan Knowles <[email protected]> Co-authored-by: KtorZ <[email protected]>
Context
This task will provide an API endpoint that allows users to migrate their funds from a Byron wallet to a new-style wallet.
Usage
The basic sequence of a complete migration would be:
postByronWallet
to restore a Byron wallet.postWallet
to create a new-style wallet (if one does not already exist).migrateByronWallet
to migrate funds from the Byron wallet to the new-style wallet.deleteByronWallet
to delete the now-empty Byron wallet.Decision
The API will provide an endpoint similar to the following:
With schema definitions similar to the following:
Acceptance Criteria
Within the list of criteria below, a ticked criterion indicates that there is test coverage in the
master
branch to demonstrate that this criterion is satisfied.migrateByronWallet
operation).migrateByronWallet
, the operation must fail with an error. The error should include a user-friendly explanation informing them that they have specified the wrong type of wallet as a source wallet.migrateByronWallet
, the operation must fail with an error. The error should include a user-friendly explanation informing them that they have specified the wrong type of wallet as a target wallet.getByronWalletMigrateInfo
endpoint. Therefore, the balance of the new wallet must be equal tob - c
, whereb
was the original balance of the legacy wallet, andc
is the cost returned bygetByronWalletMigrateInfo
.getByronWallet
with the migrated wallet ID should still succeed.getByronWallet
with the migrated wallet ID must report a balance of0
.listByronWallets
operation should still include the migrated wallet in the list it returns.PR
QA
The text was updated successfully, but these errors were encountered: