Skip to content

Check PV16 emergency switches before signing or submitting wallet operations #6450

Backlog

Description

@lklimek

TL;DR: The SDK and wallet should check whether a network emergency pause blocks an operation before asking the user to sign it.

User story

As a wallet developer, I want to tell users when a network emergency pause blocks their operation, so they can understand the refusal before signing.

Scenario

Base flow

A wallet user starts an operation on a protocol version 16 network. The wallet selects an eligible signing key and submits the signed operation while an applicable emergency switch is active.

Actual behavior

Platform can refuse the operation with consensus error 41400 even though the wallet selected an eligible key.

Expected behavior

The SDK or wallet checks the verified switch status before signing or submitting and explains a known block to the caller. Platform makes the final admission decision using the state at block execution.

Detailed discussion

On PV16, an active key-type restriction can block a transition signed with that type. StopTransfersToCore can block a withdrawal regardless of the signing key. The signing-key selection API evaluates the key, signing scope, and signer availability. Those inputs carry no emergency switch state.

Use the SDK's proved emergency switch status for preflight in the SDK or wallet operation path. Check which switches apply to the transition with dpp's StateTransition::gating_emergency_switches (the one owner of that mapping, which also covers address spends, shielded pools, asset-lock funding and the type of a key being added) instead of restating the rules, and report the blocking switch when the proved state rules out submission. Switch status can change after the proof is fetched, so admission remains subject to block-time state.

Prior work

Attribution

🤖 Co-authored by Claudius the Magnificent AI Agent

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions