diff --git a/Cargo.lock b/Cargo.lock index 3cc8700a0..57997352a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3881,7 +3881,6 @@ dependencies = [ "hex 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "hmac 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "num-derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3896,6 +3895,7 @@ dependencies = [ "sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "solana-crate-features 0.22.0", "solana-logger 0.22.0", + "solana-sdk-macro 0.22.0", "tiny-bip39 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3914,6 +3914,16 @@ dependencies = [ "solana-sdk 0.22.0", ] +[[package]] +name = "solana-sdk-macro" +version = "0.22.0" +dependencies = [ + "bs58 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "solana-stake-program" version = "0.22.0" diff --git a/programs/bpf/Cargo.lock b/programs/bpf/Cargo.lock index 871e25747..149d916da 100644 --- a/programs/bpf/Cargo.lock +++ b/programs/bpf/Cargo.lock @@ -62,7 +62,7 @@ name = "atty" version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -78,9 +78,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "backtrace-sys 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -89,7 +89,7 @@ version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -107,7 +107,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -177,7 +177,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "feature-probe 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -245,12 +245,12 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -321,8 +321,8 @@ dependencies = [ "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "publicsuffix 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", "try_from 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -435,7 +435,7 @@ dependencies = [ "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -565,7 +565,7 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "miniz_oxide 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -633,7 +633,7 @@ name = "generic-array" version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -643,7 +643,7 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -808,7 +808,7 @@ name = "iovec" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -822,7 +822,7 @@ dependencies = [ [[package]] name = "itertools" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -839,7 +839,7 @@ version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "getrandom 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -870,7 +870,7 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.65" +version = "0.2.66" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -914,7 +914,7 @@ name = "memmap" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -957,7 +957,7 @@ dependencies = [ "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", @@ -971,7 +971,7 @@ version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -992,7 +992,7 @@ version = "0.2.33" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1050,7 +1050,7 @@ name = "num_cpus" version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1080,7 +1080,7 @@ name = "parking_lot_core" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1117,7 +1117,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1182,7 +1182,7 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1194,7 +1194,7 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1212,7 +1212,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "getrandom 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1286,7 +1286,7 @@ name = "rand_jitter" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1298,7 +1298,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1399,8 +1399,8 @@ dependencies = [ "mime 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "mime_guess 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", "serde_urlencoded 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1427,7 +1427,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "untrusted 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "web-sys 0.3.27 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1506,10 +1506,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "1.0.102" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1517,12 +1517,12 @@ name = "serde_bytes" version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_derive" -version = "1.0.102" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1532,12 +1532,12 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.41" +version = "1.0.42" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1547,7 +1547,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1585,156 +1585,157 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "solana-bpf-loader-program" -version = "0.21.0" +version = "0.22.0" dependencies = [ "bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "solana-logger 0.21.0", - "solana-sdk 0.21.0", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-logger 0.22.0", + "solana-sdk 0.22.0", "solana_rbpf 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "solana-bpf-programs" -version = "0.21.0" +version = "0.22.0" dependencies = [ "bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "elf 0.0.10 (registry+https://github.com/rust-lang/crates.io-index)", - "solana-bpf-loader-program 0.21.0", - "solana-logger 0.21.0", - "solana-runtime 0.21.0", - "solana-sdk 0.21.0", + "solana-bpf-loader-program 0.22.0", + "solana-logger 0.22.0", + "solana-runtime 0.22.0", + "solana-sdk 0.22.0", "solana_rbpf 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", "walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "solana-bpf-rust-128bit" -version = "0.21.0" +version = "0.22.0" dependencies = [ - "solana-bpf-rust-128bit-dep 0.21.0", - "solana-sdk 0.21.0", - "solana-sdk-bpf-test 0.21.0", + "solana-bpf-rust-128bit-dep 0.22.0", + "solana-sdk 0.22.0", + "solana-sdk-bpf-test 0.22.0", ] [[package]] name = "solana-bpf-rust-128bit-dep" -version = "0.21.0" +version = "0.22.0" dependencies = [ - "solana-sdk 0.21.0", - "solana-sdk-bpf-test 0.21.0", + "solana-sdk 0.22.0", + "solana-sdk-bpf-test 0.22.0", ] [[package]] name = "solana-bpf-rust-alloc" -version = "0.21.0" +version = "0.22.0" dependencies = [ - "solana-sdk 0.21.0", - "solana-sdk-bpf-test 0.21.0", + "solana-sdk 0.22.0", + "solana-sdk-bpf-test 0.22.0", ] [[package]] name = "solana-bpf-rust-dep-crate" -version = "0.21.0" +version = "0.22.0" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "solana-sdk 0.21.0", - "solana-sdk-bpf-test 0.21.0", + "solana-sdk 0.22.0", + "solana-sdk-bpf-test 0.22.0", ] [[package]] name = "solana-bpf-rust-external-spend" -version = "0.21.0" +version = "0.22.0" dependencies = [ - "solana-sdk 0.21.0", - "solana-sdk-bpf-test 0.21.0", + "solana-sdk 0.22.0", + "solana-sdk-bpf-test 0.22.0", ] [[package]] name = "solana-bpf-rust-iter" -version = "0.21.0" +version = "0.22.0" dependencies = [ - "solana-sdk 0.21.0", - "solana-sdk-bpf-test 0.21.0", + "solana-sdk 0.22.0", + "solana-sdk-bpf-test 0.22.0", ] [[package]] name = "solana-bpf-rust-many-args" -version = "0.21.0" +version = "0.22.0" dependencies = [ - "solana-bpf-rust-many-args-dep 0.21.0", - "solana-sdk 0.21.0", - "solana-sdk-bpf-test 0.21.0", + "solana-bpf-rust-many-args-dep 0.22.0", + "solana-sdk 0.22.0", + "solana-sdk-bpf-test 0.22.0", ] [[package]] name = "solana-bpf-rust-many-args-dep" -version = "0.21.0" +version = "0.22.0" dependencies = [ - "solana-sdk 0.21.0", - "solana-sdk-bpf-test 0.21.0", + "solana-sdk 0.22.0", + "solana-sdk-bpf-test 0.22.0", ] [[package]] name = "solana-bpf-rust-noop" -version = "0.21.0" +version = "0.22.0" dependencies = [ - "solana-sdk 0.21.0", - "solana-sdk-bpf-test 0.21.0", + "solana-sdk 0.22.0", + "solana-sdk-bpf-test 0.22.0", ] [[package]] name = "solana-bpf-rust-panic" -version = "0.21.0" +version = "0.22.0" dependencies = [ - "solana-sdk 0.21.0", - "solana-sdk-bpf-test 0.21.0", + "solana-sdk 0.22.0", + "solana-sdk-bpf-test 0.22.0", ] [[package]] name = "solana-bpf-rust-param-passing" -version = "0.21.0" +version = "0.22.0" dependencies = [ - "solana-bpf-rust-param-passing-dep 0.21.0", - "solana-sdk 0.21.0", - "solana-sdk-bpf-test 0.21.0", + "solana-bpf-rust-param-passing-dep 0.22.0", + "solana-sdk 0.22.0", + "solana-sdk-bpf-test 0.22.0", ] [[package]] name = "solana-bpf-rust-param-passing-dep" -version = "0.21.0" +version = "0.22.0" dependencies = [ - "solana-sdk 0.21.0", - "solana-sdk-bpf-test 0.21.0", + "solana-sdk 0.22.0", + "solana-sdk-bpf-test 0.22.0", ] [[package]] name = "solana-bpf-rust-sysval" -version = "0.21.0" +version = "0.22.0" dependencies = [ - "solana-sdk 0.21.0", - "solana-sdk-bpf-test 0.21.0", + "solana-sdk 0.22.0", + "solana-sdk-bpf-test 0.22.0", ] [[package]] name = "solana-config-program" -version = "0.21.0" +version = "0.22.0" dependencies = [ "bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "solana-logger 0.21.0", - "solana-sdk 0.21.0", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-logger 0.22.0", + "solana-sdk 0.22.0", ] [[package]] name = "solana-crate-features" -version = "0.21.0" +version = "0.22.0" dependencies = [ "backtrace 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1744,11 +1745,11 @@ dependencies = [ "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest 0.9.22 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1757,7 +1758,7 @@ dependencies = [ [[package]] name = "solana-logger" -version = "0.21.0" +version = "0.22.0" dependencies = [ "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1766,26 +1767,26 @@ dependencies = [ [[package]] name = "solana-measure" -version = "0.21.0" +version = "0.22.0" dependencies = [ - "solana-sdk 0.21.0", + "solana-sdk 0.22.0", ] [[package]] name = "solana-metrics" -version = "0.21.0" +version = "0.22.0" dependencies = [ "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest 0.9.22 (registry+https://github.com/rust-lang/crates.io-index)", - "solana-sdk 0.21.0", + "solana-sdk 0.22.0", "sys-info 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "solana-rayon-threadlimit" -version = "0.21.0" +version = "0.22.0" dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "sys-info 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1793,40 +1794,40 @@ dependencies = [ [[package]] name = "solana-runtime" -version = "0.21.0" +version = "0.22.0" dependencies = [ "bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "bv 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "fs_extra 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)", - "solana-bpf-loader-program 0.21.0", - "solana-logger 0.21.0", - "solana-measure 0.21.0", - "solana-metrics 0.21.0", - "solana-rayon-threadlimit 0.21.0", - "solana-sdk 0.21.0", - "solana-stake-program 0.21.0", - "solana-storage-program 0.21.0", - "solana-vote-program 0.21.0", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-bpf-loader-program 0.22.0", + "solana-logger 0.22.0", + "solana-measure 0.22.0", + "solana-metrics 0.22.0", + "solana-rayon-threadlimit 0.22.0", + "solana-sdk 0.22.0", + "solana-stake-program 0.22.0", + "solana-storage-program 0.22.0", + "solana-vote-program 0.22.0", "sys-info 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "solana-sdk" -version = "0.21.0" +version = "0.22.0" dependencies = [ "assert_matches 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1836,8 +1837,7 @@ dependencies = [ "generic-array 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "hmac 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "num-derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1845,65 +1845,78 @@ dependencies = [ "pbkdf2 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_bytes 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "solana-crate-features 0.21.0", - "solana-logger 0.21.0", + "solana-crate-features 0.22.0", + "solana-logger 0.22.0", + "solana-sdk-macro 0.22.0", ] [[package]] name = "solana-sdk-bpf-test" -version = "0.21.0" +version = "0.22.0" + +[[package]] +name = "solana-sdk-macro" +version = "0.22.0" +dependencies = [ + "bs58 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "solana-stake-program" -version = "0.21.0" +version = "0.22.0" dependencies = [ "bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "num-derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "solana-config-program 0.21.0", - "solana-logger 0.21.0", - "solana-metrics 0.21.0", - "solana-sdk 0.21.0", - "solana-vote-program 0.21.0", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-config-program 0.22.0", + "solana-logger 0.22.0", + "solana-metrics 0.22.0", + "solana-sdk 0.22.0", + "solana-vote-program 0.22.0", + "thiserror 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "solana-storage-program" -version = "0.21.0" +version = "0.22.0" dependencies = [ "bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "num-derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "solana-logger 0.21.0", - "solana-sdk 0.21.0", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-logger 0.22.0", + "solana-sdk 0.22.0", ] [[package]] name = "solana-vote-program" -version = "0.21.0" +version = "0.22.0" dependencies = [ "bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "num-derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", - "solana-logger 0.21.0", - "solana-metrics 0.21.0", - "solana-sdk 0.21.0", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-logger 0.22.0", + "solana-metrics 0.22.0", + "solana-sdk 0.22.0", + "thiserror 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1915,7 +1928,7 @@ dependencies = [ "combine 2.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "elfkit 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "hash32 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2014,7 +2027,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2023,7 +2036,7 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", "remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2046,6 +2059,24 @@ dependencies = [ "unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "thiserror" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "thiserror-impl 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "thread_local" version = "0.3.6" @@ -2059,7 +2090,7 @@ name = "time" version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2247,7 +2278,7 @@ dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", "mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2601,7 +2632,7 @@ dependencies = [ "checksum cc 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)" = "4fc9a35e1f4290eb9e5fc54ba6cf40671ed2a2514c3eeb2b2a908dda2ea5a1be" "checksum cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33" "checksum cgmath 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)" = "64a4b57c8f4e3a2e9ac07e0f6abc9c24b6fc9e1b54c3478cfb598f3d0023e51c" -"checksum chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e8493056968583b0193c1bb04d6f7684586f3726992d6c573261941a895dbd68" +"checksum chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "31850b4a4d6bae316f7a09e691c944c28299298837edc0a03f755618c23cbc01" "checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" "checksum clear_on_drop 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "97276801e127ffb46b66ce23f35cc96bd454fa311294bced4bbace7baa8b1d17" "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" @@ -2662,13 +2693,13 @@ dependencies = [ "checksum indexmap 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a61202fbe46c4a951e9404a720a0180bcf3212c750d735cb5c4ba4dc551299f3" "checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08" "checksum itertools 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)" = "0d47946d458e94a1b7bcabbf6521ea7c037062c81f534615abcad76e84d4970d" -"checksum itertools 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "87fa75c9dea7b07be3138c49abbb83fd4bea199b5cdc76f9804458edc5da0d6e" +"checksum itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" "checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" "checksum jobserver 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b1d42ef453b30b7387e113da1c83ab1605d90c5b4e0eb8e96d016ed3b8c160" "checksum js-sys 0.3.27 (registry+https://github.com/rust-lang/crates.io-index)" = "1efc4f2a556c58e79c5500912e221dd826bec64ff4aabd8ce71ccef6da02d7d4" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -"checksum libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)" = "1a31a0627fdf1f6a39ec0dd577e101440b7db22672c0901fe00a9a6fbb5c24e8" +"checksum libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)" = "d515b1f41455adea1313a4a2ac8a8a477634fbae63cc6100e3aebb207ce61558" "checksum libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" "checksum lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "62ebf1391f6acad60e5c8b43706dde4582df75c06698ab44511d15016bc2442c" "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" @@ -2741,10 +2772,10 @@ dependencies = [ "checksum sct 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"checksum serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4b39bd9b0b087684013a792c59e3e07a46a01d2322518d8a1104641a0b1be0" +"checksum serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)" = "1217f97ab8e8904b57dd22eb61cde455fa7446a9c1cf43966066da047c1f3702" "checksum serde_bytes 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "45af0182ff64abaeea290235eb67da3825a576c5d53e642c4d5b652e12e6effc" -"checksum serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)" = "ca13fc1a832f793322228923fbb3aba9f3f44444898f835d31ad1b74fa0a2bf8" -"checksum serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)" = "2f72eb2a68a7dc3f9a691bfda9305a1c017a6215e5a4545c258500d2099a37c2" +"checksum serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)" = "a8c6faef9a2e64b0064f48570289b4bf8823b7581f1d6157c1b52152306651d0" +"checksum serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)" = "1a3351dcbc1f067e2c92ab7c3c1f288ad1a4cffc470b5aaddb4c2e0a3ae80043" "checksum serde_urlencoded 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "642dd69105886af2efd227f75a520ec9b44a820d65bc133a9131f7d229fd165a" "checksum sha2 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9eb6be24e4c23a84d7184280d2722f7f2731fcdd4a9d886efbfe4413e4847ea0" "checksum sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b4d8bfd0e469f417657573d8451fb33d16cfe0989359b93baf3a1ffc639543d" @@ -2767,6 +2798,8 @@ dependencies = [ "checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" "checksum termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "96d6098003bde162e4277c70665bd87c326f5a0c3f3fbfb285787fa482d54e6e" "checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +"checksum thiserror 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "cc6b305ec0e323c7b6cfff6098a22516e0063d0bb7c3d88660a890217dca099a" +"checksum thiserror-impl 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "45ba8d810d9c48fc456b7ad54574e8bfb7c7918a57ad7a6e6a0985d7959e8597" "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" "checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" "checksum tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" diff --git a/programs/bpf/rust/sysval/src/lib.rs b/programs/bpf/rust/sysval/src/lib.rs index 0cb2ccc72..999a125df 100644 --- a/programs/bpf/rust/sysval/src/lib.rs +++ b/programs/bpf/rust/sysval/src/lib.rs @@ -6,10 +6,11 @@ use solana_sdk::{ clock::{get_segment_from_slot, DEFAULT_SLOTS_PER_EPOCH, DEFAULT_SLOTS_PER_SEGMENT}, entrypoint, entrypoint::SUCCESS, + info, pubkey::Pubkey, rent, sysvar::{ - clock::Clock, fees::Fees, rent::Rent, rewards::Rewards, slot_hashes::SlotHashes, + self, clock::Clock, fees::Fees, rent::Rent, rewards::Rewards, slot_hashes::SlotHashes, stake_history::StakeHistory, Sysvar, }, }; @@ -17,6 +18,8 @@ use solana_sdk::{ entrypoint!(process_instruction); fn process_instruction(_program_id: &Pubkey, accounts: &mut [AccountInfo], _data: &[u8]) -> u32 { // Clock + info!("Clock identifier:"); + sysvar::clock::id().log(); let clock = Clock::from_account_info(&accounts[2]).expect("clock"); assert_eq!(clock.slot, DEFAULT_SLOTS_PER_EPOCH + 1); assert_eq!( @@ -25,18 +28,26 @@ fn process_instruction(_program_id: &Pubkey, accounts: &mut [AccountInfo], _data ); // Fees + info!("Fees identifier:"); + sysvar::fees::id().log(); let fees = Fees::from_account_info(&accounts[3]).expect("fees"); let burn = fees.fee_calculator.burn(42); assert_eq!(burn, (21, 21)); // Rewards + info!("Rewards identifier:"); + sysvar::rewards::id().log(); let _rewards = Rewards::from_account_info(&accounts[4]).expect("rewards"); // Slot Hashes + info!("SlotHashes identifier:"); + sysvar::slot_hashes::id().log(); let slot_hashes = SlotHashes::from_account_info(&accounts[5]).expect("slot_hashes"); assert!(slot_hashes.len() >= 1); // Stake History + info!("StakeHistory identifier:"); + sysvar::stake_history::id().log(); let stake_history = StakeHistory::from_account_info(&accounts[6]).expect("stake_history"); assert!(stake_history.len() >= 1); diff --git a/programs/bpf_loader/src/lib.rs b/programs/bpf_loader/src/lib.rs index c19dcf0e4..26405169b 100644 --- a/programs/bpf_loader/src/lib.rs +++ b/programs/bpf_loader/src/lib.rs @@ -7,7 +7,6 @@ use byteorder::{ByteOrder, LittleEndian, WriteBytesExt}; use log::*; use solana_rbpf::{memory_region::MemoryRegion, EbpfVm}; use solana_sdk::account::KeyedAccount; -use solana_sdk::bpf_loader; use solana_sdk::instruction::InstructionError; use solana_sdk::instruction_processor_utils::{limited_deserialize, next_keyed_account}; use solana_sdk::loader_instruction::LoaderInstruction; @@ -19,7 +18,7 @@ use std::io::Error; use std::mem; solana_sdk::declare_program!( - bpf_loader::BS58_STRING, + solana_sdk::bpf_loader::ID, solana_bpf_loader_program, process_instruction ); diff --git a/programs/move_loader/src/lib.rs b/programs/move_loader/src/lib.rs index 4862a5707..e2aac1db1 100644 --- a/programs/move_loader/src/lib.rs +++ b/programs/move_loader/src/lib.rs @@ -4,10 +4,9 @@ pub mod error_mappers; pub mod processor; use crate::processor::process_instruction; -use solana_sdk::move_loader; solana_sdk::declare_program!( - move_loader::BS58_STRING, + solana_sdk::move_loader::ID, solana_move_loader_program, process_instruction ); diff --git a/sdk/Cargo.toml b/sdk/Cargo.toml index 1864d3856..9902067f7 100644 --- a/sdk/Cargo.toml +++ b/sdk/Cargo.toml @@ -33,7 +33,6 @@ generic-array = { version = "0.13.2", default-features = false, features = ["ser hex = "0.4.0" hmac = "0.7.0" itertools = { version = "0.8.2" } -lazy_static = "1.4.0" log = { version = "0.4.8" } memmap = { version = "0.6.2", optional = true } num-derive = { version = "0.3" } @@ -47,8 +46,9 @@ serde_derive = "1.0.103" serde_json = { version = "1.0.42", optional = true } sha2 = "0.8.0" ed25519-dalek = { version = "1.0.0-pre.1", optional = true } -solana-logger = { path = "../logger", version = "0.22.0", optional = true } solana-crate-features = { path = "../crate-features", version = "0.22.0", optional = true } +solana-logger = { path = "../logger", version = "0.22.0", optional = true } +solana-sdk-macro = { path = "macro" } [dev-dependencies] tiny-bip39 = "0.6.2" diff --git a/sdk/macro/Cargo.toml b/sdk/macro/Cargo.toml new file mode 100644 index 000000000..253710c87 --- /dev/null +++ b/sdk/macro/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "solana-sdk-macro" +version = "0.22.0" +description = "Solana SDK Macro" +authors = ["Solana Maintainers "] +repository = "https://github.com/solana-labs/solana" +homepage = "https://solana.com/" +license = "Apache-2.0" +edition = "2018" + +[lib] +proc-macro = true + +[dependencies] +bs58 = "0.3.0" +proc-macro2 = "1.0" +quote = "1.0" +syn = { version = "1.0", features = ["full", "extra-traits"] } diff --git a/sdk/macro/src/lib.rs b/sdk/macro/src/lib.rs new file mode 100644 index 000000000..2f3075174 --- /dev/null +++ b/sdk/macro/src/lib.rs @@ -0,0 +1,73 @@ +//! Convenience macro to declare a static public key and functions to interact with it +//! +//! Input: a single literal base58 string representation of a program's id + +extern crate proc_macro; + +use proc_macro::TokenStream; +use proc_macro2::Span; +use quote::{quote, ToTokens}; +use std::convert::TryFrom; +use syn::{ + parse::{Parse, ParseStream, Result}, + parse_macro_input, Expr, LitByte, LitStr, +}; + +struct Id(proc_macro2::TokenStream); +impl Parse for Id { + fn parse(input: ParseStream) -> Result { + let token_stream = if input.peek(syn::LitStr) { + let id_literal: LitStr = input.parse()?; + let id_vec = bs58::decode(id_literal.value()) + .into_vec() + .map_err(|_| syn::Error::new_spanned(&id_literal, "failed to decode base58 id"))?; + let id_array = <[u8; 32]>::try_from(<&[u8]>::clone(&&id_vec[..])) + .map_err(|_| syn::Error::new_spanned(&id_literal, "id is not 32 bytes long"))?; + let bytes = id_array.iter().map(|b| LitByte::new(*b, Span::call_site())); + quote! { + ::solana_sdk::pubkey::Pubkey::new_from_array( + [#(#bytes,)*] + ) + } + } else { + let expr: Expr = input.parse()?; + quote! { #expr } + }; + + if !input.is_empty() { + let stream: proc_macro2::TokenStream = input.parse()?; + return Err(syn::Error::new_spanned(stream, "unexpected token")); + } + + Ok(Id(token_stream)) + } +} + +impl ToTokens for Id { + fn to_tokens(&self, tokens: &mut proc_macro2::TokenStream) { + let id = &self.0; + tokens.extend(quote! { + pub static ID: ::solana_sdk::pubkey::Pubkey = #id; + + pub fn check_id(id: &::solana_sdk::pubkey::Pubkey) -> bool { + id == &ID + } + + pub fn id() -> ::solana_sdk::pubkey::Pubkey { + ID + } + + #[cfg(test)] + #[test] + fn test_id() { + assert!(check_id(&id())); + } + }); + } +} + +#[proc_macro] +pub fn declare_id(input: TokenStream) -> TokenStream { + let id = parse_macro_input!(input as Id); + TokenStream::from(quote! {#id}) +} diff --git a/sdk/src/bpf_loader.rs b/sdk/src/bpf_loader.rs index 32aef711c..33461caa0 100644 --- a/sdk/src/bpf_loader.rs +++ b/sdk/src/bpf_loader.rs @@ -1,2 +1 @@ -pub const BS58_STRING: &str = "BPFLoader1111111111111111111111111111111111"; -crate::declare_id!(BS58_STRING); +crate::declare_id!("BPFLoader1111111111111111111111111111111111"); diff --git a/sdk/src/instruction_processor_utils.rs b/sdk/src/instruction_processor_utils.rs index 269fe7a20..0d9fda679 100644 --- a/sdk/src/instruction_processor_utils.rs +++ b/sdk/src/instruction_processor_utils.rs @@ -37,6 +37,10 @@ macro_rules! solana_entrypoint( /// # Examples /// /// ``` +/// use std::str::FromStr; +/// # // wrapper is used so that the macro invocation occurs in the item position +/// # // rather than in the statement position which isn't allowed. +/// # mod item_wrapper { /// use solana_sdk::account::KeyedAccount; /// use solana_sdk::instruction::InstructionError; /// use solana_sdk::pubkey::Pubkey; @@ -51,11 +55,46 @@ macro_rules! solana_entrypoint( /// Ok(()) /// } /// -/// solana_sdk::declare_program!( -/// "My!!!11111111111111111111111111111111111111", +/// declare_program!( +/// "My11111111111111111111111111111111111111111", /// solana_my_program, /// my_process_instruction /// ); +/// +/// # } +/// # use solana_sdk::pubkey::Pubkey; +/// # use item_wrapper::id; +/// let my_id = Pubkey::from_str("My11111111111111111111111111111111111111111").unwrap(); +/// assert_eq!(id(), my_id); +/// ``` +/// ``` +/// use std::str::FromStr; +/// # // wrapper is used so that the macro invocation occurs in the item position +/// # // rather than in the statement position which isn't allowed. +/// # mod item_wrapper { +/// use solana_sdk::account::KeyedAccount; +/// use solana_sdk::instruction::InstructionError; +/// use solana_sdk::pubkey::Pubkey; +/// use solana_sdk::declare_program; +/// +/// fn my_process_instruction( +/// program_id: &Pubkey, +/// keyed_accounts: &mut [KeyedAccount], +/// data: &[u8], +/// ) -> Result<(), InstructionError> { +/// // Process an instruction +/// Ok(()) +/// } +/// +/// declare_program!( +/// solana_sdk::system_program::ID, +/// solana_my_program, +/// my_process_instruction +/// ); +/// # } +/// +/// # use item_wrapper::id; +/// assert_eq!(id(), solana_sdk::system_program::ID); /// ``` #[macro_export] macro_rules! declare_program( diff --git a/sdk/src/lib.rs b/sdk/src/lib.rs index c118648fa..1806ea1dc 100644 --- a/sdk/src/lib.rs +++ b/sdk/src/lib.rs @@ -1,3 +1,6 @@ +// Allows macro expansion of `use ::solana_sdk::*` to work within this crate +extern crate self as solana_sdk; + pub mod account; pub mod account_utils; pub mod bpf_loader; @@ -24,6 +27,29 @@ pub mod system_program; pub mod sysvar; pub mod timing; +/// Convenience macro to declare a static public key and functions to interact with it +/// +/// Input: a single literal base58 string representation of a program's id +/// +/// # Example +/// +/// ``` +/// # // wrapper is used so that the macro invocation occurs in the item position +/// # // rather than in the statement position which isn't allowed. +/// use std::str::FromStr; +/// use solana_sdk::{declare_id, pubkey::Pubkey}; +/// +/// # mod item_wrapper { +/// # use solana_sdk::declare_id; +/// declare_id!("My11111111111111111111111111111111111111111"); +/// # } +/// # use item_wrapper::id; +/// +/// let my_id = Pubkey::from_str("My11111111111111111111111111111111111111111").unwrap(); +/// assert_eq!(id(), my_id); +/// ``` +pub use solana_sdk_macro::declare_id; + // On-chain program specific modules pub mod account_info; pub mod entrypoint; @@ -52,5 +78,4 @@ pub mod transport; #[macro_use] extern crate serde_derive; pub extern crate bs58; -pub extern crate lazy_static; extern crate log as logger; diff --git a/sdk/src/move_loader.rs b/sdk/src/move_loader.rs index 0637d4083..d89c077d6 100644 --- a/sdk/src/move_loader.rs +++ b/sdk/src/move_loader.rs @@ -1,5 +1,4 @@ -pub const BS58_STRING: &str = "MoveLdr111111111111111111111111111111111111"; -crate::declare_id!(BS58_STRING); +crate::declare_id!("MoveLdr111111111111111111111111111111111111"); pub fn solana_move_loader_program() -> (String, crate::pubkey::Pubkey) { ("solana_move_loader_program".to_string(), id()) diff --git a/sdk/src/pubkey.rs b/sdk/src/pubkey.rs index e0a0659c2..f501fd067 100644 --- a/sdk/src/pubkey.rs +++ b/sdk/src/pubkey.rs @@ -47,6 +47,10 @@ impl Pubkey { ) } + pub const fn new_from_array(pubkey_array: [u8; 32]) -> Self { + Self(pubkey_array) + } + #[cfg(not(feature = "program"))] pub fn new_rand() -> Self { Self::new(&rand::random::<[u8; 32]>()) @@ -104,62 +108,6 @@ pub fn read_pubkey_file(infile: &str) -> Result> { Ok(Pubkey::from_str(&printable)?) } -/// Convenience macro to declare a static Pubkey and functions to interact with it -/// -/// bs58_string: bs58 string representation the program's id -/// -/// # Examples -/// -/// ``` -/// solana_sdk::declare_id!("My!!!11111111111111111111111111111111111111"); -/// ``` -#[macro_export] -macro_rules! -declare_id( - ($bs58_string:expr) => ( - use std::str::FromStr; - - $crate::lazy_static::lazy_static! { - static ref _PUBKEY: $crate::pubkey::Pubkey = { - match $crate::pubkey::Pubkey::from_str(&$bs58_string) { - Ok(pubkey) => pubkey, - Err(_) => { - let pubkey_vec = $crate::bs58::decode(&$bs58_string) - .into_vec() - .map_err(|e| panic!("Error: {}, {}", $bs58_string, e)) - .unwrap(); - let expected_len = std::mem::size_of::<$crate::pubkey::Pubkey>(); - let len = pubkey_vec.len(); - if len != expected_len { - panic!( - "Error: {}, decoded length {}, expected {}", - $bs58_string, len, expected_len); - } else { - panic!( - "Error: {}, not a valid string, cannot determine reason", - $bs58_string); - } - } - } - }; - } - - pub fn check_id(id: &$crate::pubkey::Pubkey) -> bool { - *id == *_PUBKEY - } - - pub fn id() -> $crate::pubkey::Pubkey { - *_PUBKEY - } - - #[cfg(test)] - #[test] - fn test_id() { - assert!(check_id(&id())); - } - ) -); - #[cfg(test)] mod tests { use super::*;