Skip to content

Commit df1921b

Browse files
authored
runtime-api: sync syscall function signatures with pallet (#397)
This PR synchronizes the syscall function signatures in the runtime-api with the current revive pallet API surface. Signed-off-by: xermicus <[email protected]>
1 parent 84018c1 commit df1921b

File tree

3 files changed

+10
-15
lines changed

3 files changed

+10
-15
lines changed

crates/llvm-context/src/polkavm/evm/call.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ pub fn call<'ctx>(
9999
let is_success = context.builder().build_int_compare(
100100
inkwell::IntPredicate::EQ,
101101
success,
102-
context.integer_const(revive_common::BIT_LENGTH_X64, 0),
102+
context.integer_const(revive_common::BIT_LENGTH_X32, 0),
103103
"is_success",
104104
)?;
105105

@@ -178,7 +178,7 @@ pub fn delegate_call<'ctx>(
178178
let is_success = context.builder().build_int_compare(
179179
inkwell::IntPredicate::EQ,
180180
success,
181-
context.integer_const(revive_common::BIT_LENGTH_X64, 0),
181+
context.integer_const(revive_common::BIT_LENGTH_X32, 0),
182182
"is_success",
183183
)?;
184184

crates/runtime-api/src/polkavm_imports.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ POLKAVM_IMPORT(void, block_hash, uint32_t, uint32_t)
5353

5454
POLKAVM_IMPORT(void, block_number, uint32_t)
5555

56-
POLKAVM_IMPORT(uint64_t, call, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t)
56+
POLKAVM_IMPORT(uint32_t, call, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t)
5757

58-
POLKAVM_IMPORT(uint64_t, call_data_copy, uint32_t, uint32_t, uint32_t)
58+
POLKAVM_IMPORT(void, call_data_copy, uint32_t, uint32_t, uint32_t)
5959

60-
POLKAVM_IMPORT(uint64_t, call_data_load, uint32_t, uint32_t)
60+
POLKAVM_IMPORT(void, call_data_load, uint32_t, uint32_t)
6161

6262
POLKAVM_IMPORT(uint64_t, call_data_size)
6363

@@ -69,7 +69,7 @@ POLKAVM_IMPORT(uint64_t, code_size, uint32_t)
6969

7070
POLKAVM_IMPORT(void, code_hash, uint32_t, uint32_t)
7171

72-
POLKAVM_IMPORT(uint64_t, delegate_call, uint64_t, uint64_t, uint64_t, uint32_t, uint64_t, uint64_t)
72+
POLKAVM_IMPORT(uint32_t, delegate_call, uint64_t, uint64_t, uint64_t, uint32_t, uint64_t, uint64_t)
7373

7474
POLKAVM_IMPORT(void, deposit_event, uint32_t, uint32_t, uint32_t, uint32_t)
7575

@@ -79,11 +79,11 @@ POLKAVM_IMPORT(uint64_t, gas_price);
7979

8080
POLKAVM_IMPORT(void, get_immutable_data, uint32_t, uint32_t);
8181

82-
POLKAVM_IMPORT(uint64_t, get_storage_or_zero, uint32_t, uint32_t, uint32_t)
82+
POLKAVM_IMPORT(void, get_storage_or_zero, uint32_t, uint32_t, uint32_t)
8383

8484
POLKAVM_IMPORT(void, hash_keccak_256, uint32_t, uint32_t, uint32_t)
8585

86-
POLKAVM_IMPORT(uint64_t, instantiate, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t)
86+
POLKAVM_IMPORT(uint32_t, instantiate, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t)
8787

8888
POLKAVM_IMPORT(void, now, uint32_t)
8989

@@ -99,8 +99,6 @@ POLKAVM_IMPORT(uint64_t, return_data_size)
9999

100100
POLKAVM_IMPORT(void, set_immutable_data, uint32_t, uint32_t);
101101

102-
POLKAVM_IMPORT(uint64_t, set_storage_or_clear, uint32_t, uint32_t, uint32_t)
102+
POLKAVM_IMPORT(uint32_t, set_storage_or_clear, uint32_t, uint32_t, uint32_t)
103103

104104
POLKAVM_IMPORT(void, value_transferred, uint32_t)
105-
106-
POLKAVM_IMPORT(void, weight_to_fee, uint64_t, uint64_t, uint32_t);

crates/runtime-api/src/polkavm_imports.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,9 @@ pub static SET_STORAGE: &str = "set_storage_or_clear";
6666

6767
pub static VALUE_TRANSFERRED: &str = "value_transferred";
6868

69-
pub static WEIGHT_TO_FEE: &str = "weight_to_fee";
70-
7169
/// All imported runtime API symbols.
7270
/// Useful for configuring common attributes and linkage.
73-
pub static IMPORTS: [&str; 33] = [
71+
pub static IMPORTS: [&str; 32] = [
7472
ADDRESS,
7573
BALANCE,
7674
BALANCE_OF,
@@ -103,7 +101,6 @@ pub static IMPORTS: [&str; 33] = [
103101
SET_IMMUTABLE_DATA,
104102
SET_STORAGE,
105103
VALUE_TRANSFERRED,
106-
WEIGHT_TO_FEE,
107104
];
108105

109106
/// Creates a LLVM module from the [BITCODE].

0 commit comments

Comments
 (0)