-
Notifications
You must be signed in to change notification settings - Fork 58
fix(platform-wallet): contain panics before the extern "C" abort shim #4424
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -165,11 +165,11 @@ pub unsafe extern "C" fn core_wallet_tx_builder_finalize( | |
| // the signer await, never around it: holding it across an open signing prompt | ||
| // would stall this wallet's teardown for as long as the user takes, and the | ||
| // check makes that unnecessary. | ||
| let (_lifecycle, wallet_is_live) = runtime().block_on(async { | ||
| let (_lifecycle, wallet_is_live) = unwrap_result_or_return!(runtime().try_block_on(async { | ||
| let gate = wallet.core().generation_payment_guard().await; | ||
| let live = wallet.core().is_current_generation().await; | ||
| (gate, live) | ||
| }); | ||
| })); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Suggestion: Release the reservation before returning a lifecycle-check failure These newly fallible lifecycle checks run after finalization has acquired a transaction reservation. If source: ['coderabbit']
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Confirmed and fixed in 84f469e at all three sites you identified ( Rather than repeat the compensation three times, the release now lives next to the acquisition that can fail: Two tests. One thing worth calling out: the panic is injected through a
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved in Auto-resolved by the review system based on the latest commit diff. If you believe this was closed in error, reopen the thread. |
||
| if !wallet_is_live { | ||
| // No handle was published, so nothing would ever release this build's | ||
| // reservation. Reconcile it here: the release is generation-bound, so on | ||
|
|
@@ -299,11 +299,11 @@ pub unsafe extern "C" fn core_wallet_signed_payment_finalize( | |
| // Deliberately acquired AFTER the signer await rather than around it: holding | ||
| // it across an open signing prompt would stall this wallet's teardown for as | ||
| // long as the user takes, and the check below makes that unnecessary. | ||
| let (_lifecycle, wallet_is_live) = runtime().block_on(async { | ||
| let (_lifecycle, wallet_is_live) = unwrap_result_or_return!(runtime().try_block_on(async { | ||
| let gate = wallet.core().generation_payment_guard().await; | ||
| let live = wallet.core().is_current_generation().await; | ||
| (gate, live) | ||
| }); | ||
| })); | ||
| if !wallet_is_live { | ||
| // Nothing was registered, so no token would ever release this build's | ||
| // reservation. Reconcile it here: the release is generation-bound, so on | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.