mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 06:27:58 +00:00
Improve CodeExecutor (#2358)
Since `sp-state-machine` and `GenesisConfigBuilderRuntimeCaller` always set `use_native` to be false. We should remove this param and make `NativeElseWasmExecutor` behave like its name. It could make the above components use the correct execution strategy. Maybe polkadot do not need about `NativeElseWasmExecutor` anymore. But it is still needed by other chains and it's useful for debugging. --------- Co-authored-by: Bastian Köcher <git@kchr.de> Co-authored-by: command-bot <> Co-authored-by: Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com>
This commit is contained in:
@@ -103,14 +103,7 @@ fn construct_block<E: Externalities>(
|
||||
|
||||
// execute the block to get the real header.
|
||||
executor
|
||||
.call(
|
||||
ext,
|
||||
&runtime_code,
|
||||
"Core_initialize_block",
|
||||
&header.encode(),
|
||||
true,
|
||||
CallContext::Offchain,
|
||||
)
|
||||
.call(ext, &runtime_code, "Core_initialize_block", &header.encode(), CallContext::Offchain)
|
||||
.0
|
||||
.unwrap();
|
||||
|
||||
@@ -121,7 +114,6 @@ fn construct_block<E: Externalities>(
|
||||
&runtime_code,
|
||||
"BlockBuilder_apply_extrinsic",
|
||||
&i.encode(),
|
||||
true,
|
||||
CallContext::Offchain,
|
||||
)
|
||||
.0
|
||||
@@ -135,7 +127,6 @@ fn construct_block<E: Externalities>(
|
||||
&runtime_code,
|
||||
"BlockBuilder_finalize_block",
|
||||
&[0u8; 0],
|
||||
true,
|
||||
CallContext::Offchain,
|
||||
)
|
||||
.0
|
||||
@@ -200,7 +191,6 @@ fn bench_execute_block(c: &mut Criterion) {
|
||||
&runtime_code,
|
||||
"Core_execute_block",
|
||||
&block.0,
|
||||
false,
|
||||
CallContext::Offchain,
|
||||
)
|
||||
.0
|
||||
|
||||
Reference in New Issue
Block a user