Skip to content

Conversation

mvds00
Copy link

@mvds00 mvds00 commented Aug 27, 2025

do not update (singular) BlockEmission for every subnet but only on fetching Tao block emission

Description

BlockEmission is updated in a utility function, which is very clearly the wrong place

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Other (please describe):

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have run cargo fmt and cargo clippy to ensure my code is formatted and linted correctly
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Additional Notes

This is actively being discussed in discord channel refactor-run_coinbase

@JohnReedV JohnReedV added the skip-cargo-audit This PR fails cargo audit but needs to be merged anyway label Aug 28, 2025
Self::get_block_emission_for_issuance(Self::get_total_issuance().into());
let block_emission_u64: u64 = block_emission.unwrap_or(0);
if BlockEmission::<T>::get() != block_emission_u64 {
BlockEmission::<T>::put(block_emission_u64);
Copy link
Contributor

Choose a reason for hiding this comment

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

it is not a good idea to update anything in a get method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-cargo-audit This PR fails cargo audit but needs to be merged anyway
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants