You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
platform-wallet: check the Core fee rate before quoting or signing a Platform address withdrawal #6401
The Platform address withdrawal preview accepts a Core fee rate that the withdrawal itself rejects after signing.
The planner in packages/rs-platform-wallet/src/wallet/platform_addresses/withdrawal.rs uses core_fee_per_byte only to work out the minimum amount. DPP requires the rate to be a nonzero Fibonacci number, and from protocol version 14 also caps it at 6,765. The SDK passes the caller's rate through, builds the witnesses (so the signer is called), and only then runs the structure check that refuses the rate.
A Rust, C or Swift caller can therefore get a successful preview at, for example, 4 duffs per byte, ask the user to sign, and then fail before broadcast.
This affects the preview and the spend of both the withdrawal of everything and the withdrawal of a chosen amount (added in #6373).
Request
Check the fee rate in the shared Rust planner with DPP's existing rules, so an invalid rate fails before a quote is returned and before the signer is called. The rule stays in DPP; the wallet calls it and does not copy it.
Tests: a non-Fibonacci rate such as 4, and a Fibonacci rate such as 10,946 that passes the protocol 13 rule but exceeds the protocol 14 cap.
Found in the review of #6373 (#6373 (comment)) and deferred there because the gap is shared with the existing withdrawal.
Activity