From 58a376fca1b51b1cbacb32b89c65fdfcc20a270f Mon Sep 17 00:00:00 2001 From: Diwaker Gupta <15990+diwakergupta@users.noreply.github.com> Date: Wed, 22 Feb 2023 14:44:25 -0500 Subject: [PATCH 01/17] chore: delete circle.yml CircleCI hasn't been used in 11+ months. Fixes #3072 --- circle.yml | 76 ------------------------------------------------------ 1 file changed, 76 deletions(-) delete mode 100644 circle.yml diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 131712a04a..0000000000 --- a/circle.yml +++ /dev/null @@ -1,76 +0,0 @@ -version: 2.1 -executors: - docker-publisher: - docker: - - image: circleci/buildpack-deps:stretch -jobs: - test_demo: - working_directory: /test - docker: - - image: rust:1.45-stretch - steps: - - checkout - - run: - command: | - cargo build - - run: - command: | - ./target/debug/stacks-inspect local initialize db && - ./target/debug/stacks-inspect local check sample-contracts/tokens.clar db && - ./target/debug/stacks-inspect local launch S1G2081040G2081040G2081040G208105NK8PE5.tokens sample-contracts/tokens.clar db && - ./target/debug/stacks-inspect local check sample-contracts/names.clar db && - ./target/debug/stacks-inspect local launch S1G2081040G2081040G2081040G208105NK8PE5.names sample-contracts/names.clar db && - ./target/debug/stacks-inspect local execute db S1G2081040G2081040G2081040G208105NK8PE5.tokens mint! SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR u100000 - - run: - command: | - echo "(get-balance 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR)" | ./target/debug/stacks-inspect local eval S1G2081040G2081040G2081040G208105NK8PE5.tokens db - unit_tests_with_cov: - machine: true - working_directory: ~/blockstack - steps: - - checkout - - run: - name: Coverage via tarpaulin - command: | - docker run --security-opt seccomp=unconfined -v "${PWD}:/volume" xd009642/tarpaulin \ - bash -c "cargo tarpaulin -v --workspace -t 300 -o Xml" - no_output_timeout: 200m - - run: - name: Upload to codecov.io - command: | - bash <(curl -s https://codecov.io/bash) - unit_tests: - docker: - - image: rust:1.40-stretch - working_directory: ~/blockstack - steps: - - checkout - - run: - no_output_timeout: 200m - command: | - cargo test -j 1 --workspace --exclude clarity - all_tests: - docker: - - image: rust:1.40-stretch - working_directory: ~/blockstack - steps: - - checkout - - run: - no_output_timeout: 200m - command: | - cargo test --workspace && cargo test -- --ignored --test-threads 1 -workflows: - version: 2 - test: - jobs: - - unit_tests - - test_demo -# disable `all_tests` for now, because the circle builder -# OOMs on compile... -# - all_tests: -# filters: -# branches: -# only: -# - master -# - /.*net.*/ -# - /.*marf.*/ From 5a4681758af36ae05aa7e33e745f51c089c34b76 Mon Sep 17 00:00:00 2001 From: Stjepan Golemac Date: Fri, 24 Feb 2023 09:22:04 +0100 Subject: [PATCH 02/17] fix: Exclude benchmarks from compilation --- Cargo.lock | 1203 ++++++++++------- Cargo.toml | 6 + ...block_limits.rs => block_limits.rs.backup} | 0 benches/{c32_bench.rs => c32_bench.rs.backup} | 0 ...ench.rs => large_contract_bench.rs.backup} | 0 .../{marf_bench.rs => marf_bench.rs.backup} | 0 6 files changed, 716 insertions(+), 493 deletions(-) rename benches/{block_limits.rs => block_limits.rs.backup} (100%) rename benches/{c32_bench.rs => c32_bench.rs.backup} (100%) rename benches/{large_contract_bench.rs => large_contract_bench.rs.backup} (100%) rename benches/{marf_bench.rs => marf_bench.rs.backup} (100%) diff --git a/Cargo.lock b/Cargo.lock index 4aa1ca1c4a..5f4e37fb49 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.17.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" dependencies = [ "gimli", ] @@ -29,7 +29,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", ] [[package]] @@ -85,18 +85,27 @@ checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" [[package]] name = "aho-corasick" -version = "0.7.18" +version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" dependencies = [ "memchr", ] +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "anyhow" -version = "1.0.53" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0" +checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" [[package]] name = "assert-json-diff" @@ -121,9 +130,9 @@ dependencies = [ [[package]] name = "async-channel" -version = "1.6.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" +checksum = "cf46fee83e5ccffc220104713af3292ff9bc7c64c7de289f66dae8e38d826833" dependencies = [ "concurrent-queue", "event-listener", @@ -142,31 +151,30 @@ dependencies = [ [[package]] name = "async-executor" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" +checksum = "17adb73da160dfb475c183343c8cccd80721ea5a605d3eb57125f0a7b7a92d0b" dependencies = [ + "async-lock", "async-task", "concurrent-queue", "fastrand", "futures-lite", - "once_cell", "slab", ] [[package]] name = "async-global-executor" -version = "2.0.2" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9586ec52317f36de58453159d48351bc244bc24ced3effc1fce22f3d48664af6" +checksum = "f1b6f5d7df27bd294849f8eec66ecfc63d11814df7a4f5d74168a2394467b776" dependencies = [ "async-channel", "async-executor", "async-io", - "async-mutex", + "async-lock", "blocking", "futures-lite", - "num_cpus", "once_cell", ] @@ -188,46 +196,39 @@ dependencies = [ [[package]] name = "async-io" -version = "1.6.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a811e6a479f2439f0c04038796b5cfb3d2ad56c230e0f2d3f7b04d68cfee607b" +checksum = "8c374dda1ed3e7d8f0d9ba58715f924862c63eae6849c92d3a18e7fbde9e2794" dependencies = [ + "async-lock", + "autocfg", "concurrent-queue", "futures-lite", "libc", "log", - "once_cell", "parking", "polling", "slab", "socket2", "waker-fn", - "winapi 0.3.9", + "windows-sys 0.42.0", ] [[package]] name = "async-lock" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6a8ea61bf9947a1007c5cada31e647dbc77b103c679858150003ba697ea798b" -dependencies = [ - "event-listener", -] - -[[package]] -name = "async-mutex" -version = "1.4.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479db852db25d9dbf6204e6cb6253698f175c15726470f78af0d918e99d6156e" +checksum = "c8101efe8695a6c17e02911402145357e718ac92d3ff88ae8419e84b1707b685" dependencies = [ "event-listener", + "futures-lite", ] [[package]] name = "async-std" -version = "1.10.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8056f1455169ab86dd47b47391e4ab0cbd25410a70e9fe675544f49bafaf952" +checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" dependencies = [ "async-attributes", "async-channel", @@ -243,7 +244,6 @@ dependencies = [ "kv-log-macro", "log", "memchr", - "num_cpus", "once_cell", "pin-project-lite", "pin-utils", @@ -253,15 +253,15 @@ dependencies = [ [[package]] name = "async-task" -version = "4.1.0" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d306121baf53310a3fd342d88dc0824f6bbeace68347593658525565abee8" +checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524" [[package]] name = "atomic-waker" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" +checksum = "debc29dde2e69f9e47506b525f639ed42300fc014a3e007832592448fa8e4599" [[package]] name = "atty" @@ -269,22 +269,22 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi 0.3.9", ] [[package]] name = "autocfg" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.64" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e121dee8023ce33ab248d9ce1493df03c3b38a659b240096fcbd7048ff9c31f" +checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" dependencies = [ "addr2line", "cc", @@ -297,9 +297,9 @@ dependencies = [ [[package]] name = "base-x" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" +checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" [[package]] name = "base64" @@ -309,9 +309,15 @@ checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" [[package]] name = "base64" -version = "0.13.0" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" [[package]] name = "bitflags" @@ -337,16 +343,16 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", ] [[package]] name = "block-buffer" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", ] [[package]] @@ -360,16 +366,16 @@ dependencies = [ [[package]] name = "blocking" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046e47d4b2d391b1f6f8b407b1deb8dee56c1852ccd868becf2710f601b5f427" +checksum = "3c67b173a56acffd6d2326fb7ab938ba0b00a71480e14902b2591c87bc5741e8" dependencies = [ "async-channel", + "async-lock", "async-task", "atomic-waker", "fastrand", "futures-lite", - "once_cell", ] [[package]] @@ -396,12 +402,12 @@ dependencies = [ "rstest", "rstest_reuse", "rusqlite", - "secp256k1 0.24.2", + "secp256k1 0.24.3", "serde", "serde_derive", "serde_json", "serde_stacker", - "sha2 0.10.2", + "sha2 0.10.6", "sha3", "siphasher", "slog", @@ -415,18 +421,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "bstr" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" -dependencies = [ - "lazy_static", - "memchr", - "regex-automata", - "serde", -] - [[package]] name = "buf_redux" version = "0.8.4" @@ -439,9 +433,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.9.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" +checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" [[package]] name = "byte-tools" @@ -457,30 +451,21 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" - -[[package]] -name = "cache-padded" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "cast" -version = "0.2.7" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c24dab4283a142afa2fdca129b80ad2c6284e073930f964c3a1293c225ee39a" -dependencies = [ - "rustc_version 0.4.0", -] +checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.0.72" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" [[package]] name = "cfg-if" @@ -496,14 +481,16 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.19" +version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" dependencies = [ - "libc", + "iana-time-zone", + "js-sys", "num-integer", "num-traits", - "time 0.1.44", + "time 0.1.45", + "wasm-bindgen", "winapi 0.3.9", ] @@ -513,7 +500,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", ] [[package]] @@ -552,20 +539,30 @@ dependencies = [ [[package]] name = "clear_on_drop" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9cc5db465b294c3fa986d5bbb0f3017cd850bff6dd6c52f9ccff8b4d21b7b08" +checksum = "38508a63f4979f0048febc9966fadbd48e5dab31fd0ec6a3f151bbf4a74f7423" dependencies = [ "cc", ] +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + [[package]] name = "concurrent-queue" -version = "1.2.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" +checksum = "c278839b831783b70278b14df4d45e1beb1aad306c07bb796637de9a0e323e8e" dependencies = [ - "cache-padded", + "crossbeam-utils", ] [[package]] @@ -581,21 +578,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03a5d7b21829bc7b4bf4754a978a241ae54ea55a40f92bb20216e54096f4b951" dependencies = [ "aes-gcm", - "base64 0.13.0", + "base64 0.13.1", "hkdf", "hmac", "percent-encoding", - "rand 0.8.4", + "rand 0.8.5", "sha2 0.9.9", "time 0.2.27", "version_check", ] +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + [[package]] name = "cpufeatures" -version = "0.2.1" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" dependencies = [ "libc", ] @@ -608,18 +611,18 @@ checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" [[package]] name = "crc32fast" -version = "1.3.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2209c310e29876f7f0b2721e7e26b84aff178aa3da5d091f9bfbf47669e60e3" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ "cfg-if 1.0.0", ] [[package]] name = "criterion" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1604dafd25fba2fe2d5895a9da139f8dc9b319a5fe5354ca137cbbce4e178d10" +checksum = "b01d6de93b2b6c65e17c634a26653a29d107b3c98c607c765bf38d041531cd8f" dependencies = [ "atty", "cast", @@ -643,9 +646,9 @@ dependencies = [ [[package]] name = "criterion-plot" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d00996de9f2f7559f7f4dc286073197f83e92256a59ed395f9aac01fe717da57" +checksum = "2673cc8207403546f45f5fd319a974b1e6983ad1a3ee7e6041650013be041876" dependencies = [ "cast", "itertools", @@ -653,9 +656,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.2" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e54ea8bc3fb1ee042f5aace6e3c6e025d3874866da222930f70ce62aceba0bfa" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", @@ -663,9 +666,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" dependencies = [ "cfg-if 1.0.0", "crossbeam-epoch", @@ -674,34 +677,33 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.7" +version = "0.9.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c00d6d2ea26e8b151d99093005cb442fb9a37aeaca582a03ec70946f49ab5ed9" +checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" dependencies = [ + "autocfg", "cfg-if 1.0.0", "crossbeam-utils", - "lazy_static", - "memoffset", + "memoffset 0.7.1", "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.7" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e5bed1f1c269533fa816a0a5492b3545209a205ca1a54842be180eb63a16a6" +checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" dependencies = [ "cfg-if 1.0.0", - "lazy_static", ] [[package]] name = "crypto-common" -version = "0.1.3" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57952ca27b5e3606ff4dd79b0020231aaf9d6aa76dc05fd30137538c50bd3ce8" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", "typenum", ] @@ -711,19 +713,18 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bff07008ec701e8028e2ceb8f83f0e4274ee62bd2dbdc4fefff2e9a91824081a" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", "subtle", ] [[package]] name = "csv" -version = "1.1.6" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1" +checksum = "af91f40b7355f82b0a891f50e70399475945bb0b0da4f1700ce60761c9d3e359" dependencies = [ - "bstr", "csv-core", - "itoa 0.4.8", + "itoa", "ryu", "serde", ] @@ -739,9 +740,9 @@ dependencies = [ [[package]] name = "ctor" -version = "0.1.21" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccc0a48a9b826acdf4028595adc9db92caea352f7af011a3034acd172a52a0aa" +checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" dependencies = [ "quote", "syn", @@ -770,6 +771,50 @@ dependencies = [ "zeroize", ] +[[package]] +name = "cxx" +version = "1.0.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86d3488e7665a7a483b57e25bdd90d0aeb2bc7608c8d0346acf2ad3f1caf1d62" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48fcaf066a053a41a81dfb14d57d99738b767febb8b735c3016e469fac5da690" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2", + "quote", + "scratch", + "syn", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2ef98b8b717a829ca5603af80e1f9e2e48013ab227b68ef37872ef84ee479bf" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "086c685979a698443656e5cf7856c95c642295a38599f12fb1ff76fb28d19892" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "digest" version = "0.8.1" @@ -785,16 +830,16 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", ] [[package]] name = "digest" -version = "0.10.3" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" dependencies = [ - "block-buffer 0.10.2", + "block-buffer 0.10.3", "crypto-common", ] @@ -840,24 +885,24 @@ dependencies = [ [[package]] name = "either" -version = "1.6.1" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" [[package]] name = "encoding_rs" -version = "0.8.30" +version = "0.8.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dc8abb250ffdda33912550faa54c88ec8b998dec0b2c55ab224921ce11df" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" dependencies = [ "cfg-if 1.0.0", ] [[package]] name = "event-listener" -version = "2.5.2" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "extend" @@ -891,9 +936,9 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" [[package]] name = "fastrand" -version = "1.7.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" dependencies = [ "instant", ] @@ -906,11 +951,10 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" dependencies = [ - "matches", "percent-encoding", ] @@ -932,9 +976,9 @@ checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" [[package]] name = "futures-channel" -version = "0.3.21" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" +checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" dependencies = [ "futures-core", "futures-sink", @@ -942,15 +986,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.21" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" +checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" [[package]] name = "futures-io" -version = "0.3.21" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" +checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" [[package]] name = "futures-lite" @@ -969,21 +1013,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.21" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" +checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" [[package]] name = "futures-task" -version = "0.3.21" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" +checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" [[package]] name = "futures-util" -version = "0.3.21" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" +checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" dependencies = [ "futures-core", "futures-io", @@ -1006,9 +1050,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.5" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" dependencies = [ "typenum", "version_check", @@ -1027,13 +1071,13 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.4" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ "cfg-if 1.0.0", "libc", - "wasi 0.10.0+wasi-snapshot-preview1", + "wasi 0.11.0+wasi-snapshot-preview1", ] [[package]] @@ -1048,15 +1092,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.26.1" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" +checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" [[package]] name = "gloo-timers" -version = "0.2.3" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d12a7f4e95cfe710f1d624fb1210b7d961a5fb05c4fd942f4feab06e61f590e" +checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" dependencies = [ "futures-channel", "futures-core", @@ -1066,9 +1110,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.11" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9f1f717ddc7b2ba36df7e871fd88db79326551d3d6f1fc406fbfd28b582ff8e" +checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" dependencies = [ "bytes", "fnv", @@ -1100,9 +1144,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashlink" @@ -1115,18 +1159,18 @@ dependencies = [ [[package]] name = "headers" -version = "0.3.6" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c84c647447a07ca16f5fbd05b633e535cc41a08d2d74ab1e08648df53be9cb89" +checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" dependencies = [ - "base64 0.13.0", + "base64 0.13.1", "bitflags", "bytes", "headers-core", "http", "httpdate", "mime", - "sha-1", + "sha1 0.10.5", ] [[package]] @@ -1147,6 +1191,15 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + [[package]] name = "hkdf" version = "0.10.0" @@ -1169,20 +1222,20 @@ dependencies = [ [[package]] name = "http" -version = "0.2.6" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ "bytes", "fnv", - "itoa 1.0.1", + "itoa", ] [[package]] name = "http-body" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes", "http", @@ -1198,7 +1251,7 @@ dependencies = [ "anyhow", "async-channel", "async-std", - "base64 0.13.0", + "base64 0.13.1", "cookie", "futures-lite", "infer", @@ -1213,9 +1266,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.5.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acd94fdbe1d4ff688b67b04eee2e17bd50995534a61539e45adfefb45e5e5503" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" @@ -1225,9 +1278,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.16" +version = "0.14.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7ec3e62bdc98a2f0393a5048e4c30ef659440ea6e0e572965103e72bd836f55" +checksum = "5e011372fa0b68db8350aa7a248930ecc7839bf46d8485577d69f117a75f164c" dependencies = [ "bytes", "futures-channel", @@ -1238,7 +1291,7 @@ dependencies = [ "http-body", "httparse", "httpdate", - "itoa 0.4.8", + "itoa", "pin-project-lite", "socket2", "tokio", @@ -1249,9 +1302,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.23.0" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d87c48c02e0dc5e3b849a2041db3029fd066650f8f717c07bf8ed78ccb895cac" +checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" dependencies = [ "http", "hyper", @@ -1260,25 +1313,48 @@ dependencies = [ "tokio-rustls", ] +[[package]] +name = "iana-time-zone" +version = "0.1.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "winapi 0.3.9", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +dependencies = [ + "cxx", + "cxx-build", +] + [[package]] name = "idna" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" dependencies = [ - "matches", "unicode-bidi", "unicode-normalization", ] [[package]] name = "indexmap" -version = "1.8.0" +version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" +checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" dependencies = [ "autocfg", - "hashbrown 0.11.2", + "hashbrown 0.12.3", ] [[package]] @@ -1316,45 +1392,42 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.3.1" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f2d64f2edebec4ce84ad108148e67e1064789bee435edc5b60ad398714a3a9" +checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" [[package]] name = "itertools" -version = "0.10.3" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ "either", ] [[package]] name = "itoa" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" - -[[package]] -name = "itoa" -version = "1.0.1" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" [[package]] name = "js-sys" -version = "0.3.56" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a38fc24e30fd564ce974c02bf1d337caddff65be6cc4735a1f7eab22a7440f04" +checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" dependencies = [ "wasm-bindgen", ] [[package]] name = "keccak" -version = "0.1.0" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" +checksum = "3afef3b6eff9ce9d8ff9b3601125eec7f0c8cbac7abd14f355d053fa56c98768" +dependencies = [ + "cpufeatures", +] [[package]] name = "kernel32-sys" @@ -1383,15 +1456,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.117" +version = "0.2.139" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e74d72e0f9b65b5b4ca49a346af3976df0f9c61d550727f349ecd559f251a26c" +checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" [[package]] name = "libflate" -version = "1.1.2" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2d57e534717ac3e0b8dc459fe338bdfb4e29d7eea8fd0926ba649ddd3f4765f" +checksum = "97822bf791bd4d5b403713886a5fbe8bf49520fe78e323b0dc480ca1a03e50b0" dependencies = [ "adler32", "crc32fast", @@ -1400,9 +1473,9 @@ dependencies = [ [[package]] name = "libflate_lz77" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39a734c0493409afcd49deee13c006a04e3586b9761a03543c6272c9c51f2f5a" +checksum = "a52d3a8bfc85f250440e4424db7d857e241a3aebbbe301f3eb606ab15c39acbf" dependencies = [ "rle-decode-fast", ] @@ -1419,26 +1492,29 @@ dependencies = [ ] [[package]] -name = "log" -version = "0.4.14" +name = "link-cplusplus" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" dependencies = [ - "cfg-if 1.0.0", - "value-bag", + "cc", ] [[package]] -name = "matches" -version = "0.1.9" +name = "log" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if 1.0.0", + "value-bag", +] [[package]] name = "memchr" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memoffset" @@ -1449,6 +1525,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + [[package]] name = "mime" version = "0.3.16" @@ -1457,9 +1542,9 @@ checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" [[package]] name = "mime_guess" -version = "2.0.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" dependencies = [ "mime", "unicase", @@ -1467,12 +1552,11 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.4.4" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" dependencies = [ "adler", - "autocfg", ] [[package]] @@ -1488,7 +1572,7 @@ dependencies = [ "kernel32-sys", "libc", "log", - "miow 0.2.2", + "miow", "net2", "slab", "winapi 0.2.8", @@ -1496,15 +1580,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.7.14" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" +checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" dependencies = [ "libc", "log", - "miow 0.3.7", - "ntapi", - "winapi 0.3.9", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.45.0", ] [[package]] @@ -1519,15 +1602,6 @@ dependencies = [ "ws2_32-sys", ] -[[package]] -name = "miow" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" -dependencies = [ - "winapi 0.3.9", -] - [[package]] name = "multipart" version = "0.18.0" @@ -1540,7 +1614,7 @@ dependencies = [ "mime", "mime_guess", "quick-error", - "rand 0.8.4", + "rand 0.8.5", "safemem", "tempfile", "twoway", @@ -1548,9 +1622,9 @@ dependencies = [ [[package]] name = "net2" -version = "0.2.37" +version = "0.2.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae" +checksum = "74d0df99cfcd2530b2e694f6e17e7f37b8e26bb23983ac530c0c97408837c631" dependencies = [ "cfg-if 0.1.10", "libc", @@ -1559,31 +1633,22 @@ dependencies = [ [[package]] name = "nix" -version = "0.23.1" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f866317acbd3a240710c63f065ffb1e4fd466259045ccb504130b7f668f35c6" +checksum = "8f3790c00a0150112de0f4cd161e3d7fc4b2d8a5542ffc35f099a2562aecb35c" dependencies = [ "bitflags", "cc", "cfg-if 1.0.0", "libc", - "memoffset", -] - -[[package]] -name = "ntapi" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" -dependencies = [ - "winapi 0.3.9", + "memoffset 0.6.5", ] [[package]] name = "num-integer" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" dependencies = [ "autocfg", "num-traits", @@ -1591,37 +1656,46 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ "autocfg", ] [[package]] name = "num_cpus" -version = "1.13.1" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +dependencies = [ + "hermit-abi 0.2.6", + "libc", +] + +[[package]] +name = "num_threads" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" dependencies = [ - "hermit-abi", "libc", ] [[package]] name = "object" -version = "0.27.1" +version = "0.30.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9" +checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.9.0" +version = "1.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" [[package]] name = "oorandom" @@ -1649,16 +1723,17 @@ checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" [[package]] name = "percent-encoding" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pest" -version = "2.1.3" +version = "2.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" +checksum = "028accff104c4e513bad663bbcd2ad7cfd5304144404c31ed0a77ac103d00660" dependencies = [ + "thiserror", "ucd-trie", ] @@ -1670,18 +1745,18 @@ checksum = "28b9b4df73455c861d7cbf8be42f01d3b373ed7f02e378d55fa84eafc6f638b1" [[package]] name = "pin-project" -version = "1.0.10" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.10" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", @@ -1690,9 +1765,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" [[package]] name = "pin-utils" @@ -1702,15 +1777,15 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.24" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" [[package]] name = "plotters" -version = "0.3.1" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a3fd9ec30b9749ce28cd91f255d569591cdf937fe280c312143e3c4bad6f2a" +checksum = "2538b639e642295546c50fcd545198c9d64ee2a38620a628724a3b266d5fbf97" dependencies = [ "num-traits", "plotters-backend", @@ -1721,30 +1796,31 @@ dependencies = [ [[package]] name = "plotters-backend" -version = "0.3.2" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d88417318da0eaf0fdcdb51a0ee6c3bed624333bff8f946733049380be67ac1c" +checksum = "193228616381fecdc1224c62e96946dfbc73ff4384fba576e052ff8c1bea8142" [[package]] name = "plotters-svg" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "521fa9638fa597e1dc53e9412a4f9cefb01187ee1f7413076f9e6749e2885ba9" +checksum = "f9a81d2759aae1dae668f783c308bc5c8ebd191ff4184aaa1b37f65a6ae5a56f" dependencies = [ "plotters-backend", ] [[package]] name = "polling" -version = "2.2.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "685404d509889fade3e86fe3a5803bca2ec09b0c0778d5ada6ec8bf7a8de5259" +checksum = "22122d5ec4f9fe1b3916419b76be1e80bcb93f618d071d2edf841b137b2a2bd6" dependencies = [ + "autocfg", "cfg-if 1.0.0", "libc", "log", "wepoll-ffi", - "winapi 0.3.9", + "windows-sys 0.42.0", ] [[package]] @@ -1760,9 +1836,9 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro-error" @@ -1790,17 +1866,17 @@ dependencies = [ [[package]] name = "proc-macro-hack" -version = "0.5.19" +version = "0.5.20+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.36" +version = "1.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" +checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] @@ -1819,15 +1895,15 @@ dependencies = [ [[package]] name = "protobuf" -version = "2.27.1" +version = "2.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf7e6d18738ecd0902d30d1ad232c9125985a3422929b16c65517b38adc14f96" +checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" [[package]] name = "psm" -version = "0.1.16" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd136ff4382c4753fc061cb9e4712ab2af263376b95bbd5bd8cd50c020b78e69" +checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" dependencies = [ "cc", ] @@ -1840,9 +1916,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.15" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" +checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" dependencies = [ "proc-macro2", ] @@ -1857,19 +1933,18 @@ dependencies = [ "libc", "rand_chacha 0.2.2", "rand_core 0.5.1", - "rand_hc 0.2.0", + "rand_hc", ] [[package]] name = "rand" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha 0.3.1", - "rand_core 0.6.3", - "rand_hc 0.3.1", + "rand_core 0.6.4", ] [[package]] @@ -1889,7 +1964,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.3", + "rand_core 0.6.4", ] [[package]] @@ -1903,11 +1978,11 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.4", + "getrandom 0.2.8", ] [[package]] @@ -1919,81 +1994,64 @@ dependencies = [ "rand_core 0.5.1", ] -[[package]] -name = "rand_hc" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" -dependencies = [ - "rand_core 0.6.3", -] - [[package]] name = "rayon" -version = "1.5.1" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" +checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7" dependencies = [ - "autocfg", - "crossbeam-deque", "either", "rayon-core", ] [[package]] name = "rayon-core" -version = "1.9.1" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" +checksum = "356a0625f1954f730c0201cdab48611198dc6ce21f4acff55089b5a78e6e835b" dependencies = [ "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "lazy_static", "num_cpus", ] [[package]] name = "redox_syscall" -version = "0.2.10" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ "bitflags", ] [[package]] name = "redox_users" -version = "0.4.0" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "getrandom 0.2.4", + "getrandom 0.2.8", "redox_syscall", + "thiserror", ] [[package]] name = "regex" -version = "1.5.4" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" dependencies = [ "aho-corasick", "memchr", "regex-syntax", ] -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" - [[package]] name = "regex-syntax" -version = "0.6.25" +version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" [[package]] name = "remove_dir_all" @@ -2006,11 +2064,11 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.9" +version = "0.11.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f242f1488a539a79bac6dbe7c8609ae43b7914b7736210f239a37cccb32525" +checksum = "21eed90ec8570952d53b772ecf8f206aa1ec9a3d76b2521c56c42973f2d91ee9" dependencies = [ - "base64 0.13.0", + "base64 0.21.0", "bytes", "encoding_rs", "futures-core", @@ -2022,18 +2080,19 @@ dependencies = [ "hyper-rustls", "ipnet", "js-sys", - "lazy_static", "log", "mime", + "once_cell", "percent-encoding", "pin-project-lite", "rustls", - "rustls-pemfile", + "rustls-pemfile 1.0.2", "serde", "serde_json", "serde_urlencoded", "tokio", "tokio-rustls", + "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", @@ -2059,11 +2118,11 @@ dependencies = [ [[package]] name = "ripemd" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1facec54cb5e0dc08553501fa740091086d0259ad0067e0d4103448e4cb22ed3" +checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" dependencies = [ - "digest 0.10.3", + "digest 0.10.6", ] [[package]] @@ -2143,14 +2202,14 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.5", + "semver 1.0.16", ] [[package]] name = "rustls" -version = "0.20.2" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d37e5e2290f3e040b594b1a9e04377c2c671f1a1cfd9bfdef82106ac1c113f84" +checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" dependencies = [ "log", "ring", @@ -2164,20 +2223,29 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9" dependencies = [ - "base64 0.13.0", + "base64 0.13.1", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" +dependencies = [ + "base64 0.21.0", ] [[package]] name = "rustversion" -version = "1.0.6" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f" +checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" [[package]] name = "ryu" -version = "1.0.9" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" +checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" [[package]] name = "safemem" @@ -2196,9 +2264,9 @@ dependencies = [ [[package]] name = "scoped-tls" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "scopeguard" @@ -2206,6 +2274,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +[[package]] +name = "scratch" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2" + [[package]] name = "sct" version = "0.7.0" @@ -2218,9 +2292,9 @@ dependencies = [ [[package]] name = "secp256k1" -version = "0.21.2" +version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab7883017d5b21f011ef8040ea9c6c7ac90834c0df26a69e4c0b06276151f125" +checksum = "9c42e6f1735c5f00f51e43e28d6634141f2bcad10931b2609ddd74a86d751260" dependencies = [ "secp256k1-sys 0.4.2", "serde", @@ -2228,9 +2302,9 @@ dependencies = [ [[package]] name = "secp256k1" -version = "0.24.2" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9512ffd81e3a3503ed401f79c33168b9148c75038956039166cd750eaa037c3" +checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" dependencies = [ "secp256k1-sys 0.6.1", "serde", @@ -2274,9 +2348,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.5" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0486718e92ec9a68fbed73bb5ef687d71103b142595b406835649bebd33f72c7" +checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" [[package]] name = "semver-parser" @@ -2295,9 +2369,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.136" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" +checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" dependencies = [ "serde_derive", ] @@ -2314,9 +2388,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.136" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" +checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ "proc-macro2", "quote", @@ -2325,11 +2399,11 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.78" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d23c1ba4cf0efd44be32017709280b32d1cea5c3f1275c3b6d9e8bc54f758085" +checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76" dependencies = [ - "itoa 1.0.1", + "itoa", "ryu", "serde", ] @@ -2347,9 +2421,9 @@ dependencies = [ [[package]] name = "serde_stacker" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c92391a63e3b83f77334d8beaaf11bac4c900f3769483e543bf76a81bf8ee2" +checksum = "35f73df5c3072392d6a2abb8588d06db7f57b83dc95d5bbb96da71cd8468fcfd" dependencies = [ "serde", "stacker", @@ -2362,22 +2436,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", - "itoa 1.0.1", + "itoa", "ryu", "serde", ] [[package]] name = "sha-1" -version = "0.9.8" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" +checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" dependencies = [ - "block-buffer 0.9.0", "cfg-if 1.0.0", "cpufeatures", - "digest 0.9.0", - "opaque-debug 0.3.0", + "digest 0.10.6", ] [[package]] @@ -2389,6 +2461,17 @@ dependencies = [ "sha1_smol", ] +[[package]] +name = "sha1" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.10.6", +] + [[package]] name = "sha1_smol" version = "1.0.0" @@ -2422,13 +2505,13 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.2" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ "cfg-if 1.0.0", "cpufeatures", - "digest 0.10.3", + "digest 0.10.6", "sha2-asm 0.6.2", ] @@ -2452,11 +2535,11 @@ dependencies = [ [[package]] name = "sha3" -version = "0.10.1" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881bf8156c87b6301fc5ca6b27f11eeb2761224c7081e69b409d5a1951a70c86" +checksum = "bdf0c33fae925bdc080598b84bc15c55e7b9a4a43b3c704da051f977469691c9" dependencies = [ - "digest 0.10.3", + "digest 0.10.6", "keccak", ] @@ -2471,15 +2554,18 @@ dependencies = [ [[package]] name = "siphasher" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a86232ab60fa71287d7f2ddae4a7073f6b7aac33631c3015abb556f08c6d0a3e" +checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" [[package]] name = "slab" -version = "0.4.5" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +dependencies = [ + "autocfg", +] [[package]] name = "slog" @@ -2489,40 +2575,40 @@ checksum = "8347046d4ebd943127157b94d63abb990fcf729dc4e9978927fdf4ac3c998d06" [[package]] name = "slog-json" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f7f7a952ce80fca9da17bf0a53895d11f8aa1ba063668ca53fc72e7869329e9" +checksum = "3e1e53f61af1e3c8b852eef0a9dee29008f55d6dd63794f3f12cef786cf0f219" dependencies = [ - "chrono", "serde", "serde_json", "slog", + "time 0.3.19", ] [[package]] name = "slog-term" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95c1e7e5aab61ced6006149ea772770b84a0d16ce0f7885def313e4829946d76" +checksum = "87d29185c55b7b258b4f120eab00f48557d4d9bc814f41713f449d35b0f8977c" dependencies = [ "atty", - "chrono", "slog", "term", "thread_local", + "time 0.3.19", ] [[package]] name = "smallvec" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "socket2" -version = "0.4.4" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" dependencies = [ "libc", "winapi 0.3.9", @@ -2536,9 +2622,9 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "stacker" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90939d5171a4420b3ff5fbc8954d641e7377335454c259dcb80786f3f21dc9b4" +checksum = "c886bd4480155fd3ef527d45e9ac8dd7118a898a46530b7b94c3e21866259fce" dependencies = [ "cc", "cfg-if 1.0.0", @@ -2563,12 +2649,12 @@ dependencies = [ "rstest", "rstest_reuse", "rusqlite", - "secp256k1 0.21.2", + "secp256k1 0.21.3", "serde", "serde_derive", "serde_json", "serde_stacker", - "sha2 0.10.2", + "sha2 0.10.6", "sha3", "slog", "slog-json", @@ -2661,7 +2747,7 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "sha1", + "sha1 0.6.1", "syn", ] @@ -2676,7 +2762,7 @@ name = "stx-genesis" version = "0.1.0" dependencies = [ "libflate", - "sha2 0.10.2", + "sha2 0.10.6", ] [[package]] @@ -2687,13 +2773,13 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.86" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" +checksum = "d56e159d99e6c2b93995d171050271edb50ecc5288fbc7cc17de8fdce4e58c14" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] @@ -2721,6 +2807,15 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "termcolor" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +dependencies = [ + "winapi-util", +] + [[package]] name = "textwrap" version = "0.11.0" @@ -2732,18 +2827,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.30" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" +checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.30" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" +checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" dependencies = [ "proc-macro2", "quote", @@ -2752,18 +2847,19 @@ dependencies = [ [[package]] name = "thread_local" -version = "1.1.4" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ + "cfg-if 1.0.0", "once_cell", ] [[package]] name = "time" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" dependencies = [ "libc", "wasi 0.10.0+wasi-snapshot-preview1", @@ -2780,11 +2876,31 @@ dependencies = [ "libc", "standback", "stdweb", - "time-macros", + "time-macros 0.1.1", "version_check", "winapi 0.3.9", ] +[[package]] +name = "time" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53250a3b3fed8ff8fd988587d8925d26a83ac3845d9e03b220b37f34c2b8d6c2" +dependencies = [ + "itoa", + "libc", + "num_threads", + "serde", + "time-core", + "time-macros 0.2.7", +] + +[[package]] +name = "time-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" + [[package]] name = "time-macros" version = "0.1.1" @@ -2795,6 +2911,15 @@ dependencies = [ "time-macros-impl", ] +[[package]] +name = "time-macros" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a460aeb8de6dcb0f381e1ee05f1cd56fcf5a5f6eb8187ff3d8f0b11078d38b7c" +dependencies = [ + "time-core", +] + [[package]] name = "time-macros-impl" version = "0.1.2" @@ -2820,32 +2945,34 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" dependencies = [ "tinyvec_macros", ] [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.16.1" +version = "1.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c27a64b625de6d309e8c57716ba93021dccf1b3b5c97edd6d3dd2d2135afc0a" +checksum = "c8e00990ebabbe4c14c08aca901caed183ecd5c09562a12c824bb53d3c3fd3af" dependencies = [ + "autocfg", "bytes", "libc", "memchr", - "mio 0.7.14", + "mio 0.8.6", "num_cpus", "pin-project-lite", - "winapi 0.3.9", + "socket2", + "windows-sys 0.42.0", ] [[package]] @@ -2861,9 +2988,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.8" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50145484efff8818b5ccd256697f36863f587da82cf8b409c53adf1e840798e3" +checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313" dependencies = [ "futures-core", "pin-project-lite", @@ -2872,51 +2999,50 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.15.0" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "511de3f85caf1c98983545490c3d09685fa8eb634e57eec22bb4db271f46cbd8" +checksum = "f714dd15bead90401d77e04243611caec13726c2408afd5b31901dfcdcb3b181" dependencies = [ "futures-util", "log", - "pin-project", "tokio", "tungstenite", ] [[package]] name = "tokio-util" -version = "0.6.9" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" +checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" dependencies = [ "bytes", "futures-core", "futures-sink", - "log", "pin-project-lite", "tokio", + "tracing", ] [[package]] name = "toml" -version = "0.5.8" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" dependencies = [ "serde", ] [[package]] name = "tower-service" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.30" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d8d93354fe2a8e50d5953f5ae2e47a3fc2ef03292e7ea46e3cc38f549525fb9" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if 1.0.0", "log", @@ -2926,32 +3052,32 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.22" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03cfcb51380632a72d3111cb8d3447a8d908e577d31beeac006f836383d29a23" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" dependencies = [ - "lazy_static", + "once_cell", ] [[package]] name = "try-lock" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "tungstenite" -version = "0.14.0" +version = "0.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0b2d8558abd2e276b0a8df5c05a2ec762609344191e5fd23e292c910e9165b5" +checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0" dependencies = [ - "base64 0.13.0", + "base64 0.13.1", "byteorder", "bytes", "http", "httparse", "log", - "rand 0.8.4", + "rand 0.8.5", "sha-1", "thiserror", "url", @@ -2969,15 +3095,15 @@ dependencies = [ [[package]] name = "typenum" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "ucd-trie" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" [[package]] name = "unicase" @@ -2990,30 +3116,30 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.7" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" +checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" + +[[package]] +name = "unicode-ident" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" [[package]] name = "unicode-normalization" -version = "0.1.19" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] [[package]] name = "unicode-width" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" - -[[package]] -name = "unicode-xid" -version = "0.2.2" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] name = "universal-hash" @@ -3021,7 +3147,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", "subtle", ] @@ -3033,13 +3159,12 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.2.2" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" dependencies = [ "form_urlencoded", "idna", - "matches", "percent-encoding", "serde", ] @@ -3052,9 +3177,9 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "value-bag" -version = "1.0.0-alpha.8" +version = "1.0.0-alpha.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79923f7731dc61ebfba3633098bf3ac533bbd35ccd8c57e7088d9a5eebe0263f" +checksum = "2209b78d1249f7e6f3293657c9779fe31ced465df091bbd433a1cf88e916ec55" dependencies = [ "ctor", "version_check", @@ -3101,9 +3226,9 @@ dependencies = [ [[package]] name = "warp" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cef4e1e9114a4b7f1ac799f16ce71c14de5778500c5450ec6b7b920c55b587e" +checksum = "ed7b8be92646fc3d18b06147664ebc5f48d222686cb11a8755e561a735aacc6d" dependencies = [ "bytes", "futures-channel", @@ -3117,6 +3242,7 @@ dependencies = [ "multipart", "percent-encoding", "pin-project", + "rustls-pemfile 0.2.1", "scoped-tls", "serde", "serde_json", @@ -3141,11 +3267,17 @@ version = "0.10.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + [[package]] name = "wasm-bindgen" -version = "0.2.79" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25f1af7423d8588a3d840681122e72e6a24ddbcb3f0ec385cac0d12d24256c06" +checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -3153,13 +3285,13 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.79" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b21c0df030f5a177f3cba22e9bc4322695ec43e7257d865302900290bcdedca" +checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", "syn", @@ -3168,9 +3300,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.29" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb6ec270a31b1d3c7e266b999739109abce8b6c87e4b31fcfcd788b65267395" +checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -3180,9 +3312,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.79" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f4203d69e40a52ee523b2529a773d5ffc1dc0071801c87b3d270b471b80ed01" +checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3190,9 +3322,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.79" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc" +checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ "proc-macro2", "quote", @@ -3203,15 +3335,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.79" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d958d035c4438e28c70e4321a2911302f10135ce78a9c7834c0cab4123d06a2" +checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" [[package]] name = "web-sys" -version = "0.3.56" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c060b319f29dd25724f09a2ba1418f142f539b2be99fbf4d2d5a8f7330afb8eb" +checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" dependencies = [ "js-sys", "wasm-bindgen", @@ -3229,9 +3361,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.22.5" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368bfe657969fb01238bb756d351dcade285e0f6fcbd36dcb23359a5169975be" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" dependencies = [ "webpki", ] @@ -3288,11 +3420,92 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" + [[package]] name = "winreg" -version = "0.7.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" dependencies = [ "winapi 0.3.9", ] @@ -3309,6 +3522,10 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.5.2" +version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" +<<<<<<< Updated upstream checksum = "7c88870063c39ee00ec285a2f8d6a966e5b6fb2becc4e8dac77ed0d370ed6006" +======= +checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" +>>>>>>> Stashed changes diff --git a/Cargo.toml b/Cargo.toml index 35e52d1e1f..f1a16eb783 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,6 +33,7 @@ path = "src/clarity_cli_main.rs" name = "blockstack-cli" path = "src/blockstack_cli.rs" +<<<<<<< Updated upstream [[bench]] name = "marf_bench" harness = false @@ -48,6 +49,11 @@ harness = false [[bench]] name = "c32_bench" harness = false +======= +[[bin]] +name = "relay-server" +path = "contrib/tools/relay-server/src/main.rs" +>>>>>>> Stashed changes [dependencies] rand = "0.7.3" diff --git a/benches/block_limits.rs b/benches/block_limits.rs.backup similarity index 100% rename from benches/block_limits.rs rename to benches/block_limits.rs.backup diff --git a/benches/c32_bench.rs b/benches/c32_bench.rs.backup similarity index 100% rename from benches/c32_bench.rs rename to benches/c32_bench.rs.backup diff --git a/benches/large_contract_bench.rs b/benches/large_contract_bench.rs.backup similarity index 100% rename from benches/large_contract_bench.rs rename to benches/large_contract_bench.rs.backup diff --git a/benches/marf_bench.rs b/benches/marf_bench.rs.backup similarity index 100% rename from benches/marf_bench.rs rename to benches/marf_bench.rs.backup From 9800e7e8a66463d059577966864dd019aefde787 Mon Sep 17 00:00:00 2001 From: Stjepan Golemac Date: Fri, 24 Feb 2023 09:28:39 +0100 Subject: [PATCH 03/17] fix: Resolve conflicts and the remaining two errors --- Cargo.lock | 4 ---- Cargo.toml | 22 ---------------------- testnet/stacks-node/src/tests/epoch_21.rs | 4 +--- 3 files changed, 1 insertion(+), 29 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5f4e37fb49..b20f432762 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3524,8 +3524,4 @@ dependencies = [ name = "zeroize" version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -<<<<<<< Updated upstream -checksum = "7c88870063c39ee00ec285a2f8d6a966e5b6fb2becc4e8dac77ed0d370ed6006" -======= checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" ->>>>>>> Stashed changes diff --git a/Cargo.toml b/Cargo.toml index f1a16eb783..4a68b9056e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,28 +33,6 @@ path = "src/clarity_cli_main.rs" name = "blockstack-cli" path = "src/blockstack_cli.rs" -<<<<<<< Updated upstream -[[bench]] -name = "marf_bench" -harness = false - -[[bench]] -name = "large_contract_bench" -harness = false - -[[bench]] -name = "block_limits" -harness = false - -[[bench]] -name = "c32_bench" -harness = false -======= -[[bin]] -name = "relay-server" -path = "contrib/tools/relay-server/src/main.rs" ->>>>>>> Stashed changes - [dependencies] rand = "0.7.3" rand_chacha = "=0.2.2" diff --git a/testnet/stacks-node/src/tests/epoch_21.rs b/testnet/stacks-node/src/tests/epoch_21.rs index 3b0675bcb0..d6e4732955 100644 --- a/testnet/stacks-node/src/tests/epoch_21.rs +++ b/testnet/stacks-node/src/tests/epoch_21.rs @@ -4711,7 +4711,7 @@ fn trait_invocation_cross_epoch() { test_observer::spawn(); - let (mut conf, miner_account) = neon_integration_test_conf(); + let (mut conf, _) = neon_integration_test_conf(); let mut initial_balances = vec![InitialBalance { address: spender_addr.clone(), amount: 200_000_000, @@ -4728,8 +4728,6 @@ fn trait_invocation_cross_epoch() { epochs[3].start_height = epoch_2_1; conf.burnchain.epochs = Some(epochs); - let http_origin = format!("http://{}", &conf.node.rpc_bind); - let mut burnchain_config = Burnchain::regtest(&conf.get_burn_db_path()); let reward_cycle_len = 2000; From 24d064f05526baa5e1ab253deac5e9ebe2066a4c Mon Sep 17 00:00:00 2001 From: Stjepan Golemac Date: Mon, 27 Feb 2023 13:55:14 +0100 Subject: [PATCH 04/17] clean: remove benchmark files --- benches/block_limits.rs.backup | 678 ------------------------- benches/c32_bench.rs.backup | 35 -- benches/large_contract_bench.rs.backup | 158 ------ benches/marf_bench.rs.backup | 136 ----- 4 files changed, 1007 deletions(-) delete mode 100644 benches/block_limits.rs.backup delete mode 100644 benches/c32_bench.rs.backup delete mode 100644 benches/large_contract_bench.rs.backup delete mode 100644 benches/marf_bench.rs.backup diff --git a/benches/block_limits.rs.backup b/benches/block_limits.rs.backup deleted file mode 100644 index 6ab56baf52..0000000000 --- a/benches/block_limits.rs.backup +++ /dev/null @@ -1,678 +0,0 @@ -extern crate blockstack_lib; -extern crate rand; -extern crate serde_json; - -use std::fs; -use std::path::PathBuf; -use std::process; -use std::{env, time::Instant}; - -use blockstack_lib::clarity_vm::clarity::ClarityInstance; -use blockstack_lib::clarity_vm::database::MemoryBackingStore; -use blockstack_lib::core::StacksEpochId; -use blockstack_lib::types::chainstate::BlockHeaderHash; -use blockstack_lib::types::chainstate::BurnchainHeaderHash; -use blockstack_lib::types::chainstate::VRFSeed; -use blockstack_lib::types::proof::ClarityMarfTrieId; -use blockstack_lib::vm::ast::build_ast; -use blockstack_lib::vm::contexts::GlobalContext; -use blockstack_lib::vm::costs::LimitedCostTracker; -use blockstack_lib::vm::errors::InterpreterResult; -use blockstack_lib::vm::{eval_all, ContractContext}; -use rand::Rng; - -use blockstack_lib::clarity_vm::database::marf::MarfedKV; -use blockstack_lib::types::chainstate::{StacksAddress, StacksBlockId}; -use blockstack_lib::util::boot::boot_code_id; -use blockstack_lib::{ - vm::costs::ExecutionCost, - vm::{ - database::{HeadersDB, NULL_BURN_STATE_DB}, - types::{PrincipalData, QualifiedContractIdentifier, StandardPrincipalData}, - Value, - }, -}; - -struct TestHeadersDB; - -impl HeadersDB for TestHeadersDB { - fn get_stacks_block_header_hash_for_block( - &self, - id_bhh: &StacksBlockId, - ) -> Option { - Some(BlockHeaderHash(id_bhh.0.clone())) - } - - fn get_burn_header_hash_for_block( - &self, - id_bhh: &StacksBlockId, - ) -> Option { - Some(BurnchainHeaderHash(id_bhh.0.clone())) - } - - fn get_vrf_seed_for_block(&self, _id_bhh: &StacksBlockId) -> Option { - Some(VRFSeed([0; 32])) - } - - fn get_burn_block_time_for_block(&self, _id_bhh: &StacksBlockId) -> Option { - Some(1) - } - - fn get_burn_block_height_for_block(&self, id_bhh: &StacksBlockId) -> Option { - if id_bhh == &StacksBlockId::sentinel() { - Some(0) - } else { - let mut bytes = [0; 4]; - bytes.copy_from_slice(&id_bhh.0[0..4]); - let height = u32::from_le_bytes(bytes); - Some(height) - } - } - - fn get_miner_address(&self, _id_bhh: &StacksBlockId) -> Option { - None - } -} - -fn as_hash160(inp: u32) -> [u8; 20] { - let mut out = [0; 20]; - out[0..4].copy_from_slice(&inp.to_le_bytes()); - out -} - -fn as_hash(inp: u32) -> [u8; 32] { - let mut out = [0; 32]; - out[0..4].copy_from_slice(&inp.to_le_bytes()); - out -} - -fn transfer_test(buildup_count: u32, scaling: u32, genesis_size: u32) -> ExecutionCost { - let start = Instant::now(); - - let marf = setup_chain_state(genesis_size); - let mut clarity_instance = ClarityInstance::new(false, marf); - let blocks: Vec<_> = (0..(buildup_count + 1)) - .into_iter() - .map(|i| StacksBlockId(as_hash(i))) - .collect(); - - let principals: Vec = (0..(buildup_count - 1)) - .into_iter() - .map(|i| StandardPrincipalData(0, as_hash160(i)).into()) - .collect(); - - let last_mint_block = blocks.len() - 2; - let last_block = blocks.len() - 1; - - for ix in 1..(last_mint_block + 1) { - let parent_block = &blocks[ix - 1]; - let current_block = &blocks[ix]; - - let mut conn = clarity_instance.begin_block( - parent_block, - current_block, - &TestHeadersDB, - &NULL_BURN_STATE_DB, - ); - - // minting phase - conn.as_transaction(|tx| { - tx.with_clarity_db(|db| { - let mut stx_account_0 = db.get_stx_balance_snapshot_genesis(&principals[ix - 1]); - stx_account_0.credit(1_000_000); - stx_account_0.save(); - Ok(()) - }) - .unwrap() - }); - - conn.commit_to_block(current_block); - } - - eprintln!("Finished buildup in {}ms", start.elapsed().as_millis()); - - // transfer phase - let mut conn = clarity_instance.begin_block( - &blocks[last_mint_block], - &blocks[last_block], - &TestHeadersDB, - &NULL_BURN_STATE_DB, - ); - - let begin = Instant::now(); - - let mut rng = rand::thread_rng(); - for _i in 0..scaling { - let from = rng.gen_range(0, principals.len()); - let to = (from + rng.gen_range(1, principals.len())) % principals.len(); - - conn.as_transaction(|tx| { - tx.run_stx_transfer(&principals[from], &principals[to], 10, &BuffData::empty()) - .unwrap() - }); - } - - let this_cost = conn.commit_to_block(&blocks[last_block]).get_total(); - let elapsed = begin.elapsed(); - - println!( - "{} transfers in {} ms, after {} block buildup with a {} account genesis", - scaling, - elapsed.as_millis(), - buildup_count, - genesis_size, - ); - - this_cost -} - -fn setup_chain_state(scaling: u32) -> MarfedKV { - let pre_initialized_path = format!("/tmp/block_limit_bench_{}.marf", scaling); - let out_path = "/tmp/block_limit_bench_last.marf"; - - if fs::metadata(&pre_initialized_path).is_err() { - let marf = MarfedKV::open(&pre_initialized_path, None).unwrap(); - let mut clarity_instance = ClarityInstance::new(false, marf); - let mut conn = clarity_instance.begin_test_genesis_block( - &StacksBlockId::sentinel(), - &StacksBlockId(as_hash(0)), - &TestHeadersDB, - &NULL_BURN_STATE_DB, - ); - - conn.as_transaction(|tx| { - for j in 0..scaling { - tx.with_clarity_db(|db| { - let addr = StandardPrincipalData(0, as_hash160(j + 1)).into(); - let mut stx_account_0 = db.get_stx_balance_snapshot_genesis(&addr); - stx_account_0.credit(1); - stx_account_0.save(); - db.increment_ustx_liquid_supply(1).unwrap(); - Ok(()) - }) - .unwrap(); - } - }); - - conn.commit_to_block(&StacksBlockId(as_hash(0))); - }; - - if fs::metadata(&out_path).is_err() { - let path = PathBuf::from(out_path); - fs::create_dir_all(&path).expect("Error creating directory"); - } - - fs::copy( - &format!("{}/marf.sqlite", pre_initialized_path), - &format!("{}/marf.sqlite", out_path), - ) - .unwrap(); - return MarfedKV::open(out_path, None).unwrap(); -} - -fn test_via_raw_contract( - eval: &str, - scaling: u32, - buildup_count: u32, - genesis_size: u32, -) -> ExecutionCost { - let start = Instant::now(); - - let marf = setup_chain_state(genesis_size); - - let mut clarity_instance = ClarityInstance::new(false, marf); - let blocks: Vec<_> = (0..(buildup_count + 1)) - .into_iter() - .map(|i| StacksBlockId(as_hash(i))) - .collect(); - - let stacker: PrincipalData = StandardPrincipalData(0, as_hash160(0)).into(); - - let contract_id = - QualifiedContractIdentifier::new(StandardPrincipalData(0, as_hash160(0)), "test".into()); - - let mut smart_contract = "".to_string(); - for _i in 0..scaling { - smart_contract.push_str(&format!("{}\n", eval)); - } - - let last_mint_block = blocks.len() - 2; - let last_block = blocks.len() - 1; - - for ix in 1..(last_mint_block + 1) { - let parent_block = &blocks[ix - 1]; - let current_block = &blocks[ix]; - - let mut conn = clarity_instance.begin_block( - parent_block, - current_block, - &TestHeadersDB, - &NULL_BURN_STATE_DB, - ); - - // minting phase - conn.as_transaction(|tx| { - tx.with_clarity_db(|db| { - let mut stx_account_0 = db.get_stx_balance_snapshot_genesis(&stacker); - stx_account_0.credit(1_000_000); - stx_account_0.save(); - db.increment_ustx_liquid_supply(1_000_000).unwrap(); - Ok(()) - }) - .unwrap(); - }); - - conn.commit_to_block(current_block); - } - - eprintln!("Finished buildup in {}ms", start.elapsed().as_millis()); - - // execute the block - let mut conn = clarity_instance.begin_block( - &blocks[last_mint_block], - &blocks[last_block], - &TestHeadersDB, - &NULL_BURN_STATE_DB, - ); - - let begin = Instant::now(); - - let exec_cost = conn.as_transaction(|tx| { - let analysis_cost = tx.cost_so_far(); - let (contract_ast, contract_analysis) = tx - .analyze_smart_contract(&contract_id, &smart_contract) - .unwrap(); - tx.initialize_smart_contract( - &contract_id, - &contract_ast, - &smart_contract, - None, - |_, _| false, - ) - .unwrap(); - - let mut initialize_cost = tx.cost_so_far(); - initialize_cost.sub(&analysis_cost).unwrap(); - - tx.save_analysis(&contract_id, &contract_analysis) - .expect("FATAL: failed to store contract analysis"); - - initialize_cost - }); - - let _this_cost = conn.commit_to_block(&blocks[last_block]).get_total(); - let elapsed = begin.elapsed(); - - println!( - "Completed raw execution scaled at {} in {} ms, after {} block buildup with a {} account genesis", - scaling, - elapsed.as_millis(), - buildup_count, - genesis_size, - ); - - exec_cost -} - -fn smart_contract_test(scaling: u32, buildup_count: u32, genesis_size: u32) -> ExecutionCost { - let start = Instant::now(); - - let marf = setup_chain_state(genesis_size); - - let mut clarity_instance = ClarityInstance::new(false, marf); - let blocks: Vec<_> = (0..(buildup_count + 1)) - .into_iter() - .map(|i| StacksBlockId(as_hash(i))) - .collect(); - - let stacker: PrincipalData = StandardPrincipalData(0, as_hash160(0)).into(); - - let contract_id = - QualifiedContractIdentifier::new(StandardPrincipalData(0, as_hash160(0)), "test".into()); - - let mut smart_contract = "".to_string(); - for i in 0..scaling { - smart_contract.push_str(&format!("(define-public (foo-{}) (ok (+ u2 u3)))\n", i)); - } - - let last_mint_block = blocks.len() - 2; - let last_block = blocks.len() - 1; - - for ix in 1..(last_mint_block + 1) { - let parent_block = &blocks[ix - 1]; - let current_block = &blocks[ix]; - - let mut conn = clarity_instance.begin_block( - parent_block, - current_block, - &TestHeadersDB, - &NULL_BURN_STATE_DB, - ); - - // minting phase - conn.as_transaction(|tx| { - tx.with_clarity_db(|db| { - let mut stx_account_0 = db.get_stx_balance_snapshot_genesis(&stacker); - stx_account_0.credit(1_000_000); - stx_account_0.save(); - db.increment_ustx_liquid_supply(1_000_000).unwrap(); - Ok(()) - }) - .unwrap(); - }); - - conn.commit_to_block(current_block); - } - - eprintln!("Finished buildup in {}ms", start.elapsed().as_millis()); - - // execute the block - let mut conn = clarity_instance.begin_block( - &blocks[last_mint_block], - &blocks[last_block], - &TestHeadersDB, - &NULL_BURN_STATE_DB, - ); - - let begin = Instant::now(); - - conn.as_transaction(|tx| { - let (contract_ast, contract_analysis) = tx - .analyze_smart_contract(&contract_id, &smart_contract) - .unwrap(); - tx.initialize_smart_contract( - &contract_id, - &contract_ast, - &smart_contract, - None, - |_, _| false, - ) - .unwrap(); - - tx.save_analysis(&contract_id, &contract_analysis) - .expect("FATAL: failed to store contract analysis"); - }); - - let this_cost = conn.commit_to_block(&blocks[last_block]).get_total(); - let elapsed = begin.elapsed(); - - println!( - "Completed smart-contract scaled at {} in {} ms, after {} block buildup with a {} account genesis", - scaling, - elapsed.as_millis(), - buildup_count, - genesis_size, - ); - - this_cost -} - -fn expensive_contract_test(scaling: u32, buildup_count: u32, genesis_size: u32) -> ExecutionCost { - let start = Instant::now(); - - let marf = setup_chain_state(genesis_size); - - let mut clarity_instance = ClarityInstance::new(false, marf); - let blocks: Vec<_> = (0..(buildup_count + 1)) - .into_iter() - .map(|i| StacksBlockId(as_hash(i))) - .collect(); - - let stacker: PrincipalData = StandardPrincipalData(0, as_hash160(0)).into(); - - let contract_id = - QualifiedContractIdentifier::new(StandardPrincipalData(0, as_hash160(0)), "test".into()); - - let smart_contract = format!( - "(define-public (f) (begin {} (ok 1))) (begin (f))", - (0..scaling) - .map(|_| format!( - "(unwrap! (contract-call? '{} submit-proposal '{} \"cost-old\" '{} \"cost-new\") (err 1))", - boot_code_id("cost-voting", false), - contract_id.clone(), - contract_id.clone() - )) - .collect::>() - .join(" ") - ); - - let last_mint_block = blocks.len() - 2; - let last_block = blocks.len() - 1; - - for ix in 1..(last_mint_block + 1) { - let parent_block = &blocks[ix - 1]; - let current_block = &blocks[ix]; - - let mut conn = clarity_instance.begin_block( - parent_block, - current_block, - &TestHeadersDB, - &NULL_BURN_STATE_DB, - ); - - // minting phase - conn.as_transaction(|tx| { - tx.with_clarity_db(|db| { - let mut stx_account_0 = db.get_stx_balance_snapshot_genesis(&stacker); - stx_account_0.credit(1_000_000); - stx_account_0.save(); - db.increment_ustx_liquid_supply(1_000_000).unwrap(); - Ok(()) - }) - .unwrap(); - }); - - conn.commit_to_block(current_block); - } - - eprintln!("Finished buildup in {}ms", start.elapsed().as_millis()); - - // execute the block - let mut conn = clarity_instance.begin_block( - &blocks[last_mint_block], - &blocks[last_block], - &TestHeadersDB, - &NULL_BURN_STATE_DB, - ); - - let begin = Instant::now(); - - conn.as_transaction(|tx| { - let (contract_ast, contract_analysis) = tx - .analyze_smart_contract(&contract_id, &smart_contract) - .unwrap(); - tx.initialize_smart_contract(&contract_id, &contract_ast, &smart_contract, |_, _| false) - .unwrap(); - - tx.save_analysis(&contract_id, &contract_analysis) - .expect("FATAL: failed to store contract analysis"); - }); - - let this_cost = conn.commit_to_block(&blocks[last_block]).get_total(); - let elapsed = begin.elapsed(); - - println!( - "Completed smart-contract scaled at {} in {} ms, after {} block buildup with a {} account genesis", - scaling, - elapsed.as_millis(), - buildup_count, - genesis_size, - ); - - this_cost -} - -pub fn execute_in_epoch(program: &str, epoch: StacksEpochId) -> InterpreterResult> { - let contract_id = QualifiedContractIdentifier::transient(); - let mut contract_context = ContractContext::new(contract_id.clone()); - let mut marf = MemoryBackingStore::new(); - let conn = marf.as_clarity_db(); - let mut global_context = GlobalContext::new(false, conn, LimitedCostTracker::new_free(), epoch); - global_context.execute(|g| { - let parsed = build_ast(&contract_id, program, &mut ())?.expressions; - eval_all(&parsed, &mut contract_context, g) - }) -} - -fn execute(program: &str) -> InterpreterResult> { - let epoch_200_result = execute_in_epoch(program, StacksEpochId::Epoch20); - let epoch_205_result = execute_in_epoch(program, StacksEpochId::Epoch2_05); - assert_eq!( - epoch_200_result, epoch_205_result, - "Epoch 2.0 and 2.05 should have same execution result, but did not for program `{}`", - program - ); - epoch_205_result -} - -fn stack_stx_test(buildup_count: u32, genesis_size: u32, scaling: u32) -> ExecutionCost { - let start = Instant::now(); - let marf = setup_chain_state(genesis_size); - - let mut clarity_instance = ClarityInstance::new(false, marf); - let blocks: Vec<_> = (0..(buildup_count + 1)) - .into_iter() - .map(|i| StacksBlockId(as_hash(i))) - .collect(); - - let stackers: Vec = (0..scaling) - .into_iter() - .map(|i| StandardPrincipalData(0, as_hash160(i)).into()) - .collect(); - - let stacker_balance = (buildup_count as u128 - 1) * 1_000_000; - - let pox_addrs: Vec = (0..50u64) - .map(|ix| { - execute(&format!( - "{{ version: 0x00, hashbytes: 0x000000000000000000000000{} }}", - &blockstack_lib::util::hash::to_hex(&ix.to_le_bytes()) - )) - .unwrap() - .unwrap() - }) - .collect(); - - let last_mint_block = blocks.len() - 2; - let last_block = blocks.len() - 1; - - for ix in 1..(last_mint_block + 1) { - let parent_block = &blocks[ix - 1]; - let current_block = &blocks[ix]; - - let mut conn = clarity_instance.begin_block( - parent_block, - current_block, - &TestHeadersDB, - &NULL_BURN_STATE_DB, - ); - - // minting phase - conn.as_transaction(|tx| { - tx.with_clarity_db(|db| { - for stacker in stackers.iter() { - let mut stx_account_0 = db.get_stx_balance_snapshot_genesis(stacker); - stx_account_0.credit(1_000_000); - stx_account_0.save(); - db.increment_ustx_liquid_supply(1_000_000).unwrap(); - } - Ok(()) - }) - .unwrap(); - }); - - conn.commit_to_block(current_block); - } - - eprintln!("Finished buildup in {}ms", start.elapsed().as_millis()); - - // do the stack-stx block - let mut conn = clarity_instance.begin_block( - &blocks[last_mint_block], - &blocks[last_block], - &TestHeadersDB, - &NULL_BURN_STATE_DB, - ); - - let begin = Instant::now(); - - conn.as_transaction(|tx| { - for stacker in stackers.iter() { - let result = tx - .run_contract_call( - stacker, - None, - &boot_code_id("pox", false), - "stack-stx", - &[ - Value::UInt(stacker_balance), - pox_addrs[0].clone(), - Value::UInt(buildup_count as u128 + 2), - Value::UInt(12), - ], - |_, _| false, - ) - .unwrap() - .0; - if let Err(v) = result.expect_result() { - panic!("Stacking failed: {}", v); - } - } - }); - - let this_cost = conn.commit_to_block(&blocks[last_block]).get_total(); - let elapsed = begin.elapsed(); - - println!( - "Completed {} stack-stx ops in {} ms, after {} block buildup with a {} account genesis", - scaling, - elapsed.as_millis(), - buildup_count, - genesis_size, - ); - - this_cost -} - -fn main() { - let argv: Vec<_> = env::args().collect(); - - if argv.len() < 3 { - eprintln!( - "Usage: {} [test-name] [scalar-0] ... [scalar-n] - -transfer -smart-contract -stack-stx -clarity-transfer -clarity-verify -clarity-raw -", - argv[0] - ); - process::exit(1); - } - - let block_build_up = argv[2].parse().expect("Invalid scalar"); - let genesis_size = argv[3].parse().expect("Invalid scalar"); - let scaling = argv[4].parse().expect("Invalid scalar"); - - let result = match argv[1].as_str() { - "transfer" => transfer_test(block_build_up, scaling, genesis_size), - "smart-contract" => smart_contract_test(scaling, block_build_up, genesis_size), - "clarity-transfer" => test_via_raw_contract(r#"(stx-transfer? u1 tx-sender 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR)"#, - scaling, block_build_up, genesis_size), - "expensive-contract" => expensive_contract_test(scaling, block_build_up, genesis_size), - "clarity-verify" => test_via_raw_contract("(secp256k1-verify 0xde5b9eb9e7c5592930eb2e30a01369c36586d872082ed8181ee83d2a0ec20f04 - 0x8738487ebe69b93d8e51583be8eee50bb4213fc49c767d329632730cc193b873554428fc936ca3569afc15f1c9365f6591d6251a89fee9c9ac661116824d3a1301 - 0x03adb8de4bfb65db2cfd6120d55c6526ae9c52e675db7e47308636534ba7786110)", - scaling, block_build_up, genesis_size), - "stack-stx" => stack_stx_test(block_build_up, genesis_size, scaling), - _ => { - eprintln!("bad test name"); - process::exit(1); - } - }; - - println!("{}", serde_json::to_string(&result).unwrap()); -} diff --git a/benches/c32_bench.rs.backup b/benches/c32_bench.rs.backup deleted file mode 100644 index 3fc4a93381..0000000000 --- a/benches/c32_bench.rs.backup +++ /dev/null @@ -1,35 +0,0 @@ -extern crate blockstack_lib; -extern crate criterion; -extern crate rand; - -use blockstack_lib::address::c32::{c32_address, c32_address_decode}; -use blockstack_lib::address::c32_old::c32_address_decode as c32_address_decode_old; -use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion}; -use rand::Rng; - -fn bench_c32_decoding(c: &mut Criterion) { - let mut group = c.benchmark_group("C32 Decoding"); - - let mut addrs: Vec = vec![]; - for _ in 0..5 { - // random version - let random_version: u8 = rand::thread_rng().gen_range(0, 31); - // random 20 bytes - let random_bytes = rand::thread_rng().gen::<[u8; 20]>(); - let addr = c32_address(random_version, &random_bytes).unwrap(); - addrs.push(addr); - } - - for addr in addrs.iter() { - group.bench_with_input(BenchmarkId::new("Legacy", addr), addr, |b, i| { - b.iter(|| c32_address_decode_old(i)) - }); - group.bench_with_input(BenchmarkId::new("Updated", addr), addr, |b, i| { - b.iter(|| c32_address_decode(i)) - }); - } - group.finish(); -} - -criterion_group!(benches, bench_c32_decoding); -criterion_main!(benches); diff --git a/benches/large_contract_bench.rs.backup b/benches/large_contract_bench.rs.backup deleted file mode 100644 index 0e57793f2e..0000000000 --- a/benches/large_contract_bench.rs.backup +++ /dev/null @@ -1,158 +0,0 @@ -#[macro_use] -extern crate criterion; -extern crate blockstack_lib; -extern crate rand; - -use blockstack_lib::clarity_vm::clarity::ClarityInstance; -use blockstack_lib::clarity_vm::database::marf::MarfedKV; -use blockstack_lib::types::chainstate::StacksBlockId; -use blockstack_lib::types::proof::ClarityMarfTrieId; -use blockstack_lib::vm::database::NULL_BURN_STATE_DB; -use blockstack_lib::{vm::database::NULL_HEADER_DB, vm::types::QualifiedContractIdentifier}; -use criterion::Criterion; - -pub fn rollback_log_memory_test() { - let marf = MarfedKV::temporary(); - let mut clarity_instance = ClarityInstance::new(false, marf); - let EXPLODE_N = 100; - - let contract_identifier = QualifiedContractIdentifier::local("foo").unwrap(); - - { - let mut conn = clarity_instance.begin_block( - &StacksBlockId::sentinel(), - &StacksBlockId::from_bytes(&[0 as u8; 32]).unwrap(), - &NULL_HEADER_DB, - &NULL_BURN_STATE_DB, - ); - - let define_data_var = "(define-data-var XZ (buff 1048576) \"a\")"; - - let mut contract = define_data_var.to_string(); - for i in 0..20 { - let cur_size = format!("{}", 2u32.pow(i)); - contract.push_str("\n"); - contract.push_str(&format!( - "(var-set XZ (concat (unwrap-panic (as-max-len? (var-get XZ) u{})) - (unwrap-panic (as-max-len? (var-get XZ) u{}))))", - cur_size, cur_size - )); - } - for i in 0..EXPLODE_N { - let exploder = format!("(define-data-var var-{} (buff 1048576) (var-get XZ))", i); - contract.push_str("\n"); - contract.push_str(&exploder); - } - - conn.as_transaction(|conn| { - let (ct_ast, _ct_analysis) = conn - .analyze_smart_contract(&contract_identifier, &contract) - .unwrap(); - - assert!(format!( - "{:?}", - conn.initialize_smart_contract(&contract_identifier, &ct_ast, &contract, |_, _| { - false - }) - .unwrap_err() - ) - .contains("MemoryBalanceExceeded")); - }); - } -} - -pub fn ccall_memory_test() { - let marf = MarfedKV::temporary(); - let mut clarity_instance = ClarityInstance::new(false, marf); - let COUNT_PER_CONTRACT = 20; - let CONTRACTS = 5; - - { - let mut conn = clarity_instance.begin_block( - &StacksBlockId::sentinel(), - &StacksBlockId::from_bytes(&[0 as u8; 32]).unwrap(), - &NULL_HEADER_DB, - &NULL_BURN_STATE_DB, - ); - - let define_data_var = "(define-constant buff-0 \"a\")\n"; - - let mut contract = define_data_var.to_string(); - for i in 0..20 { - contract.push_str(&format!( - "(define-constant buff-{} (concat buff-{} buff-{}))\n", - i + 1, - i, - i - )); - } - - for i in 0..COUNT_PER_CONTRACT { - contract.push_str(&format!("(define-constant var-{} buff-20)\n", i)); - } - - contract.push_str("(define-public (call)\n"); - - let mut contracts = vec![]; - - for i in 0..CONTRACTS { - let mut my_contract = contract.clone(); - if i == 0 { - my_contract.push_str("(ok 1))\n"); - } else { - my_contract.push_str(&format!("(contract-call? .contract-{} call))\n", i - 1)); - } - my_contract.push_str("(call)\n"); - contracts.push(my_contract); - } - - for (i, contract) in contracts.into_iter().enumerate() { - let contract_name = format!("contract-{}", i); - let contract_identifier = QualifiedContractIdentifier::local(&contract_name).unwrap(); - - if i < (CONTRACTS - 1) { - conn.as_transaction(|conn| { - let (ct_ast, ct_analysis) = conn - .analyze_smart_contract(&contract_identifier, &contract) - .unwrap(); - conn.initialize_smart_contract( - &contract_identifier, - &ct_ast, - &contract, - |_, _| false, - ) - .unwrap(); - conn.save_analysis(&contract_identifier, &ct_analysis) - .unwrap(); - }) - } else { - conn.as_transaction(|conn| { - let (ct_ast, _ct_analysis) = conn - .analyze_smart_contract(&contract_identifier, &contract) - .unwrap(); - assert!(format!( - "{:?}", - conn.initialize_smart_contract( - &contract_identifier, - &ct_ast, - &contract, - |_, _| false - ) - .unwrap_err() - ) - .contains("MemoryBalanceExceeded")); - }) - } - } - } -} - -pub fn basic_usage_benchmark(c: &mut Criterion) { - c.bench_function("rollback_log_memory_test", |b| { - b.iter(|| rollback_log_memory_test()) - }); - c.bench_function("ccall_memory_test", |b| b.iter(|| ccall_memory_test())); -} - -criterion_group!(benches, basic_usage_benchmark); -criterion_main!(benches); diff --git a/benches/marf_bench.rs.backup b/benches/marf_bench.rs.backup deleted file mode 100644 index 169796ac33..0000000000 --- a/benches/marf_bench.rs.backup +++ /dev/null @@ -1,136 +0,0 @@ -#[macro_use] -extern crate criterion; -extern crate blockstack_lib; -extern crate rand; - -use blockstack_lib::chainstate::stacks::Error; -use blockstack_lib::types::proof::ClarityMarfTrieId; -use criterion::Criterion; -use rand::prelude::*; -use std::fs; - -use blockstack_lib::chainstate::stacks::index::{marf::MARF, storage::TrieFileStorage}; -use blockstack_lib::types::chainstate::{MARFValue, StacksBlockId}; - -pub fn begin( - marf: &mut MARF, - chain_tip: &StacksBlockId, - next_chain_tip: &StacksBlockId, -) -> Result<(), Error> { - let mut tx = marf.begin_tx()?; - tx.begin(chain_tip, next_chain_tip)?; - Ok(()) -} - -fn benchmark_marf_usage( - filename: &str, - blocks: u32, - writes_per_block: u32, - reads_per_block: u32, - batch: bool, -) { - if fs::metadata(filename).is_ok() { - fs::remove_file(filename).unwrap(); - }; - let f = TrieFileStorage::open(filename).unwrap(); - let mut block_header = StacksBlockId::from_bytes(&[0u8; 32]).unwrap(); - let mut marf = MARF::from_storage(f); - - begin(&mut marf, &StacksBlockId::sentinel(), &block_header).unwrap(); - - let mut rng = rand::thread_rng(); - - let mut values = vec![]; - - for i in 0..blocks { - if batch { - let mut batch_keys = Vec::new(); - let mut batch_vals = Vec::new(); - for k in 0..writes_per_block { - let key = format!("{}::{}", i, k); - let mut value = [0u8; 40]; - rng.fill_bytes(&mut value); - batch_keys.push(key.clone()); - batch_vals.push(MARFValue(value.clone())); - values.push((key, MARFValue(value))); - } - marf.insert_batch(&batch_keys, batch_vals).unwrap(); - } else { - for k in 0..writes_per_block { - let key = format!("{}::{}", i, k); - let mut value = [0u8; 40]; - rng.fill_bytes(&mut value); - marf.insert(&key, MARFValue(value.clone())).unwrap(); - values.push((key, MARFValue(value))); - } - } - - for _k in 0..reads_per_block { - let (key, value) = values.as_slice().choose(&mut rng).unwrap(); - assert_eq!( - marf.get_with_proof(&block_header, key).unwrap().unwrap().0, - *value - ); - } - - let mut next_block_header = (i + 1).to_le_bytes().to_vec(); - next_block_header.resize(32, 0); - let next_block_header = StacksBlockId::from_bytes(next_block_header.as_slice()).unwrap(); - - marf.commit().unwrap(); - begin(&mut marf, &block_header, &next_block_header).unwrap(); - block_header = next_block_header; - } - marf.commit().unwrap(); -} - -fn benchmark_marf_read(filename: &str, reads: u32, block: u32, writes_per_block: u32) { - let f = TrieFileStorage::open(filename).unwrap(); - let mut block_header = block.to_le_bytes().to_vec(); - block_header.resize(32, 0); - let block_header = StacksBlockId::from_bytes(block_header.as_slice()).unwrap(); - - let mut marf = MARF::from_storage(f); - - let mut rng = rand::thread_rng(); - - for _i in 0..reads { - let i: u32 = rng.gen_range(0, block); - let k: u32 = rng.gen_range(0, writes_per_block); - let key = format!("{}::{}", i, k); - marf.get_with_proof(&block_header, &key).unwrap().unwrap().0; - } -} - -pub fn basic_usage_benchmark(c: &mut Criterion) { - c.bench_function("marf_setup_1000b_5kW", |b| { - b.iter(|| benchmark_marf_usage("/tmp/db.1k.sqlite", 1000, 5000, 0, false)) - }); - c.bench_function("marf_setup_400b_5kW", |b| { - b.iter(|| benchmark_marf_usage("/tmp/db.400.sqlite", 1000, 5000, 0, false)) - }); - c.bench_function("marf_read_1000b_1kW", |b| { - b.iter(|| benchmark_marf_read("/tmp/db.1k.sqlite", 1000, 1000, 5000)) - }); - c.bench_function("marf_read_400b_1kW", |b| { - b.iter(|| benchmark_marf_read("/tmp/db.400.sqlite", 1000, 400, 5000)) - }); - - c.bench_function("marf_usage_1b_10kW_0kR", |b| { - b.iter(|| benchmark_marf_usage("/tmp/foo.bar.z.sqlite", 1, 10000, 0, false)) - }); - c.bench_function("marf_usage_10b_1kW_2kR", |b| { - b.iter(|| benchmark_marf_usage("/tmp/foo.bar.z.sqlite", 10, 1000, 2000, false)) - }); - c.bench_function("marf_usage_100b_5kW_20kR", |b| { - b.iter(|| benchmark_marf_usage("/tmp/foo.bar.z.sqlite", 20, 5000, 20000, false)) - }); - c.bench_function("marf_usage_batches_10b_1kW_2kR", |b| { - b.iter(|| benchmark_marf_usage("/tmp/foo.bar.z.sqlite", 10, 1000, 2000, true)) - }); -} - -pub fn scaling_read_ratio(_c: &mut Criterion) {} - -criterion_group!(benches, basic_usage_benchmark); -criterion_main!(benches); From bb43fc1fc719dc4dc7b9d28581341b06b50f826d Mon Sep 17 00:00:00 2001 From: Jude Nelson Date: Mon, 27 Feb 2023 17:29:02 -0500 Subject: [PATCH 05/17] fix: don't assume that the bitcoin node always gives a non-zero number of headers --- src/burnchains/bitcoin/spv.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/burnchains/bitcoin/spv.rs b/src/burnchains/bitcoin/spv.rs index 4518dd3930..713a148788 100644 --- a/src/burnchains/bitcoin/spv.rs +++ b/src/burnchains/bitcoin/spv.rs @@ -831,6 +831,11 @@ impl SpvClient { assert!(self.readwrite, "SPV header DB is open read-only"); let num_headers = block_headers.len(); + if num_headers == 0 { + // nothing to do + return Ok(()); + } + let first_header_hash = block_headers[0].header.bitcoin_hash(); let last_header_hash = block_headers[block_headers.len() - 1].header.bitcoin_hash(); let total_work_before = self.update_chain_work()?; From ebce622b843442c5406c05f1198e2ab71280d1b5 Mon Sep 17 00:00:00 2001 From: Jude Nelson Date: Wed, 1 Mar 2023 12:22:34 -0500 Subject: [PATCH 06/17] fix: add unit test and change log entry --- CHANGELOG.md | 6 ++++++ src/burnchains/bitcoin/spv.rs | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2864df84a..3225ac33ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to the versioning scheme outlined in the [README.md](README.md). +## [Unreleased] + +### Fixed + +- Handle the case where a bitcoin node returns zero headers (#3588) + ## [2.1] This is a **consensus-breaking** release that introduces a _lot_ of new diff --git a/src/burnchains/bitcoin/spv.rs b/src/burnchains/bitcoin/spv.rs index 713a148788..28746fcdaf 100644 --- a/src/burnchains/bitcoin/spv.rs +++ b/src/burnchains/bitcoin/spv.rs @@ -1832,4 +1832,24 @@ mod test { let deserialized: Vec> = deserialize(&encoded_tx).unwrap(); } + + #[test] + fn test_handle_headers_empty() { + let headers_path = "/tmp/test-spv-handle_headers_empty.dat"; + if fs::metadata(headers_path).is_ok() { + fs::remove_file(headers_path).unwrap(); + } + + let mut spv_client = SpvClient::new( + headers_path, + 0, + None, + BitcoinNetworkType::Regtest, + true, + false, + ) + .unwrap(); + + spv_client.handle_headers(1, vec![]).unwrap(); + } } From 804303892ca12542e7123fb3139589b97c8f569b Mon Sep 17 00:00:00 2001 From: Jude Nelson Date: Wed, 1 Mar 2023 12:58:34 -0500 Subject: [PATCH 07/17] fix: use explicit version number --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3225ac33ab..7c53ca6371 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to the versioning scheme outlined in the [README.md](README.md). -## [Unreleased] +## [2.1.0.0.1] ### Fixed From 58cc729d75e11aa1ee390afa17dcdf10995f556a Mon Sep 17 00:00:00 2001 From: Jude Nelson Date: Fri, 3 Mar 2023 21:13:04 -0500 Subject: [PATCH 08/17] fix: always_use_affirmation_maps defaults to false --- testnet/stacks-node/src/config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testnet/stacks-node/src/config.rs b/testnet/stacks-node/src/config.rs index fbd35c81ed..a3dbfcd91f 100644 --- a/testnet/stacks-node/src/config.rs +++ b/testnet/stacks-node/src/config.rs @@ -1729,7 +1729,7 @@ impl NodeConfig { marf_defer_hashing: true, pox_sync_sample_secs: 30, use_test_genesis_chainstate: None, - always_use_affirmation_maps: true, + always_use_affirmation_maps: false, require_affirmed_anchor_blocks: true, fault_injection_hide_blocks: false, } From 9f7a650e1823f0f0faa0ca8cd29cc95244c1b495 Mon Sep 17 00:00:00 2001 From: Jude Nelson Date: Fri, 3 Mar 2023 21:17:11 -0500 Subject: [PATCH 09/17] fix: update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c53ca6371..cafbdd3669 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE ### Fixed - Handle the case where a bitcoin node returns zero headers (#3588) +- The default value for `always_use_affirmation_maps` is now set to `false`, + instead of `true`. This was preventing testnet nodes from reaching the chain +tip with the default configuration. ## [2.1] From 753aa1a2244acf4715fc2530eac90f763c3551b6 Mon Sep 17 00:00:00 2001 From: CharlieC3 <2747302+CharlieC3@users.noreply.github.com> Date: Tue, 14 Mar 2023 10:11:20 -0400 Subject: [PATCH 10/17] chore: update default seed nodes and example config files --- docs/profiling.md | 2 +- testnet/stacks-node/conf/mainnet-follower-conf.toml | 2 +- testnet/stacks-node/conf/mainnet-miner-conf.toml | 2 +- testnet/stacks-node/conf/mainnet-mockminer-conf.toml | 2 +- testnet/stacks-node/conf/testnet-follower-conf.toml | 2 +- testnet/stacks-node/conf/testnet-miner-conf.toml | 2 +- testnet/stacks-node/src/config.rs | 9 ++------- 7 files changed, 8 insertions(+), 13 deletions(-) diff --git a/docs/profiling.md b/docs/profiling.md index c35ca532af..35bbaf2f18 100644 --- a/docs/profiling.md +++ b/docs/profiling.md @@ -27,7 +27,7 @@ Enabling debug logging using environment variable `STACKS_LOG_DEBUG=1`: $ STACKS_LOG_DEBUG=1 cargo run -r -p stacks-node --bin stacks-node check-config --config=testnet/stacks-node/conf/mainnet-mockminer-conf.toml INFO [1661276562.220137] [testnet/stacks-node/src/main.rs:82] [main] stacks-node 0.1.0 (tip-mine:c90476aa8a+, release build, macos [aarch64]) INFO [1661276562.220363] [testnet/stacks-node/src/main.rs:115] [main] Loading config at path testnet/stacks-node/conf/mainnet-mockminer-conf.toml -DEBG [1661276562.222450] [testnet/stacks-node/src/main.rs:118] [main] Loaded config file: ConfigFile { burnchain: Some(BurnchainConfigFile { chain: Some("bitcoin"), burn_fee_cap: Some(1), mode: Some("mainnet"), commit_anchor_block_within: None, peer_host: Some("bitcoind.stacks.co"), peer_port: Some(8333), rpc_port: Some(8332), rpc_ssl: None, username: Some("blockstack"), password: Some("blockstacksystem"), timeout: None, magic_bytes: None, local_mining_public_key: None, process_exit_at_block_height: None, poll_time_secs: None, satoshis_per_byte: None, leader_key_tx_estimated_size: None, block_commit_tx_estimated_size: None, rbf_fee_increment: None, max_rbf: None, epochs: None }), node: Some(NodeConfigFile { name: None, seed: None, deny_nodes: None, working_dir: Some("/Users/igor/w/stacks-work/working_dir"), rpc_bind: Some("0.0.0.0:20443"), p2p_bind: Some("0.0.0.0:20444"), p2p_address: None, data_url: None, bootstrap_node: Some("02da7a464ac770ae8337a343670778b93410f2f3fef6bea98dd1c3e9224459d36b@seed-0.mainnet.stacks.co:20444,02afeae522aab5f8c99a00ddf75fbcb4a641e052dd48836408d9cf437344b63516@seed-1.mainnet.stacks.co:20444,03652212ea76be0ed4cd83a25c06e57819993029a7b9999f7d63c36340b34a4e62@seed-2.mainnet.stacks.co:20444"), local_peer_seed: None, miner: Some(true), mock_mining: Some(true), mine_microblocks: None, microblock_frequency: None, max_microblocks: None, wait_time_for_microblocks: None, prometheus_bind: None, marf_cache_strategy: None, marf_defer_hashing: None, pox_sync_sample_secs: None, use_test_genesis_chainstate: None }), ustx_balance: None, events_observer: Some([EventObserverConfigFile { endpoint: "localhost:3700", events_keys: ["*"] }]), connection_options: None, fee_estimation: None, miner: None } +DEBG [1661276562.222450] [testnet/stacks-node/src/main.rs:118] [main] Loaded config file: ConfigFile { burnchain: Some(BurnchainConfigFile { chain: Some("bitcoin"), burn_fee_cap: Some(1), mode: Some("mainnet"), commit_anchor_block_within: None, peer_host: Some("bitcoind.stacks.co"), peer_port: Some(8333), rpc_port: Some(8332), rpc_ssl: None, username: Some("blockstack"), password: Some("blockstacksystem"), timeout: None, magic_bytes: None, local_mining_public_key: None, process_exit_at_block_height: None, poll_time_secs: None, satoshis_per_byte: None, leader_key_tx_estimated_size: None, block_commit_tx_estimated_size: None, rbf_fee_increment: None, max_rbf: None, epochs: None }), node: Some(NodeConfigFile { name: None, seed: None, deny_nodes: None, working_dir: Some("/Users/igor/w/stacks-work/working_dir"), rpc_bind: Some("0.0.0.0:20443"), p2p_bind: Some("0.0.0.0:20444"), p2p_address: None, data_url: None, bootstrap_node: Some("02196f005965cebe6ddc3901b7b1cc1aa7a88f305bb8c5893456b8f9a605923893@seed.mainnet.hiro.so:20444"), local_peer_seed: None, miner: Some(true), mock_mining: Some(true), mine_microblocks: None, microblock_frequency: None, max_microblocks: None, wait_time_for_microblocks: None, prometheus_bind: None, marf_cache_strategy: None, marf_defer_hashing: None, pox_sync_sample_secs: None, use_test_genesis_chainstate: None }), ustx_balance: None, events_observer: Some([EventObserverConfigFile { endpoint: "localhost:3700", events_keys: ["*"] }]), connection_options: None, fee_estimation: None, miner: None } INFO [1661276562.233071] [testnet/stacks-node/src/main.rs:128] [main] Valid config! ``` diff --git a/testnet/stacks-node/conf/mainnet-follower-conf.toml b/testnet/stacks-node/conf/mainnet-follower-conf.toml index f6b283e38e..9f992a7e2c 100644 --- a/testnet/stacks-node/conf/mainnet-follower-conf.toml +++ b/testnet/stacks-node/conf/mainnet-follower-conf.toml @@ -2,7 +2,7 @@ # working_dir = "/dir/to/save/chainstate" rpc_bind = "0.0.0.0:20443" p2p_bind = "0.0.0.0:20444" -bootstrap_node = "02da7a464ac770ae8337a343670778b93410f2f3fef6bea98dd1c3e9224459d36b@seed-0.mainnet.stacks.co:20444,02afeae522aab5f8c99a00ddf75fbcb4a641e052dd48836408d9cf437344b63516@seed-1.mainnet.stacks.co:20444,03652212ea76be0ed4cd83a25c06e57819993029a7b9999f7d63c36340b34a4e62@seed-2.mainnet.stacks.co:20444" +bootstrap_node = "02196f005965cebe6ddc3901b7b1cc1aa7a88f305bb8c5893456b8f9a605923893@seed.mainnet.hiro.so:20444" [burnchain] chain = "bitcoin" diff --git a/testnet/stacks-node/conf/mainnet-miner-conf.toml b/testnet/stacks-node/conf/mainnet-miner-conf.toml index 1769178740..319328b677 100644 --- a/testnet/stacks-node/conf/mainnet-miner-conf.toml +++ b/testnet/stacks-node/conf/mainnet-miner-conf.toml @@ -5,7 +5,7 @@ p2p_bind = "0.0.0.0:20444" seed = "" local_peer_seed = "" miner = true -bootstrap_node = "02da7a464ac770ae8337a343670778b93410f2f3fef6bea98dd1c3e9224459d36b@seed-0.mainnet.stacks.co:20444,02afeae522aab5f8c99a00ddf75fbcb4a641e052dd48836408d9cf437344b63516@seed-1.mainnet.stacks.co:20444,03652212ea76be0ed4cd83a25c06e57819993029a7b9999f7d63c36340b34a4e62@seed-2.mainnet.stacks.co:20444" +bootstrap_node = "02196f005965cebe6ddc3901b7b1cc1aa7a88f305bb8c5893456b8f9a605923893@seed.mainnet.hiro.so:20444" [burnchain] chain = "bitcoin" diff --git a/testnet/stacks-node/conf/mainnet-mockminer-conf.toml b/testnet/stacks-node/conf/mainnet-mockminer-conf.toml index 9283a6ca95..37381a60af 100644 --- a/testnet/stacks-node/conf/mainnet-mockminer-conf.toml +++ b/testnet/stacks-node/conf/mainnet-mockminer-conf.toml @@ -4,7 +4,7 @@ rpc_bind = "0.0.0.0:20443" p2p_bind = "0.0.0.0:20444" miner = true mock_mining = true -bootstrap_node = "02da7a464ac770ae8337a343670778b93410f2f3fef6bea98dd1c3e9224459d36b@seed-0.mainnet.stacks.co:20444,02afeae522aab5f8c99a00ddf75fbcb4a641e052dd48836408d9cf437344b63516@seed-1.mainnet.stacks.co:20444,03652212ea76be0ed4cd83a25c06e57819993029a7b9999f7d63c36340b34a4e62@seed-2.mainnet.stacks.co:20444" +bootstrap_node = "02196f005965cebe6ddc3901b7b1cc1aa7a88f305bb8c5893456b8f9a605923893@seed.mainnet.hiro.so:20444" [burnchain] chain = "bitcoin" diff --git a/testnet/stacks-node/conf/testnet-follower-conf.toml b/testnet/stacks-node/conf/testnet-follower-conf.toml index e1563d333a..6872666a2c 100644 --- a/testnet/stacks-node/conf/testnet-follower-conf.toml +++ b/testnet/stacks-node/conf/testnet-follower-conf.toml @@ -2,7 +2,7 @@ # working_dir = "/dir/to/save/chainstate" rpc_bind = "0.0.0.0:20443" p2p_bind = "0.0.0.0:20444" -bootstrap_node = "047435c194e9b01b3d7f7a2802d6684a3af68d05bbf4ec8f17021980d777691f1d51651f7f1d566532c804da506c117bbf79ad62eea81213ba58f8808b4d9504ad@testnet.stacks.co:20444" +bootstrap_node = "029266faff4c8e0ca4f934f34996a96af481df94a89b0c9bd515f3536a95682ddc@seed.testnet.hiro.so:20444" wait_time_for_microblocks = 10000 [burnchain] diff --git a/testnet/stacks-node/conf/testnet-miner-conf.toml b/testnet/stacks-node/conf/testnet-miner-conf.toml index 3b1b0013e3..379cbd3822 100644 --- a/testnet/stacks-node/conf/testnet-miner-conf.toml +++ b/testnet/stacks-node/conf/testnet-miner-conf.toml @@ -5,7 +5,7 @@ p2p_bind = "0.0.0.0:20444" seed = "" local_peer_seed = "" miner = true -bootstrap_node = "047435c194e9b01b3d7f7a2802d6684a3af68d05bbf4ec8f17021980d777691f1d51651f7f1d566532c804da506c117bbf79ad62eea81213ba58f8808b4d9504ad@testnet.stacks.co:20444" +bootstrap_node = "029266faff4c8e0ca4f934f34996a96af481df94a89b0c9bd515f3536a95682ddc@seed.testnet.hiro.so:20444" wait_time_for_microblocks = 10000 [burnchain] diff --git a/testnet/stacks-node/src/config.rs b/testnet/stacks-node/src/config.rs index a3dbfcd91f..6cb3ae2743 100644 --- a/testnet/stacks-node/src/config.rs +++ b/testnet/stacks-node/src/config.rs @@ -206,7 +206,7 @@ impl ConfigFile { }; let node = NodeConfigFile { - bootstrap_node: Some("047435c194e9b01b3d7f7a2802d6684a3af68d05bbf4ec8f17021980d777691f1d51651f7f1d566532c804da506c117bbf79ad62eea81213ba58f8808b4d9504ad@xenon.blockstack.org:20444".to_string()), + bootstrap_node: Some("029266faff4c8e0ca4f934f34996a96af481df94a89b0c9bd515f3536a95682ddc@seed.testnet.hiro.so:20444".to_string()), miner: Some(false), ..NodeConfigFile::default() }; @@ -250,13 +250,8 @@ impl ConfigFile { ..BurnchainConfigFile::default() }; - let bootstrap_nodes = [ - "02da7a464ac770ae8337a343670778b93410f2f3fef6bea98dd1c3e9224459d36b@seed-0.mainnet.stacks.co:20444", - "02afeae522aab5f8c99a00ddf75fbcb4a641e052dd48836408d9cf437344b63516@seed-1.mainnet.stacks.co:20444", - "03652212ea76be0ed4cd83a25c06e57819993029a7b9999f7d63c36340b34a4e62@seed-2.mainnet.stacks.co:20444"].join(","); - let node = NodeConfigFile { - bootstrap_node: Some(bootstrap_nodes), + bootstrap_node: Some("02196f005965cebe6ddc3901b7b1cc1aa7a88f305bb8c5893456b8f9a605923893@seed.mainnet.hiro.so:20444".to_string()), miner: Some(false), ..NodeConfigFile::default() }; From ffccbd767db396f14de79d91d3582a00b42e1211 Mon Sep 17 00:00:00 2001 From: Scott A <119700554+fpbgg@users.noreply.github.com> Date: Tue, 14 Mar 2023 13:03:50 -0400 Subject: [PATCH 11/17] fix(deps): only depend on one version of secp256k1 --- Cargo.lock | 340 ++++++++++++++++++++------------------- Cargo.toml | 2 +- stacks-common/Cargo.toml | 2 +- 3 files changed, 179 insertions(+), 165 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b20f432762..df02fb1ea3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -216,12 +216,11 @@ dependencies = [ [[package]] name = "async-lock" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8101efe8695a6c17e02911402145357e718ac92d3ff88ae8419e84b1707b685" +checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" dependencies = [ "event-listener", - "futures-lite", ] [[package]] @@ -348,9 +347,9 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array 0.14.6", ] @@ -402,7 +401,7 @@ dependencies = [ "rstest", "rstest_reuse", "rusqlite", - "secp256k1 0.24.3", + "secp256k1", "serde", "serde_derive", "serde_json", @@ -481,9 +480,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.23" +version = "0.4.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" +checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" dependencies = [ "iana-time-zone", "js-sys", @@ -656,9 +655,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +checksum = "cf2b3e8478797446514c91ef04bafcb59faba183e621ad488df88983cc14128c" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", @@ -666,9 +665,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" dependencies = [ "cfg-if 1.0.0", "crossbeam-epoch", @@ -677,22 +676,22 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.13" +version = "0.9.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" +checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695" dependencies = [ "autocfg", "cfg-if 1.0.0", "crossbeam-utils", - "memoffset 0.7.1", + "memoffset 0.8.0", "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.14" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" +checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" dependencies = [ "cfg-if 1.0.0", ] @@ -719,9 +718,9 @@ dependencies = [ [[package]] name = "csv" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af91f40b7355f82b0a891f50e70399475945bb0b0da4f1700ce60761c9d3e359" +checksum = "0b015497079b9a9d69c02ad25de6c0a6edef051ea6360a327d0bd05802ef64ad" dependencies = [ "csv-core", "itoa", @@ -773,9 +772,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.91" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86d3488e7665a7a483b57e25bdd90d0aeb2bc7608c8d0346acf2ad3f1caf1d62" +checksum = "9a140f260e6f3f79013b8bfc65e7ce630c9ab4388c6a89c71e07226f49487b72" dependencies = [ "cc", "cxxbridge-flags", @@ -785,9 +784,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.91" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48fcaf066a053a41a81dfb14d57d99738b767febb8b735c3016e469fac5da690" +checksum = "da6383f459341ea689374bf0a42979739dc421874f112ff26f829b8040b8e613" dependencies = [ "cc", "codespan-reporting", @@ -800,15 +799,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.91" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2ef98b8b717a829ca5603af80e1f9e2e48013ab227b68ef37872ef84ee479bf" +checksum = "90201c1a650e95ccff1c8c0bb5a343213bdd317c6e600a93075bca2eff54ec97" [[package]] name = "cxxbridge-macro" -version = "1.0.91" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "086c685979a698443656e5cf7856c95c642295a38599f12fb1ff76fb28d19892" +checksum = "0b75aed41bb2e6367cae39e6326ef817a851db13c13e4f3263714ca3cfb8de56" dependencies = [ "proc-macro2", "quote", @@ -839,7 +838,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" dependencies = [ - "block-buffer 0.10.3", + "block-buffer 0.10.4", "crypto-common", ] @@ -898,6 +897,27 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "errno" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +dependencies = [ + "errno-dragonfly", + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "event-listener" version = "2.5.3" @@ -976,9 +996,9 @@ checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" [[package]] name = "futures-channel" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" +checksum = "164713a5a0dcc3e7b4b1ed7d3b433cabc18025386f9339346e8daf15963cf7ac" dependencies = [ "futures-core", "futures-sink", @@ -986,15 +1006,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" +checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd" [[package]] name = "futures-io" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" +checksum = "89d422fa3cbe3b40dca574ab087abb5bc98258ea57eea3fd6f1fa7162c778b91" [[package]] name = "futures-lite" @@ -1013,21 +1033,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" +checksum = "ec93083a4aecafb2a80a885c9de1f0ccae9dbd32c2bb54b0c3a65690e0b8d2f2" [[package]] name = "futures-task" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" +checksum = "fd65540d33b37b16542a0438c12e6aeead10d4ac5d05bd3f805b8f35ab592879" [[package]] name = "futures-util" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" +checksum = "3ef6b17e481503ec85211fed8f39d1970f128935ca1f814cd32ac4a6842e84ab" dependencies = [ "futures-core", "futures-io", @@ -1110,9 +1130,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" +checksum = "5be7b54589b581f624f566bf5d8eb2bab1db736c51528720b6bd36b96b55924d" dependencies = [ "bytes", "fnv", @@ -1278,9 +1298,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.24" +version = "0.14.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e011372fa0b68db8350aa7a248930ecc7839bf46d8485577d69f117a75f164c" +checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" dependencies = [ "bytes", "futures-channel", @@ -1381,6 +1401,16 @@ dependencies = [ "num-traits", ] +[[package]] +name = "io-lifetimes" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfa919a82ea574332e2de6e74b4c36e74d41982b335080fa59d4ef31be20fdf3" +dependencies = [ + "libc", + "windows-sys 0.45.0", +] + [[package]] name = "iovec" version = "0.1.4" @@ -1407,9 +1437,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" [[package]] name = "js-sys" @@ -1456,9 +1486,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.139" +version = "0.2.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" [[package]] name = "libflate" @@ -1500,6 +1530,12 @@ dependencies = [ "cc", ] +[[package]] +name = "linux-raw-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" + [[package]] name = "log" version = "0.4.17" @@ -1527,9 +1563,9 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.7.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" dependencies = [ "autocfg", ] @@ -1729,9 +1765,9 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pest" -version = "2.5.5" +version = "2.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "028accff104c4e513bad663bbcd2ad7cfd5304144404c31ed0a77ac103d00660" +checksum = "8cbd939b234e95d72bc393d51788aec68aeeb5d51e748ca08ff3aad58cb722f7" dependencies = [ "thiserror", "ucd-trie", @@ -1811,16 +1847,18 @@ dependencies = [ [[package]] name = "polling" -version = "2.5.2" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22122d5ec4f9fe1b3916419b76be1e80bcb93f618d071d2edf841b137b2a2bd6" +checksum = "7e1f879b2998099c2d69ab9605d145d5b661195627eccc680002c4918a7fb6fa" dependencies = [ "autocfg", + "bitflags", "cfg-if 1.0.0", + "concurrent-queue", "libc", "log", - "wepoll-ffi", - "windows-sys 0.42.0", + "pin-project-lite", + "windows-sys 0.45.0", ] [[package]] @@ -1872,9 +1910,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.51" +version = "1.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" +checksum = "1d0e1ae9e836cc3beddd63db0df682593d7e2d3d891ae8c9083d2113e1744224" dependencies = [ "unicode-ident", ] @@ -1916,9 +1954,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.23" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" dependencies = [ "proc-macro2", ] @@ -1996,9 +2034,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7" +checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" dependencies = [ "either", "rayon-core", @@ -2006,9 +2044,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.10.2" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "356a0625f1954f730c0201cdab48611198dc6ce21f4acff55089b5a78e6e835b" +checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" dependencies = [ "crossbeam-channel", "crossbeam-deque", @@ -2053,15 +2091,6 @@ version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi 0.3.9", -] - [[package]] name = "reqwest" version = "0.11.14" @@ -2202,7 +2231,21 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.16", + "semver 1.0.17", +] + +[[package]] +name = "rustix" +version = "0.36.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd5c6ff11fecd55b40746d1995a02f2eb375bf8c00d192d521ee09f42bef37bc" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.45.0", ] [[package]] @@ -2237,15 +2280,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" +checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" [[package]] name = "ryu" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" [[package]] name = "safemem" @@ -2276,9 +2319,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "scratch" -version = "1.0.3" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2" +checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" [[package]] name = "sct" @@ -2290,35 +2333,16 @@ dependencies = [ "untrusted", ] -[[package]] -name = "secp256k1" -version = "0.21.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c42e6f1735c5f00f51e43e28d6634141f2bcad10931b2609ddd74a86d751260" -dependencies = [ - "secp256k1-sys 0.4.2", - "serde", -] - [[package]] name = "secp256k1" version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" dependencies = [ - "secp256k1-sys 0.6.1", + "secp256k1-sys", "serde", ] -[[package]] -name = "secp256k1-sys" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957da2573cde917463ece3570eab4a0b3f19de6f1646cde62e6fd3868f566036" -dependencies = [ - "cc", -] - [[package]] name = "secp256k1-sys" version = "0.6.1" @@ -2348,9 +2372,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" +checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" [[package]] name = "semver-parser" @@ -2369,9 +2393,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.152" +version = "1.0.156" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" +checksum = "314b5b092c0ade17c00142951e50ced110ec27cea304b1037c6969246c2469a4" dependencies = [ "serde_derive", ] @@ -2388,9 +2412,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.152" +version = "1.0.156" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" +checksum = "d7e29c4601e36bcec74a223228dce795f4cd3616341a4af93520ca1a837c087d" dependencies = [ "proc-macro2", "quote", @@ -2399,9 +2423,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.93" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76" +checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea" dependencies = [ "itoa", "ryu", @@ -2421,9 +2445,9 @@ dependencies = [ [[package]] name = "serde_stacker" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35f73df5c3072392d6a2abb8588d06db7f57b83dc95d5bbb96da71cd8468fcfd" +checksum = "2f5557f4c1103cecd0e639a17ab22d670b89912d8a506589ee627bf738a15a5d" dependencies = [ "serde", "stacker", @@ -2582,7 +2606,7 @@ dependencies = [ "serde", "serde_json", "slog", - "time 0.3.19", + "time 0.3.20", ] [[package]] @@ -2595,7 +2619,7 @@ dependencies = [ "slog", "term", "thread_local", - "time 0.3.19", + "time 0.3.20", ] [[package]] @@ -2606,9 +2630,9 @@ checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "socket2" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" dependencies = [ "libc", "winapi 0.3.9", @@ -2649,7 +2673,7 @@ dependencies = [ "rstest", "rstest_reuse", "rusqlite", - "secp256k1 0.21.3", + "secp256k1", "serde", "serde_derive", "serde_json", @@ -2773,9 +2797,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.108" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56e159d99e6c2b93995d171050271edb50ecc5288fbc7cc17de8fdce4e58c14" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", @@ -2784,16 +2808,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95" dependencies = [ "cfg-if 1.0.0", "fastrand", - "libc", "redox_syscall", - "remove_dir_all", - "winapi 0.3.9", + "rustix", + "windows-sys 0.42.0", ] [[package]] @@ -2827,18 +2850,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.38" +version = "1.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" +checksum = "a5ab016db510546d856297882807df8da66a16fb8c4101cb8b30054b0d5b2d9c" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.38" +version = "1.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" +checksum = "5420d42e90af0c38c3290abcca25b9b3bdf379fc9f55c528f53a269d9c9a267e" dependencies = [ "proc-macro2", "quote", @@ -2883,16 +2906,16 @@ dependencies = [ [[package]] name = "time" -version = "0.3.19" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53250a3b3fed8ff8fd988587d8925d26a83ac3845d9e03b220b37f34c2b8d6c2" +checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" dependencies = [ "itoa", "libc", "num_threads", "serde", "time-core", - "time-macros 0.2.7", + "time-macros 0.2.8", ] [[package]] @@ -2913,9 +2936,9 @@ dependencies = [ [[package]] name = "time-macros" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a460aeb8de6dcb0f381e1ee05f1cd56fcf5a5f6eb8187ff3d8f0b11078d38b7c" +checksum = "fd80a657e71da814b8e5d60d3374fc6d35045062245d80224748ae522dd76f36" dependencies = [ "time-core", ] @@ -2960,9 +2983,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.25.0" +version = "1.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e00990ebabbe4c14c08aca901caed183ecd5c09562a12c824bb53d3c3fd3af" +checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" dependencies = [ "autocfg", "bytes", @@ -2972,7 +2995,7 @@ dependencies = [ "num_cpus", "pin-project-lite", "socket2", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -3116,15 +3139,15 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" +checksum = "524b68aca1d05e03fdf03fcdce2c6c94b6daf6d16861ddaa7e4f2b6638a9052c" [[package]] name = "unicode-ident" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" [[package]] name = "unicode-normalization" @@ -3368,15 +3391,6 @@ dependencies = [ "webpki", ] -[[package]] -name = "wepoll-ffi" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" -dependencies = [ - "cc", -] - [[package]] name = "winapi" version = "0.2.8" @@ -3446,9 +3460,9 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -3461,45 +3475,45 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_i686_gnu" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_x86_64_gnu" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "winreg" diff --git a/Cargo.toml b/Cargo.toml index 4a68b9056e..b930bacb78 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -71,7 +71,7 @@ version = "1.0" features = ["arbitrary_precision", "unbounded_depth"] [dependencies.secp256k1] -version = "0.24.2" +version = "0.24.3" features = ["serde", "recovery"] [dependencies.rusqlite] diff --git a/stacks-common/Cargo.toml b/stacks-common/Cargo.toml index a962386b5d..19cd58172e 100644 --- a/stacks-common/Cargo.toml +++ b/stacks-common/Cargo.toml @@ -37,7 +37,7 @@ version = "1.0" features = ["arbitrary_precision", "unbounded_depth"] [dependencies.secp256k1] -version = "0.21.0" +version = "0.24.3" features = ["serde", "recovery"] [dependencies.rusqlite] From 91173a23cd76f71de97e32d4a66b3d8b050ce015 Mon Sep 17 00:00:00 2001 From: Jude Nelson Date: Tue, 14 Mar 2023 14:09:09 -0400 Subject: [PATCH 12/17] fix: don't panic if a bloom counter underflows --- src/util_lib/bloom.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/util_lib/bloom.rs b/src/util_lib/bloom.rs index d77d476d69..e3633288f0 100644 --- a/src/util_lib/bloom.rs +++ b/src/util_lib/bloom.rs @@ -365,15 +365,15 @@ impl BloomCounter { let sql = format!("CREATE TABLE IF NOT EXISTS {}(counts BLOB NOT NULL, num_bins INTEGER NOT NULL, num_hashes INTEGER NOT NULL, hasher BLOB NOT NULL);", table_name); tx.execute(&sql, NO_PARAMS).map_err(db_error::SqliteError)?; - let (num_bits, num_hashes) = bloom_hash_count(error_rate, max_items); - let counts_vec = vec![0u8; (num_bits * 4) as usize]; + let (num_bins, num_hashes) = bloom_hash_count(error_rate, max_items); + let counts_vec = vec![0u8; (num_bins * 4) as usize]; let hasher_vec = hasher.serialize_to_vec(); let sql = format!( "INSERT INTO {} (counts, num_bins, num_hashes, hasher) VALUES (?1, ?2, ?3, ?4)", table_name ); - let args: &[&dyn ToSql] = &[&counts_vec, &num_bits, &num_hashes, &hasher_vec]; + let args: &[&dyn ToSql] = &[&counts_vec, &num_bins, &num_hashes, &hasher_vec]; tx.execute(&sql, args).map_err(db_error::SqliteError)?; @@ -384,7 +384,7 @@ impl BloomCounter { Ok(BloomCounter { hasher, table_name: table_name.to_string(), - num_bins: num_bits, + num_bins: num_bins, num_hashes, counts_rowid: counts_rowid as u32, }) @@ -533,8 +533,6 @@ impl BloomCounter { let new_bin = bin - 1; BloomCounter::::set_counts_bin(&mut fd, slot, new_bin); count = cmp::min(new_bin, count); - } else { - panic!("BUG: item is present in the bloom counter, but has a zero count (i = {}, slot = {})", i, slot); } } From f6a48d02bfae32f0ea3eded5f31b5fba81112536 Mon Sep 17 00:00:00 2001 From: Aaron Blankstein Date: Tue, 14 Mar 2023 08:00:54 -0500 Subject: [PATCH 13/17] fix: reduce chain-liveness poll frequency --- testnet/stacks-node/src/config.rs | 10 ++++++++++ testnet/stacks-node/src/run_loop/neon.rs | 8 +++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/testnet/stacks-node/src/config.rs b/testnet/stacks-node/src/config.rs index 6cb3ae2743..6b3f6df012 100644 --- a/testnet/stacks-node/src/config.rs +++ b/testnet/stacks-node/src/config.rs @@ -665,6 +665,9 @@ impl Config { // chainstate fault_injection activation for hide_blocks. // you can't set this in the config file. fault_injection_hide_blocks: false, + chain_liveness_poll_time_secs: node + .chain_liveness_poll_time_secs + .unwrap_or(default_node_config.chain_liveness_poll_time_secs), }; (node_config, node.bootstrap_node, node.deny_nodes) } @@ -1450,6 +1453,9 @@ pub struct NodeConfig { // fault injection for hiding blocks. // not part of the config file. pub fault_injection_hide_blocks: bool, + /// At most, how often should the chain-liveness thread + /// wake up the chains-coordinator. Defaults to 300s (5 min). + pub chain_liveness_poll_time_secs: u64, } #[derive(Clone, Debug)] @@ -1727,6 +1733,7 @@ impl NodeConfig { always_use_affirmation_maps: false, require_affirmed_anchor_blocks: true, fault_injection_hide_blocks: false, + chain_liveness_poll_time_secs: 300, } } @@ -1928,6 +1935,9 @@ pub struct NodeConfigFile { pub use_test_genesis_chainstate: Option, pub always_use_affirmation_maps: Option, pub require_affirmed_anchor_blocks: Option, + /// At most, how often should the chain-liveness thread + /// wake up the chains-coordinator. Defaults to 300s (5 min). + pub chain_liveness_poll_time_secs: Option, } #[derive(Clone, Deserialize, Debug)] diff --git a/testnet/stacks-node/src/run_loop/neon.rs b/testnet/stacks-node/src/run_loop/neon.rs index 7c5d387124..47b5df31ce 100644 --- a/testnet/stacks-node/src/run_loop/neon.rs +++ b/testnet/stacks-node/src/run_loop/neon.rs @@ -629,7 +629,7 @@ impl RunLoop { last_stacks_pox_reorg_recover_time: &mut u128, ) { let delay = cmp::max( - 1, + config.node.chain_liveness_poll_time_secs, cmp::max( config.miner.first_attempt_time_ms, config.miner.subsequent_attempt_time_ms, @@ -724,7 +724,9 @@ impl RunLoop { &stacks_tip_affirmation_map, &heaviest_affirmation_map ); - // do it anyway since it's harmless + // announce a new stacks block to force the chains coordinator + // to wake up anyways. this isn't free, so we have to make sure + // the chain-liveness thread doesn't wake up too often globals.coord().announce_new_stacks_block(); } @@ -747,7 +749,7 @@ impl RunLoop { last_announce_time: &mut u128, ) { let delay = cmp::max( - 1, + config.node.chain_liveness_poll_time_secs, cmp::max( config.miner.first_attempt_time_ms, config.miner.subsequent_attempt_time_ms, From 6ccadda4ad3705206369f6308362dae60e6f99ea Mon Sep 17 00:00:00 2001 From: Aaron Blankstein Date: Tue, 14 Mar 2023 10:18:09 -0500 Subject: [PATCH 14/17] chore: update changelog --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cafbdd3669..325b6ed7a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,9 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE - Handle the case where a bitcoin node returns zero headers (#3588) - The default value for `always_use_affirmation_maps` is now set to `false`, instead of `true`. This was preventing testnet nodes from reaching the chain -tip with the default configuration. + tip with the default configuration. +- Reduce default poll time of the `chain-liveness` thread which reduces the + possibility that a miner thread will get interrupted (#3610). ## [2.1] From ac35cde2c3106b0abf03e1378db317ca14ad8eca Mon Sep 17 00:00:00 2001 From: Aaron Blankstein Date: Mon, 20 Mar 2023 10:21:31 -0500 Subject: [PATCH 15/17] fix: incorporate unlocks in mempool admitter, #3623 --- src/chainstate/stacks/db/blocks.rs | 5 +- .../stacks/tests/block_construction.rs | 27 +++ src/core/mempool.rs | 21 +- src/main.rs | 1 + src/net/p2p.rs | 1 + src/net/relay.rs | 2 + src/net/rpc.rs | 1 + testnet/stacks-node/src/neon_node.rs | 3 + testnet/stacks-node/src/tenure.rs | 14 ++ .../stacks-node/src/tests/bitcoin_regtest.rs | 12 +- testnet/stacks-node/src/tests/integrations.rs | 32 +++ testnet/stacks-node/src/tests/mempool.rs | 215 +++++++++++++++--- testnet/stacks-node/src/tests/mod.rs | 20 +- 13 files changed, 310 insertions(+), 44 deletions(-) diff --git a/src/chainstate/stacks/db/blocks.rs b/src/chainstate/stacks/db/blocks.rs index bafeb503b8..f7acd84371 100644 --- a/src/chainstate/stacks/db/blocks.rs +++ b/src/chainstate/stacks/db/blocks.rs @@ -6975,6 +6975,7 @@ impl StacksChainState { /// unconfirmed microblock stream trailing off of it. pub fn will_admit_mempool_tx( &mut self, + burn_state_db: &dyn BurnStateDB, current_consensus_hash: &ConsensusHash, current_block: &BlockHeaderHash, tx: &StacksTransaction, @@ -7019,7 +7020,7 @@ impl StacksChainState { let current_tip = StacksChainState::get_parent_index_block(current_consensus_hash, current_block); - let res = match self.with_read_only_clarity_tx(&NULL_BURN_STATE_DB, ¤t_tip, |conn| { + let res = match self.with_read_only_clarity_tx(burn_state_db, ¤t_tip, |conn| { StacksChainState::can_include_tx(conn, &conf, has_microblock_pubk, tx, tx_size) }) { Some(r) => r, @@ -7039,7 +7040,7 @@ impl StacksChainState { { debug!("Transaction {} is unminable in the confirmed chain tip due to nonce {} != {}; trying the unconfirmed chain tip", &tx.txid(), mismatch_error.expected, mismatch_error.actual); - self.with_read_only_unconfirmed_clarity_tx(&NULL_BURN_STATE_DB, |conn| { + self.with_read_only_unconfirmed_clarity_tx(burn_state_db, |conn| { StacksChainState::can_include_tx( conn, &conf, diff --git a/src/chainstate/stacks/tests/block_construction.rs b/src/chainstate/stacks/tests/block_construction.rs index cdd7e3a208..5ba91c8046 100644 --- a/src/chainstate/stacks/tests/block_construction.rs +++ b/src/chainstate/stacks/tests/block_construction.rs @@ -248,6 +248,7 @@ fn test_build_anchored_blocks_stx_transfers_single() { mempool .submit( chainstate, + sortdb, &parent_consensus_hash, &parent_header_hash, &stx_transfer, @@ -382,6 +383,7 @@ fn test_build_anchored_blocks_empty_with_builder_timeout() { mempool .submit( chainstate, + sortdb, &parent_consensus_hash, &parent_header_hash, &stx_transfer, @@ -516,6 +518,7 @@ fn test_build_anchored_blocks_stx_transfers_multi() { mempool .submit( chainstate, + sortdb, &parent_consensus_hash, &parent_header_hash, &stx_transfer, @@ -541,6 +544,7 @@ fn test_build_anchored_blocks_stx_transfers_multi() { mempool .submit( chainstate, + sortdb, &parent_consensus_hash, &parent_header_hash, &stx_transfer, @@ -1230,6 +1234,7 @@ fn test_build_anchored_blocks_incrementing_nonces() { mempool .submit( chainstate, + sortdb, &parent_consensus_hash, &parent_header_hash, &tx, @@ -1430,6 +1435,7 @@ fn test_build_anchored_blocks_skip_too_expensive() { mempool .submit( chainstate, + sortdb, &parent_consensus_hash, &parent_header_hash, &stx_transfer, @@ -1451,6 +1457,7 @@ fn test_build_anchored_blocks_skip_too_expensive() { mempool .submit( chainstate, + sortdb, &parent_consensus_hash, &parent_header_hash, &contract_tx, @@ -1471,6 +1478,7 @@ fn test_build_anchored_blocks_skip_too_expensive() { mempool .submit( chainstate, + sortdb, &parent_consensus_hash, &parent_header_hash, &stx_transfer, @@ -1617,6 +1625,7 @@ fn test_build_anchored_blocks_multiple_chaintips() { mempool .submit( chainstate, + sortdb, &parent_consensus_hash, &parent_header_hash, &contract_tx, @@ -1771,6 +1780,7 @@ fn test_build_anchored_blocks_empty_chaintips() { mempool .submit( chainstate, + sortdb, &parent_consensus_hash, &parent_header_hash, &contract_tx, @@ -1901,6 +1911,7 @@ fn test_build_anchored_blocks_too_expensive_transactions() { mempool .submit_raw( chainstate, + sortdb, &parent_consensus_hash, &parent_header_hash, contract_tx_bytes, @@ -1928,6 +1939,7 @@ fn test_build_anchored_blocks_too_expensive_transactions() { mempool .submit_raw( chainstate, + sortdb, &parent_consensus_hash, &parent_header_hash, contract_tx_bytes, @@ -2262,6 +2274,7 @@ fn test_build_anchored_blocks_bad_nonces() { mempool .submit_raw( chainstate, + sortdb, &parent_tip_ch, &parent_header_hash, contract_tx_bytes, @@ -2290,6 +2303,7 @@ fn test_build_anchored_blocks_bad_nonces() { mempool .submit_raw( chainstate, + sortdb, &parent_tip_ch, &parent_header_hash, contract_tx_bytes, @@ -2326,6 +2340,7 @@ fn test_build_anchored_blocks_bad_nonces() { mempool .submit_raw( chainstate, + sortdb, &parent_tip_ch, &parent_header_hash, contract_tx_bytes, @@ -2354,6 +2369,7 @@ fn test_build_anchored_blocks_bad_nonces() { mempool .submit_raw( chainstate, + sortdb, &parent_tip_ch, &parent_header_hash, contract_tx_bytes, @@ -2599,6 +2615,7 @@ fn test_build_microblock_stream_forks() { mempool .submit_raw( chainstate, + sortdb, &parent_consensus_hash, &parent_header_hash, tx_bytes, @@ -2925,6 +2942,7 @@ fn test_build_microblock_stream_forks_with_descendants() { mempool .submit_raw( chainstate, + sortdb, &parent_consensus_hash, &parent_header_hash, tx_bytes, @@ -3000,6 +3018,7 @@ fn test_build_microblock_stream_forks_with_descendants() { mempool .submit_raw( chainstate, + sortdb, &parent_consensus_hash, &parent_header_hash, tx_bytes, @@ -3032,6 +3051,7 @@ fn test_build_microblock_stream_forks_with_descendants() { mempool .submit_raw( chainstate, + sortdb, &parent_consensus_hash, &parent_header_hash, tx_bytes, @@ -3989,6 +4009,7 @@ fn test_is_tx_problematic() { mempool .submit( chainstate, + sortdb, &parent_consensus_hash, &parent_header_hash, tx, @@ -4015,6 +4036,7 @@ fn test_is_tx_problematic() { mempool .submit( chainstate, + sortdb, &parent_consensus_hash, &parent_header_hash, &contract_spends_too_much_tx, @@ -4063,6 +4085,7 @@ fn test_is_tx_problematic() { mempool .submit( chainstate, + sortdb, &parent_consensus_hash, &parent_header_hash, &spend_too_much, @@ -4113,6 +4136,7 @@ fn test_is_tx_problematic() { mempool .submit( chainstate, + sortdb, &parent_consensus_hash, &parent_header_hash, &runtime_checkerror_problematic, @@ -4161,6 +4185,7 @@ fn test_is_tx_problematic() { mempool .submit( chainstate, + sortdb, &parent_consensus_hash, &parent_header_hash, &runtime_checkerror_problematic, @@ -4296,6 +4321,7 @@ fn test_fee_order_mismatch_nonce_order() { mempool .submit( chainstate, + sortdb, &parent_consensus_hash, &parent_header_hash, &stx_transfer0, @@ -4308,6 +4334,7 @@ fn test_fee_order_mismatch_nonce_order() { mempool .submit( chainstate, + sortdb, &parent_consensus_hash, &parent_header_hash, &stx_transfer1, diff --git a/src/core/mempool.rs b/src/core/mempool.rs index 1d340d59a3..7f3c195d21 100644 --- a/src/core/mempool.rs +++ b/src/core/mempool.rs @@ -38,6 +38,7 @@ use rusqlite::NO_PARAMS; use siphasher::sip::SipHasher; // this is SipHash-2-4 use crate::burnchains::Txid; +use crate::chainstate::burn::db::sortdb::SortitionDB; use crate::chainstate::burn::ConsensusHash; use crate::chainstate::stacks::{ db::blocks::MemPoolRejection, db::ClarityTx, db::StacksChainState, db::TxStreamData, @@ -174,10 +175,17 @@ impl MemPoolAdmitter { pub fn will_admit_tx( &mut self, chainstate: &mut StacksChainState, + sortdb: &SortitionDB, tx: &StacksTransaction, tx_size: u64, ) -> Result<(), MemPoolRejection> { - chainstate.will_admit_mempool_tx(&self.cur_consensus_hash, &self.cur_block, tx, tx_size) + chainstate.will_admit_mempool_tx( + &sortdb.index_conn(), + &self.cur_consensus_hash, + &self.cur_block, + tx, + tx_size, + ) } } @@ -1973,6 +1981,7 @@ impl MemPoolDB { fn tx_submit( mempool_tx: &mut MemPoolTx, chainstate: &mut StacksChainState, + sortdb: &SortitionDB, consensus_hash: &ConsensusHash, block_hash: &BlockHeaderHash, tx: &StacksTransaction, @@ -2027,7 +2036,9 @@ impl MemPoolDB { mempool_tx .admitter .set_block(&block_hash, (*consensus_hash).clone()); - mempool_tx.admitter.will_admit_tx(chainstate, tx, len)?; + mempool_tx + .admitter + .will_admit_tx(chainstate, sortdb, tx, len)?; } MemPoolDB::try_add_tx( @@ -2064,6 +2075,7 @@ impl MemPoolDB { pub fn submit( &mut self, chainstate: &mut StacksChainState, + sortdb: &SortitionDB, consensus_hash: &ConsensusHash, block_hash: &BlockHeaderHash, tx: &StacksTransaction, @@ -2101,6 +2113,7 @@ impl MemPoolDB { MemPoolDB::tx_submit( &mut mempool_tx, chainstate, + sortdb, consensus_hash, block_hash, tx, @@ -2116,6 +2129,7 @@ impl MemPoolDB { pub fn miner_submit( &mut self, chainstate: &mut StacksChainState, + sortdb: &SortitionDB, consensus_hash: &ConsensusHash, block_hash: &BlockHeaderHash, tx: &StacksTransaction, @@ -2129,6 +2143,7 @@ impl MemPoolDB { MemPoolDB::tx_submit( &mut mempool_tx, chainstate, + sortdb, consensus_hash, block_hash, tx, @@ -2146,6 +2161,7 @@ impl MemPoolDB { pub fn submit_raw( &mut self, chainstate: &mut StacksChainState, + sortdb: &SortitionDB, consensus_hash: &ConsensusHash, block_hash: &BlockHeaderHash, tx_bytes: Vec, @@ -2187,6 +2203,7 @@ impl MemPoolDB { MemPoolDB::tx_submit( &mut mempool_tx, chainstate, + sortdb, consensus_hash, block_hash, &tx, diff --git a/src/main.rs b/src/main.rs index 65c73c71ac..fcf8abb7e2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1433,6 +1433,7 @@ simulating a miner. } let result = mempool_db.submit( &mut chain_state, + &sort_db, &stacks_block.consensus_hash, &stacks_block.anchored_block_hash, &raw_tx, diff --git a/src/net/p2p.rs b/src/net/p2p.rs index 62070ea5a8..141f3b6071 100644 --- a/src/net/p2p.rs +++ b/src/net/p2p.rs @@ -5246,6 +5246,7 @@ impl PeerNetwork { if let Err(e) = mempool.submit( chainstate, + sortdb, consensus_hash, block_hash, &tx, diff --git a/src/net/relay.rs b/src/net/relay.rs index ddacfd38eb..fa699fe6f1 100644 --- a/src/net/relay.rs +++ b/src/net/relay.rs @@ -5824,6 +5824,7 @@ pub mod test { let versioned_contract = (*versioned_contract_opt.borrow()).clone().unwrap(); let versioned_contract_len = versioned_contract.serialize_to_vec().len(); match node.chainstate.will_admit_mempool_tx( + &sortdb.index_conn(), &consensus_hash, &stacks_block.block_hash(), &versioned_contract, @@ -5873,6 +5874,7 @@ pub mod test { let versioned_contract = (*versioned_contract_opt.borrow()).clone().unwrap(); let versioned_contract_len = versioned_contract.serialize_to_vec().len(); match node.chainstate.will_admit_mempool_tx( + &sortdb.index_conn(), &consensus_hash, &stacks_block.block_hash(), &versioned_contract, diff --git a/src/net/rpc.rs b/src/net/rpc.rs index 41883af802..fdad5b699d 100644 --- a/src/net/rpc.rs +++ b/src/net/rpc.rs @@ -2093,6 +2093,7 @@ impl ConversationHttp { } else { match mempool.submit( chainstate, + sortdb, &consensus_hash, &block_hash, &tx, diff --git a/testnet/stacks-node/src/neon_node.rs b/testnet/stacks-node/src/neon_node.rs index dce07cc854..87d18dc4d0 100644 --- a/testnet/stacks-node/src/neon_node.rs +++ b/testnet/stacks-node/src/neon_node.rs @@ -1594,6 +1594,7 @@ impl BlockMinerThread { fn load_and_vet_parent_microblocks( &mut self, chain_state: &mut StacksChainState, + sortdb: &SortitionDB, mem_pool: &mut MemPoolDB, parent_block_info: &mut ParentStacksBlockInfo, ) -> Option> { @@ -1662,6 +1663,7 @@ impl BlockMinerThread { // anchored block. if let Err(e) = mem_pool.miner_submit( chain_state, + sortdb, &parent_consensus_hash, &stacks_parent_header.anchored_header.block_hash(), &poison_microblock_tx, @@ -1889,6 +1891,7 @@ impl BlockMinerThread { // target it to the microblock tail in parent_block_info let microblocks_opt = self.load_and_vet_parent_microblocks( &mut chain_state, + &burn_db, &mut mem_pool, &mut parent_block_info, ); diff --git a/testnet/stacks-node/src/tenure.rs b/testnet/stacks-node/src/tenure.rs index a7a5c2cba2..77b1c88a80 100644 --- a/testnet/stacks-node/src/tenure.rs +++ b/testnet/stacks-node/src/tenure.rs @@ -5,6 +5,10 @@ use super::{BurnchainTip, Config}; use std::thread; use std::time::{Duration, Instant}; +#[cfg(test)] +use stacks::burnchains::PoxConstants; +#[cfg(test)] +use stacks::chainstate::burn::db::sortdb::SortitionDB; use stacks::chainstate::burn::db::sortdb::SortitionDBConn; use stacks::chainstate::stacks::db::StacksChainState; use stacks::chainstate::stacks::{ @@ -123,4 +127,14 @@ impl<'a> Tenure { .unwrap(); chain_state } + + #[cfg(test)] + pub fn open_fake_sortdb(&self) -> SortitionDB { + SortitionDB::open( + &self.config.get_burn_db_file_path(), + true, + PoxConstants::testnet_default(), + ) + .unwrap() + } } diff --git a/testnet/stacks-node/src/tests/bitcoin_regtest.rs b/testnet/stacks-node/src/tests/bitcoin_regtest.rs index 267908c932..2479a403cd 100644 --- a/testnet/stacks-node/src/tests/bitcoin_regtest.rs +++ b/testnet/stacks-node/src/tests/bitcoin_regtest.rs @@ -372,6 +372,8 @@ fn bitcoind_integration(segwit_flag: bool) { // Use tenure's hook for submitting transactions run_loop.callbacks.on_new_tenure(|round, _burnchain_tip, chain_tip, tenure| { let mut chainstate_copy = tenure.open_chainstate(); + let sortdb = tenure.open_fake_sortdb(); + match round { 1 => { // On round 1, publish the KV contract @@ -391,7 +393,7 @@ fn bitcoind_integration(segwit_flag: bool) { // ./blockstack-cli --testnet publish 043ff5004e3d695060fa48ac94c96049b8c14ef441c50a184a6a3875d2a000f3 0 0 store /tmp/out.clar let header_hash = chain_tip.block.block_hash(); let consensus_hash = chain_tip.metadata.consensus_hash; - tenure.mem_pool.submit_raw(&mut chainstate_copy, &consensus_hash, &header_hash, PUBLISH_CONTRACT.to_owned(), &ExecutionCost::max_value(), + tenure.mem_pool.submit_raw(&mut chainstate_copy, &sortdb, &consensus_hash, &header_hash, PUBLISH_CONTRACT.to_owned(), &ExecutionCost::max_value(), &StacksEpochId::Epoch20,).unwrap(); }, 2 => { @@ -400,7 +402,7 @@ fn bitcoind_integration(segwit_flag: bool) { let header_hash = chain_tip.block.block_hash(); let consensus_hash = chain_tip.metadata.consensus_hash; let get_foo = "8080000000040021a3c334fc0ee50359353799e8b2605ac6be1fe40000000000000001000000000000000a0100b7ff8b6c20c427b4f4f09c1ad7e50027e2b076b2ddc0ab55e64ef5ea3771dd4763a79bc5a2b1a79b72ce03dd146ccf24b84942d675a815819a8b85aa8065dfaa030200000000021a21a3c334fc0ee50359353799e8b2605ac6be1fe40573746f7265096765742d76616c7565000000010d00000003666f6f"; - tenure.mem_pool.submit_raw(&mut chainstate_copy, &consensus_hash, &header_hash,hex_bytes(get_foo).unwrap().to_vec(), &ExecutionCost::max_value(), + tenure.mem_pool.submit_raw(&mut chainstate_copy, &sortdb, &consensus_hash, &header_hash,hex_bytes(get_foo).unwrap().to_vec(), &ExecutionCost::max_value(), &StacksEpochId::Epoch20,).unwrap(); }, 3 => { @@ -409,7 +411,7 @@ fn bitcoind_integration(segwit_flag: bool) { let header_hash = chain_tip.block.block_hash(); let consensus_hash = chain_tip.metadata.consensus_hash; let set_foo_bar = "8080000000040021a3c334fc0ee50359353799e8b2605ac6be1fe40000000000000002000000000000000a010142a01caf6a32b367664869182f0ebc174122a5a980937ba259d44cc3ebd280e769a53dd3913c8006ead680a6e1c98099fcd509ce94b0a4e90d9f4603b101922d030200000000021a21a3c334fc0ee50359353799e8b2605ac6be1fe40573746f7265097365742d76616c7565000000020d00000003666f6f0d00000003626172"; - tenure.mem_pool.submit_raw(&mut chainstate_copy, &consensus_hash, &header_hash,hex_bytes(set_foo_bar).unwrap().to_vec(), &ExecutionCost::max_value(), + tenure.mem_pool.submit_raw(&mut chainstate_copy, &sortdb, &consensus_hash, &header_hash,hex_bytes(set_foo_bar).unwrap().to_vec(), &ExecutionCost::max_value(), &StacksEpochId::Epoch20,).unwrap(); }, 4 => { @@ -418,7 +420,7 @@ fn bitcoind_integration(segwit_flag: bool) { let header_hash = chain_tip.block.block_hash(); let consensus_hash = chain_tip.metadata.consensus_hash; let get_foo = "8080000000040021a3c334fc0ee50359353799e8b2605ac6be1fe40000000000000003000000000000000a010046c2c1c345231443fef9a1f64fccfef3e1deacc342b2ab5f97612bb3742aa799038b20aea456789aca6b883e52f84a31adfee0bc2079b740464877af8f2f87d2030200000000021a21a3c334fc0ee50359353799e8b2605ac6be1fe40573746f7265096765742d76616c7565000000010d00000003666f6f"; - tenure.mem_pool.submit_raw(&mut chainstate_copy, &consensus_hash, &header_hash,hex_bytes(get_foo).unwrap().to_vec(), &ExecutionCost::max_value(), + tenure.mem_pool.submit_raw(&mut chainstate_copy, &sortdb, &consensus_hash, &header_hash,hex_bytes(get_foo).unwrap().to_vec(), &ExecutionCost::max_value(), &StacksEpochId::Epoch20,).unwrap(); }, 5 => { @@ -427,7 +429,7 @@ fn bitcoind_integration(segwit_flag: bool) { let header_hash = chain_tip.block.block_hash(); let consensus_hash = chain_tip.metadata.consensus_hash; let transfer_1000_stx = "80800000000400b71a091b4b8b7661a661c620966ab6573bc2dcd30000000000000000000000000000000a0000393810832bacd44cfc4024980876135de6b95429bdb610d5ce96a92c9ee9bfd81ec77ea0f1748c8515fc9a1589e51d8b92bf028e3e84ade1249682c05271d5b803020000000000051a525b8a36ef8a73548cd0940c248d3b71ecf4a45100000000000003e800000000000000000000000000000000000000000000000000000000000000000000"; - tenure.mem_pool.submit_raw(&mut chainstate_copy, &consensus_hash, &header_hash,hex_bytes(transfer_1000_stx).unwrap().to_vec(), &ExecutionCost::max_value(), + tenure.mem_pool.submit_raw(&mut chainstate_copy, &sortdb, &consensus_hash, &header_hash,hex_bytes(transfer_1000_stx).unwrap().to_vec(), &ExecutionCost::max_value(), &StacksEpochId::Epoch20,).unwrap(); }, _ => {} diff --git a/testnet/stacks-node/src/tests/integrations.rs b/testnet/stacks-node/src/tests/integrations.rs index 8366328351..43834e40e2 100644 --- a/testnet/stacks-node/src/tests/integrations.rs +++ b/testnet/stacks-node/src/tests/integrations.rs @@ -205,6 +205,7 @@ fn integration_test_get_info() { .callbacks .on_new_tenure(|round, _burnchain_tip, chain_tip, tenure| { let mut chainstate_copy = tenure.open_chainstate(); + let sortdb = tenure.open_fake_sortdb(); let contract_sk = StacksPrivateKey::from_hex(SK_1).unwrap(); let principal_sk = StacksPrivateKey::from_hex(SK_2).unwrap(); @@ -221,6 +222,7 @@ fn integration_test_get_info() { .mem_pool .submit_raw( &mut chainstate_copy, + &sortdb, &consensus_hash, &header_hash, publish_tx, @@ -234,6 +236,7 @@ fn integration_test_get_info() { .mem_pool .submit_raw( &mut chainstate_copy, + &sortdb, &consensus_hash, &header_hash, publish_tx, @@ -247,6 +250,7 @@ fn integration_test_get_info() { .mem_pool .submit_raw( &mut chainstate_copy, + &sortdb, &consensus_hash, &header_hash, publish_tx, @@ -281,6 +285,7 @@ fn integration_test_get_info() { .mem_pool .submit_raw( &mut chainstate_copy, + &sortdb, &consensus_hash, &header_hash, publish_tx, @@ -304,6 +309,7 @@ fn integration_test_get_info() { .mem_pool .submit_raw( &mut chainstate_copy, + &sortdb, &consensus_hash, &header_hash, tx, @@ -325,6 +331,7 @@ fn integration_test_get_info() { .mem_pool .submit_raw( &mut chainstate_copy, + &sortdb, &consensus_hash, &header_hash, tx_xfer, @@ -1095,6 +1102,7 @@ fn contract_stx_transfer() { .callbacks .on_new_tenure(|round, _burnchain_tip, chain_tip, tenure| { let mut chainstate_copy = tenure.open_chainstate(); + let sortdb = tenure.open_fake_sortdb(); let contract_sk = StacksPrivateKey::from_hex(SK_1).unwrap(); let sk_2 = StacksPrivateKey::from_hex(SK_2).unwrap(); @@ -1117,6 +1125,7 @@ fn contract_stx_transfer() { .mem_pool .submit_raw( &mut chainstate_copy, + &sortdb, &consensus_hash, &header_hash, xfer_to_contract, @@ -1132,6 +1141,7 @@ fn contract_stx_transfer() { .mem_pool .submit_raw( &mut chainstate_copy, + &sortdb, &consensus_hash, &header_hash, publish_tx, @@ -1152,6 +1162,7 @@ fn contract_stx_transfer() { .mem_pool .submit_raw( &mut chainstate_copy, + &sortdb, consensus_hash, block_hash, publish_tx, @@ -1173,6 +1184,7 @@ fn contract_stx_transfer() { .mem_pool .submit_raw( &mut chainstate_copy, + &sortdb, &consensus_hash, &header_hash, tx, @@ -1197,6 +1209,7 @@ fn contract_stx_transfer() { .mem_pool .submit( &mut chainstate_copy, + &sortdb, &consensus_hash, &header_hash, &xfer_to_contract, @@ -1215,6 +1228,7 @@ fn contract_stx_transfer() { .mem_pool .submit( &mut chainstate_copy, + &sortdb, &consensus_hash, &header_hash, &xfer_to_contract, @@ -1413,6 +1427,7 @@ fn mine_transactions_out_of_order() { .callbacks .on_new_tenure(|round, _burnchain_tip, chain_tip, tenure| { let mut chainstate_copy = tenure.open_chainstate(); + let sortdb = tenure.open_fake_sortdb(); let sk = StacksPrivateKey::from_hex(SK_3).unwrap(); let header_hash = chain_tip.block.block_hash(); @@ -1433,6 +1448,7 @@ fn mine_transactions_out_of_order() { .mem_pool .submit_raw( &mut chainstate_copy, + &sortdb, &consensus_hash, &header_hash, xfer_to_contract, @@ -1447,6 +1463,7 @@ fn mine_transactions_out_of_order() { .mem_pool .submit_raw( &mut chainstate_copy, + &sortdb, &consensus_hash, &header_hash, publish_tx, @@ -1461,6 +1478,7 @@ fn mine_transactions_out_of_order() { .mem_pool .submit_raw( &mut chainstate_copy, + &sortdb, &consensus_hash, &header_hash, xfer_to_contract, @@ -1475,6 +1493,7 @@ fn mine_transactions_out_of_order() { .mem_pool .submit_raw( &mut chainstate_copy, + &sortdb, &consensus_hash, &header_hash, xfer_to_contract, @@ -1564,6 +1583,7 @@ fn mine_contract_twice() { .callbacks .on_new_tenure(|round, _burnchain_tip, _chain_tip, tenure| { let mut chainstate_copy = tenure.open_chainstate(); + let sortdb = tenure.open_fake_sortdb(); let contract_sk = StacksPrivateKey::from_hex(SK_1).unwrap(); if round == 1 { @@ -1578,6 +1598,7 @@ fn mine_contract_twice() { .mem_pool .submit_raw( &mut chainstate_copy, + &sortdb, consensus_hash, block_hash, publish_tx, @@ -1649,6 +1670,7 @@ fn bad_contract_tx_rollback() { .callbacks .on_new_tenure(|round, _burnchain_tip, _chain_tip, tenure| { let mut chainstate_copy = tenure.open_chainstate(); + let sortdb = tenure.open_fake_sortdb(); let contract_sk = StacksPrivateKey::from_hex(SK_1).unwrap(); let sk_2 = StacksPrivateKey::from_hex(SK_2).unwrap(); @@ -1674,6 +1696,7 @@ fn bad_contract_tx_rollback() { .mem_pool .submit_raw( &mut chainstate_copy, + &sortdb, consensus_hash, block_hash, xfer_to_contract, @@ -1692,6 +1715,7 @@ fn bad_contract_tx_rollback() { .mem_pool .submit_raw( &mut chainstate_copy, + &sortdb, consensus_hash, block_hash, xfer_to_contract, @@ -1706,6 +1730,7 @@ fn bad_contract_tx_rollback() { .mem_pool .submit_raw( &mut chainstate_copy, + &sortdb, consensus_hash, block_hash, xfer_to_contract, @@ -1720,6 +1745,7 @@ fn bad_contract_tx_rollback() { .mem_pool .submit_raw( &mut chainstate_copy, + &sortdb, consensus_hash, block_hash, publish_tx, @@ -1734,6 +1760,7 @@ fn bad_contract_tx_rollback() { .mem_pool .submit_raw( &mut chainstate_copy, + &sortdb, consensus_hash, block_hash, publish_tx, @@ -1960,6 +1987,7 @@ fn block_limit_runtime_test() { .callbacks .on_new_tenure(|round, _burnchain_tip, _chain_tip, tenure| { let mut chainstate_copy = tenure.open_chainstate(); + let sortdb = tenure.open_fake_sortdb(); let contract_sk = StacksPrivateKey::from_hex(SK_1).unwrap(); let _contract_identifier = QualifiedContractIdentifier::parse(&format!( @@ -1985,6 +2013,7 @@ fn block_limit_runtime_test() { .mem_pool .submit_raw( &mut chainstate_copy, + &sortdb, consensus_hash, block_hash, publish_tx, @@ -2014,6 +2043,7 @@ fn block_limit_runtime_test() { .mem_pool .submit_raw( &mut chainstate_copy, + &sortdb, consensus_hash, block_hash, tx, @@ -2087,6 +2117,7 @@ fn mempool_errors() { .on_new_tenure(|round, _burnchain_tip, chain_tip, tenure| { let contract_sk = StacksPrivateKey::from_hex(SK_1).unwrap(); let mut chainstate_copy = tenure.open_chainstate(); + let sortdb = tenure.open_fake_sortdb(); let header_hash = chain_tip.block.block_hash(); let consensus_hash = chain_tip.metadata.consensus_hash; @@ -2100,6 +2131,7 @@ fn mempool_errors() { .mem_pool .submit_raw( &mut chainstate_copy, + &sortdb, &consensus_hash, &header_hash, publish_tx, diff --git a/testnet/stacks-node/src/tests/mempool.rs b/testnet/stacks-node/src/tests/mempool.rs index c20560e036..95a8a78e07 100644 --- a/testnet/stacks-node/src/tests/mempool.rs +++ b/testnet/stacks-node/src/tests/mempool.rs @@ -16,6 +16,7 @@ use stacks::cost_estimates::UnitEstimator; use stacks::net::Error as NetError; use stacks::types::chainstate::{BlockHeaderHash, StacksAddress}; use stacks::util::{hash::*, secp256k1::*}; +use stacks::vm::database::NULL_BURN_STATE_DB; use stacks::vm::{ representations::ContractName, types::PrincipalData, types::QualifiedContractIdentifier, types::StandardPrincipalData, Value, @@ -108,6 +109,7 @@ fn mempool_setup_chainstate() { let contract_sk = StacksPrivateKey::from_hex(SK_1).unwrap(); let header_hash = chain_tip.block.block_hash(); let consensus_hash = chain_tip.metadata.consensus_hash; + let sortdb = tenure.open_fake_sortdb(); if round == 1 { eprintln!("Tenure in 1 started!"); @@ -118,6 +120,7 @@ fn mempool_setup_chainstate() { .mem_pool .submit_raw( &mut chainstate_copy, + &sortdb, &consensus_hash, &header_hash, publish_tx1, @@ -132,6 +135,7 @@ fn mempool_setup_chainstate() { .mem_pool .submit_raw( &mut chainstate_copy, + &sortdb, &consensus_hash, &header_hash, publish_tx2, @@ -151,6 +155,7 @@ fn mempool_setup_chainstate() { .mem_pool .submit_raw( &mut chainstate_copy, + &sortdb, &consensus_hash, &header_hash, publish_tx3, @@ -170,6 +175,7 @@ fn mempool_setup_chainstate() { .mem_pool .submit_raw( &mut chainstate_copy, + &sortdb, &consensus_hash, &header_hash, publish_tx4, @@ -189,6 +195,7 @@ fn mempool_setup_chainstate() { .mem_pool .submit_raw( &mut chainstate_copy, + &sortdb, &consensus_hash, &header_hash, publish_tx4, @@ -230,7 +237,13 @@ fn mempool_setup_chainstate() { let tx = StacksTransaction::consensus_deserialize(&mut tx_bytes.as_slice()).unwrap(); chain_state - .will_admit_mempool_tx(consensus_hash, block_hash, &tx, tx_bytes.len() as u64) + .will_admit_mempool_tx( + &NULL_BURN_STATE_DB, + consensus_hash, + block_hash, + &tx, + tx_bytes.len() as u64, + ) .unwrap(); let tx_bytes = make_contract_call( @@ -245,14 +258,26 @@ fn mempool_setup_chainstate() { let tx = StacksTransaction::consensus_deserialize(&mut tx_bytes.as_slice()).unwrap(); chain_state - .will_admit_mempool_tx(consensus_hash, block_hash, &tx, tx_bytes.len() as u64) + .will_admit_mempool_tx( + &NULL_BURN_STATE_DB, + consensus_hash, + block_hash, + &tx, + tx_bytes.len() as u64, + ) .unwrap(); let tx_bytes = make_stacks_transfer(&contract_sk, 5, 200, &other_addr, 1000); let tx = StacksTransaction::consensus_deserialize(&mut tx_bytes.as_slice()).unwrap(); chain_state - .will_admit_mempool_tx(consensus_hash, block_hash, &tx, tx_bytes.len() as u64) + .will_admit_mempool_tx( + &NULL_BURN_STATE_DB, + consensus_hash, + block_hash, + &tx, + tx_bytes.len() as u64, + ) .unwrap(); // bad signature @@ -260,7 +285,13 @@ fn mempool_setup_chainstate() { let tx = StacksTransaction::consensus_deserialize(&mut tx_bytes.as_slice()).unwrap(); let e = chain_state - .will_admit_mempool_tx(consensus_hash, block_hash, &tx, tx_bytes.len() as u64) + .will_admit_mempool_tx( + &NULL_BURN_STATE_DB, + consensus_hash, + block_hash, + &tx, + tx_bytes.len() as u64, + ) .unwrap_err(); eprintln!("Err: {:?}", e); assert!( @@ -296,7 +327,13 @@ fn mempool_setup_chainstate() { let tx = StacksTransaction::consensus_deserialize(&mut tx_bytes.as_slice()).unwrap(); let e = chain_state - .will_admit_mempool_tx(consensus_hash, block_hash, &tx, tx_bytes.len() as u64) + .will_admit_mempool_tx( + &NULL_BURN_STATE_DB, + consensus_hash, + block_hash, + &tx, + tx_bytes.len() as u64, + ) .unwrap_err(); assert!(if let MemPoolRejection::BadAddressVersionByte = e { @@ -319,7 +356,13 @@ fn mempool_setup_chainstate() { let tx = StacksTransaction::consensus_deserialize(&mut tx_bytes.as_slice()).unwrap(); let e = chain_state - .will_admit_mempool_tx(consensus_hash, block_hash, &tx, tx_bytes.len() as u64) + .will_admit_mempool_tx( + &NULL_BURN_STATE_DB, + consensus_hash, + block_hash, + &tx, + tx_bytes.len() as u64, + ) .unwrap_err(); assert!(if let MemPoolRejection::BadAddressVersionByte = e { true @@ -332,7 +375,13 @@ fn mempool_setup_chainstate() { let tx = StacksTransaction::consensus_deserialize(&mut tx_bytes.as_slice()).unwrap(); let e = chain_state - .will_admit_mempool_tx(consensus_hash, block_hash, &tx, tx_bytes.len() as u64) + .will_admit_mempool_tx( + &NULL_BURN_STATE_DB, + consensus_hash, + block_hash, + &tx, + tx_bytes.len() as u64, + ) .unwrap_err(); eprintln!("Err: {:?}", e); assert!(if let MemPoolRejection::FeeTooLow(0, _) = e { @@ -346,7 +395,13 @@ fn mempool_setup_chainstate() { let tx = StacksTransaction::consensus_deserialize(&mut tx_bytes.as_slice()).unwrap(); let e = chain_state - .will_admit_mempool_tx(consensus_hash, block_hash, &tx, tx_bytes.len() as u64) + .will_admit_mempool_tx( + &NULL_BURN_STATE_DB, + consensus_hash, + block_hash, + &tx, + tx_bytes.len() as u64, + ) .unwrap_err(); eprintln!("Err: {:?}", e); assert!(if let MemPoolRejection::BadNonces(_) = e { @@ -360,7 +415,13 @@ fn mempool_setup_chainstate() { let tx = StacksTransaction::consensus_deserialize(&mut tx_bytes.as_slice()).unwrap(); let e = chain_state - .will_admit_mempool_tx(consensus_hash, block_hash, &tx, tx_bytes.len() as u64) + .will_admit_mempool_tx( + &NULL_BURN_STATE_DB, + consensus_hash, + block_hash, + &tx, + tx_bytes.len() as u64, + ) .unwrap_err(); eprintln!("Err: {:?}", e); assert!(if let MemPoolRejection::NotEnoughFunds(111000, 99500) = e { @@ -375,7 +436,13 @@ fn mempool_setup_chainstate() { let tx = StacksTransaction::consensus_deserialize(&mut tx_bytes.as_slice()).unwrap(); let e = chain_state - .will_admit_mempool_tx(consensus_hash, block_hash, &tx, tx_bytes.len() as u64) + .will_admit_mempool_tx( + &NULL_BURN_STATE_DB, + consensus_hash, + block_hash, + &tx, + tx_bytes.len() as u64, + ) .unwrap_err(); eprintln!("Err: {:?}", e); assert!(if let MemPoolRejection::TransferRecipientIsSender(r) = e { @@ -392,7 +459,13 @@ fn mempool_setup_chainstate() { let tx = StacksTransaction::consensus_deserialize(&mut tx_bytes.as_slice()).unwrap(); let e = chain_state - .will_admit_mempool_tx(consensus_hash, block_hash, &tx, tx_bytes.len() as u64) + .will_admit_mempool_tx( + &NULL_BURN_STATE_DB, + consensus_hash, + block_hash, + &tx, + tx_bytes.len() as u64, + ) .unwrap_err(); eprintln!("Err: {:?}", e); assert!(if let MemPoolRejection::BadAddressVersionByte = e { @@ -419,7 +492,13 @@ fn mempool_setup_chainstate() { let tx = StacksTransaction::consensus_deserialize(&mut tx_bytes.as_slice()).unwrap(); let e = chain_state - .will_admit_mempool_tx(consensus_hash, block_hash, &tx, tx_bytes.len() as u64) + .will_admit_mempool_tx( + &NULL_BURN_STATE_DB, + consensus_hash, + block_hash, + &tx, + tx_bytes.len() as u64, + ) .unwrap_err(); eprintln!("Err: {:?}", e); assert!(if let MemPoolRejection::BadTransactionVersion = e { @@ -433,7 +512,13 @@ fn mempool_setup_chainstate() { let tx = StacksTransaction::consensus_deserialize(&mut tx_bytes.as_slice()).unwrap(); let e = chain_state - .will_admit_mempool_tx(consensus_hash, block_hash, &tx, tx_bytes.len() as u64) + .will_admit_mempool_tx( + &NULL_BURN_STATE_DB, + consensus_hash, + block_hash, + &tx, + tx_bytes.len() as u64, + ) .unwrap_err(); eprintln!("Err: {:?}", e); assert!(if let MemPoolRejection::TransferAmountMustBePositive = e { @@ -447,7 +532,13 @@ fn mempool_setup_chainstate() { let tx = StacksTransaction::consensus_deserialize(&mut tx_bytes.as_slice()).unwrap(); let e = chain_state - .will_admit_mempool_tx(consensus_hash, block_hash, &tx, tx_bytes.len() as u64) + .will_admit_mempool_tx( + &NULL_BURN_STATE_DB, + consensus_hash, + block_hash, + &tx, + tx_bytes.len() as u64, + ) .unwrap_err(); eprintln!("Err: {:?}", e); assert!(if let MemPoolRejection::NotEnoughFunds(111000, 99500) = e { @@ -460,7 +551,13 @@ fn mempool_setup_chainstate() { let tx = StacksTransaction::consensus_deserialize(&mut tx_bytes.as_slice()).unwrap(); let e = chain_state - .will_admit_mempool_tx(consensus_hash, block_hash, &tx, tx_bytes.len() as u64) + .will_admit_mempool_tx( + &NULL_BURN_STATE_DB, + consensus_hash, + block_hash, + &tx, + tx_bytes.len() as u64, + ) .unwrap_err(); eprintln!("Err: {:?}", e); assert!(if let MemPoolRejection::NotEnoughFunds(100700, 99500) = e { @@ -481,7 +578,13 @@ fn mempool_setup_chainstate() { let tx = StacksTransaction::consensus_deserialize(&mut tx_bytes.as_slice()).unwrap(); let e = chain_state - .will_admit_mempool_tx(consensus_hash, block_hash, &tx, tx_bytes.len() as u64) + .will_admit_mempool_tx( + &NULL_BURN_STATE_DB, + consensus_hash, + block_hash, + &tx, + tx_bytes.len() as u64, + ) .unwrap_err(); eprintln!("Err: {:?}", e); assert!(if let MemPoolRejection::NoSuchContract = e { @@ -502,7 +605,13 @@ fn mempool_setup_chainstate() { let tx = StacksTransaction::consensus_deserialize(&mut tx_bytes.as_slice()).unwrap(); let e = chain_state - .will_admit_mempool_tx(consensus_hash, block_hash, &tx, tx_bytes.len() as u64) + .will_admit_mempool_tx( + &NULL_BURN_STATE_DB, + consensus_hash, + block_hash, + &tx, + tx_bytes.len() as u64, + ) .unwrap_err(); eprintln!("Err: {:?}", e); assert!(if let MemPoolRejection::NoSuchPublicFunction = e { @@ -523,7 +632,13 @@ fn mempool_setup_chainstate() { let tx = StacksTransaction::consensus_deserialize(&mut tx_bytes.as_slice()).unwrap(); let e = chain_state - .will_admit_mempool_tx(consensus_hash, block_hash, &tx, tx_bytes.len() as u64) + .will_admit_mempool_tx( + &NULL_BURN_STATE_DB, + consensus_hash, + block_hash, + &tx, + tx_bytes.len() as u64, + ) .unwrap_err(); eprintln!("Err: {:?}", e); assert!(if let MemPoolRejection::BadFunctionArgument(_) = e { @@ -537,7 +652,13 @@ fn mempool_setup_chainstate() { let tx = StacksTransaction::consensus_deserialize(&mut tx_bytes.as_slice()).unwrap(); let e = chain_state - .will_admit_mempool_tx(consensus_hash, block_hash, &tx, tx_bytes.len() as u64) + .will_admit_mempool_tx( + &NULL_BURN_STATE_DB, + consensus_hash, + block_hash, + &tx, + tx_bytes.len() as u64, + ) .unwrap_err(); eprintln!("Err: {:?}", e); assert!(if let MemPoolRejection::ContractAlreadyExists(_) = e { @@ -566,7 +687,13 @@ fn mempool_setup_chainstate() { let tx = StacksTransaction::consensus_deserialize(&mut tx_bytes.as_slice()).unwrap(); let e = chain_state - .will_admit_mempool_tx(consensus_hash, block_hash, &tx, tx_bytes.len() as u64) + .will_admit_mempool_tx( + &NULL_BURN_STATE_DB, + consensus_hash, + block_hash, + &tx, + tx_bytes.len() as u64, + ) .unwrap_err(); eprintln!("Err: {:?}", e); assert!( @@ -597,7 +724,13 @@ fn mempool_setup_chainstate() { let tx = StacksTransaction::consensus_deserialize(&mut tx_bytes.as_slice()).unwrap(); let e = chain_state - .will_admit_mempool_tx(consensus_hash, block_hash, &tx, tx_bytes.len() as u64) + .will_admit_mempool_tx( + &NULL_BURN_STATE_DB, + consensus_hash, + block_hash, + &tx, + tx_bytes.len() as u64, + ) .unwrap_err(); eprintln!("Err: {:?}", e); assert!(if let MemPoolRejection::InvalidMicroblocks = e { @@ -629,7 +762,13 @@ fn mempool_setup_chainstate() { let tx = StacksTransaction::consensus_deserialize(&mut tx_bytes.as_slice()).unwrap(); let e = chain_state - .will_admit_mempool_tx(consensus_hash, block_hash, &tx, tx_bytes.len() as u64) + .will_admit_mempool_tx( + &NULL_BURN_STATE_DB, + consensus_hash, + block_hash, + &tx, + tx_bytes.len() as u64, + ) .unwrap_err(); eprintln!("Err: {:?}", e); assert!( @@ -644,7 +783,13 @@ fn mempool_setup_chainstate() { let tx = StacksTransaction::consensus_deserialize(&mut tx_bytes.as_slice()).unwrap(); let e = chain_state - .will_admit_mempool_tx(consensus_hash, block_hash, &tx, tx_bytes.len() as u64) + .will_admit_mempool_tx( + &NULL_BURN_STATE_DB, + consensus_hash, + block_hash, + &tx, + tx_bytes.len() as u64, + ) .unwrap_err(); eprintln!("Err: {:?}", e); assert!(if let MemPoolRejection::NoCoinbaseViaMempool = e { @@ -696,7 +841,13 @@ fn mempool_setup_chainstate() { let tx = StacksTransaction::consensus_deserialize(&mut tx_bytes.as_slice()).unwrap(); chain_state - .will_admit_mempool_tx(consensus_hash, block_hash, &tx, tx_bytes.len() as u64) + .will_admit_mempool_tx( + &NULL_BURN_STATE_DB, + consensus_hash, + block_hash, + &tx, + tx_bytes.len() as u64, + ) .unwrap(); let contract_id = QualifiedContractIdentifier::new( @@ -717,7 +868,13 @@ fn mempool_setup_chainstate() { let tx = StacksTransaction::consensus_deserialize(&mut tx_bytes.as_slice()).unwrap(); chain_state - .will_admit_mempool_tx(consensus_hash, block_hash, &tx, tx_bytes.len() as u64) + .will_admit_mempool_tx( + &NULL_BURN_STATE_DB, + consensus_hash, + block_hash, + &tx, + tx_bytes.len() as u64, + ) .unwrap(); let contract_id = QualifiedContractIdentifier::new( @@ -738,7 +895,13 @@ fn mempool_setup_chainstate() { let tx = StacksTransaction::consensus_deserialize(&mut tx_bytes.as_slice()).unwrap(); let e = chain_state - .will_admit_mempool_tx(consensus_hash, block_hash, &tx, tx_bytes.len() as u64) + .will_admit_mempool_tx( + &NULL_BURN_STATE_DB, + consensus_hash, + block_hash, + &tx, + tx_bytes.len() as u64, + ) .unwrap_err(); assert!(if let MemPoolRejection::BadFunctionArgument(_) = e { true diff --git a/testnet/stacks-node/src/tests/mod.rs b/testnet/stacks-node/src/tests/mod.rs index 1a24d3c93f..3ee513c24c 100644 --- a/testnet/stacks-node/src/tests/mod.rs +++ b/testnet/stacks-node/src/tests/mod.rs @@ -529,11 +529,12 @@ fn should_succeed_mining_valid_txs() { let consensus_hash = chain_tip.metadata.consensus_hash; let mut chainstate_copy = tenure.open_chainstate(); + let sortdb = tenure.open_fake_sortdb(); match round { 1 => { // On round 1, publish the KV contract - tenure.mem_pool.submit_raw(&mut chainstate_copy, &consensus_hash, &header_hash, PUBLISH_CONTRACT.to_owned(), + tenure.mem_pool.submit_raw(&mut chainstate_copy, &sortdb, &consensus_hash, &header_hash, PUBLISH_CONTRACT.to_owned(), &ExecutionCost::max_value(), &StacksEpochId::Epoch21, ).unwrap(); @@ -542,7 +543,7 @@ fn should_succeed_mining_valid_txs() { // On round 2, publish a "get:foo" transaction // ./blockstack-cli --testnet contract-call 043ff5004e3d695060fa48ac94c96049b8c14ef441c50a184a6a3875d2a000f3 10 1 STGT7GSMZG7EA0TS6MVSKT5JC1DCDFGZWJJZXN8A store get-value -e \"foo\" let get_foo = "8080000000040021a3c334fc0ee50359353799e8b2605ac6be1fe40000000000000001000000000000000a0100b7ff8b6c20c427b4f4f09c1ad7e50027e2b076b2ddc0ab55e64ef5ea3771dd4763a79bc5a2b1a79b72ce03dd146ccf24b84942d675a815819a8b85aa8065dfaa030200000000021a21a3c334fc0ee50359353799e8b2605ac6be1fe40573746f7265096765742d76616c7565000000010d00000003666f6f"; - tenure.mem_pool.submit_raw(&mut chainstate_copy, &consensus_hash, &header_hash,hex_bytes(get_foo).unwrap().to_vec(), + tenure.mem_pool.submit_raw(&mut chainstate_copy, &sortdb, &consensus_hash, &header_hash,hex_bytes(get_foo).unwrap().to_vec(), &ExecutionCost::max_value(), &StacksEpochId::Epoch21, ).unwrap(); @@ -551,7 +552,7 @@ fn should_succeed_mining_valid_txs() { // On round 3, publish a "set:foo=bar" transaction // ./blockstack-cli --testnet contract-call 043ff5004e3d695060fa48ac94c96049b8c14ef441c50a184a6a3875d2a000f3 10 2 STGT7GSMZG7EA0TS6MVSKT5JC1DCDFGZWJJZXN8A store set-value -e \"foo\" -e \"bar\" let set_foo_bar = "8080000000040021a3c334fc0ee50359353799e8b2605ac6be1fe40000000000000002000000000000000a010142a01caf6a32b367664869182f0ebc174122a5a980937ba259d44cc3ebd280e769a53dd3913c8006ead680a6e1c98099fcd509ce94b0a4e90d9f4603b101922d030200000000021a21a3c334fc0ee50359353799e8b2605ac6be1fe40573746f7265097365742d76616c7565000000020d00000003666f6f0d00000003626172"; - tenure.mem_pool.submit_raw(&mut chainstate_copy, &consensus_hash, &header_hash,hex_bytes(set_foo_bar).unwrap().to_vec(), + tenure.mem_pool.submit_raw(&mut chainstate_copy, &sortdb, &consensus_hash, &header_hash,hex_bytes(set_foo_bar).unwrap().to_vec(), &ExecutionCost::max_value(), &StacksEpochId::Epoch21, ).unwrap(); @@ -560,7 +561,7 @@ fn should_succeed_mining_valid_txs() { // On round 4, publish a "get:foo" transaction // ./blockstack-cli --testnet contract-call 043ff5004e3d695060fa48ac94c96049b8c14ef441c50a184a6a3875d2a000f3 10 3 STGT7GSMZG7EA0TS6MVSKT5JC1DCDFGZWJJZXN8A store get-value -e \"foo\" let get_foo = "8080000000040021a3c334fc0ee50359353799e8b2605ac6be1fe40000000000000003000000000000000a010046c2c1c345231443fef9a1f64fccfef3e1deacc342b2ab5f97612bb3742aa799038b20aea456789aca6b883e52f84a31adfee0bc2079b740464877af8f2f87d2030200000000021a21a3c334fc0ee50359353799e8b2605ac6be1fe40573746f7265096765742d76616c7565000000010d00000003666f6f"; - tenure.mem_pool.submit_raw(&mut chainstate_copy, &consensus_hash, &header_hash,hex_bytes(get_foo).unwrap().to_vec(), + tenure.mem_pool.submit_raw(&mut chainstate_copy, &sortdb, &consensus_hash, &header_hash,hex_bytes(get_foo).unwrap().to_vec(), &ExecutionCost::max_value(), &StacksEpochId::Epoch21, ).unwrap(); @@ -569,7 +570,7 @@ fn should_succeed_mining_valid_txs() { // On round 5, publish a stacks transaction // ./blockstack-cli --testnet token-transfer b1cf9cee5083f421c84d7cb53be5edf2801c3c78d63d53917aee0bdc8bd160ee01 10 0 ST195Q2HPXY576N4CT2A0R94D7DRYSX54A5X3YZTH 1000 let transfer_1000_stx = "80800000000400b71a091b4b8b7661a661c620966ab6573bc2dcd30000000000000000000000000000000a0000393810832bacd44cfc4024980876135de6b95429bdb610d5ce96a92c9ee9bfd81ec77ea0f1748c8515fc9a1589e51d8b92bf028e3e84ade1249682c05271d5b803020000000000051a525b8a36ef8a73548cd0940c248d3b71ecf4a45100000000000003e800000000000000000000000000000000000000000000000000000000000000000000"; - tenure.mem_pool.submit_raw(&mut chainstate_copy, &consensus_hash, &header_hash,hex_bytes(transfer_1000_stx).unwrap().to_vec(), + tenure.mem_pool.submit_raw(&mut chainstate_copy, &sortdb, &consensus_hash, &header_hash,hex_bytes(transfer_1000_stx).unwrap().to_vec(), &ExecutionCost::max_value(), &StacksEpochId::Epoch21, ).unwrap(); @@ -812,13 +813,14 @@ fn should_succeed_handling_malformed_and_valid_txs() { let header_hash = chain_tip.block.block_hash(); let consensus_hash = chain_tip.metadata.consensus_hash; let mut chainstate_copy = tenure.open_chainstate(); + let sortdb = tenure.open_fake_sortdb(); match round { 1 => { // On round 1, publish the KV contract let contract_sk = StacksPrivateKey::from_hex(SK_1).unwrap(); let publish_contract = make_contract_publish(&contract_sk, 0, 10, "store", STORE_CONTRACT); - tenure.mem_pool.submit_raw(&mut chainstate_copy, &consensus_hash, &header_hash,publish_contract, + tenure.mem_pool.submit_raw(&mut chainstate_copy, &sortdb, &consensus_hash, &header_hash,publish_contract, &ExecutionCost::max_value(), &StacksEpochId::Epoch20, ).unwrap(); @@ -828,7 +830,7 @@ fn should_succeed_handling_malformed_and_valid_txs() { // Will not be mined // ./blockstack-cli contract-call 043ff5004e3d695060fa48ac94c96049b8c14ef441c50a184a6a3875d2a000f3 10 1 STGT7GSMZG7EA0TS6MVSKT5JC1DCDFGZWJJZXN8A store get-value -e \"foo\" let get_foo = "0000000001040021a3c334fc0ee50359353799e8b2605ac6be1fe40000000000000001000000000000000a0101ef2b00e7e55ee5cb7684d5313c7c49680c97e60cb29f0166798e6ffabd984a030cf0a7b919bcf5fa052efd5d9efd96b927213cb3af1cfb8d9c5a0be0fccda64d030200000000021a21a3c334fc0ee50359353799e8b2605ac6be1fe40573746f7265096765742d76616c7565000000010d00000003666f6f"; - tenure.mem_pool.submit_raw(&mut chainstate_copy, &consensus_hash, &header_hash,hex_bytes(get_foo).unwrap().to_vec(), + tenure.mem_pool.submit_raw(&mut chainstate_copy, &sortdb, &consensus_hash, &header_hash,hex_bytes(get_foo).unwrap().to_vec(), &ExecutionCost::max_value(), &StacksEpochId::Epoch20, ).unwrap(); @@ -838,7 +840,7 @@ fn should_succeed_handling_malformed_and_valid_txs() { // Will not be mined // ./blockstack-cli --testnet contract-call 043ff5004e3d695060fa48ac94c96049b8c14ef441c50a184a6a3875d2a000f3 10 1 STGT7GSMZG7EA0TS6MVSKT5JC1DCDFGZWJJZXN8A store set-value -e \"foo\" -e \"bar\" let set_foo_bar = "8080000000040021a3c334fc0ee50359353799e8b2605ac6be1fe40000000000000001000000000000000a010093f733efcebe2b239bb22e2e1ed25612547403af66b29282ed1f6fdfbbbf8f7f6ef107256d07947cbb72e165d723af99c447d6e25e7fbb6a92fd9a51c5ef7ee9030200000000021a21a3c334fc0ee50359353799e8b2605ac6be1fe40573746f7265097365742d76616c7565000000020d00000003666f6f0d00000003626172"; - tenure.mem_pool.submit_raw(&mut chainstate_copy, &consensus_hash, &header_hash,hex_bytes(set_foo_bar).unwrap().to_vec(), + tenure.mem_pool.submit_raw(&mut chainstate_copy, &sortdb, &consensus_hash, &header_hash,hex_bytes(set_foo_bar).unwrap().to_vec(), &ExecutionCost::max_value(), &StacksEpochId::Epoch20, ).unwrap(); @@ -847,7 +849,7 @@ fn should_succeed_handling_malformed_and_valid_txs() { // On round 4, publish a "get:foo" transaction // ./blockstack-cli --testnet contract-call 043ff5004e3d695060fa48ac94c96049b8c14ef441c50a184a6a3875d2a000f3 10 1 STGT7GSMZG7EA0TS6MVSKT5JC1DCDFGZWJJZXN8A store get-value -e \"foo\" let get_foo = "8080000000040021a3c334fc0ee50359353799e8b2605ac6be1fe40000000000000001000000000000000a0100b7ff8b6c20c427b4f4f09c1ad7e50027e2b076b2ddc0ab55e64ef5ea3771dd4763a79bc5a2b1a79b72ce03dd146ccf24b84942d675a815819a8b85aa8065dfaa030200000000021a21a3c334fc0ee50359353799e8b2605ac6be1fe40573746f7265096765742d76616c7565000000010d00000003666f6f"; - tenure.mem_pool.submit_raw(&mut chainstate_copy, &consensus_hash, &header_hash,hex_bytes(get_foo).unwrap().to_vec(), + tenure.mem_pool.submit_raw(&mut chainstate_copy, &sortdb, &consensus_hash, &header_hash,hex_bytes(get_foo).unwrap().to_vec(), &ExecutionCost::max_value(), &StacksEpochId::Epoch20, ).unwrap(); From 2cd3dd093a7bbf14eafea37743a7a2a7999939cd Mon Sep 17 00:00:00 2001 From: Aaron Blankstein Date: Mon, 20 Mar 2023 12:11:04 -0500 Subject: [PATCH 16/17] test: add regression test for mempool unlock handling #3623 --- .../stacks/tests/block_construction.rs | 235 ++++++++++++++++++ 1 file changed, 235 insertions(+) diff --git a/src/chainstate/stacks/tests/block_construction.rs b/src/chainstate/stacks/tests/block_construction.rs index 5ba91c8046..e85f2cdfdc 100644 --- a/src/chainstate/stacks/tests/block_construction.rs +++ b/src/chainstate/stacks/tests/block_construction.rs @@ -28,6 +28,7 @@ use std::fs; use std::io; use std::path::{Path, PathBuf}; +use clarity::vm::database::ClarityDatabase; use rand::seq::SliceRandom; use rand::thread_rng; use rand::Rng; @@ -4238,6 +4239,240 @@ fn test_is_tx_problematic() { } } +#[test] +fn mempool_incorporate_pox_unlocks() { + let mut initial_balances = vec![]; + let total_balance = 10_000_000_000; + let pk = StacksPrivateKey::new(); + let addr = StacksAddress::from_public_keys( + C32_ADDRESS_VERSION_TESTNET_SINGLESIG, + &AddressHashMode::SerializeP2PKH, + 1, + &vec![StacksPublicKey::from_private(&pk)], + ) + .unwrap(); + initial_balances.push((addr.to_account_principal(), total_balance)); + let principal = PrincipalData::from(addr.clone()); + + let mut peer_config = TestPeerConfig::new(function_name!(), 2020, 2021); + peer_config.initial_balances = initial_balances; + peer_config.epochs = Some(vec![ + StacksEpoch { + epoch_id: StacksEpochId::Epoch20, + start_height: 0, + end_height: 1, + block_limit: ExecutionCost::max_value(), + network_epoch: PEER_VERSION_EPOCH_2_0, + }, + StacksEpoch { + epoch_id: StacksEpochId::Epoch2_05, + start_height: 1, + end_height: 36, + block_limit: ExecutionCost::max_value(), + network_epoch: PEER_VERSION_EPOCH_2_05, + }, + StacksEpoch { + epoch_id: StacksEpochId::Epoch21, + start_height: 36, + end_height: i64::MAX as u64, + block_limit: ExecutionCost::max_value(), + network_epoch: PEER_VERSION_EPOCH_2_1, + }, + ]); + peer_config.burnchain.pox_constants.v1_unlock_height = + peer_config.epochs.as_ref().unwrap()[1].end_height as u32 + 1; + let pox_constants = peer_config.burnchain.pox_constants.clone(); + + let mut peer = TestPeer::new(peer_config); + + let chainstate_path = peer.chainstate_path.clone(); + + let first_stacks_block_height = { + let sn = SortitionDB::get_canonical_burn_chain_tip(&peer.sortdb.as_ref().unwrap().conn()) + .unwrap(); + sn.block_height + }; + + let first_block_height = peer.sortdb.as_ref().unwrap().first_block_height; + let first_pox_cycle = pox_constants + .block_height_to_reward_cycle(first_block_height, first_stacks_block_height) + .unwrap(); + let active_pox_cycle_start = + pox_constants.reward_cycle_to_block_height(first_block_height, first_pox_cycle + 1); + let lockup_end = pox_constants.v1_unlock_height as u64; + + // test for two PoX cycles + let num_blocks = 3 + lockup_end - first_stacks_block_height; + info!( + "Starting test"; + "num_blocks" => num_blocks, + "first_stacks_block_height" => first_stacks_block_height, + "active_pox_cycle_start" => active_pox_cycle_start, + "active_pox_cycle_end" => lockup_end, + "first_block_height" => first_block_height, + ); + + let recipient_addr_str = "ST1RFD5Q2QPK3E0F08HG9XDX7SSC7CNRS0QR0SGEV"; + let recipient = StacksAddress::from_string(recipient_addr_str).unwrap(); + + let mut last_block = None; + for tenure_id in 0..num_blocks { + // send transactions to the mempool + let tip = SortitionDB::get_canonical_burn_chain_tip(&peer.sortdb.as_ref().unwrap().conn()) + .unwrap(); + + let (burn_ops, stacks_block, microblocks) = peer.make_tenure( + |ref mut miner, + ref mut sortdb, + ref mut chainstate, + vrf_proof, + ref parent_opt, + ref parent_microblock_header_opt| { + let parent_tip = match parent_opt { + None => StacksChainState::get_genesis_header_info(chainstate.db()).unwrap(), + Some(block) => { + let ic = sortdb.index_conn(); + let snapshot = + SortitionDB::get_block_snapshot_for_winning_stacks_block( + &ic, + &tip.sortition_id, + &block.block_hash(), + ) + .unwrap() + .unwrap(); // succeeds because we don't fork + StacksChainState::get_anchored_block_header_info( + chainstate.db(), + &snapshot.consensus_hash, + &snapshot.winning_stacks_block_hash, + ) + .unwrap() + .unwrap() + } + }; + + let parent_height = parent_tip.burn_header_height; + + let parent_header_hash = parent_tip.anchored_header.block_hash(); + let parent_consensus_hash = parent_tip.consensus_hash.clone(); + let coinbase_tx = make_coinbase(miner, tenure_id as usize); + + let mut mempool = + MemPoolDB::open_test(false, 0x80000000, &chainstate_path).unwrap(); + + let mut expected_txids = vec![]; + expected_txids.push(coinbase_tx.txid()); + + // this will be the height of the block that includes this new tenure + let my_height = first_stacks_block_height + 1 + tenure_id; + + let available_balance = chainstate.with_read_only_clarity_tx(&sortdb.index_conn(), &parent_tip.index_block_hash(), |clarity_tx| { + clarity_tx.with_clarity_db_readonly(|db| { + let burn_block_height = db.get_current_burnchain_block_height() as u64; + let v1_unlock_height = db.get_v1_unlock_height(); + let balance = db.get_account_stx_balance(&principal); + info!("Checking balance"; "v1_unlock_height" => v1_unlock_height, "burn_block_height" => burn_block_height); + balance.get_available_balance_at_burn_block(burn_block_height, v1_unlock_height) + }) + }).unwrap(); + + if tenure_id <= 1 { + assert_eq!(available_balance, total_balance as u128, "Failed at tenure_id={}", tenure_id); + } else if my_height <= lockup_end + 1 { + assert_eq!(available_balance, 0, "Failed at tenure_id={}", tenure_id); + } else if my_height == lockup_end + 2 { + assert_eq!(available_balance, total_balance as u128 - 10_000, "Failed at tenure_id={}", tenure_id); + } else { + assert_eq!(available_balance, 0, "Failed at tenure_id={}", tenure_id); + } + + if tenure_id == 1 { + let stack_stx = make_user_contract_call( + &pk, + 0, + 10_000, + &StacksAddress::burn_address(false), + "pox", + "stack-stx", + vec![ + Value::UInt(total_balance as u128 - 10_000), + Value::Tuple( + TupleData::from_data(vec![ + ("version".into(), Value::buff_from(vec![0x00]).unwrap()), + ("hashbytes".into(), Value::buff_from(vec![0; 20]).unwrap()), + ]).unwrap(), + ), + Value::UInt(my_height as u128), + Value::UInt(10) + ], + ); + mempool + .submit( + chainstate, + sortdb, + &parent_consensus_hash, + &parent_header_hash, + &stack_stx, + None, + &ExecutionCost::max_value(), + &StacksEpochId::Epoch2_05, + ) + .unwrap(); + expected_txids.push(stack_stx.txid()); + } else if my_height == lockup_end + 2 { + let stx_transfer = make_user_stacks_transfer( + &pk, + 1, + 10_000, + &StacksAddress::burn_address(false).into(), + total_balance - 10_000 - 10_000, + ); + mempool + .submit( + chainstate, + sortdb, + &parent_consensus_hash, + &parent_header_hash, + &stx_transfer, + None, + &ExecutionCost::max_value(), + &StacksEpochId::Epoch2_05, + ) + .unwrap(); + expected_txids.push(stx_transfer.txid()); + } + + let anchored_block = StacksBlockBuilder::build_anchored_block( + chainstate, + &sortdb.index_conn(), + &mut mempool, + &parent_tip, + tip.total_burn, + vrf_proof, + Hash160([tenure_id as u8; 20]), + &coinbase_tx, + BlockBuilderSettings::limited(), + None, + ) + .unwrap(); + + // make sure the right txs get included + let txids : Vec<_> = anchored_block.0.txs.iter().map(|tx| tx.txid()).collect(); + assert_eq!(txids, expected_txids); + + (anchored_block.0, vec![]) + }, + ); + + let (_, _, consensus_hash) = peer.next_burnchain_block(burn_ops.clone()); + peer.process_stacks_epoch_at_tip(&stacks_block, µblocks); + + last_block = Some(StacksBlockHeader::make_index_block_hash( + &consensus_hash, + &stacks_block.block_hash(), + )); + } +} + #[test] /// Test the situation in which the nonce order of transactions from a user. That is, /// nonce 1 has a higher fee than nonce 0. From aa5f1674229eef4e6824913f2c23a73aa9cba4ef Mon Sep 17 00:00:00 2001 From: Aaron Blankstein Date: Mon, 20 Mar 2023 12:18:50 -0500 Subject: [PATCH 17/17] chore: add changelog entry --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 325b6ed7a2..872497c801 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to the versioning scheme outlined in the [README.md](README.md). +## [2.1.0.0.2] + +This software update is a hotfix to resolve improper unlock handling +in mempool admission. This release's chainstate directory is +compatible with chainstate directories from 2.1.0.0.2. + +### Fixed + +- Fix mempool admission logic's improper handling of PoX unlocks. This would + cause users to get spurious `NotEnoughFunds` rejections when trying to submit + their transactions (#3623) + ## [2.1.0.0.1] ### Fixed