From 6cf32250ee8ba7d19a514b64d93fdbaa4292a132 Mon Sep 17 00:00:00 2001 From: Kevin Heavey Date: Thu, 20 Jun 2024 16:42:37 +0900 Subject: [PATCH] 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 --- Cargo.lock | 8 +++++--- Cargo.toml | 1 + programs/sbf/Cargo.lock | 8 +++++--- sdk/Cargo.toml | 3 ++- sdk/program/Cargo.toml | 3 ++- sdk/program/src/alt_bn128/mod.rs | 2 +- sdk/program/src/hash.rs | 2 +- sdk/program/src/pubkey.rs | 2 +- sdk/program/src/sysvar/slot_hashes.rs | 2 +- sdk/src/ed25519_instruction.rs | 3 ++- zk-sdk/Cargo.toml | 2 +- 11 files changed, 22 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e14ac4012339f4..36274246efb2e9 100644 --- a/Cargo.lock +++ b/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", diff --git a/Cargo.toml b/Cargo.toml index c5b069e8f7c409..33cfb62a3b95de 100644 --- a/Cargo.toml +++ b/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" diff --git a/programs/sbf/Cargo.lock b/programs/sbf/Cargo.lock index 5dc8cc9069195d..820ba3c8ddd06e 100644 --- a/programs/sbf/Cargo.lock +++ b/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", diff --git a/sdk/Cargo.toml b/sdk/Cargo.toml index 33d7bd28bb5e30..be8560a88a26b5 100644 --- a/sdk/Cargo.toml +++ b/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 } diff --git a/sdk/program/Cargo.toml b/sdk/program/Cargo.toml index 57819881b70d06..cbfaf3161a8d8b 100644 --- a/sdk/program/Cargo.toml +++ b/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 } diff --git a/sdk/program/src/alt_bn128/mod.rs b/sdk/program/src/alt_bn128/mod.rs index 4919df3ac845ad..c7e1d8e5d28250 100644 --- a/sdk/program/src/alt_bn128/mod.rs +++ b/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, }; diff --git a/sdk/program/src/hash.rs b/sdk/program/src/hash.rs index 94fb7df9367dc2..eb6b467de6935e 100644 --- a/sdk/program/src/hash.rs +++ b/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, diff --git a/sdk/program/src/pubkey.rs b/sdk/program/src/pubkey.rs index 7ac04629bf1b87..94438c66d81bb9 100644 --- a/sdk/program/src/pubkey.rs +++ b/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}, diff --git a/sdk/program/src/sysvar/slot_hashes.rs b/sdk/program/src/sysvar/slot_hashes.rs index 9d66fab235b585..4a1904039d7d8e 100644 --- a/sdk/program/src/sysvar/slot_hashes.rs +++ b/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); diff --git a/sdk/src/ed25519_instruction.rs b/sdk/src/ed25519_instruction.rs index 64c3de083fc0e5..10ae533f478171 100644 --- a/sdk/src/ed25519_instruction.rs +++ b/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}, }; diff --git a/zk-sdk/Cargo.toml b/zk-sdk/Cargo.toml index 8b67d12c693987..08276b941c76a0 100644 --- a/zk-sdk/Cargo.toml +++ b/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 }