Skip to content

Walk miners through a 0.5 TAO burn on a second push - #450

Merged
dylanuys merged 7 commits into
testnetfrom
feat/interactive-resubmit-burn
Sep 15, 2026
Merged

dylanuys merged 7 commits into
testnetfrom
feat/interactive-resubmit-burn

Conversation

@kenobijon

@kenobijon kenobijon commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • gascli d push still does a normal upload first. If this hotkey already used its free slot and has no unused burn credit, the CLI explains the 0.5 TAO SN34 alpha fee, asks to continue, unlocks the coldkey, burns, and retries the upload with the burn receipt. Miners do not paste a hash.
  • Enough staked α uses burn_alpha. Short α and ≥0.5 free TAO uses one add_stake_burn. Recycle does not count. There is no --yes / --no-burn; a second counted model requires the burn.
  • A crash after the extrinsic, or a failed upload / exam, reuses the unused credit (saved receipt locally, unused row on the API). The burn is spent only when the model is confirmed.

Depends on the upload API in BitMind-AI/bmcore#392 accepting burn_tx_hash / burn_block and auto-attaching unused credit.

Test plan

  • pytest tests/test_resubmit_burn.py tests/test_miner_upload_streaming.py tests/test_push_model_retries.py
  • First gascli d push on a fresh registration still succeeds without a burn
  • Second gascli d push on the same hotkey prompts, burns, retries (needs bmcore refactor cache modules #392 deployed)
  • Answering n stops without sending a burn
  • Non-interactive CI/scripted push prints the “re-run in a terminal” hint instead of hanging
  • After a failed exam or dead upload, the next push does not ask to burn again

Note

Medium Risk
Introduces on-chain burns and coldkey-signed extrinsics tied to upload authorization; behavior depends on the upload API accepting burn proof (bmcore #392).

Overview
Enables second and later model pushes on the same hotkey after the free submission slot is used, by having gascli d push burn 0.5 TAO of SN34 alpha and attach proof to the upload API.

Adds gas/protocol/resubmit_burn.py for an interactive flow: explain the fee, confirm in a TTY, then either burn_alpha from staked α or add_stake_burn when stake is short. Burn receipts (tx_hash + block) are saved under GAS_HOME and reused if upload or exam fails; the receipt is cleared only after a successful confirm.

upload_single_modality now sends optional burn_tx_hash / burn_block on presign, retries with a saved or fresh burn on 403 submission-limit responses, and narrows “already uploaded” handling so only the explicit duplicate-hash 409 skips upload (other 409s fail closed). push_model passes a resubmit callback into uploads. Docs in Discriminative-Mining.md describe the paid resubmit path. Covered by tests/test_resubmit_burn.py.

Reviewed by Cursor Bugbot for commit 6a00b35. Bugbot is set up for automated code reviews on this repo. Configure here.

dylanuys and others added 3 commits September 15, 2026 16:34
If gascli d push hits a used free slot, the CLI offers to burn SN34 alpha
from this wallet, then retries the upload with the on-chain receipt so
miners do not have to paste a transaction hash.

Co-authored-by: Cursor <cursoragent@cursor.com>
A first push never mentions burning. A later push always walks through
the 0.5 TAO SN34 alpha burn; declining or running non-interactively
stops the upload.

Co-authored-by: Cursor <cursoragent@cursor.com>
A second push still burns existing SN34 alpha when there is enough.
Otherwise it spends 0.5 TAO in one add_stake_burn instead of staking
and burning in two steps.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread gas/protocol/resubmit_burn.py
Comment thread neurons/discriminator/push_model.py
A crash after the extrinsic lands should not charge a second 0.5 TAO
when the same receipt can still claim unused credit.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

There are 4 total unresolved issues (including 2 from previous reviews).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e5c0770. Configure here.

Comment thread gas/protocol/miner_requests.py Outdated
Comment thread gas/protocol/miner_requests.py
dylanuys and others added 2 commits September 15, 2026 17:38
Allow the interactive prints, burn when staked alpha already covers
the 0.5 TAO fee, keep the receipt until confirm, and start a new burn
when a saved hash is already used.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ation

Distinguish duplicate uploads from other 409 conflicts
@dylanuys
dylanuys merged commit 60b9e4a into testnet Sep 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants