mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 15:11:03 +00:00
WASM Local-blob override (#7317)
* Provide WASM overwrite functionality in LocalCallExecutor - add a new module `wasm_overwrite.rs` in client - scrapes given folder for runtimes - add two new CLI Options `wasm-overwrite` and `wasm_overwrite_path` * formatting * Make comment clearer remove sc-runtime-test from dev-dependencies * comments * Update client/service/src/client/wasm_overwrite.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Update client/service/src/client/wasm_overwrite.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Fix spaces, remove call into backend for 'heap_pages' in 'try_replace' * Error if path is not a directory, Comments, Doc Comment for WasmOverwrite * make WasmOverwrite Option<> * Change to one CLI argument for overwrites - move getting runtime version into LocalCallExecutor * change unwrap() to expect() * comment * Remove `check_overwrites` * Encapsulate checking for overwrites in LocalCallExecutor * move duplicate code into function * Update client/cli/src/params/import_params.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * comma * Update client/service/src/client/wasm_overwrite.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Update client/service/src/client/wasm_overwrite.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * cache hash in WasmBlob * Update client/service/src/client/wasm_overwrite.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Update client/service/src/client/client.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * move getting overwrite into its own function * fix error when directory is not a directory * Error on duplicate WASM runtimes * better comment, grammar * docs * Revert StateBackend back to _ * Update client/service/src/client/wasm_overwrite.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Update client/service/src/client/wasm_overwrite.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Update client/service/src/client/call_executor.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Add two tests, fix doc comments Add a test for the runtime_version method of WasmOverwrite Add a test for check_overwrite method of LocalCallExecutor * remove redundant `Return` from expect msg * Update client/cli/src/params/import_params.rs Co-authored-by: David <dvdplm@gmail.com> * Update client/service/src/client/call_executor.rs Co-authored-by: David <dvdplm@gmail.com> * Update client/service/src/client/wasm_overwrite.rs Co-authored-by: David <dvdplm@gmail.com> * Update client/service/src/config.rs Co-authored-by: David <dvdplm@gmail.com> * Update client/service/src/client/wasm_overwrite.rs Co-authored-by: David <dvdplm@gmail.com> * Add Module Documentation, match on '.wasm' extension * Add test for scraping WASM blob * fix expect * remove creating another block in LocalCallExecutor test * remove unused import * add tests for duplicates and scraping wasm * make tests a bit nicer * add test for ignoring non-.wasm files * check error message in test * Update client/service/src/client/wasm_overwrite.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * remove println * Update client/service/src/client/wasm_overwrite.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * make tests prettier * Update client/service/src/client/wasm_overwrite.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * comment for seemingly random client * locally-built -> custom * remove unused import * fix comment * rename all references to overwrite with override * fix cli flag in module documentation Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: David <dvdplm@gmail.com>
This commit is contained in:
@@ -303,8 +303,9 @@ pub fn new_full_parts<TBl, TRtApi, TExecDisp>(
|
||||
Box::new(task_manager.spawn_handle()),
|
||||
config.prometheus_config.as_ref().map(|config| config.registry.clone()),
|
||||
ClientConfig {
|
||||
offchain_worker_enabled : config.offchain_worker.enabled ,
|
||||
offchain_worker_enabled : config.offchain_worker.enabled,
|
||||
offchain_indexing_api: config.offchain_worker.indexing_enabled,
|
||||
wasm_runtime_overrides: config.wasm_runtime_overrides.clone(),
|
||||
},
|
||||
)?
|
||||
};
|
||||
@@ -396,7 +397,7 @@ pub fn new_client<E, Block, RA>(
|
||||
const CANONICALIZATION_DELAY: u64 = 4096;
|
||||
|
||||
let backend = Arc::new(Backend::new(settings, CANONICALIZATION_DELAY)?);
|
||||
let executor = crate::client::LocalCallExecutor::new(backend.clone(), executor, spawn_handle, config.clone());
|
||||
let executor = crate::client::LocalCallExecutor::new(backend.clone(), executor, spawn_handle, config.clone())?;
|
||||
Ok((
|
||||
crate::client::Client::new(
|
||||
backend.clone(),
|
||||
|
||||
Reference in New Issue
Block a user