From b59a8ec86cbdc7b5c48b220cd55bae156609d6e7 Mon Sep 17 00:00:00 2001 From: sai Date: Fri, 19 Jun 2026 00:31:17 +0000 Subject: [PATCH 1/2] fix(hasher): import sys_hash for SBPF v3 static syscalls light-hasher copies Solana's static-syscall macro but never defined sys_hash, causing compile failures under --arch v3 (SIMD-0500). Add solana-define-syscall and re-export sys_hash, matching solana-program 2.3. Co-authored-by: Cursor --- Cargo.toml | 1 + program-libs/hasher/Cargo.toml | 1 + program-libs/hasher/src/syscalls/definitions.rs | 3 +++ 3 files changed, 5 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 110bcc81b2..19f8d2f1e8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -148,6 +148,7 @@ solana-bn254 = "3.2.1" solana-sysvar = { version = "2.2" } solana-rent = { version = "2.2" } solana-program-error = { version = "2.2" } +solana-define-syscall = { version = "2.3" } solana-account-info = { version = "2.2" } solana-transaction = { version = "2.2" } solana-transaction-error = { version = "2.2" } diff --git a/program-libs/hasher/Cargo.toml b/program-libs/hasher/Cargo.toml index a3e7dc5ba9..46480959d3 100644 --- a/program-libs/hasher/Cargo.toml +++ b/program-libs/hasher/Cargo.toml @@ -27,6 +27,7 @@ num-bigint = { workspace = true } # Optional import for ProgramError conversion solana-program-error = { workspace = true, optional = true } +solana-define-syscall = { workspace = true } pinocchio = { workspace = true, optional = true } zerocopy = { workspace = true, optional = true } borsh = { workspace = true, optional = true } diff --git a/program-libs/hasher/src/syscalls/definitions.rs b/program-libs/hasher/src/syscalls/definitions.rs index 38f5d3a6be..e1a7b178ae 100644 --- a/program-libs/hasher/src/syscalls/definitions.rs +++ b/program-libs/hasher/src/syscalls/definitions.rs @@ -35,6 +35,9 @@ macro_rules! define_syscall { } } +#[cfg(target_feature = "static-syscalls")] +pub use solana_define_syscall::sys_hash; + define_syscall!(fn sol_sha256(vals: *const u8, val_len: u64, hash_result: *mut u8) -> u64); define_syscall!(fn sol_keccak256(vals: *const u8, val_len: u64, hash_result: *mut u8) -> u64); define_syscall!(fn sol_poseidon(parameters: u64, endianness: u64, vals: *const u8, val_len: u64, hash_result: *mut u8) -> u64); From 9f61b174ef2f22781f383f65a9ce263a56838303 Mon Sep 17 00:00:00 2001 From: sai Date: Fri, 19 Jun 2026 00:31:29 +0000 Subject: [PATCH 2/2] chore: update Cargo.lock for light-hasher solana-define-syscall dep Co-authored-by: Cursor --- Cargo.lock | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.lock b/Cargo.lock index 094bcaac5e..6bdd16ba00 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4011,6 +4011,7 @@ dependencies = [ "rand 0.8.5", "sha2 0.10.9", "sha3", + "solana-define-syscall 2.3.0", "solana-program-error", "solana-pubkey", "thiserror 2.0.18",