Skip to content
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

Bump PolkaVM version #6533

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f91a828
Bump polkavm version to 0.16.0
jarkkojs Nov 20, 2024
618dc43
Remove unused import
jarkkojs Nov 20, 2024
86179c2
Update Cargo.toml
jarkkojs Nov 20, 2024
1bae57b
Drop polkavm-common
jarkkojs Nov 20, 2024
1f888ed
sc-executor-common: Use polkavm::ArcBytes to store the raw blob
jarkkojs Nov 21, 2024
cfa00ce
sc-executor-polkavm: remove unnecessary unwrap
jarkkojs Nov 21, 2024
5b37507
sc-executor-polkavm: address unwraps and restore code
jarkkojs Nov 21, 2024
0582e94
sc-executor-polkavm: fix exception handling in call_with_allocation_s…
jarkkojs Nov 21, 2024
f173aae
sc-executor-polkavm: Restore allocate_memory()
jarkkojs Nov 21, 2024
2590aab
sc-executor-polkavm: Fix allocate_memory() error handling
jarkkojs Nov 21, 2024
def26a5
sc-executor-polkavm: Fix 64-bit reg handling in call_host_function()
jarkkojs Nov 21, 2024
6edfed7
sc-executor-polkavm: method_index -> _
jarkkojs Nov 21, 2024
f69b82d
Merge branch 'master' into bump-polkavm-version
jarkkojs Nov 21, 2024
0eedd5e
Merge branch 'master' into bump-polkavm-version
jarkkojs Nov 22, 2024
9b8bc81
ci: PR fixups
jarkkojs Nov 22, 2024
e001c39
polkadot-primitives: Revert compilation bug fix
jarkkojs Nov 22, 2024
f7aa8a1
Merge branch 'master' into bump-polkavm-version
jarkkojs Nov 22, 2024
9f49e12
polkadot-primitives: Revert compilation bug fix
jarkkojs Nov 22, 2024
284d1f3
Update substrate/client/executor/common/src/runtime_blob/runtime_blob.rs
jarkkojs Nov 22, 2024
bdaa448
sc-executor-polkavm: increase nth_reg
jarkkojs Nov 22, 2024
ae00e1c
sc-executor-polkavm: Add 64-bit set_reg calls
jarkkojs Nov 22, 2024
a4190e3
sc-executor-common: cargo fmt fix
jarkkojs Nov 22, 2024
e259528
sc-executor-polkavm: remove exports lookup from call_with_allocation_…
jarkkojs Nov 22, 2024
8e3bb67
Merge branch 'master' into bump-polkavm-version
jarkkojs Nov 25, 2024
52289aa
sc-executor-polkavm: Fixups
jarkkojs Nov 30, 2024
6182ec8
Merge remote-tracking branch 'upstream/master' into bump-polkavm-version
jarkkojs Nov 30, 2024
5fa39bb
sc-executor-polkavm: Fix cargo fmt errors
jarkkojs Nov 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 40 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,7 @@ 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 = { version = "0.17.0", default-features = false }
polkavm-derive = "0.9.1"
polkavm-linker = "0.9.2"
portpicker = { version = "0.1.1" }
Expand Down
11 changes: 11 additions & 0 deletions prdoc/pr_6533.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
title: "Bump to polkavm 0.17.0"
doc:
- audience: Runtime Dev
description: |
Bumped to polkvm 0.17.0.

crates:
- name: sc-executor-common
bump: major
- name: sc-executor-polkavm
bump: major
4 changes: 2 additions & 2 deletions substrate/client/executor/common/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ pub enum WasmError {
Other(String),
}

impl From<polkavm::ProgramParseError> for WasmError {
fn from(error: polkavm::ProgramParseError) -> Self {
impl From<polkavm::program::ProgramParseError> for WasmError {
fn from(error: polkavm::program::ProgramParseError) -> Self {
WasmError::Other(error.to_string())
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.

use crate::{error::WasmError, wasm_runtime::HeapAllocStrategy};
use polkavm::ArcBytes;
use wasm_instrument::parity_wasm::elements::{
deserialize_buffer, serialize, ExportEntry, External, Internal, MemorySection, MemoryType,
Module, Section,
Expand All @@ -29,7 +30,7 @@ pub struct RuntimeBlob(BlobKind);
#[derive(Clone)]
enum BlobKind {
WebAssembly(Module),
PolkaVM(polkavm::ProgramBlob<'static>),
PolkaVM((polkavm::ProgramBlob, ArcBytes)),
}

impl RuntimeBlob {
Expand All @@ -52,9 +53,9 @@ impl RuntimeBlob {
pub fn new(raw_blob: &[u8]) -> Result<Self, WasmError> {
if raw_blob.starts_with(b"PVM\0") {
if crate::is_polkavm_enabled() {
return Ok(Self(BlobKind::PolkaVM(
polkavm::ProgramBlob::parse(raw_blob)?.into_owned(),
)));
let raw = ArcBytes::from(raw_blob);
let blob = polkavm::ProgramBlob::parse(raw.clone())?;
return Ok(Self(BlobKind::PolkaVM((blob, raw))));
} else {
return Err(WasmError::Other("expected a WASM runtime blob, found a PolkaVM runtime blob; set the 'SUBSTRATE_ENABLE_POLKAVM' environment variable to enable the experimental PolkaVM-based executor".to_string()));
}
Expand Down Expand Up @@ -192,7 +193,7 @@ impl RuntimeBlob {
match self.0 {
BlobKind::WebAssembly(raw_module) =>
serialize(raw_module).expect("serializing into a vec should succeed; qed"),
BlobKind::PolkaVM(ref blob) => blob.as_bytes().to_vec(),
BlobKind::PolkaVM(ref blob) => blob.1.to_vec(),
}
}

Expand Down Expand Up @@ -227,7 +228,7 @@ impl RuntimeBlob {
pub fn as_polkavm_blob(&self) -> Option<&polkavm::ProgramBlob> {
match self.0 {
BlobKind::WebAssembly(..) => None,
BlobKind::PolkaVM(ref blob) => Some(blob),
BlobKind::PolkaVM((ref blob, _)) => Some(blob),
}
}
}
Loading
Loading