Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add subnets precompile #1110

Merged
merged 31 commits into from
Jan 30, 2025
Merged

add subnets precompile #1110

merged 31 commits into from
Jan 30, 2025

Conversation

open-junius
Copy link
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
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 sam0x17, gztensor and a team January 16, 2025 15:05

address constant ISUBNETS_ADDRESS = 0x0000000000000000000000000000000000000804;

interface ISubnets {
Copy link
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
dispatch(handle, call, NEURON_CONTRACT_ADDRESS)
}

fn parse_netuid_hotkey_parameter(data: &[u8]) -> Result<(u16, [u8; 32]), PrecompileFailure> {
Copy link
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
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

@open-junius open-junius requested a review from gztensor January 30, 2025 11:18
@sam0x17 sam0x17 merged commit 051b531 into devnet-ready Jan 30, 2025
11 of 15 checks passed
@open-junius open-junius deleted the neuron-precompile branch January 30, 2025 23:51
@open-junius open-junius mentioned this pull request Jan 31, 2025
13 tasks
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