diff --git a/Cargo.lock b/Cargo.lock index 7b1cb4e..3071fdd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -83,15 +83,21 @@ checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "async-trait" -version = "0.1.81" +version = "0.1.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" +checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.77", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" version = "1.3.0" @@ -108,7 +114,7 @@ dependencies = [ "getrandom", "instant", "pin-project-lite", - "rand 0.8.5", + "rand", "tokio", ] @@ -133,6 +139,12 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d27c3610c36aee21ce8ac510e6224498de4228ad772a171ed65643a24693a5a8" +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "base64" version = "0.13.1" @@ -141,9 +153,15 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.7" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64ct" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bitflags" @@ -157,33 +175,22 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" -[[package]] -name = "bitvec" -version = "0.18.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98fcd36dda4e17b7d7abc64cb549bf0201f4ab71e00700c798ca7e62ed3761fa" -dependencies = [ - "funty", - "radium", - "wyz", -] - [[package]] name = "blake2" version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a4e37d16930f5459780f5621038b6382b9bb37c19016f39fb6b5808d831f174" dependencies = [ - "crypto-mac 0.8.0", - "digest", + "crypto-mac", + "digest 0.9.0", "opaque-debug", ] [[package]] name = "block-buffer" -version = "0.9.0" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] @@ -209,109 +216,79 @@ checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "casper-client" version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7aee479ac95ca2100bef1654621fcaac122af56d7bac8bdb1f0384e088c9914" +source = "git+https://github.com/casper-ecosystem/casper-client-rs?branch=feat-track-node-2.0#2227d5ada7a02f9406a7fb0cb290e55bea3e30e5" dependencies = [ "async-trait", "base16", - "base64 0.13.1", - "casper-hashing", "casper-types", "clap", "clap_complete", - "derp", - "ed25519-dalek", - "getrandom", - "hex-buffer-serde 0.4.0", + "hex-buffer-serde", "humantime", - "itertools", + "itertools 0.11.0", "jsonrpc-lite", - "k256", "num-traits", "once_cell", - "pem 1.1.1", - "rand 0.8.5", + "rand", "reqwest", "schemars", "serde", + "serde-map-to-array", "serde_json", - "signature", - "tempfile", "thiserror", "tokio", "uint", - "untrusted 0.9.0", - "vergen", -] - -[[package]] -name = "casper-hashing" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9cafc15f22892b417888b9eafc63a07e8233c5c51ffb15e420b1e2fe7ea9293" -dependencies = [ - "base16", - "blake2", - "casper-types", - "datasize", - "hex", - "hex-buffer-serde 0.3.0", - "hex_fmt", - "itertools", - "once_cell", - "schemars", - "serde", - "thiserror", ] [[package]] name = "casper-types" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d65faf6ea346ce733206a51822cb4da2a76cee29308b0ee4c1f3cba756bdee5" +version = "5.0.0" +source = "git+https://github.com/casper-network/casper-node?branch=release-2.0.0-rc4#4e2ddf485e5cec830f9ff402b052f5f55801eb54" dependencies = [ "base16", "base64 0.13.1", "bitflags 1.3.2", "blake2", - "datasize", + "derive_more", "derp", "ed25519-dalek", "getrandom", "hex", "hex_fmt", "humantime", + "itertools 0.10.5", "k256", + "libc", "num", "num-derive", "num-integer", "num-rational", "num-traits", "once_cell", - "pem 0.8.3", - "rand 0.8.5", + "pem", + "rand", "serde", + "serde-map-to-array", "serde_bytes", "serde_json", "thiserror", + "tracing", "uint", "untrusted 0.7.1", ] [[package]] name = "cc" -version = "1.1.13" +version = "1.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72db2f7947ecee9b03b510377e8bb9077afa27176fdbff55c51027e976fdcc48" +checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6" dependencies = [ - "jobserver", - "libc", "shlex", ] [[package]] name = "cctl-rs" -version = "0.1.0" +version = "0.2.0" dependencies = [ "anyhow", "backoff", @@ -319,8 +296,11 @@ dependencies = [ "casper-types", "clap", "hex", + "itertools 0.13.0", "nom", "sd-notify", + "serde", + "serde_json", "tempfile", "tokio", "tracing", @@ -335,9 +315,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.16" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019" +checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" dependencies = [ "clap_builder", "clap_derive", @@ -345,43 +325,42 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.15" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" +checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" dependencies = [ "anstream", "anstyle", "clap_lex", "strsim", - "terminal_size", ] [[package]] name = "clap_complete" -version = "4.5.18" +version = "4.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee158892bd7ce77aa15c208abbdb73e155d191c287a659b57abd5adb92feb03" +checksum = "abb745187d7f4d76267b37485a65e0149edd0e91a4cfcdd3f27524ad86cee9f3" dependencies = [ "clap", ] [[package]] name = "clap_derive" -version = "4.5.13" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.77", ] [[package]] name = "clap_lex" -version = "0.7.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" [[package]] name = "colorchoice" @@ -391,9 +370,15 @@ checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "const-oid" -version = "0.4.5" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6b64db6932c7e49332728e3a6bd82c6b7e16016607d20923b537c3bc4c0d5f" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "core-foundation" @@ -427,74 +412,85 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "crypto-mac" -version = "0.8.0" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", + "rand_core", "subtle", + "zeroize", ] [[package]] -name = "crypto-mac" -version = "0.10.1" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff07008ec701e8028e2ceb8f83f0e4274ee62bd2dbdc4fefff2e9a91824081a" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", - "subtle", + "typenum", ] [[package]] -name = "curve25519-dalek" -version = "3.2.0" +name = "crypto-mac" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ - "byteorder", - "digest", - "rand_core 0.5.1", + "generic-array", "subtle", - "zeroize", ] [[package]] -name = "datasize" -version = "0.2.15" +name = "curve25519-dalek" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e65c07d59e45d77a8bda53458c24a828893a99ac6cdd9c84111e09176ab739a2" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ - "datasize_derive", + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto", + "rustc_version", + "subtle", + "zeroize", ] [[package]] -name = "datasize_derive" -version = "0.2.15" +name = "curve25519-dalek-derive" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613e4ee15899913285b7612004bbd490abd605be7b11d35afada5902fb6b91d5" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.77", ] [[package]] name = "der" -version = "0.1.0" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51f59c66c30bb7445c8320a5f9233e437e3572368099f25532a59054328899b4" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", + "zeroize", ] [[package]] -name = "deranged" -version = "0.3.11" +name = "derive_more" +version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ - "powerfmt", + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.77", ] [[package]] @@ -515,6 +511,18 @@ dependencies = [ "generic-array", ] +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + [[package]] name = "dyn-clone" version = "1.0.17" @@ -523,34 +531,38 @@ checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "ecdsa" -version = "0.10.2" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fbdb4ff710acb4db8ca29f93b897529ea6d6a45626d5183b47e012aa6ae7e4" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ + "der", + "digest 0.10.7", "elliptic-curve", - "hmac", + "rfc6979", "signature", ] [[package]] name = "ed25519" -version = "1.2.0" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4620d40f6d2601794401d6dd95a5cf69b6c157852539470eeda433a99b3c0efc" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ + "pkcs8", "signature", ] [[package]] name = "ed25519-dalek" -version = "1.0.1" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ "curve25519-dalek", "ed25519", - "rand 0.7.3", + "serde", "sha2", + "subtle", "zeroize", ] @@ -562,18 +574,18 @@ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "elliptic-curve" -version = "0.8.5" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2db227e61a43a34915680bdda462ec0e212095518020a88a1f91acd16092c39" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ - "bitvec", - "digest", + "base16ct", + "crypto-bigint", + "digest 0.10.7", "ff", - "funty", "generic-array", "group", - "pkcs8", - "rand_core 0.5.1", + "rand_core", + "sec1", "subtle", "zeroize", ] @@ -587,26 +599,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "enum-iterator" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fd242f399be1da0a5354aa462d57b4ab2b4ee0683cc552f7c007d2d12d36e94" -dependencies = [ - "enum-iterator-derive", -] - -[[package]] -name = "enum-iterator-derive" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ab991c1362ac86c61ab6f556cff143daa22e5a15e4e189df818b2fd19fe65b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.75", -] - [[package]] name = "equivalent" version = "1.0.1" @@ -625,21 +617,26 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "ff" -version = "0.8.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01646e077d4ebda82b73f1bca002ea1e91561a77df2431a9e79729bcc31950ef" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "bitvec", - "rand_core 0.5.1", + "rand_core", "subtle", ] +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + [[package]] name = "fnv" version = "1.0.7" @@ -670,12 +667,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "funty" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" - [[package]] name = "futures-channel" version = "0.3.30" @@ -723,6 +714,7 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] @@ -732,20 +724,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi", -] - -[[package]] -name = "getset" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e45727250e75cc04ff2846a66397da8ef2b3db8e40e0cef4df67950a07621eb9" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", + "wasm-bindgen", ] [[package]] @@ -754,55 +736,36 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" -[[package]] -name = "git2" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2994bee4a3a6a51eb90c218523be382fd7ea09b16380b9312e9dbe955ff7c7d1" -dependencies = [ - "bitflags 1.3.2", - "libc", - "libgit2-sys", - "log", - "url", -] - [[package]] name = "group" -version = "0.8.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc11f9f5fbf1943b48ae7c2bf6846e7d827a512d1be4f23af708f5ca5d01dde1" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core 0.5.1", + "rand_core", "subtle", ] [[package]] name = "h2" -version = "0.3.26" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" dependencies = [ + "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "futures-util", "http", - "indexmap 2.4.0", + "indexmap", "slab", "tokio", "tokio-util", "tracing", ] -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - [[package]] name = "hashbrown" version = "0.14.5" @@ -811,9 +774,9 @@ checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "heck" -version = "0.5.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" @@ -826,19 +789,6 @@ name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -dependencies = [ - "serde", -] - -[[package]] -name = "hex-buffer-serde" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f52012c160668b4494727f3588045aa00429849fcae51de70d68fa98228039" -dependencies = [ - "hex", - "serde", -] [[package]] name = "hex-buffer-serde" @@ -858,19 +808,18 @@ checksum = "b07f60793ff0a4d9cef0f18e63b5357e06209987153a64648c972c1e5aff336f" [[package]] name = "hmac" -version = "0.10.1" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "crypto-mac 0.10.1", - "digest", + "digest 0.10.7", ] [[package]] name = "http" -version = "0.2.12" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", @@ -879,12 +828,24 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.6" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http", + "http-body", "pin-project-lite", ] @@ -894,12 +855,6 @@ version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - [[package]] name = "humantime" version = "2.1.0" @@ -908,70 +863,95 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.30" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" dependencies = [ "bytes", "futures-channel", - "futures-core", "futures-util", "h2", "http", "http-body", "httparse", - "httpdate", "itoa", "pin-project-lite", - "socket2", + "smallvec", "tokio", - "tower-service", - "tracing", "want", ] +[[package]] +name = "hyper-rustls" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +dependencies = [ + "futures-util", + "http", + "hyper", + "hyper-util", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", +] + [[package]] name = "hyper-tls" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", + "http-body-util", "hyper", + "hyper-util", "native-tls", "tokio", "tokio-native-tls", + "tower-service", ] [[package]] -name = "idna" -version = "0.5.0" +name = "hyper-util" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "pin-project-lite", + "socket2", + "tokio", + "tower", + "tower-service", + "tracing", ] [[package]] -name = "indexmap" -version = "1.9.3" +name = "idna" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", + "unicode-bidi", + "unicode-normalization", ] [[package]] name = "indexmap" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown", ] [[package]] @@ -1005,20 +985,29 @@ dependencies = [ ] [[package]] -name = "itoa" -version = "1.0.11" +name = "itertools" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] [[package]] -name = "jobserver" -version = "0.1.32" +name = "itertools" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ - "libc", + "either", ] +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + [[package]] name = "js-sys" version = "0.3.70" @@ -1041,9 +1030,9 @@ dependencies = [ [[package]] name = "k256" -version = "0.7.3" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4476a0808212a9e81ce802eb1a0cfc60e73aea296553bacc0fac7e1268bc572a" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ "cfg-if", "ecdsa", @@ -1063,30 +1052,6 @@ version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" -[[package]] -name = "libgit2-sys" -version = "0.14.2+1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f3d95f6b51075fe9810a7ae22c7095f12b98005ab364d8544797a825ce946a4" -dependencies = [ - "cc", - "libc", - "libz-sys", - "pkg-config", -] - -[[package]] -name = "libz-sys" -version = "1.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc53a7799a7496ebc9fd29f31f7df80e83c9bda5299768af5f9e59eeea74647" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "linux-raw-sys" version = "0.4.14" @@ -1227,12 +1192,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - [[package]] name = "num-derive" version = "0.3.3" @@ -1273,6 +1232,7 @@ dependencies = [ "num-bigint", "num-integer", "num-traits", + "serde", ] [[package]] @@ -1286,9 +1246,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.3" +version = "0.36.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9" +checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" dependencies = [ "memchr", ] @@ -1328,7 +1288,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.77", ] [[package]] @@ -1375,7 +1335,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -1390,19 +1350,30 @@ dependencies = [ ] [[package]] -name = "pem" -version = "1.1.1" +name = "percent-encoding" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ - "base64 0.13.1", + "pin-project-internal", ] [[package]] -name = "percent-encoding" -version = "2.3.1" +name = "pin-project-internal" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] [[package]] name = "pin-project-lite" @@ -1418,11 +1389,12 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkcs8" -version = "0.3.3" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4839a901843f3942576e65857f0ebf2e190ef7024d3c62a94099ba3f819ad1d" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ "der", + "spki", ] [[package]] @@ -1431,12 +1403,6 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -1446,30 +1412,6 @@ dependencies = [ "zerocopy", ] -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - [[package]] name = "proc-macro2" version = "1.0.86" @@ -1481,30 +1423,13 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] -[[package]] -name = "radium" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "def50a86306165861203e7f84ecffbbdfdea79f0e51039b33de1e952358c47ac" - -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc", -] - [[package]] name = "rand" version = "0.8.5" @@ -1512,18 +1437,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", + "rand_chacha", + "rand_core", ] [[package]] @@ -1533,15 +1448,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.4", + "rand_core", ] -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" - [[package]] name = "rand_core" version = "0.6.4" @@ -1551,15 +1460,6 @@ dependencies = [ "getrandom", ] -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", -] - [[package]] name = "redox_syscall" version = "0.5.3" @@ -1615,11 +1515,11 @@ checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "reqwest" -version = "0.11.27" +version = "0.12.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "bytes", "encoding_rs", "futures-core", @@ -1627,8 +1527,11 @@ dependencies = [ "h2", "http", "http-body", + "http-body-util", "hyper", + "hyper-rustls", "hyper-tls", + "hyper-util", "ipnet", "js-sys", "log", @@ -1650,7 +1553,32 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "winreg", + "windows-registry", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "spin", + "untrusted 0.9.0", + "windows-sys 0.52.0", ] [[package]] @@ -1659,11 +1587,20 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "a85d50532239da68e9addb745ba38ff4612a242c1c7ceea689c4bc7c2f43c36f" dependencies = [ "bitflags 2.6.0", "errno", @@ -1672,20 +1609,45 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rustls" +version = "0.23.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" +dependencies = [ + "once_cell", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + [[package]] name = "rustls-pemfile" -version = "1.0.4" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", + "rustls-pki-types", ] [[package]] -name = "rustversion" -version = "1.0.17" +name = "rustls-pki-types" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" + +[[package]] +name = "rustls-webpki" +version = "0.102.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "84678086bd54edf2b415183ed7a94d0efb049f1b646a33e22a36f3794be6ae56" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted 0.9.0", +] [[package]] name = "ryu" @@ -1704,12 +1666,11 @@ dependencies = [ [[package]] name = "schemars" -version = "0.8.5" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b82485a532ef0af18878ad4281f73e58161cdba1db7918176e9294f0ca5498a5" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" dependencies = [ "dyn-clone", - "indexmap 1.9.3", "schemars_derive", "serde", "serde_json", @@ -1717,14 +1678,14 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.5" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791c2c848cff1abaeae34fef7e70da5f93171d9eea81ce0fe969a1df627a61a8" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 1.0.109", + "syn 2.0.77", ] [[package]] @@ -1739,6 +1700,19 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4646d6f919800cd25c50edb49438a1381e2cd4833c027e75e8897981c50b8b5e" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + [[package]] name = "security-framework" version = "2.11.1" @@ -1762,15 +1736,30 @@ dependencies = [ "libc", ] +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + [[package]] name = "serde" -version = "1.0.208" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" +checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" dependencies = [ "serde_derive", ] +[[package]] +name = "serde-map-to-array" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c14b52efc56c711e0dbae3f26e0cc233f5dac336c1bf0b07e1b7dc2dca3b2cc7" +dependencies = [ + "serde", +] + [[package]] name = "serde_bytes" version = "0.11.15" @@ -1782,33 +1771,33 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.208" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" +checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.77", ] [[package]] name = "serde_derive_internals" -version = "0.25.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dbab34ca63057a1f15280bdf3c39f2b1eb1b54c17e98360e511637aef7418c6" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.77", ] [[package]] name = "serde_json" -version = "1.0.125" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" +checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" dependencies = [ - "indexmap 2.4.0", + "indexmap", "itoa", "memchr", "ryu", @@ -1829,15 +1818,13 @@ dependencies = [ [[package]] name = "sha2" -version = "0.9.9" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ - "block-buffer", "cfg-if", "cpufeatures", - "digest", - "opaque-debug", + "digest 0.10.7", ] [[package]] @@ -1866,12 +1853,12 @@ dependencies = [ [[package]] name = "signature" -version = "1.2.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29f060a7d147e33490ec10da418795238fd7545bba241504d6b31a409f2e6210" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "digest", - "rand_core 0.5.1", + "digest 0.10.7", + "rand_core", ] [[package]] @@ -1899,6 +1886,22 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + [[package]] name = "static_assertions" version = "1.1.0" @@ -1907,15 +1910,15 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "strsim" -version = "0.11.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "subtle" -version = "2.4.1" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -1930,9 +1933,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.75" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", @@ -1941,26 +1944,29 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "0.1.2" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +dependencies = [ + "futures-core", +] [[package]] name = "system-configuration" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "core-foundation", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" dependencies = [ "core-foundation-sys", "libc", @@ -1979,34 +1985,24 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "terminal_size" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" -dependencies = [ - "rustix", - "windows-sys 0.48.0", -] - [[package]] name = "thiserror" -version = "1.0.34" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c1b05ca9d106ba7d2e31a9dab4a64e7be2cce415321966ea3132c49a656e252" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.34" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8f2591983642de85c921015f3f070c665a197ed69e417af436115e3a1407487" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.77", ] [[package]] @@ -2019,37 +2015,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" -dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", -] - [[package]] name = "tinyvec" version = "1.8.0" @@ -2067,9 +2032,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.39.3" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", @@ -2092,7 +2057,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.77", ] [[package]] @@ -2105,6 +2070,17 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +dependencies = [ + "rustls", + "rustls-pki-types", + "tokio", +] + [[package]] name = "tokio-util" version = "0.7.11" @@ -2118,6 +2094,27 @@ dependencies = [ "tokio", ] +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + [[package]] name = "tower-service" version = "0.3.3" @@ -2143,7 +2140,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.77", ] [[package]] @@ -2271,22 +2268,6 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" -[[package]] -name = "vergen" -version = "7.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "571b69f690c855821462709b6f41d42ceccc316fbd17b60bd06d06928cfe6a99" -dependencies = [ - "anyhow", - "cfg-if", - "enum-iterator", - "getset", - "git2", - "rustversion", - "thiserror", - "time", -] - [[package]] name = "version_check" version = "0.9.5" @@ -2330,7 +2311,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.77", "wasm-bindgen-shared", ] @@ -2364,7 +2345,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.77", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2408,45 +2389,51 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "windows-sys" -version = "0.48.0" +name = "windows-registry" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" dependencies = [ - "windows-targets 0.48.5", + "windows-result", + "windows-strings", + "windows-targets", ] [[package]] -name = "windows-sys" -version = "0.52.0" +name = "windows-result" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" dependencies = [ - "windows-targets 0.52.6", + "windows-result", + "windows-targets", ] [[package]] name = "windows-sys" -version = "0.59.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.6", + "windows-targets", ] [[package]] -name = "windows-targets" -version = "0.48.5" +name = "windows-sys" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows-targets", ] [[package]] @@ -2455,46 +2442,28 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", "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", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - [[package]] name = "windows_i686_gnu" version = "0.52.6" @@ -2507,70 +2476,30 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - -[[package]] -name = "wyz" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" - [[package]] name = "zerocopy" version = "0.7.35" @@ -2589,7 +2518,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.77", ] [[package]] @@ -2597,17 +2526,3 @@ name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.75", -] diff --git a/Cargo.toml b/Cargo.toml index 39ba943..1117470 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "cctl-rs" -version = "0.1.0" +version = "0.2.0" edition = "2021" license = "MIT OR Apache-2.0" [[bin]] name = "cctld" path = "bin/cctld.rs" -version = "0.1.0" +version = "0.2.0" test = false bench = false @@ -20,12 +20,18 @@ path = "src/lib.rs" anyhow = "1" backoff = { version = "0.4", features = ["tokio", "futures"]} clap = { version = "4", features = ["derive"] } -casper-client = "2.0" -casper-types = "3.0" +casper-client = { git = "https://github.com/casper-ecosystem/casper-client-rs", branch = "feat-track-node-2.0"} +casper-types= { git = "https://github.com/casper-network/casper-node", branch = "release-2.0.0-rc4" } +itertools = "0.13" nom = "7" hex = "0.4" sd-notify = "0.4" +serde = "1" +serde_json = "1" tokio = { version = "1", features = [ "full", "tracing", "macros" ] } tempfile = "3" tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["std", "env-filter"] } + +[patch.crates-io] +casper-types = { git = "https://github.com/casper-network/casper-node", branch = "release-2.0.0-rc4" } diff --git a/bin/cctld.rs b/bin/cctld.rs index 668160d..69a0b1f 100644 --- a/bin/cctld.rs +++ b/bin/cctld.rs @@ -1,38 +1,31 @@ -use casper_types::{runtime_args, RuntimeArgs}; use clap::Parser; use sd_notify::NotifyState; use std::path::PathBuf; use tokio::signal; +use tracing_subscriber::EnvFilter; #[derive(Parser)] pub struct Cli { #[arg(short, long)] pub working_dir: Option, #[arg(short, long)] - pub deploy_contract: Option, - #[arg(short, long)] + pub deploy_contracts: Option>, + #[arg(short = 's', long)] pub chainspec_path: Option, - #[arg(short, long)] + #[arg(short = 'c', long)] pub config_path: Option, } #[tokio::main] async fn main() -> Result<(), Box> { + tracing_subscriber::fmt() + .with_env_filter(EnvFilter::from_default_env()) + .with_writer(std::io::stderr) + .init(); let cli = Cli::parse(); - let deploy_contract = cli.deploy_contract.map(|deploy_contracts_arg| { - match deploy_contracts_arg.split_once(':') { - Some((hash_name, path)) => cctl::DeployableContract { - hash_name: hash_name.to_string(), - // FIXME at some point we want to make this parametrizable - runtime_args: runtime_args! { "initial_trie_root" => Option::<[u8; 32]>::None }, - path: PathBuf::from(&path), - }, - None => panic!("Error parsing the provided deploy contracts argument."), - } - }); let _network = cctl::CCTLNetwork::run( cli.working_dir, - deploy_contract, + cli.deploy_contracts, cli.chainspec_path, cli.config_path, ) diff --git a/docker-image.nix b/docker-image.nix index a443348..5218b2d 100644 --- a/docker-image.nix +++ b/docker-image.nix @@ -5,32 +5,58 @@ }: dockerTools.buildLayeredImage { name = "ghcr.io/cspr-rad/cctl-rs"; - tag = "cctl-casper-node-1.5.7"; + tag = "cctl-casper-node-2.0.0-rc4"; extraCommands = '' mkdir -p tmp ''; config = { Cmd = lib.getExe cctld; ExposedPorts = { - # RPC ports + # Node ports + # PROTOCOL ports "11101/tcp" = { }; "11102/tcp" = { }; "11103/tcp" = { }; "11104/tcp" = { }; "11105/tcp" = { }; + + # BINARY ports + "12101/tcp" = { }; + "12102/tcp" = { }; + "12103/tcp" = { }; + "12104/tcp" = { }; + "12105/tcp" = { }; + # REST ports + "13101/tcp" = { }; + "13102/tcp" = { }; + "13103/tcp" = { }; + "13104/tcp" = { }; + "13105/tcp" = { }; + + # SSE ports "14101/tcp" = { }; "14102/tcp" = { }; "14103/tcp" = { }; "14104/tcp" = { }; "14105/tcp" = { }; - # SSE ports - "18101/tcp" = { }; - "18102/tcp" = { }; - "18103/tcp" = { }; - "18104/tcp" = { }; - "18105/tcp" = { }; - # Consensus ports + + # Sidecar ports + # NODE-CLIENT ports + "12101/tcp" = { }; + "12102/tcp" = { }; + "12103/tcp" = { }; + "12104/tcp" = { }; + "12105/tcp" = { }; + + # MAIN-RPC ports + "21101/tcp" = { }; + "21102/tcp" = { }; + "21103/tcp" = { }; + "21104/tcp" = { }; + "21105/tcp" = { }; + + # SPEC-EXEC ports "22101/tcp" = { }; "22102/tcp" = { }; "22103/tcp" = { }; diff --git a/dummy-contract/Cargo.lock b/dummy-contract/Cargo.lock new file mode 100644 index 0000000..e4f6342 --- /dev/null +++ b/dummy-contract/Cargo.lock @@ -0,0 +1,758 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "base16" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d27c3610c36aee21ce8ac510e6224498de4228ad772a171ed65643a24693a5a8" + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "blake2" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a4e37d16930f5459780f5621038b6382b9bb37c19016f39fb6b5808d831f174" +dependencies = [ + "crypto-mac", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "casper-contract" +version = "4.0.0" +source = "git+https://github.com/casper-network/casper-node?branch=release-2.0.0-rc4#4e2ddf485e5cec830f9ff402b052f5f55801eb54" +dependencies = [ + "casper-types", + "hex_fmt", +] + +[[package]] +name = "casper-types" +version = "5.0.0" +source = "git+https://github.com/casper-network/casper-node?branch=release-2.0.0-rc4#4e2ddf485e5cec830f9ff402b052f5f55801eb54" +dependencies = [ + "base16", + "base64", + "bitflags", + "blake2", + "derive_more", + "ed25519-dalek", + "hex", + "hex_fmt", + "itertools", + "k256", + "num", + "num-derive", + "num-integer", + "num-rational", + "num-traits", + "rand", + "serde", + "serde-map-to-array", + "serde_bytes", + "serde_json", + "tracing", + "uint", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "cpufeatures" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" +dependencies = [ + "libc", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "derive_more" +version = "0.99.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.77", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "dummy-contract" +version = "0.1.0" +dependencies = [ + "casper-contract", + "casper-types", + "serde", +] + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest 0.10.7", + "elliptic-curve", + "rfc6979", + "signature", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "pkcs8", + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" +dependencies = [ + "curve25519-dalek", + "ed25519", + "serde", + "sha2", + "subtle", + "zeroize", +] + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest 0.10.7", + "ff", + "generic-array", + "group", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex_fmt" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b07f60793ff0a4d9cef0f18e63b5357e06209987153a64648c972c1e5aff336f" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "k256" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "sha2", +] + +[[package]] +name = "libc" +version = "0.2.158" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "num" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-derive" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", + "serde", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.209" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-map-to-array" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c14b52efc56c711e0dbae3f26e0cc233f5dac336c1bf0b07e1b7dc2dca3b2cc7" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_bytes" +version = "0.11.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.209" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "serde_json" +version = "1.0.127" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest 0.10.7", + "rand_core", +] + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/dummy-contract/Cargo.toml b/dummy-contract/Cargo.toml new file mode 100644 index 0000000..47b059d --- /dev/null +++ b/dummy-contract/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "dummy-contract" +version = "0.1.0" +edition = "2021" + +[dependencies] +casper-contract = { git = "https://github.com/casper-network/casper-node", branch = "release-2.0.0-rc4", default-features = false} +casper-types= { git = "https://github.com/casper-network/casper-node", branch = "release-2.0.0-rc4", default-features = false } +serde = "1" diff --git a/dummy-contract/default.nix b/dummy-contract/default.nix new file mode 100644 index 0000000..2217c90 --- /dev/null +++ b/dummy-contract/default.nix @@ -0,0 +1,51 @@ +{ inputs, ... }: +{ + perSystem = { self', inputs', pkgs, lib, ... }: + let + # nightly-2023-03-25: https://github.com/casper-network/casper-node/blob/release-2.0.0-rc4/smart_contracts/rust-toolchain + toolchainAttrs = { channel = "nightly"; date = "2023-03-25"; sha256 = "sha256-vWMW7tpbU/KseRztVYQ6CukrQWJgPgtlFuB6OPoZ/v8="; }; + rustToolchain = with inputs'.fenix.packages; combine [ + (toolchainOf toolchainAttrs).toolchain + (targets.wasm32-unknown-unknown.toolchainOf toolchainAttrs).rust-std + ]; + craneLib = (inputs.crane.mkLib pkgs).overrideToolchain rustToolchain; + + contractAttrs = { + pname = "dummy-contract"; + src = lib.cleanSourceWith { + src = lib.fileset.toSource { + root = ./.; + fileset = lib.fileset.unions [ + ./Cargo.toml + ./Cargo.lock + ./src + ]; + }; + }; + cargoExtraArgs = "--target wasm32-unknown-unknown"; + CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER = "lld"; + nativeBuildInputs = [ pkgs.binaryen pkgs.llvmPackages_16.bintools ]; + doCheck = false; + # optimize wasm + postInstall = '' + directory="$out/bin/" + for file in "$directory"*.wasm; do + if [ -e "$file" ]; then + wasm-opt -Oz --strip-debug --signext-lowering "$file" + fi + done + ''; + }; + in + { + devShells.contract = pkgs.mkShell { + inputsFrom = [ self'.packages.dummy-contract ]; + CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER = "lld"; + }; + packages = { + # Used for testing purposes + dummy-contract = craneLib.buildPackage contractAttrs; + }; + }; + flake = { }; +} diff --git a/dummy-contract/src/main.rs b/dummy-contract/src/main.rs new file mode 100644 index 0000000..b6bb1b8 --- /dev/null +++ b/dummy-contract/src/main.rs @@ -0,0 +1,41 @@ +#![no_std] +#![no_main] + +use casper_contract::contract_api::storage; +use casper_types::{ + addressable_entity::NamedKeys, CLType, EntryPoint, EntryPointAccess, EntryPointPayment, + EntryPointType, EntryPoints, +}; +extern crate alloc; +use alloc::{string::ToString, vec}; + +#[no_mangle] +pub extern "C" fn dummy() { + // this doesn't do anything, but you can call it. +} + +#[no_mangle] +pub extern "C" fn call() { + let entry_points = { + let dummy = EntryPoint::new( + "dummy", + vec![], + CLType::Unit, + EntryPointAccess::Public, + EntryPointType::Called, + EntryPointPayment::Caller, + ); + + let mut entry_points = EntryPoints::new(); + entry_points.add_entry_point(dummy); + entry_points + }; + let named_keys = NamedKeys::new(); + storage::new_contract( + entry_points, + Some(named_keys), + Some("contract-hash".to_string()), + Some("contract-package-hash".to_string()), + None, + ); +} diff --git a/flake.lock b/flake.lock index 8d0b322..9223df7 100644 --- a/flake.lock +++ b/flake.lock @@ -41,30 +41,6 @@ "type": "github" } }, - "agenix_2": { - "inputs": { - "darwin": "darwin_2", - "home-manager": "home-manager_2", - "nixpkgs": [ - "csprpkgs", - "nixpkgs" - ], - "systems": "systems_2" - }, - "locked": { - "lastModified": 1722339003, - "narHash": "sha256-ZeS51uJI30ehNkcZ4uKqT4ZDARPyqrHADSKAwv5vVCU=", - "owner": "ryantm", - "repo": "agenix", - "rev": "3f1dae074a12feb7327b4bf43cbac0d124488bb7", - "type": "github" - }, - "original": { - "owner": "ryantm", - "repo": "agenix", - "type": "github" - } - }, "cctl": { "inputs": { "csprpkgs": "csprpkgs", @@ -80,17 +56,17 @@ ] }, "locked": { - "lastModified": 1717998887, - "narHash": "sha256-0i3xRAkHI+NPwxGWC3vtJeQyAxfuxr//W7gBT6iuFuk=", - "owner": "casper-network", + "lastModified": 1725966561, + "narHash": "sha256-8U8aQnbPdwNKfuz4FpgCSqlKmYJ2aUCwC1zn19mEfBc=", + "owner": "cspr-rad", "repo": "cctl", - "rev": "947c34b991e37476db82ccfa2bd7c0312c1a91d7", + "rev": "407b24d689006e79328c23c68c17a2180a69f2ed", "type": "github" }, "original": { - "owner": "casper-network", + "owner": "cspr-rad", + "ref": "use-client-feat-2.0", "repo": "cctl", - "rev": "947c34b991e37476db82ccfa2bd7c0312c1a91d7", "type": "github" } }, @@ -121,37 +97,16 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1724854505, - "narHash": "sha256-ax1Jxgd47kmK6ZY7lm0KheDLm6DyqZRZlGY+3f9XYWU=", - "owner": "cspr-rad", - "repo": "csprpkgs", - "rev": "3bc835d3b73a5d5a5829f3b8506f51a9cd098abd", - "type": "github" - }, - "original": { - "owner": "cspr-rad", - "repo": "csprpkgs", - "type": "github" - } - }, - "csprpkgs_2": { - "inputs": { - "agenix": "agenix_2", - "nixpkgs": "nixpkgs_2", - "rust-overlay": "rust-overlay_2" - }, - "locked": { - "lastModified": 1724854505, - "narHash": "sha256-ax1Jxgd47kmK6ZY7lm0KheDLm6DyqZRZlGY+3f9XYWU=", + "lastModified": 1725966511, + "narHash": "sha256-efgD6Ia/q7Q7V7m4HcujzZwK8Q2wcktE2JVdNNrxf6c=", "owner": "cspr-rad", "repo": "csprpkgs", - "rev": "3bc835d3b73a5d5a5829f3b8506f51a9cd098abd", + "rev": "ffd1c29015183c6134365d7f4a18e7d2357bba65", "type": "github" }, "original": { "owner": "cspr-rad", "repo": "csprpkgs", - "rev": "3bc835d3b73a5d5a5829f3b8506f51a9cd098abd", "type": "github" } }, @@ -179,29 +134,6 @@ "type": "github" } }, - "darwin_2": { - "inputs": { - "nixpkgs": [ - "csprpkgs", - "agenix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1700795494, - "narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=", - "owner": "lnl7", - "repo": "nix-darwin", - "rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d", - "type": "github" - }, - "original": { - "owner": "lnl7", - "ref": "master", - "repo": "nix-darwin", - "type": "github" - } - }, "fenix": { "inputs": { "nixpkgs": [ @@ -264,28 +196,6 @@ "type": "github" } }, - "home-manager_2": { - "inputs": { - "nixpkgs": [ - "csprpkgs", - "agenix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1703113217, - "narHash": "sha256-7ulcXOk63TIT2lVDSExj7XzFx09LpdSAPtvgtM7yQPE=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "3bfaacf46133c037bb356193bd2f1765d9dc82c1", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "home-manager", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1722730825, @@ -316,27 +226,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1722730825, - "narHash": "sha256-X6U+w8qFBuGPCYrZzc9mpN34aRjQ8604MonpBUkj908=", + "lastModified": 1725534445, + "narHash": "sha256-Yd0FK9SkWy+ZPuNqUgmVPXokxDgMJoGuNpMEtkfcf84=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f3834de3782b82bfc666abf664f946d0e7d1f116", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { - "locked": { - "lastModified": 1724015816, - "narHash": "sha256-hVESnM7Eiz93+4DeiE0a1TwMeaeph1ytRJ5QtqxYRWg=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "9aa35efbea27d320d0cdc5f922f0890812affb60", + "rev": "9bb1e7571aadf31ddb4af77fc64b2d59580f9a39", "type": "github" }, "original": { @@ -351,10 +245,13 @@ "advisory-db": "advisory-db", "cctl": "cctl", "crane": "crane", - "csprpkgs": "csprpkgs_2", + "csprpkgs": [ + "cctl", + "csprpkgs" + ], "fenix": "fenix", "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_2", "treefmt-nix": "treefmt-nix" } }, @@ -397,27 +294,6 @@ "type": "github" } }, - "rust-overlay_2": { - "inputs": { - "nixpkgs": [ - "csprpkgs", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1722824458, - "narHash": "sha256-2k3/geD5Yh8JT1nrGaRycje5kB0DkvQA/OUZoel1bIU=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "a8a937c304e62a5098c6276c9cdf65c19a43b1a5", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, "systems": { "locked": { "lastModified": 1681028828, @@ -433,21 +309,6 @@ "type": "github" } }, - "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "treefmt-nix": { "inputs": { "nixpkgs": [ diff --git a/flake.nix b/flake.nix index 743b40e..fd09a11 100644 --- a/flake.nix +++ b/flake.nix @@ -27,8 +27,9 @@ crane.inputs.nixpkgs.follows = "nixpkgs"; advisory-db.url = "github:rustsec/advisory-db"; advisory-db.flake = false; - cctl.url = "github:casper-network/cctl/947c34b991e37476db82ccfa2bd7c0312c1a91d7"; - csprpkgs.url = "github:cspr-rad/csprpkgs/3bc835d3b73a5d5a5829f3b8506f51a9cd098abd"; + # with casper-node 2.0.0-rc4 https://github.com/casper-network/cctl/pull/44/commits/058de6887c691dac0b20284fba1f78bcd39187ef + cctl.url = "github:cspr-rad/cctl/use-client-feat-2.0"; + csprpkgs.follows = "cctl/csprpkgs"; }; outputs = inputs@{ flake-parts, treefmt-nix, ... }: @@ -37,14 +38,14 @@ imports = [ treefmt-nix.flakeModule ./nixos + ./dummy-contract ]; perSystem = { self', inputs', pkgs, lib, ... }: let rustToolchain = inputs'.fenix.packages.stable.toolchain; craneLib = (inputs.crane.mkLib pkgs).overrideToolchain rustToolchain; - # revision 3bc835d contains casper-node 1.5.7 - cctl = inputs'.cctl.packages.cctl.override { casper-node = inputs'.csprpkgs.packages.casper-node; }; + cctl = inputs'.cctl.packages.cctl; cctlAttrs = { pname = "cctl-rs"; diff --git a/nixos/default.nix b/nixos/default.nix index 0b77a9f..4e85883 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -11,7 +11,7 @@ { inherit (inputs.csprpkgs.packages.${pkgs.system}) casper-client-rs; cctlModule = self.nixosModules.cctl; - contractWasm = ../test-resources/demo-contract-optimized.wasm; + contractWasm = "${self.packages.${pkgs.system}.dummy-contract}/bin/dummy-contract.wasm"; }; }; nixosModules = { diff --git a/nixos/modules/cctl.nix b/nixos/modules/cctl.nix index bef9ede..05f304a 100644 --- a/nixos/modules/cctl.nix +++ b/nixos/modules/cctl.nix @@ -22,7 +22,7 @@ in port = mkOption { type = types.port; - default = 11101; + default = 21101; example = 60000; description = '' Port to listen on. @@ -62,17 +62,29 @@ in ''; }; - contract = mkOption { - type = types.nullOr (types.attrsOf types.path); + contracts = mkOption { default = null; - example = { "contract hash name" = "/path/to/contract.wasm"; }; - description = '' - The wasm compiled contract that should be deployed once the network is up and ready. - The name of the attribute should correspond to the contracts hash name when calling - https://docs.rs/casper-contract/latest/casper_contract/contract_api/storage/fn.new_locked_contract.html - ''; + type = types.nullOr (types.listOf (types.submodule { + options = { + hash_name = mkOption { + type = types.str; + description = '' + The contracts hash name which was provided when calling + https://docs.rs/casper-contract/latest/casper_contract/contract_api/storage/fn.new_locked_contract.html + ''; + }; + path = mkOption { + type = types.path; + description = "The wasm compiled contract that should be deployed once the network is up and ready."; + }; + runtime_args = mkOption { + default = null; + type = types.nullOr types.attrs; + description = "The runtime arguments expected by this contract."; + }; + }; + })); }; - }; config = mkIf cfg.enable { @@ -83,9 +95,9 @@ in "--working-dir" cfg.workingDirectory ] - ++ optionals (!builtins.isNull cfg.contract) ([ - "--deploy-contract" - ] ++ (lib.mapAttrsToList (hash_name: contract_path: "${hash_name}:${contract_path}") cfg.contract)) + ++ optionals (!builtins.isNull cfg.contracts) ([ + "--deploy-contracts" + ] ++ (lib.map (contract: builtins.toJSON contract) cfg.contracts)) ++ optionals (!builtins.isNull cfg.chainspec) [ "--chainspec-path" cfg.chainspec diff --git a/nixos/tests/verify-cctl-service.nix b/nixos/tests/verify-cctl-service.nix index 07d3baa..a02285b 100644 --- a/nixos/tests/verify-cctl-service.nix +++ b/nixos/tests/verify-cctl-service.nix @@ -8,12 +8,19 @@ nixosTest { nodes = { server = { config, ... }: { + virtualisation.diskSize = 2048; imports = [ cctlModule ]; services.cctl = { enable = true; - contract = { "kairos_contract_package_hash" = contractWasm; }; + contracts = [ + { + hash_name = "contract-hash"; + path = contractWasm; + runtime_args = null; + } + ]; }; networking.firewall.allowedTCPPorts = [ 80 config.services.cctl.port ]; }; @@ -24,20 +31,23 @@ nixosTest { testScript = { nodes }: let - casperNodeAddress = "http://server:${builtins.toString nodes.server.config.services.cctl.port}"; + casperNodeAddress = "http://server:${builtins.toString nodes.server.services.cctl.port}"; # This is the directory wget will copy to, see script below clientUsersDirectory = "server/cctl/users"; in '' - import json - start_all() server.wait_for_unit("cctl.service") # verify that the cctl network is running and reached the validate state - response = client.succeed("casper-client get-node-status --node-address ${casperNodeAddress}") - response_json = json.loads(response) - assert "result" in response_json and "Validate" in response_json["result"].get("reactor_state"), "The node didn't reach the VALIDATE state. The status response was {}".format(response) + response = client.succeed("casper-client get-peers --node-address ${casperNodeAddress}") + + # FIXME: getting the status is currently broken beteen sidecar <-> node + # import json + + # response = client.succeed("casper-client get-node-status --node-address ${casperNodeAddress}") + # response_json = json.loads(response) + # assert "result" in response_json and "Validate" in response_json["result"].get("reactor_state"), "The node didn't reach the VALIDATE state. The status response was {}".format(response) # verify that the generated cctl test accounts are being served client.succeed("wget --no-parent -r http://server/cctl/users/") diff --git a/src/lib.rs b/src/lib.rs index b7d7616..8d677b1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,10 +3,13 @@ pub mod parsers; use anyhow::anyhow; use backoff::{future::retry, ExponentialBackoff}; use hex::FromHex; +use itertools::{Either, Itertools}; +use serde::{Deserialize, Serialize}; use std::env; use std::io::{self, Write}; use std::path::PathBuf; use std::process::Command; +use std::str::FromStr; use std::{ fs, time::{Duration, Instant}, @@ -14,12 +17,17 @@ use std::{ use tempfile::tempdir; use casper_client::{ - get_account, get_deploy, get_node_status, get_state_root_hash, put_deploy, query_global_state, - rpcs::results::ReactorState, - types::{DeployBuilder, ExecutableDeployItem, StoredValue, TimeDiff, Timestamp}, - Error, JsonRpcId, Verbosity, + get_deploy, get_state_root_hash, put_deploy, query_global_state, Error, JsonRpcId, Verbosity, }; -use casper_types::{ContractHash, ExecutionResult, Key, PublicKey, RuntimeArgs, SecretKey}; +use casper_types::{ + account::AccountHash, + contracts::ContractHash, + execution::{execution_result_v1::ExecutionResultV1, ExecutionResult}, + runtime_args, DeployBuilder, ExecutableDeployItem, Key, PublicKey, RuntimeArgs, SecretKey, + StoredValue, TimeDiff, Timestamp, +}; + +use parsers::RawNodeType; #[derive(Debug, PartialEq, Clone, Copy)] pub enum NodeState { @@ -28,12 +36,25 @@ pub enum NodeState { } #[derive(Debug, PartialEq, Clone, Copy)] -pub struct CasperNodePorts { - pub consensus_port: u16, +pub struct CasperSidecarPorts { + pub node_client_port: u16, pub rpc_port: u16, + pub speculative_exec_port: u16, +} + +pub struct CasperSidecar { + pub id: u8, + pub validator_group_id: u8, + pub state: NodeState, + pub port: CasperSidecarPorts, +} + +#[derive(Debug, PartialEq, Clone, Copy)] +pub struct CasperNodePorts { + pub protocol_port: u16, + pub binary_port: u16, pub rest_port: u16, pub sse_port: u16, - pub speculative_exec_port: u16, } pub struct CasperNode { @@ -45,16 +66,27 @@ pub struct CasperNode { pub struct CCTLNetwork { pub working_dir: PathBuf, - pub nodes: Vec, + pub casper_nodes: Vec, + pub casper_sidecars: Vec, } +#[derive(Clone, Serialize, Deserialize)] pub struct DeployableContract { /// This is the named key under which the contract hash is located pub hash_name: String, - pub runtime_args: RuntimeArgs, + pub runtime_args: Option, pub path: PathBuf, } +impl FromStr for DeployableContract { + type Err = serde_json::Error; + + fn from_str(s: &str) -> Result { + serde_json::from_str(s) + } +} + +/// Configures the casper-client verbosity level depending on the tracing log level pub fn casper_client_verbosity() -> Verbosity { if tracing::enabled!(tracing::Level::TRACE) { Verbosity::High @@ -77,7 +109,7 @@ impl CCTLNetwork { /// Ensure that two instances of this function are not running at the same time even in different processes. pub async fn run( working_dir: Option, - contract_to_deploy: Option, + contracts_to_deploy: Option>, chainspec_path: Option, config_path: Option, ) -> anyhow::Result { @@ -131,68 +163,54 @@ impl CCTLNetwork { tracing::info!("{}", output); let (_, node_ports) = parsers::parse_cctl_infra_node_view_port_lines(output).unwrap(); - // Match the started nodes with their respective ports - let nodes: Vec = nodes - .into_iter() - .map(|(validator_group_id, node_id, state)| { - if let Some(&(_, port)) = node_ports - .iter() - .find(|(node_id_ports, _)| *node_id_ports == node_id) - { - CasperNode { - validator_group_id, - state, - id: node_id, - port, + tracing::info!("Fetching the networks sidecar ports"); + let output = Command::new("cctl-infra-sidecar-view-ports") + .env("CCTL_ASSETS", &assets_dir) + .output() + .expect("Failed to get the networks node ports"); + let output = std::str::from_utf8(output.stdout.as_slice()).unwrap(); + tracing::info!("{}", output); + let (_, sidecar_ports) = parsers::parse_cctl_infra_sidecar_view_port_lines(output).unwrap(); + + // Match the started nodes and sidecars with their respective ports + + let (casper_nodes, casper_sidecars): (Vec, Vec) = + nodes.iter().partition_map(|node_type| match node_type { + RawNodeType::CasperNode(validator_group_id, node_id, state) => { + if let Some(&(_, port)) = node_ports + .iter() + .find(|(node_id_ports, _)| node_id_ports == node_id) + { + Either::Left(CasperNode { + validator_group_id: *validator_group_id, + state: *state, + id: *node_id, + port, + }) + } else { + panic!("Can't find ports for node with id {}", node_id) } - } else { - panic!("Can't find ports for node with id {}", node_id) } - }) - .collect(); - - let node_port = nodes.first().unwrap().port.rpc_port; - let casper_node_rpc_url = format!("http://0.0.0.0:{node_port}/rpc"); - const MAX_GENESIS_WAIT_TIME: Duration = Duration::from_secs(90); - - let start_time = Instant::now(); - tracing::info!("Waiting {MAX_GENESIS_WAIT_TIME:?} for the network to pass genesis"); - retry(ExponentialBackoff::default(), || async { - // This prevents retrying forever even after ctrl-c - let timed_out = start_time.elapsed() > MAX_GENESIS_WAIT_TIME; - - get_node_status( - JsonRpcId::Number(1), - &casper_node_rpc_url, - casper_client_verbosity(), - ) - .await - .map_err(|err| { - let elapsed = start_time.elapsed().as_secs(); - tracing::info!( - "Waited for {elapsed}s to pass genesis, the last reported error was: {err:?}" - ); - err - }) - .map_err(|err| match &err { - err if timed_out => backoff::Error::permanent(anyhow!("Timeout on error: {err:?}")), - Error::ResponseIsHttpError { .. } | Error::FailedToGetResponse { .. } => { - backoff::Error::transient(anyhow!(err)) + RawNodeType::CasperSidecar(validator_group_id, node_id, state) => { + if let Some(&(_, port)) = sidecar_ports + .iter() + .find(|(node_id_ports, _)| node_id_ports == node_id) + { + Either::Right(CasperSidecar { + validator_group_id: *validator_group_id, + state: *state, + id: *node_id, + port: CasperSidecarPorts { + node_client_port: port.node_client_port, + rpc_port: port.rpc_port, + speculative_exec_port: port.speculative_exec_port, + }, + }) + } else { + panic!("Can't find ports for sidecar with id {}", node_id) + } } - _ => backoff::Error::permanent(anyhow!(err)), - }) - .map(|success| match success.result.reactor_state { - ReactorState::Validate => Ok(()), - reactor_state if timed_out => Err(backoff::Error::permanent(anyhow!( - "Node didn't reach the VALIDATE state before timeout: {reactor_state:?}" - ))), - _ => Err(backoff::Error::transient(anyhow!( - "Node didn't reach the VALIDATE state yet" - ))), - })? - }) - .await - .expect("Waiting for network to pass genesis failed"); + }); tracing::info!("Waiting for block 1"); let output = Command::new("cctl-chain-await-until-block-n") @@ -203,31 +221,43 @@ impl CCTLNetwork { let output = std::str::from_utf8(output.stdout.as_slice()).unwrap(); tracing::info!("{}", output); - if let Some(contract_to_deploy) = contract_to_deploy { + // FIXME: remove once sidecar <-> node communication is more reliable + std::thread::sleep(std::time::Duration::from_secs(2)); + + if let Some(contracts_to_deploy) = contracts_to_deploy { + let rpc_port = casper_sidecars.first().unwrap().port.rpc_port; + let casper_sidecar_rpc_url = format!("http://0.0.0.0:{rpc_port}/rpc"); let deployer_skey = SecretKey::from_file(working_dir.join("assets/users/user-1/secret_key.pem"))?; let deployer_pkey = PublicKey::from_file(working_dir.join("assets/users/user-1/public_key.pem"))?; - let (hash_name, contract_hash) = deploy_contract( - &casper_node_rpc_url, - &deployer_skey, - &deployer_pkey, - &contract_to_deploy, - ) - .await?; let contracts_dir = working_dir.join("contracts"); fs::create_dir_all(&contracts_dir)?; - fs::write( - contracts_dir.join(hash_name), - // For a ContractHash contract- will always be the prefix - contract_hash - .to_formatted_string() - .strip_prefix("contract-") - .unwrap(), - )? + + for contract_to_deploy in contracts_to_deploy { + let (hash_name, contract_hash) = deploy_contract( + &casper_sidecar_rpc_url, + &deployer_skey, + &deployer_pkey.to_account_hash(), + &contract_to_deploy, + ) + .await?; + fs::write( + contracts_dir.join(hash_name), + // For a ContractHash contract- will always be the prefix + contract_hash + .to_formatted_string() + .strip_prefix("contract-") + .unwrap(), + )? + } } - Ok(CCTLNetwork { working_dir, nodes }) + Ok(CCTLNetwork { + working_dir, + casper_nodes, + casper_sidecars, + }) } /// Get the deployed contract hash for a hash_name that was passed to new_contract /// https://docs.rs/casper-contract/latest/casper_contract/contract_api/storage/fn.new_contract.html @@ -255,7 +285,7 @@ impl Drop for CCTLNetwork { async fn deploy_contract( casper_node_rpc_url: &str, contract_deployer_skey: &SecretKey, - contract_deployer_pkey: &PublicKey, + contract_deployer_addr: &AccountHash, DeployableContract { hash_name, runtime_args, @@ -263,7 +293,7 @@ async fn deploy_contract( }: &DeployableContract, ) -> anyhow::Result<(String, ContractHash)> { tracing::info!( - "Deploying contract {}: {}", + "Deploying contract '{}': {}", &hash_name, path.to_str().unwrap() ); @@ -271,14 +301,14 @@ async fn deploy_contract( let casper_client_verbosity = casper_client_verbosity(); let contract_bytes = fs::read(path)?; - let contract = - ExecutableDeployItem::new_module_bytes(contract_bytes.into(), runtime_args.clone()); + let runtime_args = runtime_args.clone().unwrap_or(runtime_args! {}); + let contract = ExecutableDeployItem::new_module_bytes(contract_bytes.into(), runtime_args); let deploy = DeployBuilder::new( // TODO ideally make the chain-name configurable "cspr-dev-cctl", contract, - contract_deployer_skey, ) + .with_secret_key(contract_deployer_skey) .with_standard_payment(MAX_GAS_FEE_PAYMENT_AMOUNT) // max amount allowed to be used on gas fees .with_timestamp(Timestamp::now()) .with_ttl(TimeDiff::from_millis(60_000)) // 1 min @@ -324,15 +354,29 @@ async fn deploy_contract( _ => backoff::Error::permanent(anyhow!(err)), })?; - match response.result.execution_results.first() { - Some(result) => match &result.result { - ExecutionResult::Failure { error_message, .. } => { - Err(backoff::Error::permanent(anyhow!(error_message.clone()))) + match response.result.execution_info { + Some(execution_info) => match execution_info.execution_result { + Some(execution_result) => match &execution_result { + ExecutionResult::V1(execution_result_v1) => match execution_result_v1 { + ExecutionResultV1::Failure { error_message, .. } => { + Err(backoff::Error::permanent(anyhow!(error_message.clone()))) + } + ExecutionResultV1::Success { .. } => Ok(()), + } + ExecutionResult::V2(execution_result_v2) => match &execution_result_v2.error_message { + None => Ok(()), + Some(error_message) => Err(backoff::Error::permanent(anyhow!(error_message.clone()))) + } } - ExecutionResult::Success { .. } => Ok(()), + None if timed_out => Err(backoff::Error::permanent(anyhow!( + "Timeout on error: No execution result" + ))), + None => Err(backoff::Error::transient(anyhow!( + "No execution results there yet" + ))), }, None if timed_out => Err(backoff::Error::permanent(anyhow!( - "Timeout on error: No execution results" + "Timeout on error: No execution info" ))), None => Err(backoff::Error::transient(anyhow!( "No execution results there yet" @@ -359,34 +403,31 @@ async fn deploy_contract( .ok_or(anyhow!("No state root hash present in response")) })?; - let account = get_account( - JsonRpcId::Number(1), - casper_node_rpc_url, - casper_client_verbosity, - Option::None, - contract_deployer_pkey.clone(), - ) - .await - .map_err(Into::::into) - .map(|response| response.result.account)?; - - let account_key = Key::Account(*account.account_hash()); + tracing::info!("Querying global state"); let contract_hash: ContractHash = query_global_state( JsonRpcId::Number(1), casper_node_rpc_url, casper_client_verbosity, casper_client::rpcs::GlobalStateIdentifier::StateRootHash(state_root_hash), // fetches recent blocks state root hash - account_key, + Key::AddressableEntity(casper_types::EntityAddr::Account(contract_deployer_addr.0)), vec![hash_name.clone()], ) .await .map_err(Into::::into) .and_then(|response| match response.result.stored_value { + StoredValue::Package(package) => Ok(ContractHash::from( + package + .versions() + .contract_hashes() + .next() + .expect("") + .value(), + )), StoredValue::ContractPackage(contract_package) => Ok(*contract_package .versions() + .values() .next() - .expect("Expected at least one contract version") - .contract_hash()), + .expect("Expected at least one contract version")), other => Err(anyhow!( "Unexpected result type, type is not a CLValue: {:?}", other diff --git a/src/parsers.rs b/src/parsers.rs index b569931..a533f95 100644 --- a/src/parsers.rs +++ b/src/parsers.rs @@ -1,9 +1,9 @@ -use super::{CasperNodePorts, NodeState}; +use super::{CasperNodePorts, CasperSidecarPorts, NodeState}; use nom::{ branch::alt, bytes::complete::tag, - character::complete::{multispace0, not_line_ending, space1}, + character::complete::{line_ending, multispace0, not_line_ending, space1}, combinator::map, multi::separated_list0, sequence::tuple, @@ -17,7 +17,13 @@ pub fn parse_node_state(input: &str) -> IResult<&str, NodeState> { ))(input) } -pub fn parse_cctl_infra_net_start_line(input: &str) -> IResult<&str, (u8, u8, NodeState)> { +#[derive(Debug, PartialEq, Clone, Copy)] +pub enum RawNodeType { + CasperNode(u8, u8, NodeState), + CasperSidecar(u8, u8, NodeState), +} + +pub fn parse_node_line(input: &str) -> IResult<&str, RawNodeType> { let (remainder, (_, _, group_id, _, node_id, _, status, _)) = tuple(( multispace0, tag("validator-group-"), @@ -29,60 +35,89 @@ pub fn parse_cctl_infra_net_start_line(input: &str) -> IResult<&str, (u8, u8, No not_line_ending, ))(input)?; - Ok((remainder, (group_id, node_id, status))) + Ok(( + remainder, + RawNodeType::CasperNode(group_id, node_id, status), + )) } -pub fn parse_cctl_infra_net_start_lines(input: &str) -> IResult<&str, Vec<(u8, u8, NodeState)>> { +pub fn parse_sidecar_line(input: &str) -> IResult<&str, RawNodeType> { + let (remainder, (_, _, group_id, _, node_id, _, _, status, _)) = tuple(( + multispace0, + tag("validator-group-"), + nom::character::complete::u8, + tag(":cctl-node-"), + nom::character::complete::u8, + tag("-sidecar"), + space1, + parse_node_state, + not_line_ending, + ))(input)?; + + Ok(( + remainder, + RawNodeType::CasperSidecar(group_id, node_id, status), + )) +} + +pub fn parse_cctl_infra_net_start_line(input: &str) -> IResult<&str, RawNodeType> { + alt((parse_sidecar_line, parse_node_line))(input) +} + +pub fn parse_cctl_infra_net_start_lines(input: &str) -> IResult<&str, Vec> { let (remainder, _) = nom::bytes::complete::take_until("validator-group")(input)?; separated_list0(tag("\n"), parse_cctl_infra_net_start_line)(remainder) } -pub fn parse_cctl_infra_node_view_port_line(input: &str) -> IResult<&str, (u8, CasperNodePorts)> { - let ( - remainder, - ( - _, - _, - group_id, - _, - consensus_port, - _, - rpc_port, - _, - rest_port, - _, - sse_port, - _, - speculative_exec_port, - _, - ), - ) = tuple(( - nom::bytes::complete::take_until("node-"), - tag("node-"), +pub fn parse_cctl_infra_node_view_ports_node_id(input: &str) -> IResult<&str, u8> { + let (remainder, (_, _, node_id)) = tuple(( + nom::bytes::complete::take_until("NODE-"), + tag("NODE-"), nom::character::complete::u8, - tag(" -> CONSENSUS @ "), - nom::character::complete::u16, - tag(" :: RPC @ "), - nom::character::complete::u16, - tag(" :: REST @ "), - nom::character::complete::u16, - tag(" :: SSE @ "), - nom::character::complete::u16, - tag(" :: SPECULATIVE_EXEC @ "), - nom::character::complete::u16, - not_line_ending, ))(input)?; + Ok((remainder, node_id)) +} + +pub fn parse_cctl_infra_node_view_ports_port<'a>( + port_type: &'a str, +) -> impl Fn(&'a str) -> IResult<&'a str, u16> { + move |input: &str| { + let (remainder, (_, _, _, port)) = tuple(( + nom::bytes::complete::take_until(port_type), + nom::bytes::complete::take_until("-> "), + tag("-> "), + nom::character::complete::u16, + ))(input)?; + Ok((remainder, port)) + } +} + +pub fn parse_cctl_infra_node_view_port_section( + input: &str, +) -> IResult<&str, (u8, CasperNodePorts)> { + let (remainder, (node_id, _, protocol_port, _, binary_port, _, rest_port, _, sse_port, _)) = + tuple(( + parse_cctl_infra_node_view_ports_node_id, + line_ending, + parse_cctl_infra_node_view_ports_port("PROTOCOL"), + line_ending, + parse_cctl_infra_node_view_ports_port("BINARY"), + line_ending, + parse_cctl_infra_node_view_ports_port("REST"), + line_ending, + parse_cctl_infra_node_view_ports_port("SSE"), + not_line_ending, + ))(input)?; Ok(( remainder, ( - group_id, + node_id, CasperNodePorts { - consensus_port, - rpc_port, + protocol_port, + binary_port, rest_port, sse_port, - speculative_exec_port, }, ), )) @@ -91,135 +126,371 @@ pub fn parse_cctl_infra_node_view_port_line(input: &str) -> IResult<&str, (u8, C pub fn parse_cctl_infra_node_view_port_lines( input: &str, ) -> IResult<&str, Vec<(u8, CasperNodePorts)>> { - separated_list0(tag("\n"), parse_cctl_infra_node_view_port_line)(input) + separated_list0(tag("\n"), parse_cctl_infra_node_view_port_section)(input) +} + +pub fn parse_cctl_infra_sidecar_view_ports_node_id(input: &str) -> IResult<&str, u8> { + let (remainder, (_, _, sidecar_id)) = tuple(( + nom::bytes::complete::take_until("SIDECAR-"), + tag("SIDECAR-"), + nom::character::complete::u8, + ))(input)?; + Ok((remainder, sidecar_id)) +} + +pub fn parse_cctl_infra_sidecar_view_port_section( + input: &str, +) -> IResult<&str, (u8, CasperSidecarPorts)> { + let (remainder, (sidecar_id, _, node_client_port, _, rpc_port, _, speculative_exec_port, _)) = + tuple(( + parse_cctl_infra_sidecar_view_ports_node_id, + line_ending, + parse_cctl_infra_node_view_ports_port("NODE-CLIENT"), + line_ending, + parse_cctl_infra_node_view_ports_port("MAIN-RPC"), + line_ending, + parse_cctl_infra_node_view_ports_port("SPEC-EXEC"), + not_line_ending, + ))(input)?; + + Ok(( + remainder, + ( + sidecar_id, + CasperSidecarPorts { + node_client_port, + rpc_port, + speculative_exec_port, + }, + ), + )) +} + +pub fn parse_cctl_infra_sidecar_view_port_lines( + input: &str, +) -> IResult<&str, Vec<(u8, CasperSidecarPorts)>> { + separated_list0(tag("\n"), parse_cctl_infra_sidecar_view_port_section)(input) } #[cfg(test)] mod tests { use super::*; use anyhow::Error; + #[test] - fn test_parse_cctl_infra_net_start_line() -> Result<(), Error> { + fn test_parse_node_line() -> Result<(), Error> { let input = "validator-group-1:cctl-node-1 RUNNING pid 428229, uptime 0:09:06\n"; - let (_, parsed) = parse_cctl_infra_net_start_line(input)?; - Ok(assert_eq!((1, 1, NodeState::Running), parsed)) + let (_, parsed) = parse_node_line(input)?; + Ok(assert_eq!( + RawNodeType::CasperNode(1, 1, NodeState::Running), + parsed + )) + } + #[test] + fn test_parse_sidecar_line() -> Result<(), Error> { + let input = + "validator-group-1:cctl-node-1-sidecar RUNNING pid 626096, uptime 0:00:03\n"; + let (_, parsed) = parse_sidecar_line(input)?; + Ok(assert_eq!( + RawNodeType::CasperSidecar(1, 1, NodeState::Running), + parsed + )) } + #[test] fn test_parse_cctl_infra_net_start_lines() -> Result<(), Error> { let input = r#" - 2024-02-06T14:06:43.332420 [INFO] [431123] CCTL :: network spin up begins ... please wait - 2024-02-06T14:06:43.334599 [INFO] [431123] CCTL :: ... starting network - 2024-02-06T14:06:43.337054 [INFO] [431123] CCTL :: ... ... genesis bootstrap nodes - 2024-02-06T14:06:44.445527 [INFO] [431123] CCTL :: ... ... genesis non-bootstrap nodes - validator-group-1:cctl-node-1 RUNNING pid 428229, uptime 0:09:06 - validator-group-1:cctl-node-2 RUNNING pid 428230, uptime 0:09:06 - validator-group-1:cctl-node-3 RUNNING pid 428231, uptime 0:09:06 - validator-group-2:cctl-node-4 RUNNING pid 428296, uptime 0:09:05 - validator-group-2:cctl-node-5 RUNNING pid 428297, uptime 0:09:05 - validator-group-3:cctl-node-10 STOPPED Not started - validator-group-3:cctl-node-6 STOPPED Not started - validator-group-3:cctl-node-7 STOPPED Not started - validator-group-3:cctl-node-8 STOPPED Not started - validator-group-3:cctl-node-9 STOPPED Not started + 2024-08-30T17:15:10.262713 [INFO] [626072] CCTL :: --------------------------------------------------------------------------------- + 2024-08-30T17:15:10.265112 [INFO] [626072] CCTL :: Network start begins + 2024-08-30T17:15:10.268196 [INFO] [626072] CCTL :: --------------------------------------------------------------------------------- + 2024-08-30T17:15:12.583839 [INFO] [626072] CCTL :: Daemon supervisor -> started + 2024-08-30T17:15:13.801089 [INFO] [626072] CCTL :: Genesis bootstrap nodes -> started + 2024-08-30T17:15:14.966443 [INFO] [626072] CCTL :: Genesis non-bootstrap nodes -> started + validator-group-1:cctl-node-1 RUNNING pid 626095, uptime 0:00:03 + validator-group-1:cctl-node-1-sidecar RUNNING pid 626096, uptime 0:00:03 + validator-group-1:cctl-node-2 RUNNING pid 626097, uptime 0:00:03 + validator-group-1:cctl-node-2-sidecar RUNNING pid 626098, uptime 0:00:03 + validator-group-1:cctl-node-3 RUNNING pid 626101, uptime 0:00:03 + validator-group-1:cctl-node-3-sidecar RUNNING pid 626102, uptime 0:00:03 + validator-group-2:cctl-node-4 RUNNING pid 626285, uptime 0:00:02 + validator-group-2:cctl-node-4-sidecar RUNNING pid 626286, uptime 0:00:02 + validator-group-2:cctl-node-5 RUNNING pid 626287, uptime 0:00:02 + validator-group-2:cctl-node-5-sidecar RUNNING pid 626288, uptime 0:00:02 + validator-group-3:cctl-node-10 STOPPED Not started + validator-group-3:cctl-node-10-sidecar STOPPED Not started + validator-group-3:cctl-node-6 STOPPED Not started + validator-group-3:cctl-node-6-sidecar STOPPED Not started + validator-group-3:cctl-node-7 STOPPED Not started + validator-group-3:cctl-node-7-sidecar STOPPED Not started + validator-group-3:cctl-node-8 STOPPED Not started + validator-group-3:cctl-node-8-sidecar STOPPED Not started + validator-group-3:cctl-node-9 STOPPED Not started + validator-group-3:cctl-node-9-sidecar STOPPED Not started + 2024-08-30T17:15:15.108318 [INFO] [626072] CCTL :: --------------------------------------------------------------------------------- + 2024-08-30T17:15:15.110310 [INFO] [626072] CCTL :: Network start ends + 2024-08-30T17:15:15.112531 [INFO] [626072] CCTL :: --------------------------------------------------------------------------------- "#; let (_, parsed) = parse_cctl_infra_net_start_lines(input)?; let expected = vec![ - (1, 1, NodeState::Running), - (1, 2, NodeState::Running), - (1, 3, NodeState::Running), - (2, 4, NodeState::Running), - (2, 5, NodeState::Running), - (3, 10, NodeState::Stopped), - (3, 6, NodeState::Stopped), - (3, 7, NodeState::Stopped), - (3, 8, NodeState::Stopped), - (3, 9, NodeState::Stopped), + RawNodeType::CasperNode(1, 1, NodeState::Running), + RawNodeType::CasperSidecar(1, 1, NodeState::Running), + RawNodeType::CasperNode(1, 2, NodeState::Running), + RawNodeType::CasperSidecar(1, 2, NodeState::Running), + RawNodeType::CasperNode(1, 3, NodeState::Running), + RawNodeType::CasperSidecar(1, 3, NodeState::Running), + RawNodeType::CasperNode(2, 4, NodeState::Running), + RawNodeType::CasperSidecar(2, 4, NodeState::Running), + RawNodeType::CasperNode(2, 5, NodeState::Running), + RawNodeType::CasperSidecar(2, 5, NodeState::Running), + RawNodeType::CasperNode(3, 10, NodeState::Stopped), + RawNodeType::CasperSidecar(3, 10, NodeState::Stopped), + RawNodeType::CasperNode(3, 6, NodeState::Stopped), + RawNodeType::CasperSidecar(3, 6, NodeState::Stopped), + RawNodeType::CasperNode(3, 7, NodeState::Stopped), + RawNodeType::CasperSidecar(3, 7, NodeState::Stopped), + RawNodeType::CasperNode(3, 8, NodeState::Stopped), + RawNodeType::CasperSidecar(3, 8, NodeState::Stopped), + RawNodeType::CasperNode(3, 9, NodeState::Stopped), + RawNodeType::CasperSidecar(3, 9, NodeState::Stopped), ]; Ok(assert_eq!(expected, parsed)) } + + #[test] + fn test_parse_cctl_infra_node_view_ports_node_id() -> Result<(), Error> { + let input = "2024-09-02T08:44:46.871632 [INFO] [124520] CCTL :: NODE-1"; + let (_, parsed) = parse_cctl_infra_node_view_ports_node_id(input)?; + Ok(assert_eq!(1, parsed)) + } + + #[test] + fn test_parse_cctl_infra_node_view_ports_protocol() -> Result<(), Error> { + let input = "2024-09-02T08:44:46.874259 [INFO] [124520] CCTL :: PROTOCOL ----> 11101"; + let (_, parsed) = parse_cctl_infra_node_view_ports_port("PROTOCOL")(input)?; + Ok(assert_eq!(11101, parsed)) + } + + #[test] + fn test_parse_cctl_infra_node_view_ports_binary() -> Result<(), Error> { + let input = "2024-09-02T08:44:46.876701 [INFO] [124520] CCTL :: BINARY ------> 12101"; + let (_, parsed) = parse_cctl_infra_node_view_ports_port("BINARY")(input)?; + Ok(assert_eq!(12101, parsed)) + } + #[test] - fn test_parse_cctl_infra_node_view_port_line() -> Result<(), Error> { - let input = "2024-02-06T17:28:10.731821 [INFO] [514427] CCTL :: node-1 -> CONSENSUS @ 22101 :: RPC @ 11101 :: REST @ 14101 :: SSE @ 18101 :: SPECULATIVE_EXEC @ 25101"; - let (_, parsed) = parse_cctl_infra_node_view_port_line(input)?; + fn test_parse_cctl_infra_node_view_ports_rest() -> Result<(), Error> { + let input = "2024-09-02T08:44:46.879103 [INFO] [124520] CCTL :: REST --------> 13101"; + let (_, parsed) = parse_cctl_infra_node_view_ports_port("REST")(input)?; + Ok(assert_eq!(13101, parsed)) + } + + #[test] + fn test_parse_cctl_infra_node_view_ports_sse() -> Result<(), Error> { + let input = "2024-09-02T08:44:46.881573 [INFO] [124520] CCTL :: SSE ---------> 14101"; + let (_, parsed) = parse_cctl_infra_node_view_ports_port("SSE")(input)?; + Ok(assert_eq!(14101, parsed)) + } + + #[test] + fn test_parse_cctl_infra_node_view_port_node() -> Result<(), Error> { + let input = r#" + 2024-09-02T08:44:46.871632 [INFO] [124520] CCTL :: NODE-1 + 2024-09-02T08:44:46.874259 [INFO] [124520] CCTL :: PROTOCOL ----> 11101 + 2024-09-02T08:44:46.876701 [INFO] [124520] CCTL :: BINARY ------> 12101 + 2024-09-02T08:44:46.879103 [INFO] [124520] CCTL :: REST --------> 13101 + 2024-09-02T08:44:46.881573 [INFO] [124520] CCTL :: SSE ---------> 14101 + 2024-09-02T08:44:46.883303 [INFO] [124520] CCTL :: ------------------------------------------------------------------------------------------------------ + "#; + let (_, parsed) = parse_cctl_infra_node_view_port_section(input)?; Ok(assert_eq!( ( 1, CasperNodePorts { - consensus_port: 22101, - rpc_port: 11101, - rest_port: 14101, - sse_port: 18101, - speculative_exec_port: 25101 + protocol_port: 11101, + binary_port: 12101, + rest_port: 13101, + sse_port: 14101, } ), parsed )) } + #[test] fn test_parse_cctl_infra_node_view_port_lines() -> Result<(), Error> { let input = r#" - 2024-02-06T17:28:10.728367 [INFO] [514427] CCTL :: ------------------------------------------------------------------------------------------------------ - 2024-02-06T17:28:10.731821 [INFO] [514427] CCTL :: node-1 -> CONSENSUS @ 22101 :: RPC @ 11101 :: REST @ 14101 :: SSE @ 18101 :: SPECULATIVE_EXEC @ 25101 - 2024-02-06T17:28:10.732997 [INFO] [514427] CCTL :: ------------------------------------------------------------------------------------------------------ - 2024-02-06T17:28:10.737211 [INFO] [514427] CCTL :: node-2 -> CONSENSUS @ 22102 :: RPC @ 11102 :: REST @ 14102 :: SSE @ 18102 :: SPECULATIVE_EXEC @ 25102 - 2024-02-06T17:28:10.738952 [INFO] [514427] CCTL :: ------------------------------------------------------------------------------------------------------ - 2024-02-06T17:28:10.742946 [INFO] [514427] CCTL :: node-3 -> CONSENSUS @ 22103 :: RPC @ 11103 :: REST @ 14103 :: SSE @ 18103 :: SPECULATIVE_EXEC @ 25103 - 2024-02-06T17:28:10.744218 [INFO] [514427] CCTL :: ------------------------------------------------------------------------------------------------------ - 2024-02-06T17:28:10.748632 [INFO] [514427] CCTL :: node-4 -> CONSENSUS @ 22104 :: RPC @ 11104 :: REST @ 14104 :: SSE @ 18104 :: SPECULATIVE_EXEC @ 25104 - 2024-02-06T17:28:10.749922 [INFO] [514427] CCTL :: ------------------------------------------------------------------------------------------------------ - 2024-02-06T17:28:10.754162 [INFO] [514427] CCTL :: node-5 -> CONSENSUS @ 22105 :: RPC @ 11105 :: REST @ 14105 :: SSE @ 18105 :: SPECULATIVE_EXEC @ 25105 - 2024-02-06T17:28:10.755567 [INFO] [514427] CCTL :: ------------------------------------------------------------------------------------------------------ + 2024-09-02T08:44:46.865013 [INFO] [124520] CCTL :: ------------------------------------------------------------------------------------------------------ + 2024-09-02T08:44:46.871632 [INFO] [124520] CCTL :: NODE-1 + 2024-09-02T08:44:46.874259 [INFO] [124520] CCTL :: PROTOCOL ----> 11101 + 2024-09-02T08:44:46.876701 [INFO] [124520] CCTL :: BINARY ------> 12101 + 2024-09-02T08:44:46.879103 [INFO] [124520] CCTL :: REST --------> 13101 + 2024-09-02T08:44:46.881573 [INFO] [124520] CCTL :: SSE ---------> 14101 + 2024-09-02T08:44:46.883303 [INFO] [124520] CCTL :: ------------------------------------------------------------------------------------------------------ + 2024-09-02T08:44:46.889475 [INFO] [124520] CCTL :: NODE-2 + 2024-09-02T08:44:46.891804 [INFO] [124520] CCTL :: PROTOCOL ----> 11102 + 2024-09-02T08:44:46.894156 [INFO] [124520] CCTL :: BINARY ------> 12102 + 2024-09-02T08:44:46.896950 [INFO] [124520] CCTL :: REST --------> 13102 + 2024-09-02T08:44:46.899175 [INFO] [124520] CCTL :: SSE ---------> 14102 + 2024-09-02T08:44:46.901358 [INFO] [124520] CCTL :: ------------------------------------------------------------------------------------------------------ + 2024-09-02T08:44:46.906934 [INFO] [124520] CCTL :: NODE-3 + 2024-09-02T08:44:46.909238 [INFO] [124520] CCTL :: PROTOCOL ----> 11103 + 2024-09-02T08:44:46.911518 [INFO] [124520] CCTL :: BINARY ------> 12103 + 2024-09-02T08:44:46.913895 [INFO] [124520] CCTL :: REST --------> 13103 + 2024-09-02T08:44:46.916383 [INFO] [124520] CCTL :: SSE ---------> 14103 + 2024-09-02T08:44:46.918830 [INFO] [124520] CCTL :: ------------------------------------------------------------------------------------------------------ + 2024-09-02T08:44:46.925381 [INFO] [124520] CCTL :: NODE-4 + 2024-09-02T08:44:46.927266 [INFO] [124520] CCTL :: PROTOCOL ----> 11104 + 2024-09-02T08:44:46.929719 [INFO] [124520] CCTL :: BINARY ------> 12104 + 2024-09-02T08:44:46.932628 [INFO] [124520] CCTL :: REST --------> 13104 + 2024-09-02T08:44:46.934868 [INFO] [124520] CCTL :: SSE ---------> 14104 + 2024-09-02T08:44:46.937664 [INFO] [124520] CCTL :: ------------------------------------------------------------------------------------------------------ + 2024-09-02T08:44:46.943128 [INFO] [124520] CCTL :: NODE-5 + 2024-09-02T08:44:46.945253 [INFO] [124520] CCTL :: PROTOCOL ----> 11105 + 2024-09-02T08:44:46.947316 [INFO] [124520] CCTL :: BINARY ------> 12105 + 2024-09-02T08:44:46.949464 [INFO] [124520] CCTL :: REST --------> 13105 + 2024-09-02T08:44:46.951770 [INFO] [124520] CCTL :: SSE ---------> 14105 + 2024-09-02T08:44:46.954542 [INFO] [124520] CCTL :: ------------------------------------------------------------------------------------------------------ "#; let (_, parsed) = parse_cctl_infra_node_view_port_lines(input)?; let expected = vec![ ( 1, CasperNodePorts { - consensus_port: 22101, - rpc_port: 11101, - rest_port: 14101, - sse_port: 18101, - speculative_exec_port: 25101, + protocol_port: 11101, + binary_port: 12101, + rest_port: 13101, + sse_port: 14101, }, ), ( 2, CasperNodePorts { - consensus_port: 22102, - rpc_port: 11102, - rest_port: 14102, - sse_port: 18102, - speculative_exec_port: 25102, + protocol_port: 11102, + binary_port: 12102, + rest_port: 13102, + sse_port: 14102, }, ), ( 3, CasperNodePorts { - consensus_port: 22103, - rpc_port: 11103, - rest_port: 14103, - sse_port: 18103, - speculative_exec_port: 25103, + protocol_port: 11103, + binary_port: 12103, + rest_port: 13103, + sse_port: 14103, }, ), ( 4, CasperNodePorts { - consensus_port: 22104, - rpc_port: 11104, - rest_port: 14104, - sse_port: 18104, - speculative_exec_port: 25104, + protocol_port: 11104, + binary_port: 12104, + rest_port: 13104, + sse_port: 14104, }, ), ( 5, CasperNodePorts { - consensus_port: 22105, - rpc_port: 11105, - rest_port: 14105, - sse_port: 18105, - speculative_exec_port: 25105, + protocol_port: 11105, + binary_port: 12105, + rest_port: 13105, + sse_port: 14105, + }, + ), + ]; + Ok(assert_eq!(expected, parsed)) + } + + #[test] + fn test_parse_cctl_infra_sidecar_view_port_node() -> Result<(), Error> { + let input = r#" + 2024-09-02T09:49:32.804362 [INFO] [194431] CCTL :: SIDECAR-1 + 2024-09-02T09:49:32.807243 [INFO] [194431] CCTL :: NODE-CLIENT -> 12101 + 2024-09-02T09:49:32.809625 [INFO] [194431] CCTL :: MAIN-RPC ----> 21101 + 2024-09-02T09:49:32.811288 [INFO] [194431] CCTL :: SPEC-EXEC ---> 22101 + "#; + let (_, parsed) = parse_cctl_infra_sidecar_view_port_section(input)?; + Ok(assert_eq!( + ( + 1, + CasperSidecarPorts { + node_client_port: 12101, + rpc_port: 21101, + speculative_exec_port: 22101, + } + ), + parsed + )) + } + + #[test] + fn test_parse_cctl_infra_sidecar_view_port_lines() -> Result<(), Error> { + let input = r#" + 2024-09-02T09:49:32.792987 [INFO] [194431] CCTL :: ------------------------------------------------------------------------------------------------------ + 2024-09-02T09:49:32.794753 [INFO] [194431] CCTL :: SIDECAR PORTS + 2024-09-02T09:49:32.796968 [INFO] [194431] CCTL :: ------------------------------------------------------------------------------------------------------ + 2024-09-02T09:49:32.804362 [INFO] [194431] CCTL :: SIDECAR-1 + 2024-09-02T09:49:32.807243 [INFO] [194431] CCTL :: NODE-CLIENT -> 12101 + 2024-09-02T09:49:32.809625 [INFO] [194431] CCTL :: MAIN-RPC ----> 21101 + 2024-09-02T09:49:32.811288 [INFO] [194431] CCTL :: SPEC-EXEC ---> 22101 + 2024-09-02T09:49:32.816160 [INFO] [194431] CCTL :: SIDECAR-2 + 2024-09-02T09:49:32.818236 [INFO] [194431] CCTL :: NODE-CLIENT -> 12102 + 2024-09-02T09:49:32.820258 [INFO] [194431] CCTL :: MAIN-RPC ----> 21102 + 2024-09-02T09:49:32.822750 [INFO] [194431] CCTL :: SPEC-EXEC ---> 22102 + 2024-09-02T09:49:32.827580 [INFO] [194431] CCTL :: SIDECAR-3 + 2024-09-02T09:49:32.829656 [INFO] [194431] CCTL :: NODE-CLIENT -> 12103 + 2024-09-02T09:49:32.831461 [INFO] [194431] CCTL :: MAIN-RPC ----> 21103 + 2024-09-02T09:49:32.833187 [INFO] [194431] CCTL :: SPEC-EXEC ---> 22103 + 2024-09-02T09:49:32.837294 [INFO] [194431] CCTL :: SIDECAR-4 + 2024-09-02T09:49:32.839495 [INFO] [194431] CCTL :: NODE-CLIENT -> 12104 + 2024-09-02T09:49:32.841550 [INFO] [194431] CCTL :: MAIN-RPC ----> 21104 + 2024-09-02T09:49:32.843292 [INFO] [194431] CCTL :: SPEC-EXEC ---> 22104 + 2024-09-02T09:49:32.847555 [INFO] [194431] CCTL :: SIDECAR-5 + 2024-09-02T09:49:32.849820 [INFO] [194431] CCTL :: NODE-CLIENT -> 12105 + 2024-09-02T09:49:32.852074 [INFO] [194431] CCTL :: MAIN-RPC ----> 21105 + 2024-09-02T09:49:32.853727 [INFO] [194431] CCTL :: SPEC-EXEC ---> 22105 + "#; + let (_, parsed) = parse_cctl_infra_sidecar_view_port_lines(input)?; + let expected = vec![ + ( + 1, + CasperSidecarPorts { + node_client_port: 12101, + rpc_port: 21101, + speculative_exec_port: 22101, + }, + ), + ( + 2, + CasperSidecarPorts { + node_client_port: 12102, + rpc_port: 21102, + speculative_exec_port: 22102, + }, + ), + ( + 3, + CasperSidecarPorts { + node_client_port: 12103, + rpc_port: 21103, + speculative_exec_port: 22103, + }, + ), + ( + 4, + CasperSidecarPorts { + node_client_port: 12104, + rpc_port: 21104, + speculative_exec_port: 22104, + }, + ), + ( + 5, + CasperSidecarPorts { + node_client_port: 12105, + rpc_port: 21105, + speculative_exec_port: 22105, }, ), ]; diff --git a/test-resources/demo-contract-optimized.wasm b/test-resources/demo-contract-optimized.wasm deleted file mode 100644 index 2d382b6..0000000 Binary files a/test-resources/demo-contract-optimized.wasm and /dev/null differ diff --git a/test-resources/dummy-contract.wasm b/test-resources/dummy-contract.wasm new file mode 100644 index 0000000..256131f Binary files /dev/null and b/test-resources/dummy-contract.wasm differ diff --git a/tests/test_cctl_deploys_a_contract_successfully.rs b/tests/test_cctl_deploys_a_contract_successfully.rs index 92f7e48..59b7d6b 100644 --- a/tests/test_cctl_deploys_a_contract_successfully.rs +++ b/tests/test_cctl_deploys_a_contract_successfully.rs @@ -4,7 +4,7 @@ use std::fs; use std::path::PathBuf; use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter}; -use casper_types::{runtime_args, ContractHash, RuntimeArgs}; +use casper_types::contracts::ContractHash; use cctl::{CCTLNetwork, DeployableContract}; fn tracing_init() { @@ -18,16 +18,16 @@ fn tracing_init() { async fn test_cctl_deploys_a_contract_successfully() { tracing_init(); - let contract_wasm_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")) - .join("test-resources/demo-contract-optimized.wasm"); - let hash_name = "kairos_contract_package_hash"; + let contract_wasm_path = + PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("test-resources/dummy-contract.wasm"); + let hash_name = "contract-hash"; let contract_to_deploy = DeployableContract { hash_name: hash_name.to_string(), - runtime_args: runtime_args! { "initial_trie_root" => Option::<[u8; 32]>::None }, + runtime_args: None, path: contract_wasm_path, }; - let network = CCTLNetwork::run(None, Some(contract_to_deploy), None, None) + let network = CCTLNetwork::run(None, Some(vec![contract_to_deploy]), None, None) .await .unwrap(); let expected_contract_hash_path = network.working_dir.join("contracts").join(hash_name); diff --git a/tests/test_cctl_network_starts_and_terminates.rs b/tests/test_cctl_network_starts_and_terminates.rs index bca3458..2cd9ad7 100644 --- a/tests/test_cctl_network_starts_and_terminates.rs +++ b/tests/test_cctl_network_starts_and_terminates.rs @@ -1,6 +1,6 @@ use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter}; -use casper_client::{get_node_status, rpcs::results::ReactorState, JsonRpcId, Verbosity}; +use casper_client::{get_peers, JsonRpcId, Verbosity}; use cctl::{CCTLNetwork, NodeState}; fn tracing_init() { @@ -16,16 +16,24 @@ async fn test_cctl_network_starts_and_terminates() { let network = CCTLNetwork::run(None, None, None, None).await.unwrap(); - for node in &network.nodes { + for node in &network.casper_sidecars { if node.state == NodeState::Running { - let node_status = get_node_status( + // FIXME: getting the status is currently broken beteen sidecar <-> node + // let response = get_node_status( + // JsonRpcId::Number(1), + // &format!("http://0.0.0.0:{}/rpc", node.port.rpc_port), + // ) + // .await + // .unwrap(); + // assert_eq!(response.result.reactor_state, ReactorState::Validate); + let response = get_peers( JsonRpcId::Number(1), - &format!("http://0.0.0.0:{}", node.port.rpc_port), + &format!("http://0.0.0.0:{}/rpc", node.port.rpc_port), Verbosity::High, ) .await .unwrap(); - assert_eq!(node_status.result.reactor_state, ReactorState::Validate); + assert!(!response.result.peers.is_empty()); } } }