فهرست منبع

use bytemuck_derive 1.7.0 explicitly in sdk and program (#1793)

* use bytemuck_derive 1.7.0 explicitly in sdk and program

* explicitly activate the derive feature of bytemuck in zk-sdk
Kevin Heavey 1 سال پیش
والد
کامیت
6cf32250ee

+ 5 - 3
Cargo.lock

@@ -1140,13 +1140,13 @@ dependencies = [
 
 [[package]]
 name = "bytemuck_derive"
-version = "1.4.0"
+version = "1.7.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1aca418a974d83d40a0c1f0c5cba6ff4bc28d8df099109ca459a2118d40b6322"
+checksum = "1ee891b04274a59bd38b412188e24b849617b2e45a0fd8d057deb63e7403761b"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 1.0.109",
+ "syn 2.0.66",
 ]
 
 [[package]]
@@ -6799,6 +6799,7 @@ dependencies = [
  "bs58",
  "bv",
  "bytemuck",
+ "bytemuck_derive",
  "console_error_panic_hook",
  "console_log",
  "curve25519-dalek",
@@ -7243,6 +7244,7 @@ dependencies = [
  "borsh 1.5.1",
  "bs58",
  "bytemuck",
+ "bytemuck_derive",
  "byteorder",
  "chrono",
  "curve25519-dalek",

+ 1 - 0
Cargo.toml

@@ -174,6 +174,7 @@ bv = "0.11.1"
 byte-unit = "4.0.19"
 bytecount = "0.6.8"
 bytemuck = "1.16.1"
+bytemuck_derive = "1.7.0"
 byteorder = "1.5.0"
 bytes = "1.6"
 bzip2 = "0.4.4"

+ 5 - 3
programs/sbf/Cargo.lock

@@ -856,13 +856,13 @@ dependencies = [
 
 [[package]]
 name = "bytemuck_derive"
-version = "1.4.0"
+version = "1.7.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1aca418a974d83d40a0c1f0c5cba6ff4bc28d8df099109ca459a2118d40b6322"
+checksum = "1ee891b04274a59bd38b412188e24b849617b2e45a0fd8d057deb63e7403761b"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 1.0.109",
+ "syn 2.0.58",
 ]
 
 [[package]]
@@ -5287,6 +5287,7 @@ dependencies = [
  "bs58",
  "bv",
  "bytemuck",
+ "bytemuck_derive",
  "console_error_panic_hook",
  "console_log",
  "curve25519-dalek",
@@ -6102,6 +6103,7 @@ dependencies = [
  "borsh 1.5.1",
  "bs58",
  "bytemuck",
+ "bytemuck_derive",
  "byteorder 1.5.0",
  "chrono",
  "derivation-path",

+ 2 - 1
sdk/Cargo.toml

@@ -49,7 +49,8 @@ bincode = { workspace = true }
 bitflags = { workspace = true, features = ["serde"] }
 borsh = { workspace = true, optional = true }
 bs58 = { workspace = true }
-bytemuck = { workspace = true, features = ["derive"] }
+bytemuck = { workspace = true }
+bytemuck_derive = { workspace = true }
 byteorder = { workspace = true, optional = true }
 chrono = { workspace = true, features = ["alloc"], optional = true }
 curve25519-dalek = { workspace = true, optional = true }

+ 2 - 1
sdk/program/Cargo.toml

@@ -18,7 +18,8 @@ borsh = { workspace = true, optional = true }
 borsh0-10 = { package = "borsh", version = "0.10.3", optional = true }
 bs58 = { workspace = true }
 bv = { workspace = true, features = ["serde"] }
-bytemuck = { workspace = true, features = ["derive"] }
+bytemuck = { workspace = true }
+bytemuck_derive = { workspace = true }
 lazy_static = { workspace = true }
 log = { workspace = true }
 memoffset = { workspace = true }

+ 1 - 1
sdk/program/src/alt_bn128/mod.rs

@@ -4,7 +4,7 @@ pub mod prelude {
 }
 
 use {
-    bytemuck::{Pod, Zeroable},
+    bytemuck_derive::{Pod, Zeroable},
     consts::*,
     thiserror::Error,
 };

+ 1 - 1
sdk/program/src/hash.rs

@@ -9,7 +9,7 @@ use crate::wasm_bindgen;
 use borsh::{BorshDeserialize, BorshSchema, BorshSerialize};
 use {
     crate::sanitize::Sanitize,
-    bytemuck::{Pod, Zeroable},
+    bytemuck_derive::{Pod, Zeroable},
     sha2::{Digest, Sha256},
     std::{convert::TryFrom, fmt, mem, str::FromStr},
     thiserror::Error,

+ 1 - 1
sdk/program/src/pubkey.rs

@@ -10,7 +10,7 @@ use arbitrary::Arbitrary;
 use borsh::{BorshDeserialize, BorshSchema, BorshSerialize};
 use {
     crate::{decode_error::DecodeError, hash::hashv},
-    bytemuck::{Pod, Zeroable},
+    bytemuck_derive::{Pod, Zeroable},
     num_derive::{FromPrimitive, ToPrimitive},
     std::{
         convert::{Infallible, TryFrom},

+ 1 - 1
sdk/program/src/sysvar/slot_hashes.rs

@@ -55,7 +55,7 @@ use {
         slot_hashes::MAX_ENTRIES,
         sysvar::{get_sysvar, Sysvar, SysvarId},
     },
-    bytemuck::{Pod, Zeroable},
+    bytemuck_derive::{Pod, Zeroable},
 };
 
 crate::declare_sysvar_id!("SysvarS1otHashes111111111111111111111111111", SlotHashes);

+ 2 - 1
sdk/src/ed25519_instruction.rs

@@ -6,7 +6,8 @@
 
 use {
     crate::{feature_set::FeatureSet, instruction::Instruction, precompiles::PrecompileError},
-    bytemuck::{bytes_of, Pod, Zeroable},
+    bytemuck::bytes_of,
+    bytemuck_derive::{Pod, Zeroable},
     ed25519_dalek::{ed25519::signature::Signature, Signer, Verifier},
 };
 

+ 1 - 1
zk-sdk/Cargo.toml

@@ -11,7 +11,7 @@ edition = { workspace = true }
 
 [dependencies]
 base64 = { workspace = true }
-bytemuck = { workspace = true }
+bytemuck = { workspace = true, features = ["derive"] }
 merlin = { workspace = true }
 num-derive = { workspace = true }
 num-traits = { workspace = true }