You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.
There is an implicit bincode serialization in the Instruction constructor which is not desirable for creating BPF program instructions because they can't use bincode.
use bincode::serialize;implInstruction{pubfnnew<T:Serialize>(program_id:Pubkey,data:&T,accounts:Vec<AccountMeta>) -> Self{let data = serialize(data).unwrap();Self{
program_id,
data,
accounts,}}}
Proposed Solution
Probably just rename Instruction::new to indicate that only native program instructions should be created with this method.
The text was updated successfully, but these errors were encountered:
bincode is usable by BPF programs but it bloats the binary and is computationally expensive. BPF programs may use this to create instructions in the future so the real solution is to settle on a suitable serialization solution. That solution might be some kind of wrapper that hides actual serialization implementation from the user while keeping it in sync with the consumer.
Problem
There is an implicit bincode serialization in the Instruction constructor which is not desirable for creating BPF program instructions because they can't use bincode.
Proposed Solution
Probably just rename
Instruction::new
to indicate that only native program instructions should be created with this method.The text was updated successfully, but these errors were encountered: