Skip to content

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

Merged
niklasad1 merged 1 commit intomasterfrom
jsdw-sec-10
Feb 23, 2024
Merged

[audit] Update DispatchError to match latest in polkadot-sdk#1442
niklasad1 merged 1 commit intomasterfrom
jsdw-sec-10

Conversation

@jsdw
Copy link
Copy Markdown
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
Unavailable,
/// Root origin is not allowed.
#[error("Root origin is not allowed.")]
RootNotAllowed,
Copy link
Copy Markdown
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
Copy Markdown
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
@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