Skip to content

feat: Burn alpha upload payment#427

Open
jmnmv12 wants to merge 14 commits into
stagingfrom
feat/burn_alpha_upload_payment
Open

feat: Burn alpha upload payment#427
jmnmv12 wants to merge 14 commits into
stagingfrom
feat/burn_alpha_upload_payment

Conversation

@jmnmv12

@jmnmv12 jmnmv12 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR updates the payment on the agent upload process to require a burn of SN62 Alpha, using the burnAlpha or addStakeBurn functions, instead of a TAO transfer to the subnet owner's wallet. The subnet price is retrieved from the chain and together with the existing get_tao_price method, the amount of Alpha to burn is calculated.

The "preflight check" /agent/check was updated to verify the miner's staked alpha balance instead of a TAO wallet balance. The agent upload endpoint was updated to use the AlphaBurn event as the main source of truth, validating that the burned amount, netuid and burner coldkey match the expected values.

The upload_payment_quotes and evaluation_payments tables were updated to store the amount of alpha rao and the amount_rao and sender_address fields are now optional, making sure past records can still exist.

The miner CLI was updated to execute a burn_alpha operation instead of the previous transfer_keep_alive operation.

The tests were also updated and new ones were added to validate this change of behaviour.

Comment thread api/src/endpoints/upload.py Outdated
Comment thread api/src/utils/upload_agent_helpers.py Outdated
Comment thread db/models/payment.py
@jmnmv12 jmnmv12 marked this pull request as ready for review July 9, 2026 14:27
@jmnmv12 jmnmv12 changed the title Feat/burn alpha upload payment feat: Burn alpha upload payment Jul 9, 2026
if event.get("extrinsic_idx") != extrinsic_index:
continue
inner = event.get("event", {})
if inner.get("module_id") == "SubtensorModule" and inner.get("event_id") == "AlphaBurned":

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just incase we should only exit if we find one AND the netuid matches. Unlikely but possible

Comment on lines +237 to +238
"\n[yellow]Burn extrinsic submitted. Burns are irreversible; if the upload fails, "
"use this info with `ridges resume-upload` to retry[/yellow]"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add something like
"This fee is not refundable"

# Keep the 1.4x buffer. Burned alpha is destroyed (not reclaimable), so the buffer now
# absorbs alpha-price movement between quote and burn and keeps prod uploads meaningfully
# more expensive than local testing to discourage variance farming.
amount_alpha_rao = int(eval_cost_alpha * 1e9 * 1.4)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

40% is a lot, maybe 10%?

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