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
sdk: a document delete's confirmation should be proved at a block after the one it was signed against #6076
Sdk::document_delete reports a delete as confirmed only on a proof from a block after the state the SDK had verified before it signed. That proof shows the document gone after the delete was sent, not merely gone at some earlier block.
Current Behavior
A stored-document delete's proved result is verified as "the document is absent at the signed root" (packages/rs-drive/src/verify/state_transition/verify_state_transition_was_executed_with_proof/v0/mod.rs) and tagged as execution-proved. The SDK's default height tolerance allows a proof one block behind the newest it has verified (packages/rs-sdk/src/sdk.rs). Neither the height the caller observed the document at nor the wait's proof height is compared, and DocumentDeleteResult::Deleted carries no height.
With honest nodes this does not happen: the wait is answered only after the transition is included, so the proof is at or after the execution block. A node serving state from before the document existed could still answer the wait with an absence that predates the document. The SDK would then report the delete confirmed while the document still exists.
Callers that share the path: Sdk::document_delete and builders over it, delete_dpns_name / delete_dpns_domain, platform-wallet's document deletes, rs-sdk-ffi and wasm-sdk document deletes.
Possible Solution
In Sdk::document_delete, capture the highest verified height before signing, and require the wait's proof height to be above it before returning Deleted. Otherwise report the result unconfirmed. Honest flows always satisfy this, so no caller changes.
Context
Found reviewing #6055 (DPNS name give-up). Related: #6072 tracks settling a signed give-up by its attempt.
Activity