diff --git a/utils/wasm-gen/src/config/syscalls/param.rs b/utils/wasm-gen/src/config/syscalls/param.rs index fe8a622205c..849c1ec57bc 100644 --- a/utils/wasm-gen/src/config/syscalls/param.rs +++ b/utils/wasm-gen/src/config/syscalls/param.rs @@ -55,7 +55,7 @@ impl SysCallsParamsConfig { [ ParamType::Length, ParamType::Gas, - ParamType::Index, + ParamType::Offset, ParamType::DurationBlockNumber, ParamType::DelayBlockNumber, ParamType::Handler, @@ -92,7 +92,7 @@ impl Default for SysCallsParamsConfig { // There are no rules for memory arrays and pointers as they are chosen // in accordance to memory pages config. (ParamType::Gas, (0..=250_000_000_000).into()), - (ParamType::Index, (0..=10).into()), + (ParamType::Offset, (0..=10).into()), (ParamType::DurationBlockNumber, (1..=8).into()), (ParamType::DelayBlockNumber, (0..=4).into()), (ParamType::Handler, (0..=100).into()), diff --git a/utils/wasm-gen/src/generator/syscalls.rs b/utils/wasm-gen/src/generator/syscalls.rs index fcc10c54c27..40d9ebc033b 100644 --- a/utils/wasm-gen/src/generator/syscalls.rs +++ b/utils/wasm-gen/src/generator/syscalls.rs @@ -157,7 +157,7 @@ impl InvocableSysCall { HashType::ActorId, ))), // An offset defining starting index in the received payload (related to `gr_send_input`). - ParamType::Index, + ParamType::Offset, // Length of the slice of the received message payload (related to `gr_send_input`). ParamType::Length, // Delay (related to `gr_send_input`). diff --git a/utils/wasm-instrument/src/syscalls.rs b/utils/wasm-instrument/src/syscalls.rs index eca3b038265..7e36620a03e 100644 --- a/utils/wasm-instrument/src/syscalls.rs +++ b/utils/wasm-instrument/src/syscalls.rs @@ -299,7 +299,7 @@ impl SysCallName { SysCallSignature::gr([Version, Ptr(PtrInfo::new_mutable(PtrType::BufferStart))]) } Self::Read => SysCallSignature::gr([ - Index, + Offset, Length, Ptr(PtrInfo::new_mutable(PtrType::SizedBufferStart { length_param_idx: 1, @@ -317,7 +317,7 @@ impl SysCallName { ))), ]), Self::ReplyInput => SysCallSignature::gr([ - Index, + Offset, Length, Ptr(PtrInfo::new_immutable(PtrType::Value)), Ptr(PtrInfo::new_mutable(PtrType::ErrorWithHash( @@ -336,7 +336,7 @@ impl SysCallName { ))), ]), Self::ReplyInputWGas => SysCallSignature::gr([ - Index, + Offset, Length, Gas, Ptr(PtrInfo::new_immutable(PtrType::Value)), @@ -384,9 +384,11 @@ impl SysCallName { Length, Ptr(PtrInfo::new_mutable(PtrType::ErrorCode)), ]), - Self::ReplyPushInput => { - SysCallSignature::gr([Index, Length, Ptr(PtrInfo::new_mutable(PtrType::ErrorCode))]) - } + Self::ReplyPushInput => SysCallSignature::gr([ + Offset, + Length, + Ptr(PtrInfo::new_mutable(PtrType::ErrorCode)), + ]), Self::ReplyTo => SysCallSignature::gr([Ptr(PtrInfo::new_mutable( PtrType::ErrorWithHash(HashType::MessageId), ))]), @@ -410,7 +412,7 @@ impl SysCallName { Ptr(PtrInfo::new_immutable(PtrType::HashWithValue( HashType::ActorId, ))), - Index, + Offset, Length, DelayBlockNumber, Ptr(PtrInfo::new_mutable(PtrType::ErrorWithHash( @@ -435,7 +437,7 @@ impl SysCallName { Ptr(PtrInfo::new_immutable(PtrType::HashWithValue( HashType::ActorId, ))), - Index, + Offset, Length, Gas, DelayBlockNumber, @@ -477,7 +479,7 @@ impl SysCallName { ]), Self::SendPushInput => SysCallSignature::gr([ Handler, - Index, + Offset, Length, Ptr(PtrInfo::new_mutable(PtrType::ErrorCode)), ]), @@ -611,7 +613,7 @@ pub enum ParamType { Length, // i32 buffers length Ptr(PtrInfo), // i32 pointer Gas, // i64 gas amount - Index, // i32 offset in the input buffer (message payload) + Offset, // i32 offset in the input buffer (message payload) DurationBlockNumber, // i32 duration in blocks DelayBlockNumber, // i32 delay in blocks Handler, // i32 handler number