Repository navigation
Description
Summary
#5786 adds rs-sdk APIs for funding identities from asset locks without ever resending refused bytes, for settling a top-up only on proof that its lock was used up, and for registering a DPNS name under an explicit contest policy. Only dash-sdk-cxx (Dash Core's Platform GUI) uses them. wasm-sdk, rs-sdk-ffi (Swift) and rs-platform-wallet (Kotlin) keep their current behaviour, which has the defects below. This issue tracks adopting the new APIs there.
Background
Tenderdash keeps the hash of every transition its CheckTx refused, with no time limit, until its cache evicts it or the node restarts, and a node that holds it never runs CheckTx on those bytes again. The 24 h ttl-duration covers admitted transactions only. So a funding submission is the pair (proof, user_fee_increase), and no pair should be sent twice. Once a proof's fee steps are used up, the next proof is a ChainLock proof for the same outpoint at a height no earlier proof carried. asset_lock_submission's module docs ("Refused transitions") have the details.
APIs to adopt
asset_lock_submission::submit_funding_with_fee_floor: the ChainLock-height (10506) retry from the caller's floor, capped atMAX_FUNDING_FEE_INCREASE(100) andFUNDING_ATTEMPTS(15), reporting each attempt's fee before it is built, withFundingFailure { kind, error }/funding_failure_kindsaying what to do next.asset_lock_submission::next_chain_lock_proof: the proof a capped lock is sent with next (the mined height, or one above the last ChainLock proof sent, at most the caller's verified ChainLock).TopUpIdentity::top_up_identity_settled: settles only whenSdk::asset_lock_outpoint_stateproves the lock used up; otherwiseSubmitted. Signer path only today; wasm-sdk needs a private-key variant sharing the same settlement rule.DpnsContestPolicywithSdk::register_dpns_name_under_policy: the contest decision is made on the registration's own build, before any preorder read, delete or write.
Defects this closes
- rs-platform-wallet: each resume restarts from the caller's fee with the same mined-height proof and persists nothing, so it can resend pairs a node already refused. It should persist the proof generation (the ChainLock height sent and the last fee) with the reservation, before each send. It also retires a tracked top-up lock on the top-up's
Ok, which only proves a verified snapshot of the identity's balance, not that the lock was used; it should keep the lock tracked while the outcome isSubmitted. - wasm-sdk and rs-sdk-ffi:
submit_with_cl_height_retryhas no fee cap and reports no attempts, and a top-up'sOkdoes not settle its lock.
Smaller items from #5786's review
top_up_identity_settledtakes noPutSettings, so callers cannot set timeouts or retries. Add it before other SDKs adopt the method.- DPNS: no test inspects the encoded
prefunded_voting_balanceof the domain document forCap(0)andCap(n). The current tests observe that the SDK does not price the contest itself; the exact value is forwarded correctly on inspection.
Reference
- feat(sdk): tri-state quorum lookups, bounded funding retries and a DPNS contest policy in dash-sdk-cxx #5786 (the rs-sdk APIs and the dash-sdk-cxx binding).
Activity