Skip to content

add subnets precompile#1110

Merged
sam0x17 merged 31 commits into
devnet-readyfrom
neuron-precompile
Jan 30, 2025
Merged

add subnets precompile#1110
sam0x17 merged 31 commits into
devnet-readyfrom
neuron-precompile

Conversation

@open-junius

Copy link
Copy Markdown
Contributor

Description

Related Issue(s)

  • Closes #[1075]

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

If this PR introduces a breaking change, please provide a detailed description of the impact and the migration path for existing applications.

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.

@open-junius open-junius requested a review from unconst as a code owner December 20, 2024 10:49
@open-junius open-junius self-assigned this Dec 20, 2024
@open-junius

Copy link
Copy Markdown
Contributor Author

@open-junius open-junius added no-spec-version-bump PR does not contain changes that requires bumping the spec version skip-cargo-audit This PR fails cargo audit but needs to be merged anyway labels Dec 20, 2024
@open-junius open-junius changed the title [WIP] add subnets precompile add subnets precompile Jan 16, 2025
@open-junius open-junius requested review from a team, gztensor and sam0x17 January 16, 2025 15:05

address constant ISUBNETS_ADDRESS = 0x0000000000000000000000000000000000000804;

interface ISubnets {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This naming is a bit confusing. Please rename ISubnets to INeuron and files: subnets.sol/abi to neuron.sol/abi.

@open-junius open-junius requested a review from gztensor January 17, 2025 15:06
Comment thread runtime/src/precompiles/neuron.rs Outdated
dispatch(handle, call, NEURON_CONTRACT_ADDRESS)
}

fn parse_netuid_hotkey_parameter(data: &[u8]) -> Result<(u16, [u8; 32]), PrecompileFailure> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you please move parse_pub_key and parse_netuid to the common space like you did with dispatch, for example, and use them here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

moved both functions to mod

Comment thread runtime/src/precompiles/subnet.rs
@open-junius open-junius requested a review from gztensor January 30, 2025 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-spec-version-bump PR does not contain changes that requires bumping the spec version 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