-
Notifications
You must be signed in to change notification settings - Fork 779
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
PoV Reclaim Runtime Side #3002
PoV Reclaim Runtime Side #3002
Changes from 22 commits
9bacb18
fca700f
fd3b613
f808645
088dd8d
ce33ece
0468623
72b8818
ec26a45
fb86674
00dbfb6
102c17e
903a026
d9550e3
a54f670
93c5570
a257a52
9433f16
2f8244e
0f44605
b308598
872f170
5386108
6af533b
fb523e5
03074da
f6bb796
eb79558
b8012be
2a5cfba
fdfa266
408f7c7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -40,7 +40,10 @@ use substrate_prometheus_endpoint::Registry; | |||||||||||||||||
pub struct ParachainNativeExecutor; | ||||||||||||||||||
|
||||||||||||||||||
impl sc_executor::NativeExecutionDispatch for ParachainNativeExecutor { | ||||||||||||||||||
type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions; | ||||||||||||||||||
type ExtendHostFunctions = ( | ||||||||||||||||||
cumulus_client_service::storage_proof_size::HostFunctions, | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we propose this host function in the template. Maybe we should also need to add the Otherwise what is its usage? IIUC the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The polkadot-sdk/substrate/frame/executive/src/lib.rs Lines 607 to 614 in 150a360
This means that the weightreclaimer should only modify the value in the weightmeter, not the storage value itself.
This is a good point, I will add it. |
||||||||||||||||||
frame_benchmarking::benchmarking::HostFunctions, | ||||||||||||||||||
); | ||||||||||||||||||
|
||||||||||||||||||
fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> { | ||||||||||||||||||
parachain_template_runtime::api::dispatch(method, data) | ||||||||||||||||||
|
@@ -100,10 +103,11 @@ pub fn new_partial(config: &Configuration) -> Result<Service, sc_service::Error> | |||||||||||||||||
let executor = ParachainExecutor::new_with_wasm_executor(wasm); | ||||||||||||||||||
|
||||||||||||||||||
let (client, backend, keystore_container, task_manager) = | ||||||||||||||||||
sc_service::new_full_parts::<Block, RuntimeApi, _>( | ||||||||||||||||||
sc_service::new_full_parts_record_import::<Block, RuntimeApi, _>( | ||||||||||||||||||
config, | ||||||||||||||||||
telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()), | ||||||||||||||||||
executor, | ||||||||||||||||||
true, | ||||||||||||||||||
)?; | ||||||||||||||||||
let client = Arc::new(client); | ||||||||||||||||||
|
||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[package] | ||
name = "cumulus-primitives-storage-weight-reclaim" | ||
version = "0.2.0" | ||
authors.workspace = true | ||
edition.workspace = true | ||
description = "Utilities to reclaim storage weight." | ||
license = "Apache-2.0" | ||
|
||
[lints] | ||
workspace = true | ||
|
||
[dependencies] | ||
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } | ||
log = { workspace = true } | ||
scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } | ||
|
||
frame-support = { path = "../../../substrate/frame/support", default-features = false } | ||
frame-system = { path = "../../../substrate/frame/system", default-features = false } | ||
|
||
sp-runtime = { path = "../../../substrate/primitives/runtime", default-features = false } | ||
sp-std = { path = "../../../substrate/primitives/std", default-features = false } | ||
|
||
cumulus-primitives-core = { path = "../../primitives/core", default-features = false } | ||
cumulus-primitives-proof-size-hostfunction = { path = "../../primitives/proof-size-hostfunction", default-features = false } | ||
docify = "0.2.7" | ||
|
||
[dev-dependencies] | ||
sp-trie = { path = "../../../substrate/primitives/trie", default-features = false } | ||
sp-io = { path = "../../../substrate/primitives/io", default-features = false } | ||
|
||
[features] | ||
default = ["std"] | ||
std = ["codec/std", "cumulus-primitives-core/std", "cumulus-primitives-proof-size-hostfunction/std", "frame-support/std", "frame-system/std", "log/std", "scale-info/std", "sp-io/std", "sp-runtime/std", "sp-std/std", "sp-trie/std"] |
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.
Actually realizing that my comment last time was not correct 🙈
Given that we reset the
recorder
here, it is fine to also use this function forcheck_inherents
. So can you do this? :D It should not be used there, but better than having it fail the validation.