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

[audit] Update DispatchError to match latest in polkadot-sdk #1442

Merged
merged 1 commit into from
Feb 23, 2024

Conversation

jsdw
Copy link
Collaborator

@jsdw jsdw commented Feb 23, 2024

The auditors spotted that our DispatchError type had fallen a bit out of sync with the latest one found here https://github.com/paritytech/polkadot-sdk/blob/master/substrate/primitives/runtime/src/lib.rs#L564-L598.

@jsdw jsdw requested a review from a team as a code owner February 23, 2024 13:01
@@ -59,6 +59,9 @@ pub enum DispatchError {
"Some resource (e.g. a preimage) is unavailable right now. This might fix itself later."
)]
Unavailable,
/// Root origin is not allowed.
#[error("Root origin is not allowed.")]
RootNotAllowed,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would be interesting if we could automatically check that all types we have from substrate are in sync.

I'm not aware of a clean way to do that.
We could probably explore in the future a custom crate that compares the tokens from this type to a github link, or crate version.

#[sync_test(
   git = "https://github.com/paritytech/polkadot-sdk/blob/master/substrate",
   path  = "substrate/primitives/runtime/src/lib.rs"
)
enum SubstrateType {
  ...
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's an interesting idea!

@niklasad1 niklasad1 changed the title [sudit] Update DispatchError to match latest in polkadot-sdk [audit] Update DispatchError to match latest in polkadot-sdk Feb 23, 2024
@niklasad1 niklasad1 merged commit 0d1cc92 into master Feb 23, 2024
13 checks passed
@niklasad1 niklasad1 deleted the jsdw-sec-10 branch February 23, 2024 15:16
@jsdw jsdw mentioned this pull request Mar 21, 2024
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.

3 participants