-
Notifications
You must be signed in to change notification settings - Fork 1.6k
paras: add governance control dispatchables #4575
Conversation
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
@@ -1726,7 +1801,10 @@ impl<T: Config> Pallet<T> { | |||
fn decrease_code_ref(code_hash: &ValidationCodeHash) -> Weight { | |||
let mut weight = T::DbWeight::get().reads(1); | |||
let refs = <Self as Store>::CodeByHashRefs::get(code_hash); | |||
debug_assert!(refs != 0); |
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 is removed just to pass an extra paranoid test: increase_code_ref_doesnt_have_allergy_on_add_trusted_validation_code
runtime/parachains/src/paras.rs
Outdated
/// | ||
/// This function is mainly meant to be used for upgrading parachains that do not follow | ||
/// the go-ahead signal while the PVF pre-checking feature is enabled. | ||
#[pallet::weight(0)] // TODO: |
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 still need to run benchmarks for this.
ec51042
to
9a79982
Compare
Adds a couple of functions for governance control for the paras module in the anticipation of PVF pre-checking enabling. Specifically, this commit adds a function for pre-registering a PVF that governance trusts enough. This function will come in handy in case there is a parachain that does not follow the GoAhead signal. That is, does not include paritytech/cumulus#517. This may be not an exhaustive list of the functions that may come in handy. Any suggestions to add more are welcome.
9a79982
to
3f99599
Compare
/benchmark runtime kusama runtime_parachains::paras |
// | ||
// NOTE That we do not use `increase_code_ref` here, because the code is not yet used | ||
// by any parachain. | ||
<Self as Store>::CodeByHash::insert(code_hash, &validation_code); |
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.
So in this case, we completely ignore the onboarding/upgrade machinery? I guess that's fine/intended, but I would like to understand it better: Like how does the actual upgrade work then for example? Code is already on the relay chain, so what steps must a parachain do now to upgrade in this state?
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.
A parachain would attempt an upgrade. When that candidate is enacted, the inclusion module would call schedule_code_upgrade
and then control will fall into kick_off_pvf_check
and this branch will be taken.
From the parachain's standpoint, it will look like instant PVF approval or equally as good old pre-go-ahead signal upgrade.
Does this make sense?
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.
yep it does - thanks! So a parachain would still need to get it's full runtime upgrade through the backing phase, although the code is already on chain. We just bypass the voting, because we trust governance to have the code checked by some other means. 💡
/benchmark runtime kusama runtime_parachains::paras |
Benchmark Runtime Kusama Pallet for branch "pep-pvf-paras-force-fns" with command cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_paras.rs Results
|
…pep-pvf-paras-force-fns
…k --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_paras.rs
/benchmark runtime polkadot runtime_parachains::paras |
Benchmark Runtime Polkadot Pallet for branch "pep-pvf-paras-force-fns" with command cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=polkadot-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/runtime_parachains_paras.rs Results
|
…k --chain=polkadot-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/runtime_parachains_paras.rs
/benchmark runtime westend runtime_parachains::paras |
Benchmark Runtime Westend Pallet for branch "pep-pvf-paras-force-fns" with command cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_paras.rs Results
|
…pep-pvf-paras-force-fns
…k --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_paras.rs
/benchmark runtime custom --chain=rococo-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/rococo/src/weights/runtime_parachains_paras.rs |
Benchmark Runtime Custom for branch "pep-pvf-paras-force-fns" with command cargo run --quiet --release --features runtime-benchmarks -- benchmark --chain=rococo-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/rococo/src/weights/runtime_parachains_paras.rs Results
|
…k --chain=rococo-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/rococo/src/weights/runtime_parachains_paras.rs
* master: Set CurrentCodeHash before running some dispatchable benchmarks (#4645) paras: split tests (#4636) Bump quote from 1.0.10 to 1.0.14 (#4632) Bump pin-project from 1.0.8 to 1.0.9 (#4606) chore: fix copy&paste and tidy comments (#4646) derive Copy and Clone for Upgrade signals (#4637) (#4647) paras: fix upgrade restriction signal (#4603) configuration: Rename validation_upgrade_{frequency -> cooldown} (#4635) Bump lru from 0.7.1 to 0.7.2 (#4633) paras: add governance control dispatchables (#4575)
* paras: add governance control dispatchables Adds a couple of functions for governance control for the paras module in the anticipation of PVF pre-checking enabling. Specifically, this commit adds a function for pre-registering a PVF that governance trusts enough. This function will come in handy in case there is a parachain that does not follow the GoAhead signal. That is, does not include paritytech/cumulus#517. This may be not an exhaustive list of the functions that may come in handy. Any suggestions to add more are welcome. * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_paras.rs * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=polkadot-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/runtime_parachains_paras.rs * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_paras.rs * cargo run --quiet --release --features runtime-benchmarks -- benchmark --chain=rococo-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/rococo/src/weights/runtime_parachains_paras.rs Co-authored-by: Parity Bot <admin@parity.io>
* paras: add governance control dispatchables Adds a couple of functions for governance control for the paras module in the anticipation of PVF pre-checking enabling. Specifically, this commit adds a function for pre-registering a PVF that governance trusts enough. This function will come in handy in case there is a parachain that does not follow the GoAhead signal. That is, does not include paritytech/cumulus#517. This may be not an exhaustive list of the functions that may come in handy. Any suggestions to add more are welcome. * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_paras.rs * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=polkadot-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/runtime_parachains_paras.rs * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_paras.rs * cargo run --quiet --release --features runtime-benchmarks -- benchmark --chain=rococo-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/rococo/src/weights/runtime_parachains_paras.rs Co-authored-by: Parity Bot <admin@parity.io>
Part of #3211
Adds a couple of functions for governance control for the paras module
in the anticipation of PVF pre-checking enabling.
Specifically, this commit adds a function for pre-registering a PVF that
governance trusts enough. This function will come in handy in case there
is a parachain that does not follow the GoAhead signal. That is, does
not include paritytech/cumulus#517.
This may be not an exhaustive list of the functions that may come in
handy. Any suggestions to add more are welcome.
cc @bkchr @shawntabrizi
TODO: