Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
b6cb088
impl tests benchmarks
camfairchild Nov 5, 2025
3118bb7
bump spec
camfairchild Nov 5, 2025
843bc88
remove duplicate remove
camfairchild Nov 5, 2025
fb053c8
use alpha out here
camfairchild Nov 5, 2025
cb2085e
Hotfix/vune/epoch sub fix (#2186)
0xcacti Nov 5, 2025
b068d02
emit full alpha if subsidized
camfairchild Nov 5, 2025
7d77cf0
fix coinbase test
camfairchild Nov 5, 2025
e792dd1
fix tests
camfairchild Nov 5, 2025
d7a28ba
Revert "Hotfix/vune/epoch sub fix (#2186)"
camfairchild Nov 5, 2025
a837632
add total issuance bump
camfairchild Nov 5, 2025
6bddb56
no alpha out thing
camfairchild Nov 6, 2025
b857d4d
add tests for emissions w/ subs
camfairchild Nov 6, 2025
e1feb05
bump spec
camfairchild Nov 6, 2025
ad602c1
Fix clippy warnings
shamil-gadelshin Nov 6, 2025
cac43c5
Hotfix/vune/epoch sub fix (#2186)
0xcacti Nov 5, 2025
85fe2d4
rename drain_pending to distr em
camfairchild Nov 6, 2025
90d4be4
remove arg and total internally
camfairchild Nov 6, 2025
f81986b
test pending em
camfairchild Nov 6, 2025
be16df6
make sure we check subsidize during those tests
camfairchild Nov 6, 2025
69249f4
fix root claim tests
camfairchild Nov 6, 2025
9762f6a
helper and clippy
camfairchild Nov 6, 2025
94d31d7
bump spec
camfairchild Nov 6, 2025
186c717
rename subsidy to root flag
camfairchild Nov 6, 2025
25290f1
only pull these values if root selling
camfairchild Nov 6, 2025
d3698bf
rename subsidy checks to the root_sell flag
camfairchild Nov 6, 2025
62ecfe1
rename subsidy to excess_tao
camfairchild Nov 6, 2025
c5a7f51
use recycle alpha helper
camfairchild Nov 6, 2025
54e7033
change name of reveal fn and move to block step
camfairchild Nov 6, 2025
8ad48b3
update moving prices outside of coinbase
camfairchild Nov 6, 2025
f00a7ac
filter root out just in case
camfairchild Nov 6, 2025
feeee61
refactor coinbase
camfairchild Nov 6, 2025
4abd92d
chore: fmt
camfairchild Nov 6, 2025
1f965d4
chore: clippy
camfairchild Nov 6, 2025
1ea4ddf
add test for reg disabled
camfairchild Nov 6, 2025
7a9b662
refactor get sn terms
camfairchild Nov 6, 2025
0b5df3c
test wip -- set price
camfairchild Nov 6, 2025
75440be
Hotfix/vune/subnet-dereg-burn-use-issuance (#2190)
camfairchild Nov 6, 2025
40b4ffc
remove log out
camfairchild Nov 6, 2025
fb0cd73
make maybe init v3 pub
camfairchild Nov 6, 2025
6e20035
add type
camfairchild Nov 6, 2025
660b1c6
fix coinbase test
camfairchild Nov 6, 2025
a0c2369
rename test vars and add comment
camfairchild Nov 6, 2025
8652a5f
rename fn
camfairchild Nov 6, 2025
ba0fae0
rename sub -> excess
camfairchild Nov 6, 2025
47a5d54
Merge branch 'hotfix/vune/epoch-fn-inp' into feat/new-coinbase
camfairchild Nov 6, 2025
8e6286c
remove ref to subs
camfairchild Nov 6, 2025
c38aa09
remove dup fn
camfairchild Nov 6, 2025
61227c8
rename vars
camfairchild Nov 6, 2025
c2598a9
add test for injection order
camfairchild Nov 7, 2025
09a2cac
add comment to test
camfairchild Nov 7, 2025
3b9c11e
add tests for drain pending
camfairchild Nov 7, 2025
1b540d9
rename test
camfairchild Nov 7, 2025
d3d5819
rename tests
camfairchild Nov 7, 2025
f1c0476
lower eps
camfairchild Nov 7, 2025
9de47ed
add another subnetterms test
camfairchild Nov 7, 2025
01f8f61
remove unneeded test setup
camfairchild Nov 7, 2025
16822b4
wip
camfairchild Nov 7, 2025
f4eb1ad
Merge branch 'main' into feat/new-coinbase
camfairchild Nov 8, 2025
8b8f763
move reg disabled filter to sn to emit to
camfairchild Nov 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 29 additions & 4 deletions pallets/subtensor/src/coinbase/block_step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,18 @@ impl<T: Config + pallet_drand::Config> Pallet<T> {
.to_u64(),
);
log::debug!("Block emission: {block_emission:?}");
// --- 3. Run emission through network.

// --- 3. Reveal matured weights.
Self::reveal_crv3_commits();
// --- 4. Run emission through network.
Self::run_coinbase(block_emission);
// --- 4. Set pending children on the epoch; but only after the coinbase has been run.
// --- 5. Update moving prices AFTER using them for emissions.
Self::update_moving_prices();
// --- 6. Set pending children on the epoch; but only after the coinbase has been run.
Self::try_set_pending_children(block_number);
// --- 5. Run auto-claim root divs.
// --- 7. Run auto-claim root divs.
Self::run_auto_claim_root_divs(last_block_hash);
// --- 6. Populate root coldkey maps.
// --- 8. Populate root coldkey maps.
Self::populate_root_coldkey_staking_maps();

// Return ok.
Expand Down Expand Up @@ -261,4 +266,24 @@ impl<T: Config + pallet_drand::Config> Pallet<T> {
return next_value.saturating_to_num::<u64>().into();
}
}

pub fn update_moving_prices() {
let subnets_to_emit_to: Vec<NetUid> =
Self::get_subnets_to_emit_to(&Self::get_all_subnet_netuids());
// Only update price EMA for subnets that we emit to.
for netuid_i in subnets_to_emit_to.iter() {
// Update moving prices after using them above.
Self::update_moving_price(*netuid_i);
}
}

pub fn reveal_crv3_commits() {
let netuids: Vec<NetUid> = Self::get_all_subnet_netuids();
for netuid in netuids.into_iter().filter(|netuid| *netuid != NetUid::ROOT) {
// Reveal matured weights.
if let Err(e) = Self::reveal_crv3_commits_for_subnet(netuid) {
log::warn!("Failed to reveal commits for subnet {netuid} due to error: {e:?}");
};
}
}
}
2 changes: 1 addition & 1 deletion pallets/subtensor/src/coinbase/reveal_commits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub struct LegacyWeightsTlockPayload {

impl<T: Config> Pallet<T> {
/// The `reveal_crv3_commits` function is run at the very beginning of epoch `n`,
pub fn reveal_crv3_commits(netuid: NetUid) -> dispatch::DispatchResult {
pub fn reveal_crv3_commits_for_subnet(netuid: NetUid) -> dispatch::DispatchResult {
let reveal_period = Self::get_reveal_period(netuid);
let cur_block = Self::get_current_block_as_u64();
let cur_epoch = Self::get_epoch_index(netuid, cur_block);
Expand Down
Loading
Loading