feat: Rebrand Polkadot/Substrate references to PezkuwiChain
This commit systematically rebrands various references from Parity Technologies' Polkadot/Substrate ecosystem to PezkuwiChain within the kurdistan-sdk. Key changes include: - Updated external repository URLs (zombienet-sdk, parity-db, parity-scale-codec, wasm-instrument) to point to pezkuwichain forks. - Modified internal documentation and code comments to reflect PezkuwiChain naming and structure. - Replaced direct references to with or specific paths within the for XCM, Pezkuwi, and other modules. - Cleaned up deprecated issue and PR references in various and files, particularly in and modules. - Adjusted image and logo URLs in documentation to point to PezkuwiChain assets. - Removed or rephrased comments related to external Polkadot/Substrate PRs and issues. This is a significant step towards fully customizing the SDK for the PezkuwiChain ecosystem.
This commit is contained in:
@@ -0,0 +1,129 @@
|
||||
[package]
|
||||
name = "pezsp-io"
|
||||
version = "30.0.0"
|
||||
authors.workspace = true
|
||||
edition.workspace = true
|
||||
license = "Apache-2.0"
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
description = "I/O for Bizinikiwi runtimes"
|
||||
documentation = "https://docs.rs/pezsp-io"
|
||||
readme = "README.md"
|
||||
build = "build.rs"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
[dependencies]
|
||||
bytes = { workspace = true }
|
||||
codec = { features = ["bytes"], workspace = true }
|
||||
secp256k1 = { features = [
|
||||
"global-context",
|
||||
"recovery",
|
||||
], optional = true, workspace = true, default-features = true }
|
||||
pezsp-core = { workspace = true }
|
||||
pezsp-crypto-hashing = { workspace = true }
|
||||
pezsp-externalities = { workspace = true }
|
||||
pezsp-keystore = { optional = true, workspace = true }
|
||||
pezsp-runtime-interface = { workspace = true }
|
||||
pezsp-state-machine = { optional = true, workspace = true }
|
||||
pezsp-tracing = { workspace = true }
|
||||
pezsp-trie = { optional = true, workspace = true }
|
||||
tracing = { workspace = true }
|
||||
tracing-core = { workspace = true }
|
||||
|
||||
[target.'cfg(not(bizinikiwi_runtime))'.dependencies]
|
||||
pezsp-keystore = { workspace = true, default-features = false }
|
||||
pezsp-trie = { workspace = true, default-features = false }
|
||||
pezsp-state-machine = { workspace = true, default-features = false }
|
||||
log = { workspace = true, default-features = true }
|
||||
libsecp256k1 = { workspace = true, default-features = false, features = [
|
||||
"static-context",
|
||||
] }
|
||||
secp256k1 = { workspace = true, default-features = false, features = [
|
||||
"alloc",
|
||||
"recovery",
|
||||
] }
|
||||
|
||||
# Required for backwards compatibility reason, but only used for verifying when `UseDalekExt` is set.
|
||||
ed25519-dalek = { workspace = true }
|
||||
|
||||
docify = { workspace = true }
|
||||
|
||||
[target.'cfg(all(any(target_arch = "riscv32", target_arch = "riscv64"), bizinikiwi_runtime))'.dependencies]
|
||||
polkavm-derive = { workspace = true }
|
||||
|
||||
[build-dependencies]
|
||||
rustversion = { workspace = true }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = [
|
||||
"bytes/std",
|
||||
"codec/std",
|
||||
"ed25519-dalek/std",
|
||||
"libsecp256k1/std",
|
||||
"log/std",
|
||||
"secp256k1/global-context",
|
||||
"secp256k1/std",
|
||||
"pezsp-core/std",
|
||||
"pezsp-crypto-hashing/std",
|
||||
"pezsp-externalities/std",
|
||||
"pezsp-keystore/std",
|
||||
"pezsp-runtime-interface/std",
|
||||
"pezsp-state-machine/std",
|
||||
"pezsp-tracing/std",
|
||||
"pezsp-trie/std",
|
||||
"tracing-core/std",
|
||||
"tracing/std",
|
||||
]
|
||||
|
||||
with-tracing = ["pezsp-tracing/with-tracing"]
|
||||
|
||||
# These two features are used for `no_std` builds for the environments which already provides
|
||||
# `#[panic_handler]`, `#[alloc_error_handler]` and `#[global_allocator]`.
|
||||
#
|
||||
# For the regular wasm runtime builds those are not used.
|
||||
disable_panic_handler = []
|
||||
disable_oom = []
|
||||
disable_allocator = []
|
||||
|
||||
# This feature flag controls the runtime's behavior when encountering
|
||||
# a panic or when it runs out of memory, improving the diagnostics.
|
||||
#
|
||||
# When enabled the runtime will marshal the relevant error message
|
||||
# to the host through the `PanicHandler::abort_on_panic` runtime interface.
|
||||
# This gives the caller direct programmatic access to the error message.
|
||||
#
|
||||
# When disabled the error message will only be printed out in the
|
||||
# logs, with the caller receiving a generic "wasm `unreachable` instruction executed"
|
||||
# error message.
|
||||
#
|
||||
# This has no effect if both `disable_panic_handler` and `disable_oom`
|
||||
# are enabled.
|
||||
#
|
||||
# WARNING: Enabling this feature flag requires the `PanicHandler::abort_on_panic`
|
||||
# host function to be supported by the host. Do *not* enable it for your
|
||||
# runtime without first upgrading your host client!
|
||||
improved_panic_error_reporting = []
|
||||
|
||||
# This feature adds BLS crypto primitives.
|
||||
# It should not be used in production since the implementation and interface may still
|
||||
# be subject to significant changes.
|
||||
bls-experimental = ["pezsp-core/bls-experimental", "pezsp-keystore/bls-experimental"]
|
||||
|
||||
# This feature adds Bandersnatch crypto primitives.
|
||||
# It should not be used in production since the implementation and interface may still
|
||||
# be subject to significant changes.
|
||||
bandersnatch-experimental = [
|
||||
"pezsp-core/bandersnatch-experimental",
|
||||
"pezsp-keystore/bandersnatch-experimental",
|
||||
]
|
||||
runtime-benchmarks = [
|
||||
"pezsp-runtime-interface/runtime-benchmarks",
|
||||
"pezsp-state-machine?/runtime-benchmarks",
|
||||
"pezsp-trie?/runtime-benchmarks",
|
||||
]
|
||||
@@ -0,0 +1,3 @@
|
||||
I/O host interface for Bizinikiwi runtime.
|
||||
|
||||
License: Apache-2.0
|
||||
@@ -0,0 +1,26 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[rustversion::before(1.68)]
|
||||
fn main() {
|
||||
if !cfg!(feature = "std") {
|
||||
println!("cargo:rustc-cfg=enable_alloc_error_handler");
|
||||
}
|
||||
}
|
||||
|
||||
#[rustversion::since(1.68)]
|
||||
fn main() {}
|
||||
@@ -0,0 +1,19 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#[global_allocator]
|
||||
static ALLOCATOR: polkavm_derive::LeakingAllocator = polkavm_derive::LeakingAllocator;
|
||||
@@ -0,0 +1,85 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
use core::{
|
||||
alloc::{GlobalAlloc, Layout},
|
||||
ptr,
|
||||
};
|
||||
|
||||
/// The type used to store the offset between the real pointer and the returned pointer.
|
||||
type Offset = u16;
|
||||
|
||||
/// The length of [`Offset`].
|
||||
const OFFSET_LENGTH: usize = core::mem::size_of::<Offset>();
|
||||
|
||||
/// Allocator used by Bizinikiwi from within the runtime.
|
||||
///
|
||||
/// The allocator needs to align the returned pointer to given layout. We assume that on the host
|
||||
/// side the freeing-bump allocator is used with a fixed alignment of `8` and a `HEADER_SIZE` of
|
||||
/// `8`. The freeing-bump allocator is storing the header in the 8 bytes before the actual pointer
|
||||
/// returned by `alloc`. The problem is that the runtime not only sees pointers allocated by this
|
||||
/// `RuntimeAllocator`, but also pointers allocated by the host. The header is stored as a
|
||||
/// little-endian `u64`. The allocation header consists of 8 bytes. The first four bytes (as written
|
||||
/// in memory) are used to store the order of the allocation (or the link to the next slot, if
|
||||
/// unallocated). Then the least significant bit of the next byte determines whether a given slot is
|
||||
/// occupied or free, and the last three bytes are unused.
|
||||
///
|
||||
/// The `RuntimeAllocator` aligns the pointer to the required alignment before returning it to the
|
||||
/// user code. As we are assuming the freeing-bump allocator that already aligns by `8` by default,
|
||||
/// we only need to take care of alignments above `8`. The offset is stored in two bytes before the
|
||||
/// pointer that we return to the user. Depending on the alignment, we may write into the header,
|
||||
/// but given the assumptions above this should be no problem.
|
||||
struct RuntimeAllocator;
|
||||
|
||||
#[global_allocator]
|
||||
static ALLOCATOR: RuntimeAllocator = RuntimeAllocator;
|
||||
|
||||
unsafe impl GlobalAlloc for RuntimeAllocator {
|
||||
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
|
||||
let align = layout.align();
|
||||
let size = layout.size();
|
||||
|
||||
// Allocate for the required size, plus a potential alignment.
|
||||
//
|
||||
// As the host side already aligns the pointer by `8`, we only need to account for any
|
||||
// excess.
|
||||
let ptr = crate::allocator::malloc((size + align.saturating_sub(8)) as u32);
|
||||
|
||||
// Calculate the required alignment.
|
||||
let ptr_offset = ptr.align_offset(align);
|
||||
|
||||
// Should never happen, but just to be sure.
|
||||
if ptr_offset > u16::MAX as usize || ptr.is_null() {
|
||||
return ptr::null_mut();
|
||||
}
|
||||
|
||||
// Align the pointer.
|
||||
let ptr = ptr.add(ptr_offset);
|
||||
|
||||
unsafe {
|
||||
(ptr.sub(OFFSET_LENGTH) as *mut Offset).write_unaligned(ptr_offset as Offset);
|
||||
}
|
||||
|
||||
ptr
|
||||
}
|
||||
|
||||
unsafe fn dealloc(&self, ptr: *mut u8, _: Layout) {
|
||||
let offset = unsafe { (ptr.sub(OFFSET_LENGTH) as *const Offset).read_unaligned() };
|
||||
|
||||
crate::allocator::free(ptr.sub(offset as usize))
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user