diff --git a/.eslintrc.js b/.eslintrc.js
index daec0f421c9..710873e1b56 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,4 +1,4 @@
-module.exports = { // E: 'module' is not defined.
+module.exports = {
extends: ['turbo', '@solana/eslint-config-solana', '@solana/eslint-config-solana/jest'],
root: true,
};
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 00000000000..7bfa0e8650f
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1,11 @@
+docs
+lib
+test-ledger
+node_modules
+dist
+generated
+.mypy_cache
+*.yml
+*.yaml
+*.md
+*.json
diff --git a/.prettierrc b/.prettierrc
new file mode 100644
index 00000000000..173a61f766c
--- /dev/null
+++ b/.prettierrc
@@ -0,0 +1,9 @@
+{
+ "semi": true,
+ "singleQuote": true,
+ "trailingComma": "es5",
+ "useTabs": false,
+ "tabWidth": 4,
+ "arrowParens": "always",
+ "printWidth": 80
+}
diff --git a/Cargo.lock b/Cargo.lock
index 48af5913c93..16fda2face9 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -430,13 +430,14 @@ dependencies = [
[[package]]
name = "assert_cmd"
-version = "2.0.15"
+version = "2.0.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bc65048dd435533bb1baf2ed9956b9a278fbfdcf90301b39ee117f06c0199d37"
+checksum = "dc1835b7f27878de8525dc71410b5a31cdcc5f230aed5ba5df968e09c201b23d"
dependencies = [
"anstyle",
"bstr 1.6.0",
"doc-comment",
+ "libc",
"predicates 3.0.3",
"predicates-core",
"predicates-tree",
@@ -922,18 +923,18 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7"
[[package]]
name = "bytemuck"
-version = "1.16.1"
+version = "1.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e"
+checksum = "6fd4c6dcc3b0aea2f5c0b4b82c2b15fe39ddbc76041a310848f4706edf76bb31"
dependencies = [
"bytemuck_derive",
]
[[package]]
name = "bytemuck_derive"
-version = "1.7.0"
+version = "1.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ee891b04274a59bd38b412188e24b849617b2e45a0fd8d057deb63e7403761b"
+checksum = "0cc8b54b395f2fcfbb3d90c47b01c7f444d94d05bdeb775811dec868ac3bbc26"
dependencies = [
"proc-macro2",
"quote",
@@ -1064,7 +1065,7 @@ dependencies = [
"num-traits",
"serde",
"wasm-bindgen",
- "windows-targets 0.52.0",
+ "windows-targets 0.52.6",
]
[[package]]
@@ -1721,7 +1722,7 @@ dependencies = [
"ed25519",
"rand 0.7.3",
"serde",
- "sha2 0.9.8",
+ "sha2 0.9.9",
"zeroize",
]
@@ -2908,7 +2909,7 @@ dependencies = [
"libsecp256k1-gen-genmult",
"rand 0.7.3",
"serde",
- "sha2 0.9.8",
+ "sha2 0.9.9",
"typenum",
]
@@ -3385,18 +3386,18 @@ dependencies = [
[[package]]
name = "num_enum"
-version = "0.7.2"
+version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845"
+checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179"
dependencies = [
"num_enum_derive",
]
[[package]]
name = "num_enum_derive"
-version = "0.7.2"
+version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b"
+checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56"
dependencies = [
"proc-macro-crate 3.1.0",
"proc-macro2",
@@ -4604,9 +4605,9 @@ dependencies = [
[[package]]
name = "serde"
-version = "1.0.204"
+version = "1.0.208"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12"
+checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2"
dependencies = [
"serde_derive",
]
@@ -4622,9 +4623,9 @@ dependencies = [
[[package]]
name = "serde_derive"
-version = "1.0.204"
+version = "1.0.208"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222"
+checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf"
dependencies = [
"proc-macro2",
"quote",
@@ -4633,9 +4634,9 @@ dependencies = [
[[package]]
name = "serde_json"
-version = "1.0.121"
+version = "1.0.125"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ab380d7d9f22ef3f21ad3e6c1ebe8e4fc7a2000ccba2e4d71fc96f15b2cb609"
+checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed"
dependencies = [
"itoa",
"memchr",
@@ -4794,9 +4795,9 @@ dependencies = [
[[package]]
name = "sha2"
-version = "0.9.8"
+version = "0.9.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b69f9a4c9740d74c5baa3fd2e547f9525fa8088a8a958e0ca2409a514e33f5fa"
+checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800"
dependencies = [
"block-buffer 0.9.0",
"cfg-if 1.0.0",
@@ -7252,30 +7253,30 @@ dependencies = [
[[package]]
name = "spl-pod"
version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e6166a591d93af33afd75bbd8573c5fd95fb1213f1bf254f0508c89fdb5ee156"
dependencies = [
- "base64 0.22.1",
"borsh 1.5.1",
"bytemuck",
"bytemuck_derive",
- "serde",
- "serde_json",
"solana-program",
"solana-zk-token-sdk",
- "spl-program-error 0.5.0",
+ "spl-program-error 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "spl-pod"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e6166a591d93af33afd75bbd8573c5fd95fb1213f1bf254f0508c89fdb5ee156"
+version = "0.3.1"
dependencies = [
+ "base64 0.22.1",
"borsh 1.5.1",
"bytemuck",
"bytemuck_derive",
+ "serde",
+ "serde_json",
"solana-program",
- "solana-zk-token-sdk",
- "spl-program-error 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "solana-zk-sdk",
+ "spl-program-error 0.5.0",
]
[[package]]
@@ -7337,7 +7338,7 @@ dependencies = [
"solana-program",
"solana-program-test",
"solana-sdk",
- "spl-pod 0.3.0",
+ "spl-pod 0.3.1",
"thiserror",
]
@@ -7428,7 +7429,7 @@ dependencies = [
"solana-security-txt",
"solana-vote-program",
"spl-math",
- "spl-pod 0.3.0",
+ "spl-pod 0.3.1",
"spl-token 6.0.0",
"spl-token-2022 4.0.1",
"test-case",
@@ -7473,7 +7474,7 @@ dependencies = [
"solana-program-test",
"solana-sdk",
"spl-discriminator 0.3.0",
- "spl-pod 0.3.0",
+ "spl-pod 0.3.1",
"spl-program-error 0.5.0",
"spl-type-length-value 0.5.0",
]
@@ -7487,7 +7488,7 @@ dependencies = [
"bytemuck",
"solana-program",
"spl-discriminator 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "spl-pod 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "spl-pod 0.3.0",
"spl-program-error 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"spl-type-length-value 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -7540,7 +7541,7 @@ dependencies = [
"solana-security-txt",
"solana-zk-token-sdk",
"spl-memo 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "spl-pod 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "spl-pod 0.3.0",
"spl-token 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"spl-token-group-interface 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"spl-token-metadata-interface 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -7569,11 +7570,14 @@ dependencies = [
"solana-program-test",
"solana-sdk",
"solana-security-txt",
- "solana-zk-token-sdk",
+ "solana-zk-sdk",
"spl-memo 5.0.0",
- "spl-pod 0.3.0",
+ "spl-pod 0.3.1",
"spl-tlv-account-resolution 0.7.0",
"spl-token 6.0.0",
+ "spl-token-confidential-transfer-ciphertext-arithmetic",
+ "spl-token-confidential-transfer-proof-extraction",
+ "spl-token-confidential-transfer-proof-generation",
"spl-token-group-interface 0.3.0",
"spl-token-metadata-interface 0.4.0",
"spl-transfer-hook-interface 0.7.0",
@@ -7587,6 +7591,7 @@ version = "0.0.1"
dependencies = [
"async-trait",
"borsh 1.5.1",
+ "bytemuck",
"futures-util",
"solana-program",
"solana-program-test",
@@ -7594,10 +7599,12 @@ dependencies = [
"spl-associated-token-account 4.0.0",
"spl-instruction-padding",
"spl-memo 5.0.0",
- "spl-pod 0.3.0",
+ "spl-pod 0.3.1",
+ "spl-record",
"spl-tlv-account-resolution 0.7.0",
"spl-token-2022 4.0.1",
"spl-token-client",
+ "spl-token-confidential-transfer-proof-generation",
"spl-token-group-interface 0.3.0",
"spl-token-metadata-interface 0.4.0",
"spl-transfer-hook-example",
@@ -7608,7 +7615,7 @@ dependencies = [
[[package]]
name = "spl-token-cli"
-version = "4.0.0"
+version = "4.0.1"
dependencies = [
"assert_cmd",
"base64 0.22.1",
@@ -7635,6 +7642,7 @@ dependencies = [
"spl-token 6.0.0",
"spl-token-2022 4.0.1",
"spl-token-client",
+ "spl-token-confidential-transfer-proof-generation",
"spl-token-group-interface 0.3.0",
"spl-token-metadata-interface 0.4.0",
"strum 0.26.3",
@@ -7649,7 +7657,8 @@ name = "spl-token-client"
version = "0.11.0"
dependencies = [
"async-trait",
- "curve25519-dalek",
+ "bincode",
+ "bytemuck",
"futures 0.3.30",
"futures-util",
"solana-banks-interface",
@@ -7660,8 +7669,10 @@ dependencies = [
"solana-sdk",
"spl-associated-token-account 4.0.0",
"spl-memo 5.0.0",
+ "spl-record",
"spl-token 6.0.0",
"spl-token-2022 4.0.1",
+ "spl-token-confidential-transfer-proof-generation",
"spl-token-group-interface 0.3.0",
"spl-token-metadata-interface 0.4.0",
"spl-transfer-hook-interface 0.7.0",
@@ -7676,7 +7687,7 @@ dependencies = [
"solana-program-test",
"solana-sdk",
"spl-discriminator 0.3.0",
- "spl-pod 0.3.0",
+ "spl-pod 0.3.1",
"spl-program-error 0.5.0",
"spl-token-2022 4.0.1",
"spl-token-client",
@@ -7736,7 +7747,7 @@ dependencies = [
"solana-program-test",
"solana-sdk",
"spl-discriminator 0.3.0",
- "spl-pod 0.3.0",
+ "spl-pod 0.3.1",
"spl-token-2022 4.0.1",
"spl-token-client",
"spl-token-group-interface 0.3.0",
@@ -7751,7 +7762,7 @@ dependencies = [
"bytemuck",
"solana-program",
"spl-discriminator 0.3.0",
- "spl-pod 0.3.0",
+ "spl-pod 0.3.1",
"spl-program-error 0.5.0",
"spl-type-length-value 0.5.0",
]
@@ -7765,7 +7776,7 @@ dependencies = [
"bytemuck",
"solana-program",
"spl-discriminator 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "spl-pod 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "spl-pod 0.3.0",
"spl-program-error 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -7809,7 +7820,7 @@ dependencies = [
"solana-program",
"solana-program-test",
"solana-sdk",
- "spl-pod 0.3.0",
+ "spl-pod 0.3.1",
"spl-token-2022 4.0.1",
"spl-token-client",
"spl-token-metadata-interface 0.4.0",
@@ -7826,7 +7837,7 @@ dependencies = [
"serde_json",
"solana-program",
"spl-discriminator 0.3.0",
- "spl-pod 0.3.0",
+ "spl-pod 0.3.1",
"spl-program-error 0.5.0",
"spl-type-length-value 0.5.0",
]
@@ -7840,7 +7851,7 @@ dependencies = [
"borsh 1.5.1",
"solana-program",
"spl-discriminator 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "spl-pod 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "spl-pod 0.3.0",
"spl-program-error 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"spl-type-length-value 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -7977,7 +7988,7 @@ dependencies = [
"bytemuck",
"solana-program",
"spl-discriminator 0.3.0",
- "spl-pod 0.3.0",
+ "spl-pod 0.3.1",
"spl-program-error 0.5.0",
"spl-tlv-account-resolution 0.7.0",
"spl-type-length-value 0.5.0",
@@ -7994,7 +8005,7 @@ dependencies = [
"bytemuck",
"solana-program",
"spl-discriminator 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "spl-pod 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "spl-pod 0.3.0",
"spl-program-error 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"spl-tlv-account-resolution 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"spl-type-length-value 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -8007,7 +8018,7 @@ dependencies = [
"bytemuck",
"solana-program",
"spl-discriminator 0.3.0",
- "spl-pod 0.3.0",
+ "spl-pod 0.3.1",
"spl-program-error 0.5.0",
"spl-type-length-value-derive",
]
@@ -8021,7 +8032,7 @@ dependencies = [
"bytemuck",
"solana-program",
"spl-discriminator 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "spl-pod 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "spl-pod 0.3.0",
"spl-program-error 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -8292,14 +8303,15 @@ dependencies = [
[[package]]
name = "tempfile"
-version = "3.10.1"
+version = "3.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1"
+checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64"
dependencies = [
"cfg-if 1.0.0",
"fastrand",
+ "once_cell",
"rustix",
- "windows-sys 0.52.0",
+ "windows-sys 0.59.0",
]
[[package]]
@@ -8458,7 +8470,7 @@ dependencies = [
"pbkdf2 0.4.0",
"rand 0.7.3",
"rustc-hash",
- "sha2 0.9.8",
+ "sha2 0.9.9",
"thiserror",
"unicode-normalization",
"wasm-bindgen",
@@ -8482,9 +8494,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
[[package]]
name = "tokio"
-version = "1.39.2"
+version = "1.39.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1"
+checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5"
dependencies = [
"backtrace",
"bytes",
@@ -9199,7 +9211,16 @@ version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
dependencies = [
- "windows-targets 0.52.0",
+ "windows-targets 0.52.6",
+]
+
+[[package]]
+name = "windows-sys"
+version = "0.59.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
+dependencies = [
+ "windows-targets 0.52.6",
]
[[package]]
@@ -9219,17 +9240,18 @@ dependencies = [
[[package]]
name = "windows-targets"
-version = "0.52.0"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd"
+checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
dependencies = [
- "windows_aarch64_gnullvm 0.52.0",
- "windows_aarch64_msvc 0.52.0",
- "windows_i686_gnu 0.52.0",
- "windows_i686_msvc 0.52.0",
- "windows_x86_64_gnu 0.52.0",
- "windows_x86_64_gnullvm 0.52.0",
- "windows_x86_64_msvc 0.52.0",
+ "windows_aarch64_gnullvm 0.52.6",
+ "windows_aarch64_msvc 0.52.6",
+ "windows_i686_gnu 0.52.6",
+ "windows_i686_gnullvm",
+ "windows_i686_msvc 0.52.6",
+ "windows_x86_64_gnu 0.52.6",
+ "windows_x86_64_gnullvm 0.52.6",
+ "windows_x86_64_msvc 0.52.6",
]
[[package]]
@@ -9240,9 +9262,9 @@ checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc"
[[package]]
name = "windows_aarch64_gnullvm"
-version = "0.52.0"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea"
+checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
[[package]]
name = "windows_aarch64_msvc"
@@ -9252,9 +9274,9 @@ checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3"
[[package]]
name = "windows_aarch64_msvc"
-version = "0.52.0"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef"
+checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
[[package]]
name = "windows_i686_gnu"
@@ -9264,9 +9286,15 @@ checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241"
[[package]]
name = "windows_i686_gnu"
-version = "0.52.0"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
+
+[[package]]
+name = "windows_i686_gnullvm"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313"
+checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
[[package]]
name = "windows_i686_msvc"
@@ -9276,9 +9304,9 @@ checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00"
[[package]]
name = "windows_i686_msvc"
-version = "0.52.0"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a"
+checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
[[package]]
name = "windows_x86_64_gnu"
@@ -9288,9 +9316,9 @@ checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1"
[[package]]
name = "windows_x86_64_gnu"
-version = "0.52.0"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd"
+checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
[[package]]
name = "windows_x86_64_gnullvm"
@@ -9300,9 +9328,9 @@ checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953"
[[package]]
name = "windows_x86_64_gnullvm"
-version = "0.52.0"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e"
+checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
[[package]]
name = "windows_x86_64_msvc"
@@ -9312,9 +9340,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
[[package]]
name = "windows_x86_64_msvc"
-version = "0.52.0"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04"
+checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "winnow"
diff --git a/account-compression/programs/account-compression/Cargo.toml b/account-compression/programs/account-compression/Cargo.toml
index 095ad9d5e7b..a57df385abe 100644
--- a/account-compression/programs/account-compression/Cargo.toml
+++ b/account-compression/programs/account-compression/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "spl-account-compression"
-version = "0.3.0"
+version = "0.3.1"
description = "Solana Program Library Account Compression Program"
authors = ["Solana Labs Maintainers "]
repository = "https://github.com/solana-labs/solana-program-library"
@@ -21,9 +21,7 @@ default = []
anchor-lang = "0.29.0"
bytemuck = "1.13"
solana-program = ">=1.18.11,<=2"
-spl-concurrent-merkle-tree = { version = "0.3.0", path = "../../../libraries/concurrent-merkle-tree", features = [
- "sol-log",
-] }
+spl-concurrent-merkle-tree = { version = "0.3.0", path = "../../../libraries/concurrent-merkle-tree" }
spl-noop = { version = "0.2.0", path = "../noop", features = ["no-entrypoint"] }
[profile.release]
diff --git a/account-compression/programs/account-compression/README.md b/account-compression/programs/account-compression/README.md
index e57de7a10c6..e720cc57b9d 100644
--- a/account-compression/programs/account-compression/README.md
+++ b/account-compression/programs/account-compression/README.md
@@ -4,10 +4,8 @@
-# SPL Account Compression Rust SDK (Beta)
+# SPL Account Compression Rust SDK
More information about account compression can be found in [the solana-program-library repo](https://github.com/solana-labs/solana-program-library/tree/master/account-compression).
-The [Solana Program Examples repo](https://github.com/solana-developers/program-examples) will eventually include examples of how to use this program.
-
-`spl-account-compression` and this crate's implementation are targeted towards supporting [Metaplex Compressed NFTs](https://github.com/metaplex-foundation/metaplex-program-library/tree/master/bubblegum) and may be subject to change.
\ No newline at end of file
+`spl-account-compression` and this crate's implementation are targeted towards supporting [Metaplex Compressed NFTs](https://github.com/metaplex-foundation/mpl-bubblegum) and may be subject to change.
\ No newline at end of file
diff --git a/account-compression/sdk/README.md b/account-compression/sdk/README.md
index b4f81da6d62..d4c76dbfad0 100644
--- a/account-compression/sdk/README.md
+++ b/account-compression/sdk/README.md
@@ -167,7 +167,7 @@ Here are some examples using account compression in the wild:
* Solana Program Library [tests](https://github.com/solana-labs/solana-program-library/tree/master/account-compression/sdk/tests)
-* Metaplex Program Library Compressed NFT [tests](https://github.com/metaplex-foundation/metaplex-program-library/tree/master/bubblegum/js/tests)
+* Metaplex Program Library Compressed NFT [tests](https://github.com/metaplex-foundation/mpl-bubblegum/tree/main/clients/js/test)
## Build from Source
diff --git a/account-compression/sdk/package.json b/account-compression/sdk/package.json
index 58d0334cba7..bd7af81a7d8 100644
--- a/account-compression/sdk/package.json
+++ b/account-compression/sdk/package.json
@@ -35,11 +35,8 @@
"scripts": {
"build": "rm -rf dist/ && tsc -p tsconfig.json",
"build:program": "cargo build-sbf --manifest-path=../programs/account-compression/Cargo.toml && cargo build-sbf --manifest-path=../programs/noop/Cargo.toml",
- "fmt": "prettier --write '{*,**/*}.{ts,tsx,js,jsx,json}'",
- "pretty": "prettier --check '{,{src,test}/**/}*.{j,t}s'",
- "pretty:fix": "prettier --write '{,{src,test}/**/}*.{j,t}s'",
- "lint": "set -ex; npm run pretty; eslint . --ext .js,.ts",
- "lint:fix": "npm run pretty:fix && eslint . --fix --ext .js,.ts",
+ "lint": "set -ex; eslint . --ext .js,.ts",
+ "lint:fix": "eslint . --fix --ext .js,.ts",
"docs": "rm -rf docs/ && typedoc --out docs",
"deploy:docs": "npm run docs && gh-pages --dest account-compression/sdk --dist docs --dotfiles",
"start-validator": "solana-test-validator --reset --quiet --bpf-program cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK ../target/deploy/spl_account_compression.so --bpf-program noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV ../target/deploy/spl_noop.so --account 27QMkDMpBoAhmWj6xxQNYdqXZL5nnC8tkZcEtkNxCqeX pre-batch-init-tree-account.json",
@@ -61,39 +58,34 @@
"typescript-collections": "^1.3.3"
},
"peerDependencies": {
- "@solana/web3.js": "^1.95.1"
+ "@solana/web3.js": "^1.95.2"
},
"devDependencies": {
"@metaplex-foundation/rustbin": "^0.3.5",
"@metaplex-foundation/solita": "0.20.1",
- "@coral-xyz/anchor": "^0.27.0",
+ "@coral-xyz/anchor": "^0.29.0",
"@solana/eslint-config-solana": "^3.0.3",
- "@solana/prettier-config-solana": "^0.0.5",
"@types/bn.js": "^5.1.0",
"@types/jest": "^29.5.12",
- "@types/node": "^22.0.0",
+ "@types/node": "^22.4.2",
"@types/node-fetch": "^2.6.11",
- "@typescript-eslint/eslint-plugin": "^7.17.0",
- "@typescript-eslint/parser": "^7.17.0",
+ "@typescript-eslint/eslint-plugin": "^8.2.0",
+ "@typescript-eslint/parser": "^8.2.0",
"eslint": "^8.57.0",
- "eslint-config-prettier": "^9.1.0",
- "eslint-config-turbo": "^2.0.9",
+ "eslint-config-turbo": "^2.0.14",
"eslint-plugin-import": "^2.29.1",
- "eslint-plugin-jest": "^28.6.0",
+ "eslint-plugin-jest": "^28.8.0",
"eslint-plugin-mocha": "^10.5.0",
- "eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-sort-keys-fix": "^1.1.2",
"gh-pages": "^6.1.1",
"jest": "^29.0.1",
"jest-config": "^29.0.1",
- "prettier": "^3.3.3",
"start-server-and-test": "^2.0.5",
- "ts-jest": "^29.2.3",
+ "ts-jest": "^29.2.4",
"ts-jest-resolver": "^2.0.1",
"ts-node": "^10.9.2",
- "typedoc": "^0.26.5",
+ "typedoc": "^0.26.6",
"typescript": "5.5.4"
- },
- "prettier": "@solana/prettier-config-solana"
+ }
}
diff --git a/account-compression/sdk/src/.prettierignore b/account-compression/sdk/src/.prettierignore
deleted file mode 100644
index 3380d72b2f8..00000000000
--- a/account-compression/sdk/src/.prettierignore
+++ /dev/null
@@ -1,2 +0,0 @@
-test/dist
-docs/
\ No newline at end of file
diff --git a/account-compression/sdk/tests/accountCompression.test.ts b/account-compression/sdk/tests/accountCompression.test.ts
index 6ee7fc22b90..02e77cfdab6 100644
--- a/account-compression/sdk/tests/accountCompression.test.ts
+++ b/account-compression/sdk/tests/accountCompression.test.ts
@@ -618,7 +618,7 @@ describe('Account Compression', () => {
assert(
Buffer.from(onChainRoot).equals(offChainTree.root),
- 'Updated on chain root matches root of updated off chain tree'
+ 'Updated on chain root matches root of updated off chain tree',
);
});
it('Verify proof works for that leaf', async () => {
@@ -637,7 +637,7 @@ describe('Account Compression', () => {
assert(
Buffer.from(onChainRoot).equals(offChainTree.root),
- 'Updated on chain root matches root of updated off chain tree'
+ 'Updated on chain root matches root of updated off chain tree',
);
});
it('Verify leaf fails when proof fails', async () => {
@@ -668,7 +668,7 @@ describe('Account Compression', () => {
assert(
Buffer.from(onChainRoot).equals(offChainTree.root),
- 'Updated on chain root matches root of updated off chain tree'
+ 'Updated on chain root matches root of updated off chain tree',
);
});
it('Replace that leaf', async () => {
@@ -687,7 +687,7 @@ describe('Account Compression', () => {
assert(
Buffer.from(onChainRoot).equals(offChainTree.root),
- 'Updated on chain root matches root of updated off chain tree'
+ 'Updated on chain root matches root of updated off chain tree',
);
});
@@ -706,7 +706,7 @@ describe('Account Compression', () => {
assert(
Buffer.from(onChainRoot).equals(offChainTree.root),
- 'Updated on chain root matches root of updated off chain tree'
+ 'Updated on chain root matches root of updated off chain tree',
);
});
@@ -743,7 +743,7 @@ describe('Account Compression', () => {
beforeEach(async () => {
await provider.connection.confirmTransaction(
- await (connection as Connection).requestAirdrop(authority, 1e10)
+ await (connection as Connection).requestAirdrop(authority, 1e10),
);
[cmtKeypair, offChainTree] = await createTreeOnChain(provider, authorityKeypair, 1, DEPTH_SIZE_PAIR);
cmt = cmtKeypair.publicKey;
@@ -767,7 +767,7 @@ describe('Account Compression', () => {
assert(
splCMT.getAuthority().equals(randomSigner),
- `Upon transferring authority, authority should be ${randomSigner.toString()}, but was instead updated to ${splCMT.getAuthority()}`
+ `Upon transferring authority, authority should be ${randomSigner.toString()}, but was instead updated to ${splCMT.getAuthority()}`,
);
// Attempting to replace with new authority now works
@@ -816,7 +816,7 @@ describe('Account Compression', () => {
assert(
Buffer.from(onChainRoot).equals(offChainTree.root),
- 'Updated on chain root does not match root of updated off chain tree'
+ 'Updated on chain root does not match root of updated off chain tree',
);
});
it('Empty all of the leaves and close the tree', async () => {
@@ -854,7 +854,7 @@ describe('Account Compression', () => {
const finalLamports = payerInfo!.lamports;
assert(
finalLamports === payerLamports + treeLamports - 5000,
- 'Expected payer to have received the lamports from the closed tree account'
+ 'Expected payer to have received the lamports from the closed tree account',
);
treeInfo = await provider.connection.getAccountInfo(cmt, 'confirmed');
@@ -869,7 +869,7 @@ describe('Account Compression', () => {
try {
await execute(provider, [ix], [payerKeypair]);
assert(false, 'Closing a tree account before it is empty should ALWAYS error');
- } catch (e) {}
+ } catch {}
});
});
@@ -914,13 +914,13 @@ describe('Account Compression', () => {
try {
await execute(provider, [replaceIx], [payerKeypair]);
assert(false, 'Attacker was able to successfully write fake existence of a leaf');
- } catch (e) {}
+ } catch {}
const splCMT = await ConcurrentMerkleTreeAccount.fromAccountAddress(connection, cmt);
assert(
splCMT.getCurrentBufferIndex() === 0,
- "CMT updated its active index after attacker's transaction, when it shouldn't have done anything"
+ "CMT updated its active index after attacker's transaction, when it shouldn't have done anything",
);
});
});
@@ -932,7 +932,7 @@ describe('Account Compression', () => {
payerKeypair,
2 ** DEPTH,
{ maxBufferSize: 8, maxDepth: DEPTH },
- DEPTH // Store full tree on chain
+ DEPTH, // Store full tree on chain
);
cmt = cmtKeypair.publicKey;
@@ -962,7 +962,7 @@ describe('Account Compression', () => {
payerKeypair,
0,
{ maxBufferSize: 8, maxDepth: DEPTH },
- DEPTH // Store full tree on chain
+ DEPTH, // Store full tree on chain
);
cmt = cmtKeypair.publicKey;
@@ -1090,7 +1090,7 @@ describe('Account Compression', () => {
try {
await execute(provider, [replaceIx], [payerKeypair]);
throw Error('This replace instruction should have failed because the leaf index is OOB');
- } catch (_e) {}
+ } catch {}
});
});
});
diff --git a/account-compression/sdk/tests/accounts/concurrentMerkleTreeAccount.test.ts b/account-compression/sdk/tests/accounts/concurrentMerkleTreeAccount.test.ts
index 3449590506f..c3dcbcb85c9 100644
--- a/account-compression/sdk/tests/accounts/concurrentMerkleTreeAccount.test.ts
+++ b/account-compression/sdk/tests/accounts/concurrentMerkleTreeAccount.test.ts
@@ -19,18 +19,18 @@ export function assertCMTProperties(
) {
assert(
onChainCMT.getMaxDepth() === expectedMaxDepth,
- `Max depth does not match ${onChainCMT.getMaxDepth()}, expected ${expectedMaxDepth}`
+ `Max depth does not match ${onChainCMT.getMaxDepth()}, expected ${expectedMaxDepth}`,
);
assert(
onChainCMT.getMaxBufferSize() === expectedMaxBufferSize,
- `Max buffer size does not match ${onChainCMT.getMaxBufferSize()}, expected ${expectedMaxBufferSize}`
+ `Max buffer size does not match ${onChainCMT.getMaxBufferSize()}, expected ${expectedMaxBufferSize}`,
);
assert(onChainCMT.getAuthority().equals(expectedAuthority), 'Failed to write auth pubkey');
assert(onChainCMT.getCurrentRoot().equals(expectedRoot), 'On chain root does not match root passed in instruction');
if (expectedCanopyDepth) {
assert(
onChainCMT.getCanopyDepth() === expectedCanopyDepth,
- 'On chain canopy depth does not match expected canopy depth'
+ 'On chain canopy depth does not match expected canopy depth',
);
}
assert(
@@ -62,7 +62,7 @@ describe('ConcurrentMerkleTreeAccount tests', () => {
await provider.connection.confirmTransaction(
await provider.connection.requestAirdrop(payer, 1e10),
- 'confirmed'
+ 'confirmed',
);
});
@@ -81,7 +81,7 @@ describe('ConcurrentMerkleTreeAccount tests', () => {
const cmt = await ConcurrentMerkleTreeAccount.fromAccountAddress(
connection,
cmtKeypair.publicKey,
- 'confirmed'
+ 'confirmed',
);
await assertCMTProperties(cmt, MAX_DEPTH, MAX_SIZE, payer, offChainTree.root);
@@ -102,7 +102,7 @@ describe('ConcurrentMerkleTreeAccount tests', () => {
const cmt = await ConcurrentMerkleTreeAccount.fromAccountAddress(
connection,
cmtKeypair.publicKey,
- 'confirmed'
+ 'confirmed',
);
// Verify it was initialized correctly
@@ -111,7 +111,7 @@ describe('ConcurrentMerkleTreeAccount tests', () => {
depthSizePair.maxDepth,
depthSizePair.maxBufferSize,
payer,
- emptyNode(depthSizePair.maxDepth)
+ emptyNode(depthSizePair.maxDepth),
);
}
});
@@ -134,12 +134,12 @@ describe('ConcurrentMerkleTreeAccount tests', () => {
provider,
payerKeypair,
{ maxBufferSize, maxDepth },
- canopyDepth
+ canopyDepth,
);
const cmt = await ConcurrentMerkleTreeAccount.fromAccountAddress(
connection,
cmtKeypair.publicKey,
- 'confirmed'
+ 'confirmed',
);
// Verify it was initialized correctly
diff --git a/account-compression/sdk/tests/events/applicationData.test.ts b/account-compression/sdk/tests/events/applicationData.test.ts
index 14a1f5a60ce..8f82490348d 100644
--- a/account-compression/sdk/tests/events/applicationData.test.ts
+++ b/account-compression/sdk/tests/events/applicationData.test.ts
@@ -1,27 +1,24 @@
-import { strict as assert } from "node:assert";
+import { strict as assert } from 'node:assert';
-import { BN } from "bn.js";
+import { BN } from 'bn.js';
-import { deserializeApplicationDataEvent } from "../../src";
+import { deserializeApplicationDataEvent } from '../../src';
-describe("Serde tests", () => {
- describe("ApplicationDataEvent tests", () => {
- it("Can serialize and deserialize ApplicationDataEvent", () => {
- const data = Buffer.from("Hello world");
- const applicationDataEvent = Buffer.concat([
- Buffer.from([0x1]), // ApplicationData Event tag
- Buffer.from([0x0]), // version 0 tag
- Buffer.from(new BN.BN(data.length).toArray("le", 4)), // Size of application data (for Vec)
- data, // serialized application data (for Vec)
- ]);
+describe('Serde tests', () => {
+ describe('ApplicationDataEvent tests', () => {
+ it('Can serialize and deserialize ApplicationDataEvent', () => {
+ const data = Buffer.from('Hello world');
+ const applicationDataEvent = Buffer.concat([
+ Buffer.from([0x1]), // ApplicationData Event tag
+ Buffer.from([0x0]), // version 0 tag
+ Buffer.from(new BN.BN(data.length).toArray('le', 4)), // Size of application data (for Vec)
+ data, // serialized application data (for Vec)
+ ]);
- const deserialized =
- deserializeApplicationDataEvent(applicationDataEvent);
- const decoder = new TextDecoder();
- const deserializedData = decoder.decode(
- deserialized.fields[0].applicationData
- );
- assert("Hello world" === deserializedData);
+ const deserialized = deserializeApplicationDataEvent(applicationDataEvent);
+ const decoder = new TextDecoder();
+ const deserializedData = decoder.decode(deserialized.fields[0].applicationData);
+ assert('Hello world' === deserializedData);
+ });
});
- });
});
diff --git a/account-compression/sdk/tests/events/changelog.test.ts b/account-compression/sdk/tests/events/changelog.test.ts
index a90a99c8d8b..114e8a9d5f7 100644
--- a/account-compression/sdk/tests/events/changelog.test.ts
+++ b/account-compression/sdk/tests/events/changelog.test.ts
@@ -1,116 +1,100 @@
-import { strict as assert } from "node:assert";
+import { strict as assert } from 'node:assert';
-import { AnchorProvider } from "@coral-xyz/anchor";
-import NodeWallet from "@coral-xyz/anchor/dist/cjs/nodewallet";
-import { bs58 } from "@coral-xyz/anchor/dist/cjs/utils/bytes";
-import { Connection, Keypair, PublicKey } from "@solana/web3.js";
-import { BN } from "bn.js";
-import * as crypto from "crypto";
+import { AnchorProvider } from '@coral-xyz/anchor';
+import NodeWallet from '@coral-xyz/anchor/dist/cjs/nodewallet';
+import { bs58 } from '@coral-xyz/anchor/dist/cjs/utils/bytes';
+import { Connection, Keypair, PublicKey } from '@solana/web3.js';
+import { BN } from 'bn.js';
+import * as crypto from 'crypto';
-import {
- createAppendIx,
- deserializeChangeLogEventV1,
- SPL_NOOP_PROGRAM_ID,
-} from "../../src";
-import { MerkleTree } from "../../src/merkle-tree";
-import { createTreeOnChain,execute } from "../utils";
+import { createAppendIx, deserializeChangeLogEventV1, SPL_NOOP_PROGRAM_ID } from '../../src';
+import { MerkleTree } from '../../src/merkle-tree';
+import { createTreeOnChain, execute } from '../utils';
-describe("Serde tests", () => {
- let offChainTree: MerkleTree;
- let cmtKeypair: Keypair;
- let payerKeypair: Keypair;
- let payer: PublicKey;
- let connection: Connection;
- let provider: AnchorProvider;
+describe('Serde tests', () => {
+ let offChainTree: MerkleTree;
+ let cmtKeypair: Keypair;
+ let payerKeypair: Keypair;
+ let payer: PublicKey;
+ let connection: Connection;
+ let provider: AnchorProvider;
- const MAX_SIZE = 64;
- const MAX_DEPTH = 14;
+ const MAX_SIZE = 64;
+ const MAX_DEPTH = 14;
- beforeEach(async () => {
- payerKeypair = Keypair.generate();
- payer = payerKeypair.publicKey;
+ beforeEach(async () => {
+ payerKeypair = Keypair.generate();
+ payer = payerKeypair.publicKey;
- connection = new Connection("http://127.0.0.1:8899", {
- commitment: "confirmed",
- });
- const wallet = new NodeWallet(payerKeypair);
- provider = new AnchorProvider(connection, wallet, {
- commitment: connection.commitment,
- skipPreflight: true,
- });
+ connection = new Connection('http://127.0.0.1:8899', {
+ commitment: 'confirmed',
+ });
+ const wallet = new NodeWallet(payerKeypair);
+ provider = new AnchorProvider(connection, wallet, {
+ commitment: connection.commitment,
+ skipPreflight: true,
+ });
- await provider.connection.confirmTransaction(
- await provider.connection.requestAirdrop(payer, 1e10),
- "confirmed"
- );
- });
- describe("ChangeLogEvent tests", () => {
- let cmt: PublicKey;
- beforeEach(async () => {
- [cmtKeypair, offChainTree] = await createTreeOnChain(
- provider,
- payerKeypair,
- 0,
- { maxBufferSize: MAX_SIZE, maxDepth: MAX_DEPTH }
- );
- cmt = cmtKeypair.publicKey;
+ await provider.connection.confirmTransaction(
+ await provider.connection.requestAirdrop(payer, 1e10),
+ 'confirmed',
+ );
});
- it("Can deserialize a ChangeLogEvent", async () => {
- const newLeaf = crypto.randomBytes(32);
- const txId = await execute(
- provider,
- [createAppendIx(cmt, payer, newLeaf)],
- [payerKeypair]
- );
- offChainTree.updateLeaf(0, newLeaf);
+ describe('ChangeLogEvent tests', () => {
+ let cmt: PublicKey;
+ beforeEach(async () => {
+ [cmtKeypair, offChainTree] = await createTreeOnChain(provider, payerKeypair, 0, {
+ maxBufferSize: MAX_SIZE,
+ maxDepth: MAX_DEPTH,
+ });
+ cmt = cmtKeypair.publicKey;
+ });
+ it('Can deserialize a ChangeLogEvent', async () => {
+ const newLeaf = crypto.randomBytes(32);
+ const txId = await execute(provider, [createAppendIx(cmt, payer, newLeaf)], [payerKeypair]);
+ offChainTree.updateLeaf(0, newLeaf);
- const transaction = await connection.getTransaction(txId, {
- commitment: "confirmed",
- maxSupportedTransactionVersion: 2,
- });
+ const transaction = await connection.getTransaction(txId, {
+ commitment: 'confirmed',
+ maxSupportedTransactionVersion: 2,
+ });
- // Get noop program instruction
- const accountKeys = transaction!.transaction.message.getAccountKeys();
- const noopInstruction =
- transaction!.meta!.innerInstructions![0].instructions[0];
- const programId = accountKeys.get(noopInstruction.programIdIndex)!;
- if (!programId.equals(SPL_NOOP_PROGRAM_ID)) {
- throw Error(
- `Only inner ix should be a noop, but instead is a ${programId.toBase58()}`
- );
- }
- const cpiData = Buffer.from(bs58.decode(noopInstruction.data));
- const changeLogEvent = deserializeChangeLogEventV1(cpiData);
+ // Get noop program instruction
+ const accountKeys = transaction!.transaction.message.getAccountKeys();
+ const noopInstruction = transaction!.meta!.innerInstructions![0].instructions[0];
+ const programId = accountKeys.get(noopInstruction.programIdIndex)!;
+ if (!programId.equals(SPL_NOOP_PROGRAM_ID)) {
+ throw Error(`Only inner ix should be a noop, but instead is a ${programId.toBase58()}`);
+ }
+ const cpiData = Buffer.from(bs58.decode(noopInstruction.data));
+ const changeLogEvent = deserializeChangeLogEventV1(cpiData);
- assert(
- changeLogEvent.treeId.equals(cmt),
- `Tree id in changeLog differs from expected tree ${cmt.toBase58()}`
- );
- assert(
- changeLogEvent.index === 0,
- `ChangeLog should have index 0, but has index ${changeLogEvent.index}`
- );
- assert(
- new BN.BN(changeLogEvent.seq).toNumber() === 1,
- `ChangeLog should have sequence number of 1, but has seq number of ${changeLogEvent.seq.toString()}`
- );
+ assert(
+ changeLogEvent.treeId.equals(cmt),
+ `Tree id in changeLog differs from expected tree ${cmt.toBase58()}`,
+ );
+ assert(changeLogEvent.index === 0, `ChangeLog should have index 0, but has index ${changeLogEvent.index}`);
+ assert(
+ new BN.BN(changeLogEvent.seq).toNumber() === 1,
+ `ChangeLog should have sequence number of 1, but has seq number of ${changeLogEvent.seq.toString()}`,
+ );
- // Check that the emitted ChangeLog path matches up with the updated Tree
- let nodeIndex = 0 + (1 << MAX_DEPTH);
- let realTreeNode = offChainTree.leaves[0];
- while (nodeIndex > 0) {
- const clNode = changeLogEvent.path.shift()!;
- assert(
- nodeIndex === clNode.index,
- `Expected changeLog index to be ${nodeIndex} but is ${clNode.index}`
- );
- assert(
- realTreeNode!.node.equals(Buffer.from(clNode.node)),
- `ChangeLog node differs at node index: ${clNode.index}`
- );
- realTreeNode = realTreeNode.parent!;
- nodeIndex = nodeIndex >> 1;
- }
+ // Check that the emitted ChangeLog path matches up with the updated Tree
+ let nodeIndex = 0 + (1 << MAX_DEPTH);
+ let realTreeNode = offChainTree.leaves[0];
+ while (nodeIndex > 0) {
+ const clNode = changeLogEvent.path.shift()!;
+ assert(
+ nodeIndex === clNode.index,
+ `Expected changeLog index to be ${nodeIndex} but is ${clNode.index}`,
+ );
+ assert(
+ realTreeNode!.node.equals(Buffer.from(clNode.node)),
+ `ChangeLog node differs at node index: ${clNode.index}`,
+ );
+ realTreeNode = realTreeNode.parent!;
+ nodeIndex = nodeIndex >> 1;
+ }
+ });
});
- });
});
diff --git a/account-compression/sdk/tests/merkleTree.test.ts b/account-compression/sdk/tests/merkleTree.test.ts
index f2e4814f363..1ecc6763b2d 100644
--- a/account-compression/sdk/tests/merkleTree.test.ts
+++ b/account-compression/sdk/tests/merkleTree.test.ts
@@ -1,35 +1,31 @@
-import { strict as assert } from "node:assert";
+import { strict as assert } from 'node:assert';
-import * as crypto from "crypto";
+import * as crypto from 'crypto';
-import { emptyNode, MerkleTree } from "../src";
+import { emptyNode, MerkleTree } from '../src';
-describe("MerkleTree tests", () => {
- it("Check constructor equivalence for depth 2 tree", () => {
- const leaves = [
- crypto.randomBytes(32),
- crypto.randomBytes(32),
- crypto.randomBytes(32),
- ];
- const rawLeaves = leaves.concat(emptyNode(0));
- const merkleTreeRaw = new MerkleTree(rawLeaves);
- const merkleTreeSparse = MerkleTree.sparseMerkleTreeFromLeaves(leaves, 2);
+describe('MerkleTree tests', () => {
+ it('Check constructor equivalence for depth 2 tree', () => {
+ const leaves = [crypto.randomBytes(32), crypto.randomBytes(32), crypto.randomBytes(32)];
+ const rawLeaves = leaves.concat(emptyNode(0));
+ const merkleTreeRaw = new MerkleTree(rawLeaves);
+ const merkleTreeSparse = MerkleTree.sparseMerkleTreeFromLeaves(leaves, 2);
- assert(merkleTreeRaw.root.equals(merkleTreeSparse.root));
- });
+ assert(merkleTreeRaw.root.equals(merkleTreeSparse.root));
+ });
- const TEST_DEPTH = 14;
- it(`Check proofs for 2^${TEST_DEPTH} tree`, () => {
- const leaves: Buffer[] = [];
- for (let i = 0; i < 2 ** TEST_DEPTH; i++) {
- leaves.push(crypto.randomBytes(32));
- }
- const merkleTree = new MerkleTree(leaves);
+ const TEST_DEPTH = 14;
+ it(`Check proofs for 2^${TEST_DEPTH} tree`, () => {
+ const leaves: Buffer[] = [];
+ for (let i = 0; i < 2 ** TEST_DEPTH; i++) {
+ leaves.push(crypto.randomBytes(32));
+ }
+ const merkleTree = new MerkleTree(leaves);
- // Check proofs
- for (let i = 0; i < leaves.length; i++) {
- const proof = merkleTree.getProof(i);
- assert(MerkleTree.verify(merkleTree.getRoot(), proof));
- }
- });
+ // Check proofs
+ for (let i = 0; i < leaves.length; i++) {
+ const proof = merkleTree.getProof(i);
+ assert(MerkleTree.verify(merkleTree.getRoot(), proof));
+ }
+ });
});
diff --git a/account-compression/sdk/tests/utils.ts b/account-compression/sdk/tests/utils.ts
index 6016053a07c..4e49c305c71 100644
--- a/account-compression/sdk/tests/utils.ts
+++ b/account-compression/sdk/tests/utils.ts
@@ -29,7 +29,7 @@ export async function execute(
instructions: TransactionInstruction[],
signers: Signer[],
skipPreflight = false,
- verbose = false
+ verbose = false,
): Promise {
let tx = new Transaction();
instructions.map(ix => {
@@ -60,7 +60,7 @@ export async function createTreeOnChain(
payer: Keypair,
numLeaves: number,
depthSizePair: ValidDepthSizePair,
- canopyDepth = 0
+ canopyDepth = 0,
): Promise<[Keypair, MerkleTree]> {
const cmtKeypair = Keypair.generate();
@@ -75,7 +75,7 @@ export async function createTreeOnChain(
cmtKeypair.publicKey,
payer.publicKey,
depthSizePair,
- canopyDepth
+ canopyDepth,
);
const ixs = [allocAccountIx, createInitEmptyMerkleTreeIx(cmtKeypair.publicKey, payer.publicKey, depthSizePair)];
@@ -103,7 +103,7 @@ export async function createEmptyTreeOnChain(
provider: AnchorProvider,
payer: Keypair,
depthSizePair: ValidDepthSizePair,
- canopyDepth = 0
+ canopyDepth = 0,
): Promise {
const cmtKeypair = Keypair.generate();
const allocAccountIx = await createAllocTreeIx(
@@ -111,7 +111,7 @@ export async function createEmptyTreeOnChain(
cmtKeypair.publicKey,
payer.publicKey,
depthSizePair,
- canopyDepth
+ canopyDepth,
);
const ixs = [allocAccountIx, createInitEmptyMerkleTreeIx(cmtKeypair.publicKey, payer.publicKey, depthSizePair)];
diff --git a/ci/do-audit.sh b/ci/do-audit.sh
index 74631550c63..94da4303d23 100755
--- a/ci/do-audit.sh
+++ b/ci/do-audit.sh
@@ -5,32 +5,11 @@ cd "$(dirname "$0")/.."
source ./ci/rust-version.sh stable
cargo_audit_ignores=(
- # Potential segfault in the time crate
- #
- # Blocked on chrono updating `time` to >= 0.2.23
- --ignore RUSTSEC-2020-0071
-
- # tokio: vulnerability affecting named pipes on Windows
- #
- # Exception is a stopgap to unblock CI
- # https://github.com/solana-labs/solana/issues/29586
- --ignore RUSTSEC-2023-0001
-
# ed25519-dalek: Double Public Key Signing Function Oracle Attack
#
- # Remove once SPL upgrades to Solana v1.17 or greater
+ # Remove once SPL upgrades to ed25519-dalek v2
--ignore RUSTSEC-2022-0093
- # webpki: CPU denial of service in certificate path building
- #
- # No fixed upgrade is available! Only fix is switching to rustls-webpki
- --ignore RUSTSEC-2023-0052
-
- # tungstenite
- #
- # Remove once SPL upgrades to Solana v1.17 or greater
- --ignore RUSTSEC-2023-0065
-
# curve25519-dalek
#
# Remove once SPL upgrades to curve25519-dalek v4
diff --git a/ci/js-test-account-compression.sh b/ci/js-test-account-compression.sh
index 38b6314eca2..2c9659b6ff1 100755
--- a/ci/js-test-account-compression.sh
+++ b/ci/js-test-account-compression.sh
@@ -5,8 +5,9 @@ cd "$(dirname "$0")/.."
source ./ci/solana-version.sh install
set -x
-cd account-compression/sdk
pnpm install
+pnpm format
+cd account-compression/sdk
pnpm build
pnpm build:program
pnpm lint
diff --git a/ci/js-test-libraries.sh b/ci/js-test-libraries.sh
index fab495f0bba..9d8ef554e54 100755
--- a/ci/js-test-libraries.sh
+++ b/ci/js-test-libraries.sh
@@ -4,9 +4,10 @@ set -e
cd "$(dirname "$0")/.."
set -x
-cd libraries/type-length-value/js
-
pnpm install
+pnpm format
+
+cd libraries/type-length-value/js
pnpm lint
pnpm build
pnpm test
diff --git a/ci/js-test-memo.sh b/ci/js-test-memo.sh
index fe6b243384f..3496f8d3f65 100755
--- a/ci/js-test-memo.sh
+++ b/ci/js-test-memo.sh
@@ -5,9 +5,10 @@ cd "$(dirname "$0")/.."
source ./ci/solana-version.sh install
set -x
-cd memo/js
-
pnpm install
+pnpm format
+
+cd memo/js
pnpm lint
pnpm build
pnpm test
diff --git a/ci/js-test-name-service.sh b/ci/js-test-name-service.sh
index f854b5fae67..e78cb1501a2 100755
--- a/ci/js-test-name-service.sh
+++ b/ci/js-test-name-service.sh
@@ -5,9 +5,10 @@ cd "$(dirname "$0")/.."
source ./ci/solana-version.sh install
set -x
-cd name-service/js
-
pnpm install
+pnpm format
+
+cd name-service/js
pnpm lint
pnpm build:program
pnpm build
diff --git a/ci/js-test-single-pool.sh b/ci/js-test-single-pool.sh
index 3842116df91..63ae054e328 100755
--- a/ci/js-test-single-pool.sh
+++ b/ci/js-test-single-pool.sh
@@ -4,10 +4,10 @@ set -ex
cd "$(dirname "$0")/.."
source ./ci/solana-version.sh install
-cd single-pool/js
pnpm install
+pnpm format
-cd packages/modern
+cd single-pool/js/packages/modern
pnpm lint
pnpm build
diff --git a/ci/js-test-stake-pool.sh b/ci/js-test-stake-pool.sh
index 4650f6597bc..500e96acfd5 100755
--- a/ci/js-test-stake-pool.sh
+++ b/ci/js-test-stake-pool.sh
@@ -4,6 +4,7 @@ set -ex
cd "$(dirname "$0")/.."
pnpm install
+pnpm format
pnpm build
cd stake-pool/js
diff --git a/ci/js-test-token-group.sh b/ci/js-test-token-group.sh
index 7c84fd16218..daead80d8bf 100755
--- a/ci/js-test-token-group.sh
+++ b/ci/js-test-token-group.sh
@@ -5,6 +5,7 @@ cd "$(dirname "$0")/.."
set -x
pnpm install
+pnpm format
pnpm build
cd token-group/js
diff --git a/ci/js-test-token-lending.sh b/ci/js-test-token-lending.sh
index 8342a2ab47f..4753d04e2fc 100755
--- a/ci/js-test-token-lending.sh
+++ b/ci/js-test-token-lending.sh
@@ -5,6 +5,7 @@ cd "$(dirname "$0")/.."
set -x
pnpm install
+pnpm format
pnpm build
cd token-lending/js
diff --git a/ci/js-test-token-metadata.sh b/ci/js-test-token-metadata.sh
index 14c0fc472ac..c12a3ebcb40 100755
--- a/ci/js-test-token-metadata.sh
+++ b/ci/js-test-token-metadata.sh
@@ -5,6 +5,7 @@ cd "$(dirname "$0")/.."
set -x
pnpm install
+pnpm format
pnpm build
cd token-metadata/js
diff --git a/ci/js-test-token-swap.sh b/ci/js-test-token-swap.sh
index f08a7ea722a..923a72c7cf1 100755
--- a/ci/js-test-token-swap.sh
+++ b/ci/js-test-token-swap.sh
@@ -5,6 +5,7 @@ cd "$(dirname "$0")/.."
source ./ci/solana-version.sh install
pnpm install
+pnpm format
pnpm build
cd token-swap/js
diff --git a/ci/js-test-token.sh b/ci/js-test-token.sh
index f7d0db98f69..089ee200c66 100755
--- a/ci/js-test-token.sh
+++ b/ci/js-test-token.sh
@@ -6,6 +6,7 @@ source ./ci/solana-version.sh install
set -x
pnpm install
+pnpm format
pnpm build
cd token/js
diff --git a/docs/package-lock.json b/docs/package-lock.json
index fdc79968146..7a07067ad07 100644
--- a/docs/package-lock.json
+++ b/docs/package-lock.json
@@ -5537,11 +5537,11 @@
}
},
"node_modules/axios": {
- "version": "1.6.2",
- "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz",
- "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==",
+ "version": "1.7.4",
+ "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.4.tgz",
+ "integrity": "sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw==",
"dependencies": {
- "follow-redirects": "^1.15.0",
+ "follow-redirects": "^1.15.6",
"form-data": "^4.0.0",
"proxy-from-env": "^1.1.0"
}
@@ -23253,11 +23253,11 @@
}
},
"axios": {
- "version": "1.6.2",
- "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz",
- "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==",
+ "version": "1.7.4",
+ "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.4.tgz",
+ "integrity": "sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw==",
"requires": {
- "follow-redirects": "^1.15.0",
+ "follow-redirects": "^1.15.6",
"form-data": "^4.0.0",
"proxy-from-env": "^1.1.0"
}
diff --git a/governance/addin-mock/program/Cargo.toml b/governance/addin-mock/program/Cargo.toml
index 4c500b8f6b4..10c772e04eb 100644
--- a/governance/addin-mock/program/Cargo.toml
+++ b/governance/addin-mock/program/Cargo.toml
@@ -17,7 +17,7 @@ bincode = "1.3.2"
borsh = "1.5.1"
num-derive = "0.4"
num-traits = "0.2"
-serde = "1.0.204"
+serde = "1.0.208"
serde_derive = "1.0.103"
solana-program = "2.0.3"
spl-token = { version = "6.0", path = "../../../token/program", features = [
diff --git a/governance/chat/program/Cargo.toml b/governance/chat/program/Cargo.toml
index 743a8186e14..caccacbefa8 100644
--- a/governance/chat/program/Cargo.toml
+++ b/governance/chat/program/Cargo.toml
@@ -17,7 +17,7 @@ bincode = "1.3.2"
borsh = "1.5.1"
num-derive = "0.4"
num-traits = "0.2"
-serde = "1.0.204"
+serde = "1.0.208"
serde_derive = "1.0.103"
solana-program = "2.0.3"
spl-token = { version = "6.0", path = "../../../token/program", features = [
diff --git a/governance/program/Cargo.toml b/governance/program/Cargo.toml
index 36ecb4b4944..495cbbd79ae 100644
--- a/governance/program/Cargo.toml
+++ b/governance/program/Cargo.toml
@@ -17,7 +17,7 @@ bincode = "1.3.2"
borsh = "1.5.1"
num-derive = "0.4"
num-traits = "0.2"
-serde = "1.0.204"
+serde = "1.0.208"
serde_derive = "1.0.103"
solana-program = "2.0.3"
spl-token = { version = "6.0", path = "../../token/program", features = [
diff --git a/governance/test-sdk/Cargo.toml b/governance/test-sdk/Cargo.toml
index 536d5806839..95d2930b289 100644
--- a/governance/test-sdk/Cargo.toml
+++ b/governance/test-sdk/Cargo.toml
@@ -14,7 +14,7 @@ borsh = "1.5.1"
lazy_static = "1.5.0"
num-derive = "0.4"
num-traits = "0.2"
-serde = "1.0.204"
+serde = "1.0.208"
serde_derive = "1.0.103"
solana-program = "2.0.3"
solana-program-test = "2.0.3"
diff --git a/governance/tools/Cargo.toml b/governance/tools/Cargo.toml
index e2375d8bd27..150f5ac5467 100644
--- a/governance/tools/Cargo.toml
+++ b/governance/tools/Cargo.toml
@@ -13,7 +13,7 @@ bincode = "1.3.2"
borsh = "1.5.1"
num-derive = "0.4"
num-traits = "0.2"
-serde = "1.0.204"
+serde = "1.0.208"
serde_derive = "1.0.103"
solana-program = "2.0.3"
spl-token = { version = "6.0", path = "../../token/program", features = [
diff --git a/instruction-padding/program/Cargo.toml b/instruction-padding/program/Cargo.toml
index f6e07034cea..b863e8be46d 100644
--- a/instruction-padding/program/Cargo.toml
+++ b/instruction-padding/program/Cargo.toml
@@ -13,7 +13,7 @@ no-entrypoint = []
test-sbf = []
[dependencies]
-num_enum = "0.7.2"
+num_enum = "0.7.3"
solana-program = "2.0.3"
[dev-dependencies]
diff --git a/libraries/concurrent-merkle-tree/Cargo.toml b/libraries/concurrent-merkle-tree/Cargo.toml
index 62b05ba7d34..2504dfc27a8 100644
--- a/libraries/concurrent-merkle-tree/Cargo.toml
+++ b/libraries/concurrent-merkle-tree/Cargo.toml
@@ -13,7 +13,7 @@ sol-log = ["log"]
[dependencies]
solana-program = ">=1.18.11,<=2"
-bytemuck = "1.16"
+bytemuck = "1.17"
thiserror = "1.0.63"
[dev-dependencies]
diff --git a/libraries/discriminator/Cargo.toml b/libraries/discriminator/Cargo.toml
index 9f0d92a0e2d..3a93666fff9 100644
--- a/libraries/discriminator/Cargo.toml
+++ b/libraries/discriminator/Cargo.toml
@@ -12,7 +12,7 @@ borsh = ["dep:borsh"]
[dependencies]
borsh = { version = "1", optional = true }
-bytemuck = { version = "1.16.1", features = ["derive"] }
+bytemuck = { version = "1.17.0", features = ["derive"] }
solana-program = "2.0.3"
spl-discriminator-derive = { version = "0.2.0", path = "./derive" }
diff --git a/libraries/pod/Cargo.toml b/libraries/pod/Cargo.toml
index 15ad72d1019..82a40b3d971 100644
--- a/libraries/pod/Cargo.toml
+++ b/libraries/pod/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "spl-pod"
-version = "0.3.0"
+version = "0.3.1"
description = "Solana Program Library Plain Old Data (Pod)"
authors = ["Solana Labs Maintainers "]
repository = "https://github.com/solana-labs/solana-program-library"
@@ -8,21 +8,21 @@ license = "Apache-2.0"
edition = "2021"
[features]
-serde-traits = ["dep:serde", "dep:base64"]
+serde-traits = ["dep:serde"]
borsh = ["dep:borsh"]
[dependencies]
-base64 = { version = "0.22.1", optional = true }
borsh = { version = "1.5.1", optional = true }
-bytemuck = { version = "1.16.1" }
-bytemuck_derive = { version = "1.7.0" }
-serde = { version = "1.0.204", optional = true }
+bytemuck = { version = "1.17.0" }
+bytemuck_derive = { version = "1.7.1" }
+serde = { version = "1.0.208", optional = true }
solana-program = "2.0.3"
-solana-zk-token-sdk = "2.0.3"
+solana-zk-sdk = "2.0.3"
spl-program-error = { version = "0.5.0", path = "../program-error" }
[dev-dependencies]
-serde_json = "1.0.121"
+serde_json = "1.0.125"
+base64 = { version = "0.22.1" }
[lib]
crate-type = ["cdylib", "lib"]
diff --git a/libraries/pod/src/option.rs b/libraries/pod/src/option.rs
index 3b15bdd1bc4..0ebad18608a 100644
--- a/libraries/pod/src/option.rs
+++ b/libraries/pod/src/option.rs
@@ -8,16 +8,25 @@
use {
bytemuck::{Pod, Zeroable},
- solana_program::{program_option::COption, pubkey::Pubkey},
+ solana_program::{
+ program_error::ProgramError,
+ program_option::COption,
+ pubkey::{Pubkey, PUBKEY_BYTES},
+ },
};
/// Trait for types that can be `None`.
///
/// This trait is used to indicate that a type can be `None` according to a
/// specific value.
-pub trait Nullable: Default + Pod {
+pub trait Nullable: PartialEq + Pod + Sized {
+ /// Value that represents `None` for the type.
+ const NONE: Self;
+
/// Indicates whether the value is `None` or not.
- fn is_none(&self) -> bool;
+ fn is_none(&self) -> bool {
+ self == &Self::NONE
+ }
/// Indicates whether the value is `Some`` value of type `T`` or not.
fn is_some(&self) -> bool {
@@ -34,6 +43,12 @@ pub trait Nullable: Default + Pod {
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
pub struct PodOption(T);
+impl Default for PodOption {
+ fn default() -> Self {
+ Self(T::NONE)
+ }
+}
+
impl PodOption {
/// Returns the contained value as an `Option`.
#[inline]
@@ -66,8 +81,16 @@ impl PodOption {
}
}
+/// ## Safety
+///
+/// `PodOption` is a transparent wrapper around a `Pod` type `T` with identical
+/// data representation.
unsafe impl Pod for PodOption {}
+/// ## Safety
+///
+/// `PodOption` is a transparent wrapper around a `Pod` type `T` with identical
+/// data representation.
unsafe impl Zeroable for PodOption {}
impl From for PodOption {
@@ -76,32 +99,33 @@ impl From for PodOption {
}
}
-impl From