diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs index 8b9cbf66015c7..f17fbdc996393 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs @@ -1202,7 +1202,6 @@ impl pallet_revive::Config for Runtime { type AddressMapper = pallet_revive::AccountId32Mapper; type RuntimeMemory = ConstU32<{ 128 * 1024 * 1024 }>; type PVFMemory = ConstU32<{ 512 * 1024 * 1024 }>; - type UnsafeUnstableInterface = ConstBool; type AllowEVMBytecode = ConstBool; type UploadOrigin = EnsureSigned; type InstantiateOrigin = EnsureSigned; diff --git a/cumulus/parachains/runtimes/testing/penpal/src/lib.rs b/cumulus/parachains/runtimes/testing/penpal/src/lib.rs index bc018b160f778..2265d9cf50c5a 100644 --- a/cumulus/parachains/runtimes/testing/penpal/src/lib.rs +++ b/cumulus/parachains/runtimes/testing/penpal/src/lib.rs @@ -830,7 +830,6 @@ impl pallet_revive::Config for Runtime { type AddressMapper = pallet_revive::AccountId32Mapper; type RuntimeMemory = ConstU32<{ 128 * 1024 * 1024 }>; type PVFMemory = ConstU32<{ 512 * 1024 * 1024 }>; - type UnsafeUnstableInterface = ConstBool; type AllowEVMBytecode = ConstBool; type UploadOrigin = EnsureSigned; type InstantiateOrigin = EnsureSigned; diff --git a/prdoc/pr_10712.prdoc b/prdoc/pr_10712.prdoc new file mode 100644 index 0000000000000..243ef0622f5ad --- /dev/null +++ b/prdoc/pr_10712.prdoc @@ -0,0 +1,20 @@ +title: '[pallet-revive] remove code related to stable and unstable_hostfn' +doc: +- audience: Runtime Dev + description: |- + Part of https://github.com/paritytech/polkadot-sdk/issues/8572 + + Removes the proc macro `unstable_hostfn` and attribute `#[stable]` because they are not used anywhere. +crates: +- name: pallet-revive-proc-macro + bump: patch +- name: pallet-revive + bump: major +- name: pallet-revive-fixtures + bump: patch +- name: pallet-revive-uapi + bump: major +- name: asset-hub-westend-runtime + bump: patch +- name: penpal-runtime + bump: patch diff --git a/substrate/bin/node/runtime/src/lib.rs b/substrate/bin/node/runtime/src/lib.rs index 6f1170651bc0c..390fefdbb2dcc 100644 --- a/substrate/bin/node/runtime/src/lib.rs +++ b/substrate/bin/node/runtime/src/lib.rs @@ -1539,7 +1539,6 @@ impl pallet_revive::Config for Runtime { type AddressMapper = pallet_revive::AccountId32Mapper; type RuntimeMemory = ConstU32<{ 128 * 1024 * 1024 }>; type PVFMemory = ConstU32<{ 512 * 1024 * 1024 }>; - type UnsafeUnstableInterface = ConstBool; type UploadOrigin = EnsureSigned; type InstantiateOrigin = EnsureSigned; type RuntimeHoldReason = RuntimeHoldReason; diff --git a/substrate/frame/revive/README.md b/substrate/frame/revive/README.md index eb64de41e7b09..629bcd5dc7a75 100644 --- a/substrate/frame/revive/README.md +++ b/substrate/frame/revive/README.md @@ -101,19 +101,4 @@ Example: cargo run --release -- --dev -lerror,runtime::revive::strace=trace,runtime::revive=debug ``` -## Unstable Interfaces - -Driven by the desire to have an iterative approach in developing new contract interfaces this pallet contains the -concept of an unstable interface. Akin to the rust nightly compiler it allows us to add new interfaces but mark them as -unstable so that contract languages can experiment with them and give feedback before we stabilize those. - -In order to access interfaces which don't have a stable `#[stable]` in [`runtime.rs`](src/vm/runtime.rs) -one need to set `pallet_revive::Config::UnsafeUnstableInterface` to `ConstU32`. -**It should be obvious that any production runtime should never be compiled with this feature: In addition to be -subject to change or removal those interfaces might not have proper weights associated with them and are therefore -considered unsafe**. - -New interfaces are generally added as unstable and might go through several iterations before they are promoted to a -stable interface. - License: Apache-2.0 diff --git a/substrate/frame/revive/fixtures/build/_Cargo.toml b/substrate/frame/revive/fixtures/build/_Cargo.toml index 955c1d29c8bf6..c340cc35d5a90 100644 --- a/substrate/frame/revive/fixtures/build/_Cargo.toml +++ b/substrate/frame/revive/fixtures/build/_Cargo.toml @@ -12,7 +12,7 @@ edition = "2021" # All paths are injected dynamically by the build script. [dependencies] -uapi = { package = 'pallet-revive-uapi', features = ["unstable-hostfn"], default-features = false } +uapi = { package = 'pallet-revive-uapi', default-features = false } hex-literal = { version = "0.4.1", default-features = false } polkavm-derive = { version = "0.30.0" } diff --git a/substrate/frame/revive/proc-macro/src/lib.rs b/substrate/frame/revive/proc-macro/src/lib.rs index b67e15a0103df..734ad9b488c1c 100644 --- a/substrate/frame/revive/proc-macro/src/lib.rs +++ b/substrate/frame/revive/proc-macro/src/lib.rs @@ -25,17 +25,6 @@ use proc_macro2::{Literal, Span, TokenStream as TokenStream2}; use quote::{quote, ToTokens}; use syn::{parse_quote, punctuated::Punctuated, spanned::Spanned, token::Comma, FnArg, Ident}; -#[proc_macro_attribute] -pub fn unstable_hostfn(_attr: TokenStream, item: TokenStream) -> TokenStream { - let input = syn::parse_macro_input!(item as syn::Item); - let expanded = quote! { - #[cfg(feature = "unstable-hostfn")] - #[cfg_attr(docsrs, doc(cfg(feature = "unstable-hostfn")))] - #input - }; - expanded.into() -} - /// Defines a host functions set that can be imported by contract polkavm code. /// /// **CAUTION**: Be advised that all functions defined by this macro @@ -71,7 +60,6 @@ struct EnvDef { /// Parsed host function definition. struct HostFn { item: syn::ItemFn, - is_stable: bool, name: String, returns: HostFnReturn, cfg: Option, @@ -135,22 +123,15 @@ impl HostFn { }; // process attributes - let msg = "Only #[stable], #[cfg] and #[mutating] attributes are allowed."; + let msg = "Only #[cfg] and #[mutating] attributes are allowed."; let span = item.span(); let mut attrs = item.attrs.clone(); attrs.retain(|a| !a.path().is_ident("doc")); - let mut is_stable = false; let mut mutating = false; let mut cfg = None; while let Some(attr) = attrs.pop() { let ident = attr.path().get_ident().ok_or(err(span, msg))?.to_string(); match ident.as_str() { - "stable" => { - if is_stable { - return Err(err(span, "#[stable] can only be specified once")) - } - is_stable = true; - }, "mutating" => { if mutating { return Err(err(span, "#[mutating] can only be specified once")) @@ -264,7 +245,7 @@ impl HostFn { _ => Err(err(arg1.span(), &msg)), }?; - Ok(Self { item, is_stable, name, returns, cfg }) + Ok(Self { item, name, returns, cfg }) }, _ => Err(err(span, &msg)), } @@ -335,16 +316,11 @@ fn expand_env(def: &EnvDef) -> TokenStream2 { let impls = expand_functions(def); let bench_impls = expand_bench_functions(def); let docs = expand_func_doc(def); - let stable_syscalls = expand_func_list(def, false); - let all_syscalls = expand_func_list(def, true); + let all_syscalls = expand_func_list(def); quote! { - pub fn list_syscalls(include_unstable: bool) -> &'static [&'static [u8]] { - if include_unstable { - #all_syscalls - } else { - #stable_syscalls - } + pub fn list_syscalls() -> &'static [&'static [u8]] { + #all_syscalls } impl<'a, E: Ext, M: PolkaVmInstance> Runtime<'a, E, M> { @@ -512,17 +488,8 @@ fn expand_func_doc(def: &EnvDef) -> TokenStream2 { }); quote! { #( #docs )* } }; - let availability = if func.is_stable { - let info = "\n# Stable API\nThis API is stable and will never change."; - quote! { #[doc = #info] } - } else { - let info = - "\n# Unstable API\nThis API is not standardized and only available for testing."; - quote! { #[doc = #info] } - }; quote! { #func_docs - #availability } }; quote! { @@ -536,8 +503,8 @@ fn expand_func_doc(def: &EnvDef) -> TokenStream2 { } } -fn expand_func_list(def: &EnvDef, include_unstable: bool) -> TokenStream2 { - let docs = def.host_funcs.iter().filter(|f| include_unstable || f.is_stable).map(|f| { +fn expand_func_list(def: &EnvDef) -> TokenStream2 { + let docs = def.host_funcs.iter().map(|f| { let name = Literal::byte_string(f.name.as_bytes()); quote! { #name.as_slice() diff --git a/substrate/frame/revive/src/lib.rs b/substrate/frame/revive/src/lib.rs index 16d11e3868e5a..cdec816cd9d5c 100644 --- a/substrate/frame/revive/src/lib.rs +++ b/substrate/frame/revive/src/lib.rs @@ -260,18 +260,6 @@ pub mod pallet { #[pallet::no_default] type AddressMapper: AddressMapper; - /// Make contract callable functions marked as `#[unstable]` available. - /// - /// Contracts that use `#[unstable]` functions won't be able to be uploaded unless - /// this is set to `true`. This is only meant for testnets and dev nodes in order to - /// experiment with new features. - /// - /// # Warning - /// - /// Do **not** set to `true` on productions chains. - #[pallet::constant] - type UnsafeUnstableInterface: Get; - /// Allow EVM bytecode to be uploaded and instantiated. #[pallet::constant] type AllowEVMBytecode: Get; @@ -438,7 +426,6 @@ pub mod pallet { type DepositPerItem = DepositPerItem; type DepositPerChildTrieItem = DepositPerChildTrieItem; type Time = Self; - type UnsafeUnstableInterface = ConstBool; type AllowEVMBytecode = ConstBool; type UploadOrigin = EnsureSigned; type InstantiateOrigin = EnsureSigned; diff --git a/substrate/frame/revive/src/tests.rs b/substrate/frame/revive/src/tests.rs index 0af794f6ec7e3..dae17bce0f378 100644 --- a/substrate/frame/revive/src/tests.rs +++ b/substrate/frame/revive/src/tests.rs @@ -258,10 +258,6 @@ pub(crate) mod builder { } impl Test { - pub fn set_unstable_interface(unstable_interface: bool) { - UNSTABLE_INTERFACE.with(|v| *v.borrow_mut() = unstable_interface); - } - pub fn set_allow_evm_bytecode(allow_evm_bytecode: bool) { ALLOW_EVM_BYTECODE.with(|v| *v.borrow_mut() = allow_evm_bytecode); } @@ -372,7 +368,6 @@ where } } parameter_types! { - pub static UnstableInterface: bool = true; pub static AllowEvmBytecode: bool = true; pub CheckingAccount: AccountId32 = BOB.clone(); pub static DebugFlag: bool = false; @@ -396,7 +391,6 @@ impl Config for Test { type DepositPerByte = DepositPerByte; type DepositPerItem = DepositPerItem; type DepositPerChildTrieItem = DepositPerItem; - type UnsafeUnstableInterface = UnstableInterface; type AllowEVMBytecode = AllowEvmBytecode; type UploadOrigin = EnsureAccount; type InstantiateOrigin = EnsureAccount; diff --git a/substrate/frame/revive/src/vm/pvm/env.rs b/substrate/frame/revive/src/vm/pvm/env.rs index f4ce11a412bbf..09208619c12a6 100644 --- a/substrate/frame/revive/src/vm/pvm/env.rs +++ b/substrate/frame/revive/src/vm/pvm/env.rs @@ -109,7 +109,7 @@ impl ContractBlob { pub fn from_pvm_code(code: Vec, owner: AccountIdOf) -> Result { // We do validation only when new code is deployed. This allows us to increase // the limits later without affecting already deployed code. - let available_syscalls = list_syscalls(T::UnsafeUnstableInterface::get()); + let available_syscalls = list_syscalls(); let code = limits::code::enforce::(code, available_syscalls)?; let code_len = code.len() as u32; @@ -192,18 +192,13 @@ impl<'a, E: Ext, M: PolkaVmInstance> Runtime<'a, E, M> { #[define_env] pub mod env { /// Noop function used to benchmark the time it takes to execute an empty function. - /// - /// Marked as stable because it needs to be called from benchmarks even when the benchmarked - /// parachain has unstable functions disabled. #[cfg(feature = "runtime-benchmarks")] - #[stable] fn noop(&mut self, memory: &mut M) -> Result<(), TrapReason> { Ok(()) } /// Set the value at the given key in the contract storage. - /// See [`pallet_revive_uapi::HostFn::set_storage_v2`] - #[stable] + /// See [`pallet_revive_uapi::HostFn::set_storage`] #[mutating] fn set_storage( &mut self, @@ -225,7 +220,6 @@ pub mod env { /// Sets the storage at a fixed 256-bit key with a fixed 256-bit value. /// See [`pallet_revive_uapi::HostFn::set_storage_or_clear`]. - #[stable] #[mutating] fn set_storage_or_clear( &mut self, @@ -245,7 +239,6 @@ pub mod env { /// Retrieve the value under the given key from storage. /// See [`pallet_revive_uapi::HostFn::get_storage`] - #[stable] fn get_storage( &mut self, memory: &mut M, @@ -267,7 +260,6 @@ pub mod env { /// Reads the storage at a fixed 256-bit key and writes back a fixed 256-bit value. /// See [`pallet_revive_uapi::HostFn::get_storage_or_zero`]. - #[stable] fn get_storage_or_zero( &mut self, memory: &mut M, @@ -289,7 +281,6 @@ pub mod env { /// Make a call to another contract. /// See [`pallet_revive_uapi::HostFn::call`]. - #[stable] fn call( &mut self, memory: &mut M, @@ -324,7 +315,6 @@ pub mod env { /// Make a call to another contract. /// See [`pallet_revive_uapi::HostFn::call_evm`]. - #[stable] fn call_evm( &mut self, memory: &mut M, @@ -362,7 +352,6 @@ pub mod env { /// Execute code in the context (storage, caller, value) of the current contract. /// See [`pallet_revive_uapi::HostFn::delegate_call`]. - #[stable] fn delegate_call( &mut self, memory: &mut M, @@ -396,7 +385,6 @@ pub mod env { /// Same as `delegate_call` but with EVM gas. /// See [`pallet_revive_uapi::HostFn::delegate_call_evm`]. - #[stable] fn delegate_call_evm( &mut self, memory: &mut M, @@ -429,7 +417,6 @@ pub mod env { /// Instantiate a contract with the specified code hash. /// See [`pallet_revive_uapi::HostFn::instantiate`]. - #[stable] #[mutating] fn instantiate( &mut self, @@ -469,7 +456,6 @@ pub mod env { /// Returns the total size of the contract call input data. /// See [`pallet_revive_uapi::HostFn::call_data_size `]. - #[stable] fn call_data_size(&mut self, memory: &mut M) -> Result { self.charge_gas(RuntimeCosts::CallDataSize)?; Ok(self @@ -481,7 +467,6 @@ pub mod env { /// Stores the input passed by the caller into the supplied buffer. /// See [`pallet_revive_uapi::HostFn::call_data_copy`]. - #[stable] fn call_data_copy( &mut self, memory: &mut M, @@ -512,7 +497,6 @@ pub mod env { /// Stores the U256 value at given call input `offset` into the supplied buffer. /// See [`pallet_revive_uapi::HostFn::call_data_load`]. - #[stable] fn call_data_load( &mut self, memory: &mut M, @@ -543,7 +527,6 @@ pub mod env { /// Cease contract execution and save a data buffer as a result of the execution. /// See [`pallet_revive_uapi::HostFn::return_value`]. - #[stable] fn seal_return( &mut self, memory: &mut M, @@ -560,7 +543,6 @@ pub mod env { /// Stores the address of the caller into the supplied buffer. /// See [`pallet_revive_uapi::HostFn::caller`]. - #[stable] fn caller(&mut self, memory: &mut M, out_ptr: u32) -> Result<(), TrapReason> { self.charge_gas(RuntimeCosts::Caller)?; let caller = ::AddressMapper::to_address(self.ext.caller().account_id()?); @@ -575,7 +557,6 @@ pub mod env { /// Stores the address of the call stack origin into the supplied buffer. /// See [`pallet_revive_uapi::HostFn::origin`]. - #[stable] fn origin(&mut self, memory: &mut M, out_ptr: u32) -> Result<(), TrapReason> { self.charge_gas(RuntimeCosts::Origin)?; let origin = ::AddressMapper::to_address(self.ext.origin().account_id()?); @@ -590,7 +571,6 @@ pub mod env { /// Retrieve the code hash for a specified contract address. /// See [`pallet_revive_uapi::HostFn::code_hash`]. - #[stable] fn code_hash(&mut self, memory: &mut M, addr_ptr: u32, out_ptr: u32) -> Result<(), TrapReason> { self.charge_gas(RuntimeCosts::CodeHash)?; let address = memory.read_h160(addr_ptr)?; @@ -605,7 +585,6 @@ pub mod env { /// Retrieve the code size for a given contract address. /// See [`pallet_revive_uapi::HostFn::code_size`]. - #[stable] fn code_size(&mut self, memory: &mut M, addr_ptr: u32) -> Result { self.charge_gas(RuntimeCosts::CodeSize)?; let address = memory.read_h160(addr_ptr)?; @@ -614,7 +593,6 @@ pub mod env { /// Stores the address of the current contract into the supplied buffer. /// See [`pallet_revive_uapi::HostFn::address`]. - #[stable] fn address(&mut self, memory: &mut M, out_ptr: u32) -> Result<(), TrapReason> { self.charge_gas(RuntimeCosts::Address)?; let address = self.ext.address(); @@ -629,7 +607,6 @@ pub mod env { /// Stores the immutable data into the supplied buffer. /// See [`pallet_revive_uapi::HostFn::get_immutable_data`]. - #[stable] fn get_immutable_data( &mut self, memory: &mut M, @@ -646,7 +623,6 @@ pub mod env { /// Attaches the supplied immutable data to the currently executing contract. /// See [`pallet_revive_uapi::HostFn::set_immutable_data`]. - #[stable] fn set_immutable_data(&mut self, memory: &mut M, ptr: u32, len: u32) -> Result<(), TrapReason> { if len > limits::IMMUTABLE_BYTES { return Err(Error::::OutOfBounds.into()); @@ -660,7 +636,6 @@ pub mod env { /// Stores the *free* balance of the current account into the supplied buffer. /// See [`pallet_revive_uapi::HostFn::balance`]. - #[stable] fn balance(&mut self, memory: &mut M, out_ptr: u32) -> Result<(), TrapReason> { self.charge_gas(RuntimeCosts::Balance)?; Ok(self.write_fixed_sandbox_output( @@ -674,7 +649,6 @@ pub mod env { /// Stores the *free* balance of the supplied address into the supplied buffer. /// See [`pallet_revive_uapi::HostFn::balance`]. - #[stable] fn balance_of( &mut self, memory: &mut M, @@ -694,7 +668,6 @@ pub mod env { /// Returns the chain ID. /// See [`pallet_revive_uapi::HostFn::chain_id`]. - #[stable] fn chain_id(&mut self, memory: &mut M, out_ptr: u32) -> Result<(), TrapReason> { Ok(self.write_fixed_sandbox_output( memory, @@ -707,7 +680,6 @@ pub mod env { /// Returns the block ref_time limit. /// See [`pallet_revive_uapi::HostFn::gas_limit`]. - #[stable] fn gas_limit(&mut self, memory: &mut M) -> Result { self.charge_gas(RuntimeCosts::GasLimit)?; Ok(self.ext.gas_limit()) @@ -715,7 +687,6 @@ pub mod env { /// Stores the value transferred along with this call/instantiate into the supplied buffer. /// See [`pallet_revive_uapi::HostFn::value_transferred`]. - #[stable] fn value_transferred(&mut self, memory: &mut M, out_ptr: u32) -> Result<(), TrapReason> { self.charge_gas(RuntimeCosts::ValueTransferred)?; Ok(self.write_fixed_sandbox_output( @@ -729,7 +700,6 @@ pub mod env { /// Returns the simulated ethereum `GASPRICE` value. /// See [`pallet_revive_uapi::HostFn::gas_price`]. - #[stable] fn gas_price(&mut self, memory: &mut M) -> Result { self.charge_gas(RuntimeCosts::GasPrice)?; Ok(self.ext.effective_gas_price().saturated_into()) @@ -737,7 +707,6 @@ pub mod env { /// Returns the simulated ethereum `BASEFEE` value. /// See [`pallet_revive_uapi::HostFn::base_fee`]. - #[stable] fn base_fee(&mut self, memory: &mut M, out_ptr: u32) -> Result<(), TrapReason> { self.charge_gas(RuntimeCosts::BaseFee)?; Ok(self.write_fixed_sandbox_output( @@ -751,7 +720,6 @@ pub mod env { /// Load the latest block timestamp into the supplied buffer /// See [`pallet_revive_uapi::HostFn::now`]. - #[stable] fn now(&mut self, memory: &mut M, out_ptr: u32) -> Result<(), TrapReason> { self.charge_gas(RuntimeCosts::Now)?; Ok(self.write_fixed_sandbox_output( @@ -765,7 +733,6 @@ pub mod env { /// Deposit a contract event with the data buffer and optional list of topics. /// See [pallet_revive_uapi::HostFn::deposit_event] - #[stable] #[mutating] fn deposit_event( &mut self, @@ -805,7 +772,6 @@ pub mod env { /// Stores the current block number of the current contract into the supplied buffer. /// See [`pallet_revive_uapi::HostFn::block_number`]. - #[stable] fn block_number(&mut self, memory: &mut M, out_ptr: u32) -> Result<(), TrapReason> { self.charge_gas(RuntimeCosts::BlockNumber)?; Ok(self.write_fixed_sandbox_output( @@ -819,7 +785,6 @@ pub mod env { /// Stores the block hash at given block height into the supplied buffer. /// See [`pallet_revive_uapi::HostFn::block_hash`]. - #[stable] fn block_hash( &mut self, memory: &mut M, @@ -840,7 +805,6 @@ pub mod env { /// Stores the current block author into the supplied buffer. /// See [`pallet_revive_uapi::HostFn::block_author`]. - #[stable] fn block_author(&mut self, memory: &mut M, out_ptr: u32) -> Result<(), TrapReason> { self.charge_gas(RuntimeCosts::BlockAuthor)?; let block_author = self.ext.block_author(); @@ -856,7 +820,6 @@ pub mod env { /// Computes the KECCAK 256-bit hash on the given input buffer. /// See [`pallet_revive_uapi::HostFn::hash_keccak_256`]. - #[stable] fn hash_keccak_256( &mut self, memory: &mut M, @@ -872,7 +835,6 @@ pub mod env { /// Stores the length of the data returned by the last call into the supplied buffer. /// See [`pallet_revive_uapi::HostFn::return_data_size`]. - #[stable] fn return_data_size(&mut self, memory: &mut M) -> Result { self.charge_gas(RuntimeCosts::ReturnDataSize)?; Ok(self @@ -885,8 +847,7 @@ pub mod env { } /// Stores data returned by the last call, starting from `offset`, into the supplied buffer. - /// See [`pallet_revive_uapi::HostFn::return_data`]. - #[stable] + /// See [`pallet_revive_uapi::HostFn::return_data_copy`]. fn return_data_copy( &mut self, memory: &mut M, @@ -917,7 +878,6 @@ pub mod env { /// would be a breaking change. /// /// See [`pallet_revive_uapi::HostFn::gas_left`]. - #[stable] fn ref_time_left(&mut self, memory: &mut M) -> Result { self.charge_gas(RuntimeCosts::RefTimeLeft)?; Ok(self.ext.gas_left()) @@ -926,7 +886,6 @@ pub mod env { /// Reverts the execution without data and cedes all remaining gas. /// /// See [`pallet_revive_uapi::HostFn::consume_all_gas`]. - #[stable] fn consume_all_gas(&mut self, memory: &mut M) -> Result<(), TrapReason> { self.ext.frame_meter_mut().consume_all_weight(); Err(TrapReason::Return(ReturnData { @@ -936,7 +895,7 @@ pub mod env { } /// Calculates Ethereum address from the ECDSA compressed public key and stores - /// See [`pallet_revive_uapi::HostFn::ecdsa_to_eth_address`]. + /// See `uapi/sol/ISystem.sol`. fn ecdsa_to_eth_address( &mut self, memory: &mut M, @@ -957,7 +916,7 @@ pub mod env { } /// Verify a sr25519 signature - /// See [`pallet_revive_uapi::HostFn::sr25519_verify`]. + /// See `uapi/sol/ISystem.sol`. fn sr25519_verify( &mut self, memory: &mut M, @@ -987,7 +946,6 @@ pub mod env { /// **total** balance if code is deleted from storage, else **free** balance only. /// See [`pallet_revive_uapi::HostFn::terminate`]. #[mutating] - #[stable] fn terminate(&mut self, memory: &mut M, beneficiary_ptr: u32) -> Result<(), TrapReason> { let charged = self.charge_gas(RuntimeCosts::Terminate { code_removed: true })?; let beneficiary = memory.read_h160(beneficiary_ptr)?; diff --git a/substrate/frame/revive/uapi/Cargo.toml b/substrate/frame/revive/uapi/Cargo.toml index 57e9c87db601f..f5cfd867e86e8 100644 --- a/substrate/frame/revive/uapi/Cargo.toml +++ b/substrate/frame/revive/uapi/Cargo.toml @@ -12,7 +12,6 @@ description = "Exposes all the host functions that a contract can import." workspace = true [package.metadata.docs.rs] -features = ["unstable-hostfn"] targets = ["riscv64imac-unknown-none-elf"] [dependencies] @@ -34,4 +33,3 @@ polkavm-derive = { version = "0.30.0" } default = ["scale"] scale = ["dep:codec", "scale-info"] precompiles-sol-interfaces = ["alloy-core"] -unstable-hostfn = []