Skip to content

Conversation

mvds00
Copy link

@mvds00 mvds00 commented Aug 28, 2025

Description

Some more refactoring, not changing functionality (except some debug logging that is now gone).

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): refactoring, making code more readable/understandable

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 PR is under debate 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 29, 2025
// --- 4. Injection.
// Actually perform the injection of alpha_in, alpha_out and tao_in into the subnet pool.
// This operation changes the pool liquidity each block.
for netuid_i in subnets_to_emit_to.iter() {
Copy link
Contributor

Choose a reason for hiding this comment

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

The reason this was made a separate loop was that injection back when we had uniswap v2 could change price, and this would disturb the balance between subnet emissions. We needed to calculate all emissions first using that prices that do not change (because emissions are proportional to prices), and then inject.

My concern here is that we are going to have a tokenomics fix that may or may not return to this behavior (i.e. change price on injection). It is safe to merge now, but will require more work for that update in the next step.

Copy link
Author

Choose a reason for hiding this comment

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

Isn't this a YAGNI case? It was five minutes to join them, it will be five to split them, and only if needed. The certain benefit of having the simplest code (for all people involved) far outweighs the possible cost (for one developer) of a possible future change.

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