Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(gstd, backend): Introduce gr_env_vars sys-call #3403

Merged
merged 20 commits into from
Oct 23, 2023
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions utils/wasm-instrument/src/syscalls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,21 +287,13 @@ impl SysCallName {
SysCallSignature::gr([Ptr(PtrInfo::new_mutable(PtrType::ErrorWithSignalCode))])
}
Self::MessageId => SysCallSignature::gr([Ptr(PtrInfo::new_mutable(PtrType::Hash))]),
Self::ExecSettings => SysCallSignature::gr([
Size,
// The PtrType::BufferStart doesn't work here as it requires length_param_idx
// Should we introduce something like PtrType::Buffer
Ptr(PtrInfo::new_mutable(PtrType::BlockNumber)),
]),
Self::ExecSettings => {
SysCallSignature::gr([Version, Ptr(PtrInfo::new_mutable(PtrType::Buffer))])
}
Self::Read => SysCallSignature::gr([
MessagePosition,
Size,
// TODO #3375, the PtrType::BlockNumber is incorrect here.
DennisInSky marked this conversation as resolved.
Show resolved Hide resolved
// Should be:
// Ptr(PtrInfo::new_mutable(PtrType::BufferStart {
// length_param_idx: 1,
// }))
DennisInSky marked this conversation as resolved.
Show resolved Hide resolved
Ptr(PtrInfo::new_mutable(PtrType::BlockNumber)),
Ptr(PtrInfo::new_mutable(PtrType::Buffer)),
Ptr(PtrInfo::new_mutable(PtrType::ErrorCode)),
]),
Self::Reply => SysCallSignature::gr([
Expand Down Expand Up @@ -534,6 +526,7 @@ pub enum ParamType {
Handler, // i32 handler number
Alloc, // i32 alloc pages
Free, // i32 free page
Version, // i32 version number of exec settings
DennisInSky marked this conversation as resolved.
Show resolved Hide resolved
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
Expand Down Expand Up @@ -561,6 +554,7 @@ pub enum PtrType {
BlockNumber,
BlockTimestamp,
BufferStart { length_param_idx: usize },
Buffer,
Hash,
Gas,
Length,
Expand Down Expand Up @@ -598,6 +592,7 @@ impl PtrType {
BlockNumber
| BlockTimestamp
| BufferStart { .. }
| Buffer
| Hash
| Gas
| Length
Expand Down