Skip to content

Validator rejects reservations as "Insufficient source balance" when Blockstream/subtensor is unreachable #147

@HadesHappy

Description

@HadesHappy

Summary

BitcoinProvider.blockstream_get_balance and SubtensorProvider.get_balance both return 0 on any backend failure. The validator's reserve handler uses the return value as a pre-flight check:

# allways/validator/axon_handlers.py:321-324
balance = provider.get_balance(synapse.from_address)
if balance < synapse.from_amount:
    reject_synapse(synapse, 'Insufficient source balance', ctx)
    return synapse

When Blockstream (or the subtensor RPC) is temporarily unreachable, the balance call returns 0, the check fails, and the validator rejects the reservation with a misleading "Insufficient source balance" error — even though the user actually has funds.

Locations

  • allways/chain_providers/bitcoin.py:294-308blockstream_get_balance swallows Exception and returns 0.
  • allways/chain_providers/subtensor.py:260-267 — same pattern for TAO balance lookups.
  • allways/validator/axon_handlers.py:321-324 — consumer that reads 0 as "insufficient".

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