diff --git a/Cargo.lock b/Cargo.lock index a4b8cd08..9519f590 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1027,7 +1027,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0b1fab2ae45819af2d0731d60f2afe17227ebb1a1538a236da84c93e9a60162" dependencies = [ "dispatch2", - "nix 0.31.2", + "nix", "windows-sys 0.61.2", ] @@ -1291,18 +1291,6 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" -[[package]] -name = "duct" -version = "0.13.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ab5718d1224b63252cd0c6f74f6480f9ffeb117438a2e0f5cf6d9a4798929c" -dependencies = [ - "libc", - "once_cell", - "os_pipe", - "shared_child", -] - [[package]] name = "dyn-clone" version = "1.0.20" @@ -2004,7 +1992,7 @@ dependencies = [ "js-sys", "log", "wasm-bindgen", - "windows-core 0.62.2", + "windows-core", ] [[package]] @@ -2283,8 +2271,8 @@ dependencies = [ [[package]] name = "kaspa-addresses" -version = "1.1.1-toc.1" -source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=d290179#d290179438511ac3ee145339f4f23d0542c2e657" +version = "2.0.0" +source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=90dbf07#90dbf074275d60c1fe74a3491883196f110970c0" dependencies = [ "borsh", "js-sys", @@ -2298,8 +2286,8 @@ dependencies = [ [[package]] name = "kaspa-bip32" -version = "1.1.1-toc.1" -source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=d290179#d290179438511ac3ee145339f4f23d0542c2e657" +version = "2.0.0" +source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=90dbf07#90dbf074275d60c1fe74a3491883196f110970c0" dependencies = [ "borsh", "bs58", @@ -2325,8 +2313,8 @@ dependencies = [ [[package]] name = "kaspa-consensus-client" -version = "1.1.1-toc.1" -source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=d290179#d290179438511ac3ee145339f4f23d0542c2e657" +version = "2.0.0" +source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=90dbf07#90dbf074275d60c1fe74a3491883196f110970c0" dependencies = [ "ahash", "borsh", @@ -2355,8 +2343,8 @@ dependencies = [ [[package]] name = "kaspa-consensus-core" -version = "1.1.1-toc.1" -source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=d290179#d290179438511ac3ee145339f4f23d0542c2e657" +version = "2.0.0" +source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=90dbf07#90dbf074275d60c1fe74a3491883196f110970c0" dependencies = [ "arc-swap", "async-trait", @@ -2394,8 +2382,8 @@ dependencies = [ [[package]] name = "kaspa-consensus-notify" -version = "1.1.1-toc.1" -source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=d290179#d290179438511ac3ee145339f4f23d0542c2e657" +version = "2.0.0" +source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=90dbf07#90dbf074275d60c1fe74a3491883196f110970c0" dependencies = [ "async-channel 2.5.0", "cfg-if 1.0.4", @@ -2414,8 +2402,8 @@ dependencies = [ [[package]] name = "kaspa-consensus-wasm" -version = "1.1.1-toc.1" -source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=d290179#d290179438511ac3ee145339f4f23d0542c2e657" +version = "2.0.0" +source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=90dbf07#90dbf074275d60c1fe74a3491883196f110970c0" dependencies = [ "cfg-if 1.0.4", "faster-hex", @@ -2439,8 +2427,8 @@ dependencies = [ [[package]] name = "kaspa-core" -version = "1.1.1-toc.1" -source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=d290179#d290179438511ac3ee145339f4f23d0542c2e657" +version = "2.0.0" +source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=90dbf07#90dbf074275d60c1fe74a3491883196f110970c0" dependencies = [ "anyhow", "cfg-if 1.0.4", @@ -2459,8 +2447,8 @@ dependencies = [ [[package]] name = "kaspa-hashes" -version = "1.1.1-toc.1" -source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=d290179#d290179438511ac3ee145339f4f23d0542c2e657" +version = "2.0.0" +source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=90dbf07#90dbf074275d60c1fe74a3491883196f110970c0" dependencies = [ "blake2b_simd", "blake3", @@ -2480,8 +2468,8 @@ dependencies = [ [[package]] name = "kaspa-index-core" -version = "1.1.1-toc.1" -source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=d290179#d290179438511ac3ee145339f4f23d0542c2e657" +version = "2.0.0" +source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=90dbf07#90dbf074275d60c1fe74a3491883196f110970c0" dependencies = [ "async-channel 2.5.0", "async-trait", @@ -2500,8 +2488,8 @@ dependencies = [ [[package]] name = "kaspa-math" -version = "1.1.1-toc.1" -source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=d290179#d290179438511ac3ee145339f4f23d0542c2e657" +version = "2.0.0" +source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=90dbf07#90dbf074275d60c1fe74a3491883196f110970c0" dependencies = [ "borsh", "faster-hex", @@ -2520,16 +2508,16 @@ dependencies = [ [[package]] name = "kaspa-merkle" -version = "1.1.1-toc.1" -source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=d290179#d290179438511ac3ee145339f4f23d0542c2e657" +version = "2.0.0" +source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=90dbf07#90dbf074275d60c1fe74a3491883196f110970c0" dependencies = [ "kaspa-hashes", ] [[package]] name = "kaspa-metrics-core" -version = "1.1.1-toc.1" -source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=d290179#d290179438511ac3ee145339f4f23d0542c2e657" +version = "2.0.0" +source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=90dbf07#90dbf074275d60c1fe74a3491883196f110970c0" dependencies = [ "async-trait", "borsh", @@ -2545,8 +2533,8 @@ dependencies = [ [[package]] name = "kaspa-mining-errors" -version = "1.1.1-toc.1" -source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=d290179#d290179438511ac3ee145339f4f23d0542c2e657" +version = "2.0.0" +source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=90dbf07#90dbf074275d60c1fe74a3491883196f110970c0" dependencies = [ "kaspa-consensus-core", "thiserror 2.0.18", @@ -2554,8 +2542,8 @@ dependencies = [ [[package]] name = "kaspa-muhash" -version = "1.1.1-toc.1" -source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=d290179#d290179438511ac3ee145339f4f23d0542c2e657" +version = "2.0.0" +source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=90dbf07#90dbf074275d60c1fe74a3491883196f110970c0" dependencies = [ "kaspa-hashes", "kaspa-math", @@ -2565,8 +2553,8 @@ dependencies = [ [[package]] name = "kaspa-notify" -version = "1.1.1-toc.1" -source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=d290179#d290179438511ac3ee145339f4f23d0542c2e657" +version = "2.0.0" +source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=90dbf07#90dbf074275d60c1fe74a3491883196f110970c0" dependencies = [ "async-channel 2.5.0", "async-trait", @@ -2635,8 +2623,8 @@ dependencies = [ [[package]] name = "kaspa-rpc-core" -version = "1.1.1-toc.1" -source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=d290179#d290179438511ac3ee145339f4f23d0542c2e657" +version = "2.0.0" +source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=90dbf07#90dbf074275d60c1fe74a3491883196f110970c0" dependencies = [ "async-channel 2.5.0", "async-trait", @@ -2677,8 +2665,8 @@ dependencies = [ [[package]] name = "kaspa-rpc-macros" -version = "1.1.1-toc.1" -source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=d290179#d290179438511ac3ee145339f4f23d0542c2e657" +version = "2.0.0" +source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=90dbf07#90dbf074275d60c1fe74a3491883196f110970c0" dependencies = [ "convert_case 0.6.0", "proc-macro-error", @@ -2690,8 +2678,8 @@ dependencies = [ [[package]] name = "kaspa-smt" -version = "1.1.1-toc.1" -source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=d290179#d290179438511ac3ee145339f4f23d0542c2e657" +version = "2.0.0" +source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=90dbf07#90dbf074275d60c1fe74a3491883196f110970c0" dependencies = [ "blake3", "kaspa-hashes", @@ -2701,8 +2689,8 @@ dependencies = [ [[package]] name = "kaspa-txscript" -version = "1.1.1-toc.1" -source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=d290179#d290179438511ac3ee145339f4f23d0542c2e657" +version = "2.0.0" +source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=90dbf07#90dbf074275d60c1fe74a3491883196f110970c0" dependencies = [ "ark-bn254", "ark-ec", @@ -2719,6 +2707,7 @@ dependencies = [ "hexplay", "indexmap 2.14.0", "itertools 0.13.0", + "js-sys", "kaspa-addresses", "kaspa-consensus-core", "kaspa-hashes", @@ -2745,8 +2734,8 @@ dependencies = [ [[package]] name = "kaspa-txscript-errors" -version = "1.1.1-toc.1" -source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=d290179#d290179438511ac3ee145339f4f23d0542c2e657" +version = "2.0.0" +source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=90dbf07#90dbf074275d60c1fe74a3491883196f110970c0" dependencies = [ "borsh", "kaspa-hashes", @@ -2756,27 +2745,22 @@ dependencies = [ [[package]] name = "kaspa-utils" -version = "1.1.1-toc.1" -source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=d290179#d290179438511ac3ee145339f4f23d0542c2e657" +version = "2.0.0" +source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=90dbf07#90dbf074275d60c1fe74a3491883196f110970c0" dependencies = [ "async-channel 2.5.0", "borsh", "cfg-if 1.0.4", - "duct", "event-listener 2.5.3", "faster-hex", "ipnet", "itertools 0.13.0", "log", - "mac_address", - "num_cpus", "once_cell", "parking_lot", - "rlimit", "serde", "sha2", "smallvec", - "sysinfo", "thiserror 2.0.18", "triggered", "uuid", @@ -2785,8 +2769,8 @@ dependencies = [ [[package]] name = "kaspa-wallet-core" -version = "1.1.1-toc.1" -source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=d290179#d290179438511ac3ee145339f4f23d0542c2e657" +version = "2.0.0" +source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=90dbf07#90dbf074275d60c1fe74a3491883196f110970c0" dependencies = [ "aes", "ahash", @@ -2863,8 +2847,8 @@ dependencies = [ [[package]] name = "kaspa-wallet-keys" -version = "1.1.1-toc.1" -source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=d290179#d290179438511ac3ee145339f4f23d0542c2e657" +version = "2.0.0" +source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=90dbf07#90dbf074275d60c1fe74a3491883196f110970c0" dependencies = [ "async-trait", "borsh", @@ -2896,8 +2880,8 @@ dependencies = [ [[package]] name = "kaspa-wallet-macros" -version = "1.1.1-toc.1" -source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=d290179#d290179438511ac3ee145339f4f23d0542c2e657" +version = "2.0.0" +source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=90dbf07#90dbf074275d60c1fe74a3491883196f110970c0" dependencies = [ "convert_case 0.5.0", "proc-macro-error", @@ -2910,8 +2894,8 @@ dependencies = [ [[package]] name = "kaspa-wallet-pskt" -version = "1.1.1-toc.1" -source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=d290179#d290179438511ac3ee145339f4f23d0542c2e657" +version = "2.0.0" +source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=90dbf07#90dbf074275d60c1fe74a3491883196f110970c0" dependencies = [ "bincode", "derive_builder", @@ -2939,8 +2923,8 @@ dependencies = [ [[package]] name = "kaspa-wasm-core" -version = "1.1.1-toc.1" -source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=d290179#d290179438511ac3ee145339f4f23d0542c2e657" +version = "2.0.0" +source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=90dbf07#90dbf074275d60c1fe74a3491883196f110970c0" dependencies = [ "faster-hex", "hexplay", @@ -2951,8 +2935,8 @@ dependencies = [ [[package]] name = "kaspa-wrpc-client" -version = "1.1.1-toc.1" -source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=d290179#d290179438511ac3ee145339f4f23d0542c2e657" +version = "2.0.0" +source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=90dbf07#90dbf074275d60c1fe74a3491883196f110970c0" dependencies = [ "async-lock", "async-trait", @@ -2988,8 +2972,8 @@ dependencies = [ [[package]] name = "kaspa-wrpc-wasm" -version = "1.1.1-toc.1" -source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=d290179#d290179438511ac3ee145339f4f23d0542c2e657" +version = "2.0.0" +source = "git+https://github.com/kaspanet/rusty-kaspa.git?rev=90dbf07#90dbf074275d60c1fe74a3491883196f110970c0" dependencies = [ "ahash", "async-lock", @@ -3153,16 +3137,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" -[[package]] -name = "mac_address" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0aeb26bf5e836cc1c341c8106051b573f1766dfa05aa87f0b98be5e51b02303" -dependencies = [ - "nix 0.29.0", - "winapi", -] - [[package]] name = "macroific" version = "1.3.1" @@ -3394,19 +3368,6 @@ dependencies = [ "rawpointer", ] -[[package]] -name = "nix" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" -dependencies = [ - "bitflags 2.11.1", - "cfg-if 1.0.4", - "cfg_aliases", - "libc", - "memoffset", -] - [[package]] name = "nix" version = "0.31.2" @@ -3432,15 +3393,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "ntapi" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3b335231dfd352ffb0f8017f3b6027a4917f7df785ea2143d8af2adc66980ae" -dependencies = [ - "winapi", -] - [[package]] name = "nu-ansi-term" version = "0.50.3" @@ -3654,16 +3606,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "os_pipe" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967" -dependencies = [ - "libc", - "windows-sys 0.61.2", -] - [[package]] name = "pad" version = "0.1.6" @@ -4973,54 +4915,12 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "shared_child" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e362d9935bc50f019969e2f9ecd66786612daae13e8f277be7bfb66e8bed3f7" -dependencies = [ - "libc", - "sigchld", - "windows-sys 0.60.2", -] - [[package]] name = "shlex" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" -[[package]] -name = "sigchld" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47106eded3c154e70176fc83df9737335c94ce22f821c32d17ed1db1f83badb1" -dependencies = [ - "libc", - "os_pipe", - "signal-hook", -] - -[[package]] -name = "signal-hook" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2" -dependencies = [ - "libc", - "signal-hook-registry", -] - -[[package]] -name = "signal-hook-registry" -version = "1.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" -dependencies = [ - "errno", - "libc", -] - [[package]] name = "simd-adler32" version = "0.3.9" @@ -5156,20 +5056,6 @@ dependencies = [ "syn 2.0.117", ] -[[package]] -name = "sysinfo" -version = "0.31.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "355dbe4f8799b304b05e1b0f05fc59b2a18d36645cf169607da45bde2f69a1be" -dependencies = [ - "core-foundation-sys", - "libc", - "memchr", - "ntapi", - "rayon", - "windows", -] - [[package]] name = "system-configuration" version = "0.7.0" @@ -6114,52 +6000,19 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows" -version = "0.57.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" -dependencies = [ - "windows-core 0.57.0", - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-core" -version = "0.57.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" -dependencies = [ - "windows-implement 0.57.0", - "windows-interface 0.57.0", - "windows-result 0.1.2", - "windows-targets 0.52.6", -] - [[package]] name = "windows-core" version = "0.62.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" dependencies = [ - "windows-implement 0.60.2", - "windows-interface 0.59.3", + "windows-implement", + "windows-interface", "windows-link", - "windows-result 0.4.1", + "windows-result", "windows-strings", ] -[[package]] -name = "windows-implement" -version = "0.57.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - [[package]] name = "windows-implement" version = "0.60.2" @@ -6171,17 +6024,6 @@ dependencies = [ "syn 2.0.117", ] -[[package]] -name = "windows-interface" -version = "0.57.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - [[package]] name = "windows-interface" version = "0.59.3" @@ -6206,19 +6048,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" dependencies = [ "windows-link", - "windows-result 0.4.1", + "windows-result", "windows-strings", ] -[[package]] -name = "windows-result" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-result" version = "0.4.1" diff --git a/Cargo.toml b/Cargo.toml index bb839b5f..26cd3f78 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,18 +16,18 @@ ahash = "0.8.12" bincode = "1.3.3" faster-hex = "0.9.0" futures = "0.3.31" -kaspa-addresses = { git = "https://github.com/kaspanet/rusty-kaspa.git", rev = "d290179" } -kaspa-bip32 = { git = "https://github.com/kaspanet/rusty-kaspa.git", rev = "d290179" } -kaspa-consensus-client = { git = "https://github.com/kaspanet/rusty-kaspa.git", rev = "d290179" } -kaspa-consensus-core = { git = "https://github.com/kaspanet/rusty-kaspa.git", rev = "d290179" } -kaspa-hashes = { git = "https://github.com/kaspanet/rusty-kaspa.git", rev = "d290179" } -kaspa-notify = { git = "https://github.com/kaspanet/rusty-kaspa.git", rev = "d290179" } -kaspa-rpc-core = { git = "https://github.com/kaspanet/rusty-kaspa.git", rev = "d290179" } -kaspa-txscript = { git = "https://github.com/kaspanet/rusty-kaspa.git", rev = "d290179", features = ["wasm32-sdk"]} -kaspa-utils = { git = "https://github.com/kaspanet/rusty-kaspa.git", rev = "d290179" } -kaspa-wallet-core = { git = "https://github.com/kaspanet/rusty-kaspa.git", rev = "d290179" } -kaspa-wallet-keys = { git = "https://github.com/kaspanet/rusty-kaspa.git", rev = "d290179" } -kaspa-wrpc-client = { git = "https://github.com/kaspanet/rusty-kaspa.git", rev = "d290179" } +kaspa-addresses = { git = "https://github.com/kaspanet/rusty-kaspa.git", rev = "90dbf07" } +kaspa-bip32 = { git = "https://github.com/kaspanet/rusty-kaspa.git", rev = "90dbf07" } +kaspa-consensus-client = { git = "https://github.com/kaspanet/rusty-kaspa.git", rev = "90dbf07" } +kaspa-consensus-core = { git = "https://github.com/kaspanet/rusty-kaspa.git", rev = "90dbf07" } +kaspa-hashes = { git = "https://github.com/kaspanet/rusty-kaspa.git", rev = "90dbf07" } +kaspa-notify = { git = "https://github.com/kaspanet/rusty-kaspa.git", rev = "90dbf07" } +kaspa-rpc-core = { git = "https://github.com/kaspanet/rusty-kaspa.git", rev = "90dbf07" } +kaspa-txscript = { git = "https://github.com/kaspanet/rusty-kaspa.git", rev = "90dbf07", features = ["wasm32-sdk"]} +kaspa-utils = { git = "https://github.com/kaspanet/rusty-kaspa.git", rev = "90dbf07" } +kaspa-wallet-core = { git = "https://github.com/kaspanet/rusty-kaspa.git", rev = "90dbf07" } +kaspa-wallet-keys = { git = "https://github.com/kaspanet/rusty-kaspa.git", rev = "90dbf07" } +kaspa-wrpc-client = { git = "https://github.com/kaspanet/rusty-kaspa.git", rev = "90dbf07" } paste = "1.0" pyo3 = { version = "0.27.1", features = ['multiple-pymethods'] } pyo3-async-runtimes = { version = "0.27.0", features = ['tokio-runtime'] } diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 94ec41de..91151a3d 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -26,8 +26,13 @@ search: - Examples under `examples/wallet/` demonstrating wallet usage - Pytest options `--network-id` and `--rpc-url` for targeting integration tests at a specific network / node. - TypedDicts for `RpcClient` subscription event payloads — `BlockAddedEvent`, `VirtualChainChangedEvent`, `FinalityConflictEvent`, `FinalityConflictResolvedEvent`, `UtxosChangedEvent`, `SinkBlueScoreChangedEvent`, `VirtualDaaScoreChangedEvent`, `PruningPointUtxoSetOverrideEvent`, `NewBlockTemplateEvent`, `ConnectEvent`, `DisconnectEvent` — and their notification body TypedDicts (`RpcBlockAddedNotification`, etc.) for typing event-listener callbacks. +- `RpcClient.get_block_reward_info(request)` — new RPC returning a block's reward info (header, block color, confirmation count, merging chain block hash, reward amount). +- `ScriptBuilder` covenant/engine flags: optional `covenants_enabled` and `sigop_script_units` arguments on `ScriptBuilder(...)` and `ScriptBuilder.from_script(...)`, plus read-only `covenants_enabled` / `sigop_script_units` properties (mirrors the WASM SDK's `ScriptBuilderOptions`). +- `Transaction.storage_mass` property and a `storageMass` key in the `Transaction` dict output (alongside the existing `mass`), mirroring the WASM SDK. ### Changed +- Bumped the pinned `rusty-kaspa` dependency from `d290179` to `90dbf07` (Toccata hardfork). The transaction mass field is now tracked internally as `storage_mass`; the Python-facing `mass` property, constructor argument, and dict key are retained as aliases. +- The network minimum relay fee was raised upstream to 100 sompi/gram (Toccata). Fees produced by the wallet and `Generator` reflect the new floor; explicit `fee_rate` values must meet it. - `py_error_map!` macro extended to register wallet exception variants into the `kaspa.exceptions` submodule. - Integration tests now default to `mainnet` (overridable via `--network-id` / `--rpc-url`). - `build-dev` script builds with `--strip` for smaller artifacts. diff --git a/docs/learn/rpc/calls.md b/docs/learn/rpc/calls.md index 02c33ee2..ef27fced 100644 --- a/docs/learn/rpc/calls.md +++ b/docs/learn/rpc/calls.md @@ -180,7 +180,7 @@ flow and `allowOrphan` semantics. fee = await client.get_fee_estimate() # { # "estimate": { -# "priorityBucket": {"feerate": 1.0, "estimatedSeconds": 1.0}, +# "priorityBucket": {"feerate": 100.0, "estimatedSeconds": 1.0}, # "normalBuckets": [...], # "lowBuckets": [...], # } diff --git a/docs/learn/transactions/mass-and-fees.md b/docs/learn/transactions/mass-and-fees.md index e805e1b3..d2ab6fbe 100644 --- a/docs/learn/transactions/mass-and-fees.md +++ b/docs/learn/transactions/mass-and-fees.md @@ -92,6 +92,11 @@ network's current rate, or `None` if the transaction's mass exceeds [`maximum_standard_transaction_mass()`](../../reference/Functions/maximum_standard_transaction_mass.md). Split the inputs across multiple transactions in that case. +Since the Toccata hardfork, the network minimum relay fee is **100 sompi per gram +of mass**. `calculate_transaction_fee` and the fee-estimate buckets are floored at +this rate, and any explicit `fee_rate` you supply must meet it or the node rejects +the transaction. + ## Querying the fee rate The network exposes a fee estimator over RPC — see diff --git a/docs/learn/wallet-sdk/tx-generator.md b/docs/learn/wallet-sdk/tx-generator.md index e1e9513a..8db00121 100644 --- a/docs/learn/wallet-sdk/tx-generator.md +++ b/docs/learn/wallet-sdk/tx-generator.md @@ -93,7 +93,7 @@ gen = Generator( priority_entries=priority, # UTXOs to consume first sig_op_count=1, # signature ops per input minimum_signatures=1, # for multisig mass estimation - fee_rate=2.0, # explicit sompi/gram override + fee_rate=120.0, # explicit sompi/gram override (>= network minimum) ) ``` diff --git a/kaspa_rpc.pyi b/kaspa_rpc.pyi index e09e9577..4533fa76 100644 --- a/kaspa_rpc.pyi +++ b/kaspa_rpc.pyi @@ -610,6 +610,11 @@ class GetBlockTemplateRequest(TypedDict): extraData: str +class GetBlockRewardInfoRequest(TypedDict): + """Request for get_block_reward_info.""" + hash: str + + class GetCurrentBlockColorRequest(TypedDict): """Request for get_current_block_color.""" hash: str @@ -886,6 +891,15 @@ class GetBlockTemplateResponse(TypedDict): isSynced: bool +class GetBlockRewardInfoResponse(TypedDict): + """Response from get_block_reward_info.""" + header: RpcBlockHeader + blockColor: Literal["unknown", "blue", "red"] + confirmationCount: int | None + mergingChainBlockHash: str | None + rewardAmount: int | None + + class GetCurrentBlockColorResponse(TypedDict): """Response from get_current_block_color.""" blue: bool diff --git a/python/kaspa/__init__.pyi b/python/kaspa/__init__.pyi index aa378984..480e65ad 100644 --- a/python/kaspa/__init__.pyi +++ b/python/kaspa/__init__.pyi @@ -2025,6 +2025,7 @@ class RpcClient: def get_block(self, request: GetBlockRequest) -> GetBlockResponse: ... def get_blocks(self, request: GetBlocksRequest) -> GetBlocksResponse: ... def get_block_template(self, request: GetBlockTemplateRequest) -> GetBlockTemplateResponse: ... + def get_block_reward_info(self, request: GetBlockRewardInfoRequest) -> GetBlockRewardInfoResponse: ... def get_current_block_color(self, request: GetCurrentBlockColorRequest) -> GetCurrentBlockColorResponse: ... def get_daa_score_timestamp_estimate(self, request: GetDaaScoreTimestampEstimateRequest) -> GetDaaScoreTimestampEstimateResponse: ... def get_fee_estimate_experimental(self, request: GetFeeEstimateExperimentalRequest) -> GetFeeEstimateExperimentalResponse: ... @@ -2052,20 +2053,46 @@ class ScriptBuilder: Used for creating complex spending conditions like multi-signature or time-locked transactions. """ - def __new__(cls) -> ScriptBuilder: + @property + def covenants_enabled(self) -> builtins.bool: + r""" + Whether covenant opcodes and post-Toccata script limits are enabled. + + Returns: + bool: True if covenants are enabled for this builder. + """ + @property + def sigop_script_units(self) -> builtins.int: + r""" + Script units charged for each signature operation. + + Returns: + int: The configured sigop script units. + """ + def __new__(cls, covenants_enabled: builtins.bool = False, sigop_script_units: typing.Optional[builtins.int] = None) -> ScriptBuilder: r""" Create a new empty script builder. + Args: + covenants_enabled: Enable covenant opcodes and post-Toccata script + limits (default: False). + sigop_script_units: Script units charged per signature operation. + Defaults to the native engine default when omitted. + Returns: ScriptBuilder: A new empty ScriptBuilder instance. """ @staticmethod - def from_script(script: Binary) -> ScriptBuilder: + def from_script(script: Binary, covenants_enabled: builtins.bool = False, sigop_script_units: typing.Optional[builtins.int] = None) -> ScriptBuilder: r""" Create a script builder from an existing script. Args: script: Existing script bytes as hex, bytes, or list. + covenants_enabled: Enable covenant opcodes and post-Toccata script + limits (default: False). + sigop_script_units: Script units charged per signature operation. + Defaults to the native engine default when omitted. Returns: ScriptBuilder: A new ScriptBuilder initialized with the script. @@ -2363,15 +2390,33 @@ class Transaction: def mass(self) -> builtins.int: r""" The transaction mass used for fee calculation. + + Alias of `storage_mass`, retained for compatibility with the WASM SDK + and earlier releases of this package. """ @mass.setter def mass(self, value: builtins.int) -> None: r""" Set the transaction mass. + Alias of `storage_mass`. + Args: value: The transaction mass value. """ + @property + def storage_mass(self) -> builtins.int: + r""" + The transaction storage mass used for fee calculation. + """ + @storage_mass.setter + def storage_mass(self, value: builtins.int) -> None: + r""" + Set the transaction storage mass. + + Args: + value: The transaction storage mass value. + """ @subnetwork_id.setter def subnetwork_id(self, value: builtins.str) -> None: r""" @@ -2832,27 +2877,6 @@ class UtxoContext: str: The UtxoContext as a repr string. """ -@typing.final -class UtxoEntries: - r""" - UTXO entries collection for flexible input handling. - - This type is not intended to be instantiated directly from Python. - It serves as a helper type that allows Rust functions to accept a list - of UTXO entries in multiple convenient forms. - - Accepts: - list[UtxoEntryReference]: A list of UtxoEntryReference objects. - list[dict]: A list of dicts with UtxoEntryReference-compatible keys. - """ - def __repr__(self) -> builtins.str: - r""" - The detailed string representation. - - Returns: - str: The UtxoEntries as a repr string. - """ - @typing.final class UtxoEntries: r""" @@ -2910,6 +2934,27 @@ class UtxoEntries: str: The UtxoEntries as a repr string. """ +@typing.final +class UtxoEntries: + r""" + UTXO entries collection for flexible input handling. + + This type is not intended to be instantiated directly from Python. + It serves as a helper type that allows Rust functions to accept a list + of UTXO entries in multiple convenient forms. + + Accepts: + list[UtxoEntryReference]: A list of UtxoEntryReference objects. + list[dict]: A list of dicts with UtxoEntryReference-compatible keys. + """ + def __repr__(self) -> builtins.str: + r""" + The detailed string representation. + + Returns: + str: The UtxoEntries as a repr string. + """ + @typing.final class UtxoEntry: r""" @@ -5591,6 +5636,11 @@ class GetBlockTemplateRequest(TypedDict): extraData: str +class GetBlockRewardInfoRequest(TypedDict): + """Request for get_block_reward_info.""" + hash: str + + class GetCurrentBlockColorRequest(TypedDict): """Request for get_current_block_color.""" hash: str @@ -5867,6 +5917,15 @@ class GetBlockTemplateResponse(TypedDict): isSynced: bool +class GetBlockRewardInfoResponse(TypedDict): + """Response from get_block_reward_info.""" + header: RpcBlockHeader + blockColor: Literal["unknown", "blue", "red"] + confirmationCount: int | None + mergingChainBlockHash: str | None + rewardAmount: int | None + + class GetCurrentBlockColorResponse(TypedDict): """Response from get_current_block_color.""" blue: bool diff --git a/src/consensus/client/transaction.rs b/src/consensus/client/transaction.rs index dbb825a9..e117630e 100644 --- a/src/consensus/client/transaction.rs +++ b/src/consensus/client/transaction.rs @@ -275,18 +275,38 @@ impl PyTransaction { } /// The transaction mass used for fee calculation. + /// + /// Alias of `storage_mass`, retained for compatibility with the WASM SDK + /// and earlier releases of this package. #[getter] pub fn get_mass(&self) -> u64 { - self.0.inner().mass + self.0.inner().storage_mass } /// Set the transaction mass. /// + /// Alias of `storage_mass`. + /// /// Args: /// value: The transaction mass value. #[setter] pub fn set_mass(&mut self, value: u64) { - self.0.inner().mass = value; + self.0.inner().storage_mass = value; + } + + /// The transaction storage mass used for fee calculation. + #[getter] + pub fn get_storage_mass(&self) -> u64 { + self.0.inner().storage_mass + } + + /// Set the transaction storage mass. + /// + /// Args: + /// value: The transaction storage mass value. + #[setter] + pub fn set_storage_mass(&mut self, value: u64) { + self.0.inner().storage_mass = value; } pub fn populate_genesis_covenants(&self, groups: Vec) -> PyResult<()> { @@ -433,11 +453,16 @@ impl TryFrom<&Bound<'_, PyDict>> for PyTransaction { Vec::from_hex(&payload_str).map_err(|err| PyException::new_err(err.to_string()))? }; - // Parse mass - let mass: u64 = dict - .get_item("mass")? - .ok_or_else(|| PyKeyError::new_err("Key `mass` not present"))? - .extract()?; + // Parse mass. Accept `storageMass` (WASM SDK) or the legacy/alias `mass`, + // preferring `storageMass` when both are present. + let mass: u64 = match (dict.get_item("storageMass")?, dict.get_item("mass")?) { + (Some(value), _) | (None, Some(value)) => value.extract()?, + (None, None) => { + return Err(PyKeyError::new_err( + "Key `mass` or `storageMass` not present", + )); + } + }; // Parse inputs let inputs_list = dict diff --git a/src/consensus/convert.rs b/src/consensus/convert.rs index 8ec26b1b..15ecf729 100644 --- a/src/consensus/convert.rs +++ b/src/consensus/convert.rs @@ -189,8 +189,9 @@ impl TryToPyDict for Transaction { // Set `payload` key dict.set_item("payload", inner.payload.to_hex())?; - // Set `mass` - dict.set_item("mass", inner.mass)?; + // Set `mass` (alias) and `storageMass` (WASM SDK parity) + dict.set_item("mass", inner.storage_mass)?; + dict.set_item("storageMass", inner.storage_mass)?; Ok(dict) } diff --git a/src/crypto/txscript/builder.rs b/src/crypto/txscript/builder.rs index d4b2a15b..1ab49d43 100644 --- a/src/crypto/txscript/builder.rs +++ b/src/crypto/txscript/builder.rs @@ -2,7 +2,8 @@ use crate::{ consensus::core::script_public_key::PyScriptPublicKey, crypto::txscript::opcodes::PyOpcodes, types::PyBinary, }; -use kaspa_txscript::{script_builder as native, standard}; +use kaspa_consensus_core::mass::ScriptUnits; +use kaspa_txscript::{EngineFlags, script_builder as native, standard}; use pyo3::{exceptions::PyException, prelude::*}; use pyo3_stub_gen::derive::{gen_stub_pyclass, gen_stub_pymethods}; use std::sync::{Arc, Mutex, MutexGuard}; @@ -36,29 +37,69 @@ impl Default for PyScriptBuilder { impl PyScriptBuilder { /// Create a new empty script builder. /// + /// Args: + /// covenants_enabled: Enable covenant opcodes and post-Toccata script + /// limits (default: False). + /// sigop_script_units: Script units charged per signature operation. + /// Defaults to the native engine default when omitted. + /// /// Returns: /// ScriptBuilder: A new empty ScriptBuilder instance. #[new] - pub fn new() -> Self { - Self::default() + #[pyo3(signature = (covenants_enabled=false, sigop_script_units=None))] + pub fn new(covenants_enabled: bool, sigop_script_units: Option) -> Self { + let flags = build_engine_flags(covenants_enabled, sigop_script_units); + Self(Arc::new(Mutex::new(native::ScriptBuilder::with_flags( + flags, + )))) } /// Create a script builder from an existing script. /// /// Args: /// script: Existing script bytes as hex, bytes, or list. + /// covenants_enabled: Enable covenant opcodes and post-Toccata script + /// limits (default: False). + /// sigop_script_units: Script units charged per signature operation. + /// Defaults to the native engine default when omitted. /// /// Returns: /// ScriptBuilder: A new ScriptBuilder initialized with the script. #[staticmethod] - pub fn from_script(script: PyBinary) -> PyResult { - let builder = PyScriptBuilder::default(); + #[pyo3(signature = (script, covenants_enabled=false, sigop_script_units=None))] + pub fn from_script( + script: PyBinary, + covenants_enabled: bool, + sigop_script_units: Option, + ) -> PyResult { + let flags = build_engine_flags(covenants_enabled, sigop_script_units); + let builder = Self(Arc::new(Mutex::new(native::ScriptBuilder::with_flags( + flags, + )))); let script: Vec = script.into(); builder.inner().script_mut().extend(&script); Ok(builder) } + /// Whether covenant opcodes and post-Toccata script limits are enabled. + /// + /// Returns: + /// bool: True if covenants are enabled for this builder. + #[getter] + pub fn get_covenants_enabled(&self) -> bool { + self.inner().flags().covenants_enabled + } + + /// Script units charged for each signature operation. + /// + /// Returns: + /// int: The configured sigop script units. + #[getter] + pub fn get_sigop_script_units(&self) -> u64 { + self.inner().flags().sigop_script_units.0 + } + /// Add a single opcode to the script. /// /// Args: @@ -248,9 +289,13 @@ impl PyScriptBuilder { pub fn pay_to_script_hash_signature_script(&self, signature: PyBinary) -> PyResult { let inner = self.inner(); let script = inner.script(); - let generated_script = - standard::pay_to_script_hash_signature_script(script.into(), signature.into()) - .map_err(|err| PyException::new_err(format!("{}", err)))?; + let flags = inner.flags(); + let generated_script = standard::pay_to_script_hash_signature_script_with_flags( + script.into(), + signature.into(), + flags, + ) + .map_err(|err| PyException::new_err(format!("{}", err)))?; Ok(generated_script.to_hex()) } @@ -283,6 +328,20 @@ impl PyScriptBuilder { } } +// Builds script engine flags from the Python-facing kwargs, mirroring the WASM +// SDK's `ScriptBuilderOptions { flags: { covenantsEnabled, sigopScriptUnits } }`. +// `sigop_script_units` falls back to the native engine default when omitted. +fn build_engine_flags(covenants_enabled: bool, sigop_script_units: Option) -> EngineFlags { + let mut flags = EngineFlags { + covenants_enabled, + ..Default::default() + }; + if let Some(units) = sigop_script_units { + flags.sigop_script_units = ScriptUnits(units); + } + flags +} + // TODO change to PyOpcode struct and handle similar to PyBinary? // Extracts multiple opcodes from a Python list[int | Opcodes] fn extract_ops(input: &Bound) -> PyResult> { diff --git a/src/rpc/messages.rs b/src/rpc/messages.rs index 85db7e54..4a688f80 100644 --- a/src/rpc/messages.rs +++ b/src/rpc/messages.rs @@ -59,6 +59,7 @@ impl_try_from_pydict!([ GetBlock, GetBlocks, GetBlockTemplate, + GetBlockRewardInfo, GetCurrentBlockColor, GetDaaScoreTimestampEstimate, GetFeeEstimateExperimental, @@ -239,7 +240,7 @@ try_from_args! ( dict : PySubmitTransactionRequest, { subnetwork_id: inner.subnetwork_id, gas: inner.gas, payload: inner.payload.clone(), - mass: inner.mass, + storage_mass: inner.storage_mass, verbose_data: None, }; diff --git a/src/rpc/model.rs b/src/rpc/model.rs index 2d60497e..f2280515 100644 --- a/src/rpc/model.rs +++ b/src/rpc/model.rs @@ -48,6 +48,7 @@ define_py_request_types!([ GetBlock, GetBlocks, GetBlockTemplate, + GetBlockRewardInfo, GetCurrentBlockColor, GetDaaScoreTimestampEstimate, GetFeeEstimateExperimental, diff --git a/src/rpc/wrpc/client.rs b/src/rpc/wrpc/client.rs index 8e98a9e1..be1f1408 100644 --- a/src/rpc/wrpc/client.rs +++ b/src/rpc/wrpc/client.rs @@ -1067,6 +1067,7 @@ build_wrpc_python_interface_with_args!([ GetBlock, GetBlocks, GetBlockTemplate, + GetBlockRewardInfo, GetCurrentBlockColor, GetDaaScoreTimestampEstimate, GetFeeEstimateExperimental, diff --git a/tests/unit/test_dict_conversion.py b/tests/unit/test_dict_conversion.py index 5d6a1cdb..77c84c9f 100644 --- a/tests/unit/test_dict_conversion.py +++ b/tests/unit/test_dict_conversion.py @@ -120,6 +120,25 @@ def test_transaction_to_dict(self): assert "gas" in d assert "payload" in d assert "mass" in d + assert "storageMass" in d + assert d["mass"] == d["storageMass"] + + def test_transaction_storage_mass_alias(self): + """`storage_mass` mirrors `mass` (kept as an alias for WASM & back-compat).""" + tx_hash = Hash("0" * 64) + outpoint = TransactionOutpoint(tx_hash, 0) + input = TransactionInput(outpoint, "", 0, 1) + spk = ScriptPublicKey(0, "51") + output = TransactionOutput(1000000, spk) + + tx = Transaction(0, [input], [output], 100, "0" * 40, 0, "", 1234) + assert tx.mass == 1234 + assert tx.storage_mass == 1234 + + tx.storage_mass = 5678 + assert tx.mass == 5678 + tx.mass = 99 + assert tx.storage_mass == 99 def test_transaction_from_dict_roundtrip(self): """Test Transaction to_dict/from_dict round-trip."""