-
Notifications
You must be signed in to change notification settings - Fork 171
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
Feat/subnet info versioning #752
Conversation
#[method(name = "subnetInfo_getSubnetInfo_v2")] | ||
fn get_subnet_info_v2(&self, netuid: u16, at: Option<BlockHash>) -> RpcResult<Vec<u8>>; | ||
#[method(name = "subnetInfo_getSubnetsInf_v2")] | ||
fn get_subnets_info_v2(&self, at: Option<BlockHash>) -> RpcResult<Vec<u8>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do all our custom rpc return bytes? It makes them annoying to consume, and returning a SCALE encoded type is no less efficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what would you rather they returned ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah 100% agree on this, opens us up to all sorts of potential footguns and even vulnerabilities potentially on the input side if certain criteria are met
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what would you rather they returned ?
The actual shape of the data. SubnetInfov2
/Vec<SubnetInfov2>
/Result<Vec<Option<SubnetInfov2>>>
, or whatever it is before you call .encode
Description
This PR :
SubnetInfov2
struct and related RPC methods.user_add_network_with_identities
struct to preserve backwards compatibility with cliRelated Issue(s)
Type of Change
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
cargo fmt
andcargo clippy
to ensure my code is formatted and linted correctlyScreenshots (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.