-
Notifications
You must be signed in to change notification settings - Fork 829
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
runtime-api: remove redundant version checks #7610
base: master
Are you sure you want to change the base?
Conversation
All GitHub workflows were cancelled due to failure one of the required jobs. |
} | ||
|
||
/// Request the node features enabled in the runtime. | ||
/// Pass in the session index for caching purposes, as it should only change on session boundaries. | ||
/// Prior to runtime API version 9, just return `None`. | ||
pub async fn request_node_features( | ||
parent: Hash, | ||
session_index: SessionIndex, | ||
sender: &mut impl overseer::SubsystemSender<RuntimeApiMessage>, | ||
) -> Result<Option<NodeFeatures>> { |
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.
This now always returns Some
, so you can remove the Option
.
@@ -469,61 +469,35 @@ where | |||
} | |||
|
|||
/// Request the min backing votes value. | |||
/// Prior to runtime API version 6, just return a hardcoded constant. | |||
pub async fn request_min_backing_votes( |
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.
we can remove these helpers altogether and implement them with specialize_requests
like we do for the other runtime APIs
let disabled_validators = get_disabled_validators_with_fallback(sender, parent) | ||
.await | ||
.map_err(|e| Error::try_from(e).expect("the conversion is infallible; qed"))?; | ||
let disabled_validators = request_disabled_validators(parent, sender).await.await??; |
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.
nit: You can move request_disabled_validators
call to the try_join
above for consistency (like it's done for validators
).
Issue
MinimumBackingVotes
andNodeFeatures
, that are already supported by Polkadot.Description
This PR removes unnecessary runtime API version checks from
subsystem-util/src/runtime
for APIs supported by Polkadot (the most recent network to upgrade). Specifically, it applies to theDisabledValidators
,MinimumBackingVotes
andNodeFeatures
APIs.