Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Add Setter for XCMP QueueConfigData #801

Closed
apopiak opened this issue Nov 26, 2021 · 10 comments
Closed

Add Setter for XCMP QueueConfigData #801

apopiak opened this issue Nov 26, 2021 · 10 comments

Comments

@apopiak
Copy link
Contributor

apopiak commented Nov 26, 2021

/// The configuration which controls the dynamics of the outbound queue.
#[pallet::storage]
pub(super) type QueueConfig<T: Config> = StorageValue<_, QueueConfigData, ValueQuery>;

QueueConfigData is read but there is no way to write it (in contrast to e.g. Polkadot's HostConfiguration).
Would be good to add a setter (that is only available to root).

@Doordashcon
Copy link
Contributor

Hi @apopiak so we need a separate function exclusively for inserting data(QueueConfigData) into the storage item QueueConfig?

@apopiak
Copy link
Contributor Author

apopiak commented Jan 17, 2022

@Doordashcon Yes, we want an extrinsic that allows setting it so governance can update the values if necessary.

@Doordashcon
Copy link
Contributor

Nice! The root/origin would be type QueueConfigDataOrigin: EnsureOrigin<Self::Origin>; enabling implementors assign governance?

@apopiak
Copy link
Contributor Author

apopiak commented Jan 18, 2022

yeah, sure, we could introduce ConfigUpdateOrigin or UpdateOrigin or sth.
Though, just requiring root would allow us to avoid downstream changes.
Either works, though.

@Doordashcon
Copy link
Contributor

I'm on it!

@Doordashcon
Copy link
Contributor

@apopiak there is no benchmarking.rs file, how do I assign weight to the update_config extrinsic?

@KiChjang
Copy link
Contributor

@Doordashcon Since it involves a storage write, I think using T::DbWeight::get().writes(1) is good enough.

@Doordashcon
Copy link
Contributor

@Doordashcon Since it involves a storage write, I think using T::DbWeight::get().writes(1) is good enough.

won't I need to kill existing storage if any before the update?

@KiChjang
Copy link
Contributor

No? You're overwriting the existing QueueConfigData with a new one.

@KiChjang
Copy link
Contributor

KiChjang commented Feb 7, 2022

Fixed in #931, weights for the pallet is tracked in #961.

@KiChjang KiChjang closed this as completed Feb 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants