Skip to content

Conversation

ales-otf
Copy link
Contributor

@ales-otf ales-otf commented Feb 17, 2025

Description

Reduces precompiles code size and complexity by switching to precompile-utls from frontier.

Also, fixes a few typing errors.

Related Issue(s)

  • Closes #[issue number]

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):

Breaking Change

  • changes the type from bytes to string in Subnet::register_network precompile;
  • changes Subnet::get_max_weight_limit return type to u16 (in accordance with pallet-subtensor API)
    • changes Subnet::set_max_weight_limit's max_weight_limit to u16 for the same reason
  • changes Subnet::get_immunity_period return type to u16 (in accordance with pallet-subtensor API)
    • changes Subnet::set_immunity_period's immunity_period to u16 for the same reason
  • changes Neuron::commit_weights's commit_hash to bytes32 (in accordance with pallet-subtensor API)

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

Screenshots (if applicable)

Please include any relevant screenshots or GIFs that demonstrate the changes made.

Additional Notes

Please provide any additional information or context that may be helpful for reviewers.

ales-otf and others added 11 commits February 4, 2025 17:17
- introduce PrecompileHandle and Precompile trait extensions
* upgrade openssl

* fix clippy

* address freeze_struct

* rename commit_reveal_period

* apply criticial openssl update to fix RUSTSEC-2025-0004 (openssl)

* remove subnet_info_v3

* address lint

* update register_network with identity precompile

* fix merge commit

* bump spec

* remove SubnetInfov3 struct

* rename emission_values => emission_value

* bump spec

* safe math

* remove duplicated function

* use saturating math

* add cleaned coinbase

* noclaim

* remove complexity

* non scaled tao emission

* bump

* fix test

* clean coinbase

* pre merge

* no tao in for non registration

* move to moving prices rather than tao reserves

* price

* moving alpha

* bump spec

* Fix tests

* add moving price tests

* add alpha in tests

* Fix all tests

* Format

* Fix unsafe math

* alpha tests

* set tao weight

* reset default staking fee

* fix names

* add mainnet names

* cargo clippy

* cargo fmt

* add a global min burn and migration

* add more tests for root pending etc

* alpha divs

* fix test for root

* new test root tao

* fix wrong parse function

* fix test

* add toggle off for transfers

* delete unused workflow file

* Fix validation for transfer toggle

* remove duplicate tests

* fix subnet creation logic

* cargo fmt

* add new test

* bump spec version to 228

* Add test test_drain_alpha_childkey_parentkey

* spec bump

* fix audit

* fix audit

* fix contract

* commit Cargo.lock

* cargo clippy

* cargo fmt

* fix min lock

* fmt

* fix migration test

* cargo fmt

* fix root

* cargo fmt

* add moving price to metagraph

* use correct min burn init (#1265)

* use correct min brun init

* fmt

* no into

* no into 2

* bump spec

* cargo update to fix cargo audit vulnerabilities

* bump spec version

* moving price init from emission

* cargo fmt

* bump spec version

* commit Cargo.lock

* cargo clippy

* cargo fmt

* DefaultMinimumPoolLiquidity and tempos in rao migration

* update readme of support of M series macs

* bump runtime version

* add tao_emission to stakeinfo runtime

* remove call from coinbase. already in block_step

* add negation for pow-reg-allowed

* only root can set min pow diff

* oops

* dont let ck-in-swap-sched move any stake/register

* add tests for validation filter

* add transfer stake to call nontransfer proxy filter

* also add proxy filters for new calls

* update staking priority

* bump spec

* use get_priority_staking for all stake operations

* bump spec

* clippy

* Remove ownership check from transition stake validation

* max the price for EMA calc at 1.0

* uncommitted lockfile change

* bump spec version

* fix merge conflicts

* add CI action that requires clean merges between all named branches

* fix

* fixes

* try again

* fix again

* fix

* fix

* stop needless wasting of CI hours with on push triggers we don't need

* provide an identity for github action to prevent failure

* Add serve_axon extrinsic validation

* Bump spec version

* Check IP validity in serve_axon validation first

* make set diff only root

* add test for set diff no owner

* add migration for min diff

* bump spec

* only allow top-stake SN owner hk to stay immune

* add tests

* only allow replace non-top-stake owner hk

* bump spec

* add tests using SubnetOwnerHotkey

* add impl for replace neuron

* add swap test

* add neuron prune impl

* add swap hotkey impl

* clippy

* clippy

* mistake in test

* add some tests

* add stake ext test

* add move_stake tests

* cargo lock

* bump spec

* clpy

* use bool return type

* clpy

* add higher liquidity on mvoe stake tests

---------

Co-authored-by: open-junius <zhou@opentensor.dev>
Co-authored-by: Aliaksandr Tsurko <ales@opentensor.dev>
Co-authored-by: JohnReedV <87283488+JohnReedV@users.noreply.github.com>
Co-authored-by: Cameron Fairchild <cameron@opentensor.ai>
Co-authored-by: unconst <jake@bittensor.com>
Co-authored-by: Greg Zaitsev <gregz@opentensor.dev>
Co-authored-by: Unconst <32490803+unconst@users.noreply.github.com>
Co-authored-by: camfairchild <cameron@opentensor.dev>
Co-authored-by: Prakash <qxprakash@gmail.com>
Co-authored-by: ibraheem-opentensor <ibraheem@opentensor.dev>
@ales-otf ales-otf marked this pull request as ready for review February 17, 2025 17:02
@ales-otf ales-otf requested a review from unconst as a code owner February 17, 2025 17:02
@ales-otf ales-otf marked this pull request as draft February 17, 2025 17:08
@ales-otf ales-otf marked this pull request as ready for review February 17, 2025 17:36
Copy link
Contributor

@open-junius open-junius left a comment

Choose a reason for hiding this comment

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

It is much better to use utilities from frontier. Great!

@ales-otf ales-otf enabled auto-merge February 18, 2025 15:40
@ales-otf ales-otf disabled auto-merge February 18, 2025 15:40
@sam0x17 sam0x17 merged commit 66d8fbd into devnet-ready Feb 18, 2025
16 of 17 checks passed
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.

4 participants