-
Notifications
You must be signed in to change notification settings - Fork 725
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
Encode required origin for extrinsics in metadata #349
Comments
Depends on: paritytech/substrate#5678 |
An idea... needs more thought
|
I like the idea of not strongly typed metadata associated to a call. the metadata associated to a call would be: a name, a type and a value. Or maybe we should type those information with:
I think it is better to allow any kind of metadata with any names and types without any assumption on their signification. |
another idea would be something like this: #[pallet::origin(EnsureRoot)]
#[pallet::weight(*_ratio * T::BlockWeights::get().max_block)]
pub(crate) fn fill_block(origin: (), _ratio: Perbill) -> DispatchResult {
Ok(())
} the new attribute would take type which implements trait EnsureOriginMetadata: EnsureOrigin {
/// Return some doc about the origin checker.
fn meta() -> &'static str;
} The attribute is optional, if no attribute origin is given then no check are done and metadata is pros:
cons:
EDIT: but in general allowing user to put in metadata some unstructured information associated to calls seems useful. |
Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions. |
issue is still relevant |
This issue has been mentioned on Polkadot Forum. There might be relevant details there: https://forum.polkadot.network/t/guidance-on-selecting-pre-images/2135/4 |
* Many relayer fixes * Fixes for E2E tests * timeout better on startup * Improve reliability of readme instructions Co-authored-by: Aidan Musnitzky <[email protected]>
This issue came up recently again, especially around the So, I would propose something like this to put origins into metadata:
I hope that I have covered all the cases that are important, but maybe I miss something. As we have now support for adding custom things to the metadata, I would say that we do not wait for a new metadata version and instead add the information to the custom metadata section. Using |
* Release and versioning workflow guidelines * Add section development workflow
Are there any strong opinions about not including this in metadata V16? We don't expect this to land before stabilization, and we could always include it in the custom metadata fields 🙏 |
There are multiple incidents in both Kusama council and Polkadot council that the council motion was created with wrong number of members count make them invalid.
We should have a way to encode the required origin for extrinsics in metadata which should avoid this issue.
It will allow polkadot apps to construct correct motion without manually duplicated that information into polkadot apps repo.
One way is add
fn metadata
totrait EnsureOrigin
. And modifydecl_module
macro to support new syntax to specify the origin likefn sudo(origin: EnsureRoot, call: Box<<T as Trait>::Call>)
The text was updated successfully, but these errors were encountered: