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
display call stack for unsuccessful unsafe calls #691
Conversation
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.
👍
bors r+ |
d8830b3
to
9d6e22b
Compare
Canceled |
bors r+ |
684: Only create checkpoints for unstable blocks r=KtorZ a=KtorZ # Issue Number <!-- Put here a reference to the issue this PR relates to and which requirements it tackles --> #639 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [x] I have only stored checkpoints for unstable blocks during restoration (and, each last block of each batch) cf: [6a7e9ff](6a7e9ff) - [x] I have fetch the `epochStability` (a.k.a `k` parameter) from genesis block (see [2d0c558](2d0c558) - [x] I have reworked `applyBlock` so it returns a `NonEmpty` list of checkpoints (since it gets a `NonEmpty` list of blocks as input and, there's a 1:1 mapping between blocks and checkpoints here). This remove some awkwardness when accessing the last checkpoint of the list during restoration. (See [c2d193a](c2d193a) # Comments <!-- Additional comments or screenshots to attach if any --> I've re-run the restoration benchmark which now behaves as expected. The last `k` blocks are longer to restore because a checkpoint needs to be created for each of them, otherwise, we only create a checkpoint every epoch. ``` All results: restore testnet seq: 12.16 s restore testnet 10% ownership: 12.14 s Benchmark restore: FINISH Completed 2 action(s). ``` This should coincidentally fix the nightly builds. <!-- 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 --> 690: Add missing descriptions for CLI commands 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 --> - [ ] Added descriptions for commands that were missing it in CLI help # Comments Before: ``` Available options: -h,--help Show this help text Available commands: launch Launch and monitor a wallet server and its chain producers. serve serve API that listens for commands/actions. mnemonic wallet transaction address version Show the program's version. ``` After: ``` Available options: -h,--help Show this help text Available commands: launch Launch and monitor a wallet server and its chain producers. serve Serve API that listens for commands/actions. mnemonic Tooling around mnemonic words. wallet Manage wallets. transaction Manage transactions. address Manage addresses. version Show the program's version. ``` <!-- 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 --> 691: display call stack for unsuccessful unsafe calls r=KtorZ a=KtorZ # 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 --> - [x] I have added "stack traces" for unsafe calls when they fail. # Comments <!-- Additional comments or screenshots to attach if any --> It's not much, but it turns: ``` uncaught exception: ErrorCall TextDecodingError {getTextDecodingError = "Unable to decode Address: encoding is neither Bech32 nor Base58."} CallStack (from HasCallStack): error, called at src/Cardano/Wallet/Unsafe.hs:56:13 in cardano-wallet-core-2019.7.24-vtyOM1MPP4BB3M0K9gXCg:Cardano.Wallet.Unsafe ``` into ``` uncaught exception: ErrorCall TextDecodingError {getTextDecodingError = "Unable to decode Address: encoding is neither Bech32 nor Base58."} CallStack (from HasCallStack): error, called at src/Cardano/Wallet/Unsafe.hs:58:13 in cardano-wallet-core-2019.7.24-vtyOM1MPP4BB3M0K9gXCg:Cardano.Wallet.Unsafe unsafeDecodeAddress, called at test/unit/Cardano/Wallet/Jormungandr/CompatibilitySpec.hs:121:21 in main:Cardano.Wallet.Jormungandr.CompatibilitySpec ``` which makes it easier to locate the point of failure. <!-- 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 <matthias.benkort@gmail.com> Co-authored-by: Piotr Stachyra <piotr.stachyra@iohk.io>
Build failed (retrying...) |
690: Add missing descriptions for CLI commands 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 --> - [ ] Added descriptions for commands that were missing it in CLI help # Comments Before: ``` Available options: -h,--help Show this help text Available commands: launch Launch and monitor a wallet server and its chain producers. serve serve API that listens for commands/actions. mnemonic wallet transaction address version Show the program's version. ``` After: ``` Available options: -h,--help Show this help text Available commands: launch Launch and monitor a wallet server and its chain producers. serve Serve API that listens for commands/actions. mnemonic Tooling around mnemonic words. wallet Manage wallets. transaction Manage transactions. address Manage addresses. version Show the program's version. ``` <!-- 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 --> 691: display call stack for unsuccessful unsafe calls r=KtorZ a=KtorZ # 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 --> - [x] I have added "stack traces" for unsafe calls when they fail. # Comments <!-- Additional comments or screenshots to attach if any --> It's not much, but it turns: ``` uncaught exception: ErrorCall TextDecodingError {getTextDecodingError = "Unable to decode Address: encoding is neither Bech32 nor Base58."} CallStack (from HasCallStack): error, called at src/Cardano/Wallet/Unsafe.hs:56:13 in cardano-wallet-core-2019.7.24-vtyOM1MPP4BB3M0K9gXCg:Cardano.Wallet.Unsafe ``` into ``` uncaught exception: ErrorCall TextDecodingError {getTextDecodingError = "Unable to decode Address: encoding is neither Bech32 nor Base58."} CallStack (from HasCallStack): error, called at src/Cardano/Wallet/Unsafe.hs:58:13 in cardano-wallet-core-2019.7.24-vtyOM1MPP4BB3M0K9gXCg:Cardano.Wallet.Unsafe unsafeDecodeAddress, called at test/unit/Cardano/Wallet/Jormungandr/CompatibilitySpec.hs:121:21 in main:Cardano.Wallet.Jormungandr.CompatibilitySpec ``` which makes it easier to locate the point of failure. <!-- 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 <piotr.stachyra@iohk.io> Co-authored-by: KtorZ <matthias.benkort@gmail.com>
Build failed (retrying...) |
691: display call stack for unsuccessful unsafe calls r=KtorZ a=KtorZ # 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 --> - [x] I have added "stack traces" for unsafe calls when they fail. # Comments <!-- Additional comments or screenshots to attach if any --> It's not much, but it turns: ``` uncaught exception: ErrorCall TextDecodingError {getTextDecodingError = "Unable to decode Address: encoding is neither Bech32 nor Base58."} CallStack (from HasCallStack): error, called at src/Cardano/Wallet/Unsafe.hs:56:13 in cardano-wallet-core-2019.7.24-vtyOM1MPP4BB3M0K9gXCg:Cardano.Wallet.Unsafe ``` into ``` uncaught exception: ErrorCall TextDecodingError {getTextDecodingError = "Unable to decode Address: encoding is neither Bech32 nor Base58."} CallStack (from HasCallStack): error, called at src/Cardano/Wallet/Unsafe.hs:58:13 in cardano-wallet-core-2019.7.24-vtyOM1MPP4BB3M0K9gXCg:Cardano.Wallet.Unsafe unsafeDecodeAddress, called at test/unit/Cardano/Wallet/Jormungandr/CompatibilitySpec.hs:121:21 in main:Cardano.Wallet.Jormungandr.CompatibilitySpec ``` which makes it easier to locate the point of failure. <!-- 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 <matthias.benkort@gmail.com>
Build failed |
bors r+ |
691: display call stack for unsuccessful unsafe calls r=KtorZ a=KtorZ # 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 --> - [x] I have added "stack traces" for unsafe calls when they fail. # Comments <!-- Additional comments or screenshots to attach if any --> It's not much, but it turns: ``` uncaught exception: ErrorCall TextDecodingError {getTextDecodingError = "Unable to decode Address: encoding is neither Bech32 nor Base58."} CallStack (from HasCallStack): error, called at src/Cardano/Wallet/Unsafe.hs:56:13 in cardano-wallet-core-2019.7.24-vtyOM1MPP4BB3M0K9gXCg:Cardano.Wallet.Unsafe ``` into ``` uncaught exception: ErrorCall TextDecodingError {getTextDecodingError = "Unable to decode Address: encoding is neither Bech32 nor Base58."} CallStack (from HasCallStack): error, called at src/Cardano/Wallet/Unsafe.hs:58:13 in cardano-wallet-core-2019.7.24-vtyOM1MPP4BB3M0K9gXCg:Cardano.Wallet.Unsafe unsafeDecodeAddress, called at test/unit/Cardano/Wallet/Jormungandr/CompatibilitySpec.hs:121:21 in main:Cardano.Wallet.Jormungandr.CompatibilitySpec ``` which makes it easier to locate the point of failure. <!-- 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 <matthias.benkort@gmail.com>
Timed out |
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.
Good idea 👍.
Too bad we can't use it on invariant
without applying HasCallStack
to basically the whole app.
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.
Looks like a nice idea, when used sparingly in places where it will help.
Only one minor change suggested.
unsafeFromHex = | ||
either (error . show) id . convertFromBase @ByteString @ByteString Base16 | ||
|
||
-- | Decode a bech32-encoded 'Text' into an 'Address', or fail. | ||
unsafeDecodeAddress :: DecodeAddress t => Proxy t -> Text -> Address | ||
unsafeDecodeAddress :: (HasCallStack, DecodeAddress t) => Proxy t -> Text -> Address |
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.
unsafeDecodeAddress :: (HasCallStack, DecodeAddress t) => Proxy t -> Text -> Address | |
unsafeDecodeAddress | |
:: (HasCallStack, DecodeAddress t) => Proxy t -> Text -> Address |
bors r+ |
691: display call stack for unsuccessful unsafe calls r=piotr-iohk a=KtorZ # 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 --> - [x] I have added "stack traces" for unsafe calls when they fail. # Comments <!-- Additional comments or screenshots to attach if any --> It's not much, but it turns: ``` uncaught exception: ErrorCall TextDecodingError {getTextDecodingError = "Unable to decode Address: encoding is neither Bech32 nor Base58."} CallStack (from HasCallStack): error, called at src/Cardano/Wallet/Unsafe.hs:56:13 in cardano-wallet-core-2019.7.24-vtyOM1MPP4BB3M0K9gXCg:Cardano.Wallet.Unsafe ``` into ``` uncaught exception: ErrorCall TextDecodingError {getTextDecodingError = "Unable to decode Address: encoding is neither Bech32 nor Base58."} CallStack (from HasCallStack): error, called at src/Cardano/Wallet/Unsafe.hs:58:13 in cardano-wallet-core-2019.7.24-vtyOM1MPP4BB3M0K9gXCg:Cardano.Wallet.Unsafe unsafeDecodeAddress, called at test/unit/Cardano/Wallet/Jormungandr/CompatibilitySpec.hs:121:21 in main:Cardano.Wallet.Jormungandr.CompatibilitySpec ``` which makes it easier to locate the point of failure. <!-- 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 <matthias.benkort@gmail.com>
bors r+ |
684: Only create checkpoints for unstable blocks r=KtorZ a=KtorZ # Issue Number <!-- Put here a reference to the issue this PR relates to and which requirements it tackles --> #639 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [x] I have only stored checkpoints for unstable blocks during restoration (and, each last block of each batch) cf: [6a7e9ff](6a7e9ff) - [x] I have fetch the `epochStability` (a.k.a `k` parameter) from genesis block (see [2d0c558](2d0c558) - [x] I have reworked `applyBlock` so it returns a `NonEmpty` list of checkpoints (since it gets a `NonEmpty` list of blocks as input and, there's a 1:1 mapping between blocks and checkpoints here). This remove some awkwardness when accessing the last checkpoint of the list during restoration. (See [c2d193a](c2d193a) # Comments <!-- Additional comments or screenshots to attach if any --> I've re-run the restoration benchmark which now behaves as expected. The last `k` blocks are longer to restore because a checkpoint needs to be created for each of them, otherwise, we only create a checkpoint every epoch. ``` All results: restore testnet seq: 12.16 s restore testnet 10% ownership: 12.14 s Benchmark restore: FINISH Completed 2 action(s). ``` This should coincidentally fix the nightly builds. <!-- 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 --> 691: display call stack for unsuccessful unsafe calls r=KtorZ a=KtorZ # 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 --> - [x] I have added "stack traces" for unsafe calls when they fail. # Comments <!-- Additional comments or screenshots to attach if any --> It's not much, but it turns: ``` uncaught exception: ErrorCall TextDecodingError {getTextDecodingError = "Unable to decode Address: encoding is neither Bech32 nor Base58."} CallStack (from HasCallStack): error, called at src/Cardano/Wallet/Unsafe.hs:56:13 in cardano-wallet-core-2019.7.24-vtyOM1MPP4BB3M0K9gXCg:Cardano.Wallet.Unsafe ``` into ``` uncaught exception: ErrorCall TextDecodingError {getTextDecodingError = "Unable to decode Address: encoding is neither Bech32 nor Base58."} CallStack (from HasCallStack): error, called at src/Cardano/Wallet/Unsafe.hs:58:13 in cardano-wallet-core-2019.7.24-vtyOM1MPP4BB3M0K9gXCg:Cardano.Wallet.Unsafe unsafeDecodeAddress, called at test/unit/Cardano/Wallet/Jormungandr/CompatibilitySpec.hs:121:21 in main:Cardano.Wallet.Jormungandr.CompatibilitySpec ``` which makes it easier to locate the point of failure. <!-- 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 --> 692: review documentation for Primitive.Mnemonic r=KtorZ a=KtorZ # 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 --> - [x] I have reviewed documentation and exports for `Cardano.Wallet.Primitive.Mnemonic` # Comments <!-- Additional comments or screenshots to attach if any --> I noticed a few discrepancy in the documentation and tried to come up with something a little bit clearer. <!-- 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 <matthias.benkort@gmail.com> Co-authored-by: Piotr Stachyra <piotr.stachyra@iohk.io>
9d6e22b
to
8271128
Compare
bors r+ |
691: display call stack for unsuccessful unsafe calls r=KtorZ a=KtorZ # 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 --> - [x] I have added "stack traces" for unsafe calls when they fail. # Comments <!-- Additional comments or screenshots to attach if any --> It's not much, but it turns: ``` uncaught exception: ErrorCall TextDecodingError {getTextDecodingError = "Unable to decode Address: encoding is neither Bech32 nor Base58."} CallStack (from HasCallStack): error, called at src/Cardano/Wallet/Unsafe.hs:56:13 in cardano-wallet-core-2019.7.24-vtyOM1MPP4BB3M0K9gXCg:Cardano.Wallet.Unsafe ``` into ``` uncaught exception: ErrorCall TextDecodingError {getTextDecodingError = "Unable to decode Address: encoding is neither Bech32 nor Base58."} CallStack (from HasCallStack): error, called at src/Cardano/Wallet/Unsafe.hs:58:13 in cardano-wallet-core-2019.7.24-vtyOM1MPP4BB3M0K9gXCg:Cardano.Wallet.Unsafe unsafeDecodeAddress, called at test/unit/Cardano/Wallet/Jormungandr/CompatibilitySpec.hs:121:21 in main:Cardano.Wallet.Jormungandr.CompatibilitySpec ``` which makes it easier to locate the point of failure. <!-- 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 --> 692: review documentation for Primitive.Mnemonic r=KtorZ a=KtorZ # 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 --> - [x] I have reviewed documentation and exports for `Cardano.Wallet.Primitive.Mnemonic` # Comments <!-- Additional comments or screenshots to attach if any --> I noticed a few discrepancy in the documentation and tried to come up with something a little bit clearer. <!-- 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 <matthias.benkort@gmail.com>
Issue Number
Overview
Comments
It's not much, but it turns:
into
which makes it easier to locate the point of failure.