Derive the backing family from the chain id (subnet alpha, PR1) - #707
Open
LandynDev wants to merge 2 commits into
Open
Derive the backing family from the chain id (subnet alpha, PR1)#707LandynDev wants to merge 2 commits into
LandynDev wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Derive a leg's backing family from its chain id so subnet alpha tokens (
sn<N>) settle in the TAO purse with no new accounts, instructions or config.backing::family(chain):sn<digits>->tao, else the chain itself. An alpha shares subtensor's account space, so the existingvote_slash(.., user: AccountId, ..)already pays its holder.collateral_leg_bindreplacescollateral_leg_amount: a leg that IS the backing asset bindsExact(amount)(today's equality check, byte-identical for every sol/tao pair, pinned by a differential test); a leg that only settles in the family bindsDeclared— bounded byswap_bounds, understatement policed off-chain (spec §2, §5).sn7<->taokeeps the free on-chain check in both directions. This is an amendment to the spec's §3 snippet, which checked the family first.collateral_leg_user_addranddeclarable_bituse the same lookup.fulfillment_grace_secs: every TAO-family chain takes TAO's 180s window.CANCEL_REASON_ALPHA_TRANSFER_DISABLED = 6for a subnet that disables transfers mid-swap.Tests:
cargo test -p allways_swap_manager --lib(54).Deploy: one program redeploy + testnet era bump. Adding another subnet later is a Python registry row, no contract change.
Spec:
SPEC_SUBNET_TOKENS.md§2–§3. Stack: PR1 (this) -> PR2 alpha assets -> das registry -> PR3 gate.