feat(platform-wallet): prepare a ProUpServTx without broadcasting it - #4512
Merged
Merged
Conversation
Hosts that want to show an unban transaction before sending it had no way to obtain it: the orchestrator built, signed and broadcast in one call. Split it — prepare_masternode_update_service runs every preflight, the payload, the funding, the operator-BLS signature and the input signatures and stops at a signed transaction whose inputs stay reserved; execute_masternode_update_service is now that plus the broadcast, so the existing behavior and its tests are unchanged. What a preview renders is therefore the exact transaction a broadcast would send, not a re-derived description of it. The two new FFI entry points register the prepared transaction in the existing core signed-transaction storage, so the host reuses the already-shipped handle verbs — core_wallet_broadcast_signed_transaction, core_wallet_abandon_signed_transaction, and the fee / bytes readers; a freed handle abandons and releases the reservation, so a host that drops a preview cannot strand inputs. Swift returns the same FinalizedCoreTransaction ownership token the send path already uses. The tracked operator-key parsing is promoted to a shared helper rather than copied into the new extern. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
QuantumExplorer
requested review from
ZocoLini,
lklimek,
llbartekll and
shumkov
as code owners
August 28, 2026 16:35
Contributor
|
Warning Review limit reachedNext included review available in 57 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
What
Lets a host show an unban transaction before it is sent. Follow-up to #4507, which built, signed and broadcast in a single call, leaving no way to obtain the transaction for review.
How
prepare_masternode_update_serviceruns every preflight, the payload, the funding, the operator-BLS signature and the input signatures, and stops at a signed transaction whose inputs stay reserved.execute_masternode_update_serviceis now exactly that plus the broadcast — existing behavior and tests unchanged. A preview built from the result therefore cannot drift from what gets broadcast, because it is what gets broadcast...._masternode_prepare_update_service,..._tracked_masternode_prepare_update_service) register the prepared transaction in the existingCORE_SIGNED_TRANSACTION_STORAGE, so the host reuses the already-shipped handle verbs rather than getting new ones:core_wallet_broadcast_signed_transaction,core_wallet_abandon_signed_transaction,core_wallet_signed_transaction_fee/_bytes. Freeing a handle abandons and releases the reservation, so a host that simply drops a preview cannot strand inputs.FinalizedCoreTransactionownership token the ordinary send path already uses, so broadcasting a reviewed transaction goes through the host's existing accepted/rejected/unknown classification. Only the raw handle crosses the task boundary; the owning token is constructed on the caller's side so a thrown error can't strand it.Tests / verification
inputs_hashbinding and the verified BLS signature.ErrorInvalidHandlefor an unknown manager and leaveout_transaction_handleat the null handle, so a host can never broadcast a stale handle after a failure.cargo fmt, clippy-D warningson both crates, platform-wallet-ffi 318 passed, platform-wallet 948 passed with the one pre-existing v4.2-dev failure (regression_reports_max_from_usable_suffix_not_total_account_balance, the feat(dpp)!: rebalance the shielded fee constants for protocol 14 #4467 fixture — unrelated and untouched here), andbuild_ios.sh --target simsucceeds end to end.🤖 Generated with Claude Code