Skip to content

Commit

Permalink
PoC
Browse files Browse the repository at this point in the history
  • Loading branch information
s0me0ne-unkn0wn committed Oct 11, 2024
1 parent 8614dc0 commit 35fb1ee
Show file tree
Hide file tree
Showing 25 changed files with 2,755 additions and 172 deletions.
196 changes: 179 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ members = [
"cumulus/parachains/runtimes/test-utils",
"cumulus/parachains/runtimes/testing/penpal",
"cumulus/parachains/runtimes/testing/rococo-parachain",
"cumulus/parachains/runtimes/testing/westend-parachain",
"cumulus/parachains/runtimes/testing/westend-pvm-parachain",
"cumulus/polkadot-parachain",
"cumulus/polkadot-parachain/polkadot-parachain-lib",
"cumulus/primitives/aura",
Expand Down Expand Up @@ -1075,9 +1077,9 @@ polkadot-subsystem-bench = { path = "polkadot/node/subsystem-bench" }
polkadot-test-client = { path = "polkadot/node/test/client" }
polkadot-test-runtime = { path = "polkadot/runtime/test-runtime" }
polkadot-test-service = { path = "polkadot/node/test/service" }
polkavm = { version = "0.9.3", default-features = false }
polkavm-derive = "0.9.1"
polkavm-linker = "0.9.2"
polkavm = { path = "../polkavm/crates/polkavm" }
polkavm-derive = { path = "../polkavm/crates/polkavm-derive" }
polkavm-linker = { path = "../polkavm/crates/polkavm-linker" }
portpicker = { version = "0.1.1" }
pretty_assertions = { version = "1.3.0" }
primitive-types = { version = "0.12.1", default-features = false }
Expand Down Expand Up @@ -1360,6 +1362,8 @@ wasmi = { version = "0.32.3", default-features = false }
wasmtime = { version = "8.0.1", default-features = false }
wat = { version = "1.0.0" }
westend-emulated-chain = { path = "cumulus/parachains/integration-tests/emulated/chains/relays/westend", default-features = false }
westend-parachain-runtime = { path = "cumulus/parachains/runtimes/testing/westend-parachain" }
westend-pvm-parachain-runtime = { path = "cumulus/parachains/runtimes/testing/westend-pvm-parachain" }
westend-runtime = { path = "polkadot/runtime/westend" }
westend-runtime-constants = { path = "polkadot/runtime/westend/constants", default-features = false }
westend-system-emulated-network = { path = "cumulus/parachains/integration-tests/emulated/networks/westend-system" }
Expand Down
5 changes: 4 additions & 1 deletion cumulus/pallets/parachain-system/proc-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,12 @@ pub fn register_validate_block(input: proc_macro::TokenStream) -> proc_macro::To
#[doc(hidden)]
mod parachain_validate_block {
use super::*;
#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
use sp_runtime_interface::polkavm::{polkavm_export, self};

#[no_mangle]
unsafe fn validate_block(arguments: *mut u8, arguments_len: usize) -> u64 {
#[cfg_attr(any(target_arch = "riscv32", target_arch = "riscv64"), polkavm_export(abi = sp_runtime_interface::polkavm::polkavm_abi))]
pub unsafe extern "C" fn validate_block(arguments: *mut u8, arguments_len: usize) -> u64 {
// We convert the `arguments` into a boxed slice and then into `Bytes`.
let args = #crate_::validate_block::Box::from_raw(
#crate_::validate_block::slice::from_raw_parts_mut(
Expand Down
Loading

0 comments on commit 35fb1ee

Please sign in to comment.