Skip to content

Commit cc282f8

Browse files
authored
Stabilize seal_delegate_call (paritytech#11037)
1 parent 8b26ac9 commit cc282f8

File tree

5 files changed

+4
-10
lines changed

5 files changed

+4
-10
lines changed

frame/contracts/fixtures/delegate_call.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
(import "seal0" "seal_input" (func $seal_input (param i32 i32)))
33
(import "seal0" "seal_get_storage" (func $seal_get_storage (param i32 i32 i32) (result i32)))
44
(import "seal0" "seal_set_storage" (func $seal_set_storage (param i32 i32 i32)))
5-
(import "__unstable__" "seal_delegate_call" (func $seal_delegate_call (param i32 i32 i32 i32 i32 i32) (result i32)))
5+
(import "seal0" "seal_delegate_call" (func $seal_delegate_call (param i32 i32 i32 i32 i32 i32) (result i32)))
66
(import "env" "memory" (memory 3 3))
77

88
;; [0, 32) storage key

frame/contracts/src/benchmarking/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1492,7 +1492,7 @@ benchmarks! {
14921492
let code = WasmModule::<T>::from(ModuleDefinition {
14931493
memory: Some(ImportedMemory::max::<T>()),
14941494
imported_functions: vec![ImportedFunction {
1495-
module: "__unstable__",
1495+
module: "seal0",
14961496
name: "seal_delegate_call",
14971497
params: vec![
14981498
ValueType::I32,

frame/contracts/src/tests.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,6 @@ fn deploy_and_call_other_contract() {
762762
}
763763

764764
#[test]
765-
#[cfg(feature = "unstable-interface")]
766765
fn delegate_call() {
767766
let (caller_wasm, caller_code_hash) = compile_module::<Test>("delegate_call").unwrap();
768767
let (callee_wasm, callee_code_hash) = compile_module::<Test>("delegate_call_lib").unwrap();

frame/contracts/src/wasm/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ mod tests {
618618
;; output_ptr: u32,
619619
;; output_len_ptr: u32
620620
;;) -> u32
621-
(import "__unstable__" "seal_delegate_call" (func $seal_delegate_call (param i32 i32 i32 i32 i32 i32) (result i32)))
621+
(import "seal0" "seal_delegate_call" (func $seal_delegate_call (param i32 i32 i32 i32 i32 i32) (result i32)))
622622
(import "env" "memory" (memory 1 1))
623623
(func (export "call")
624624
(drop

frame/contracts/src/wasm/runtime.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ pub enum RuntimeCosts {
191191
/// Base weight of calling `seal_call`.
192192
CallBase,
193193
/// Weight of calling `seal_delegate_call` for the given input size.
194-
#[cfg(feature = "unstable-interface")]
195194
DelegateCallBase,
196195
/// Weight of the transfer performed during a call.
197196
CallSurchargeTransfer,
@@ -272,7 +271,6 @@ impl RuntimeCosts {
272271
.saturating_add(s.take_storage_per_byte.saturating_mul(len.into())),
273272
Transfer => s.transfer,
274273
CallBase => s.call,
275-
#[cfg(feature = "unstable-interface")]
276274
DelegateCallBase => s.delegate_call,
277275
CallSurchargeTransfer => s.call_transfer_surcharge,
278276
CallInputCloned(len) => s.call_per_cloned_byte.saturating_mul(len.into()),
@@ -389,7 +387,6 @@ bitflags! {
389387
enum CallType {
390388
/// Execute another instantiated contract
391389
Call { callee_ptr: u32, value_ptr: u32, gas: u64 },
392-
#[cfg(feature = "unstable-interface")]
393390
/// Execute deployed code in the context (storage, account ID, value) of the caller contract
394391
DelegateCall { code_hash_ptr: u32 },
395392
}
@@ -398,7 +395,6 @@ impl CallType {
398395
fn cost(&self) -> RuntimeCosts {
399396
match self {
400397
CallType::Call { .. } => RuntimeCosts::CallBase,
401-
#[cfg(feature = "unstable-interface")]
402398
CallType::DelegateCall { .. } => RuntimeCosts::DelegateCallBase,
403399
}
404400
}
@@ -763,7 +759,6 @@ where
763759
flags.contains(CallFlags::ALLOW_REENTRY),
764760
)
765761
},
766-
#[cfg(feature = "unstable-interface")]
767762
CallType::DelegateCall { code_hash_ptr } => {
768763
if flags.contains(CallFlags::ALLOW_REENTRY) {
769764
return Err(Error::<E::T>::InvalidCallFlags.into())
@@ -1129,7 +1124,7 @@ define_env!(Env, <E: Ext>,
11291124
// `ReturnCode::CalleeReverted`: Output buffer is returned.
11301125
// `ReturnCode::CalleeTrapped`
11311126
// `ReturnCode::CodeNotFound`
1132-
[__unstable__] seal_delegate_call(
1127+
[seal0] seal_delegate_call(
11331128
ctx,
11341129
flags: u32,
11351130
code_hash_ptr: u32,

0 commit comments

Comments
 (0)