Skip to content

sign_submit: hardcoded 30s finalization timeout causes false failure on successful transactions #5

@grubbhook

Description

@grubbhook

Bug

Transactions that land on-chain successfully are reported as failures with exit code 15.

Root Cause

sign_submit() in src/chain/mod.rs uses a hardcoded 30-second timeout around wait_for_finalized_success():

let result = tokio::time::timeout(
    std::time::Duration::from_secs(30),    // ← hardcoded, too short
    progress.wait_for_finalized_success(), // ← waits for GRANDPA finality, not just inclusion
)

Bittensor produces blocks every ~12s. GRANDPA finalization occurs 3–6 blocks after inclusion = 36–72s minimum. The 30s timeout fires before finalization, reporting failure even though the extrinsic was already in a block.

Additionally, the global --timeout flag only wraps the entire command in main.rs and is never passed into sign_submit, so using --timeout 120 does NOT fix this.

$ agcli -w <wallet> -H <hotkey> stake add --netuid 2 --amount 0.1
~25s: extrinsic submitted and included in block ✅
~55s: false timeout error reported ❌

Stake is confirmed on-chain despite the error

Users see a failure and may retry, causing double-staking

The error message implies the tx may have been dropped — it was not
--timeout workaround is ineffective

Proposed Fix

Switch wait_for_finalized_success()wait_for_in_block_success() — in-block confirmation is sufficient to guarantee staking success

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions