From 8fd05b62bc576d65d67c09bceded952db631d0e0 Mon Sep 17 00:00:00 2001
From: s0me0ne-unkn0wn <48632512+s0me0ne-unkn0wn@users.noreply.github.com>
Date: Thu, 6 Apr 2023 00:01:31 +0200
Subject: [PATCH] Expose WASM bulk memory extension in execution environment
 parameters (#7008)

---
 polkadot/node/core/pvf/src/executor_intf.rs   | 1 +
 polkadot/primitives/src/v4/executor_params.rs | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/polkadot/node/core/pvf/src/executor_intf.rs b/polkadot/node/core/pvf/src/executor_intf.rs
index 7ea263b4ae6..1092e97c5e0 100644
--- a/polkadot/node/core/pvf/src/executor_intf.rs
+++ b/polkadot/node/core/pvf/src/executor_intf.rs
@@ -133,6 +133,7 @@ fn params_to_wasmtime_semantics(par: &ExecutorParams) -> Result<Semantics, Strin
 					HeapAllocStrategy::Dynamic { maximum_pages: Some(*max_pages) },
 			ExecutorParam::StackLogicalMax(slm) => stack_limit.logical_max = *slm,
 			ExecutorParam::StackNativeMax(snm) => stack_limit.native_stack_max = *snm,
+			ExecutorParam::WasmExtBulkMemory => sem.wasm_bulk_memory = true,
 			ExecutorParam::PrecheckingMaxMemory(_) => (), // TODO: Not implemented yet
 			ExecutorParam::PvfPrepTimeout(_, _) | ExecutorParam::PvfExecTimeout(_, _) => (), // Not used here
 		}
diff --git a/polkadot/primitives/src/v4/executor_params.rs b/polkadot/primitives/src/v4/executor_params.rs
index 56d3e446d0c..0f7665f7202 100644
--- a/polkadot/primitives/src/v4/executor_params.rs
+++ b/polkadot/primitives/src/v4/executor_params.rs
@@ -49,6 +49,9 @@ pub enum ExecutorParam {
 	/// PVF execution timeouts, millisec
 	#[codec(index = 6)]
 	PvfExecTimeout(PvfExecTimeoutKind, u64),
+	/// Enables WASM bulk memory proposal
+	#[codec(index = 7)]
+	WasmExtBulkMemory,
 }
 
 /// Unit type wrapper around [`type@Hash`] that represents an execution parameter set hash.
-- 
GitLab