From 6d69e911c6c67fcb1c6385d29b11acce73f2740c Mon Sep 17 00:00:00 2001 From: Keyao Shen Date: Thu, 14 Nov 2024 14:55:09 -0800 Subject: [PATCH] Fix fmt and import --- Cargo.lock | 187 +++++++++--------- crates/examples/push-cdn/all.rs | 1 - crates/hotshot/Cargo.toml | 1 + crates/hotshot/src/tasks/mod.rs | 11 +- crates/task-impls/src/helpers.rs | 3 +- .../src/quorum_proposal_recv/handlers.rs | 2 +- .../src/quorum_proposal_recv/mod.rs | 11 +- crates/task-impls/src/quorum_vote/mod.rs | 11 +- .../tests_1/quorum_proposal_recv_task.rs | 3 +- .../testing/tests/tests_1/view_sync_task.rs | 4 +- 10 files changed, 114 insertions(+), 120 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5f26fa7b02..3ea4507ef4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -105,9 +105,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.20" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45862d1c77f2228b9e10bc609d5bc203d86ebc9b87ad8d5d5167a6c9abf739d9" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "android-tzdata" @@ -498,7 +498,7 @@ dependencies = [ "nom", "num-traits", "rusticata-macros", - "thiserror 1.0.69", + "thiserror 1.0.68", "time 0.3.36", ] @@ -594,8 +594,8 @@ checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" dependencies = [ "async-task", "concurrent-queue", - "fastrand 2.2.0", - "futures-lite 2.5.0", + "fastrand 2.1.1", + "futures-lite 2.4.0", "slab", ] @@ -607,10 +607,10 @@ checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" dependencies = [ "async-channel 2.3.1", "async-executor", - "async-io 2.4.0", + "async-io 2.3.4", "async-lock 3.4.0", "blocking", - "futures-lite 2.5.0", + "futures-lite 2.4.0", "once_cell", "tokio", ] @@ -654,18 +654,18 @@ dependencies = [ [[package]] name = "async-io" -version = "2.4.0" +version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a2b323ccce0a1d90b449fd71f2a06ca7faa7c54c2751f06c9bd851fc061059" +checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" dependencies = [ "async-lock 3.4.0", "cfg-if", "concurrent-queue", "futures-io", - "futures-lite 2.5.0", + "futures-lite 2.4.0", "parking", "polling 3.7.4", - "rustix 0.38.40", + "rustix 0.38.39", "slab", "tracing", "windows-sys 0.59.0", @@ -699,7 +699,7 @@ checksum = "9e9e7a929bd34c68a82d58a4de7f86fffdaf97fb2af850162a7bb19dd7269b33" dependencies = [ "async-std", "native-tls", - "thiserror 1.0.69", + "thiserror 1.0.68", "url", ] @@ -710,15 +710,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63255f1dc2381611000436537bbedfe83183faa303a5a0edaf191edef06526bb" dependencies = [ "async-channel 2.3.1", - "async-io 2.4.0", + "async-io 2.3.4", "async-lock 3.4.0", "async-signal", "async-task", "blocking", "cfg-if", "event-listener 5.3.1", - "futures-lite 2.5.0", - "rustix 0.38.40", + "futures-lite 2.4.0", + "rustix 0.38.39", "tracing", ] @@ -728,13 +728,13 @@ version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3" dependencies = [ - "async-io 2.4.0", + "async-io 2.3.4", "async-lock 3.4.0", "atomic-waker", "cfg-if", "futures-core", "futures-io", - "rustix 0.38.40", + "rustix 0.38.39", "signal-hook-registry", "slab", "windows-sys 0.59.0", @@ -763,14 +763,14 @@ dependencies = [ "async-attributes", "async-channel 1.9.0", "async-global-executor", - "async-io 2.4.0", + "async-io 2.3.4", "async-lock 3.4.0", "async-process", "crossbeam-utils", "futures-channel", "futures-core", "futures-io", - "futures-lite 2.5.0", + "futures-lite 2.4.0", "gloo-timers", "kv-log-macro", "log", @@ -1121,7 +1121,7 @@ dependencies = [ "async-channel 2.3.1", "async-task", "futures-io", - "futures-lite 2.5.0", + "futures-lite 2.4.0", "piper", ] @@ -1218,9 +1218,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.0" +version = "1.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aeb932158bd710538c73702db6945cb68a8fb08c519e6e12706b94263b36db8" +checksum = "baee610e9452a8f6f0a1b6194ec09ff9e2d85dea54432acdae41aa0761c95d70" dependencies = [ "shlex", ] @@ -1302,7 +1302,7 @@ dependencies = [ "rustls 0.23.16", "rustls-pki-types", "sqlx", - "thiserror 1.0.69", + "thiserror 1.0.68", "tokio", "tokio-rustls", "tracing", @@ -1366,9 +1366,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.21" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" +checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" dependencies = [ "clap_builder", "clap_derive", @@ -1376,9 +1376,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.21" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" +checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" dependencies = [ "anstream", "anstyle", @@ -1400,9 +1400,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.3" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "cmake" @@ -1614,9 +1614,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.15" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca741a962e1b0bff6d724a1a0958b686406e853bb14061f218562e1896f95e6" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] @@ -2289,9 +2289,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.2.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "fiat-crypto" @@ -2460,11 +2460,11 @@ dependencies = [ [[package]] name = "futures-lite" -version = "2.5.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cef40d21ae2c515b51041df9ed313ed21e572df340ea58a922a0aefe7e8891a1" +checksum = "3f1fa2f9765705486b33fd2acf1577f8ec449c2ba1f318ae5447697b7c08d210" dependencies = [ - "fastrand 2.2.0", + "fastrand 2.1.1", "futures-core", "futures-io", "parking", @@ -2569,10 +2569,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", - "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", - "wasm-bindgen", ] [[package]] @@ -2795,7 +2793,7 @@ dependencies = [ "once_cell", "rand 0.8.5", "socket2 0.5.7", - "thiserror 1.0.69", + "thiserror 1.0.68", "tinyvec", "tokio", "tracing", @@ -2818,7 +2816,7 @@ dependencies = [ "rand 0.8.5", "resolv-conf", "smallvec", - "thiserror 1.0.69", + "thiserror 1.0.68", "tokio", "tracing", ] @@ -2934,6 +2932,7 @@ dependencies = [ "portpicker", "rand 0.8.5", "serde", + "sha2 0.10.8", "time 0.3.36", "tokio", "tracing", @@ -3669,7 +3668,7 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6b0422c86d7ce0e97169cc42e04ae643caf278874a7a3c87b8150a220dc7e1e" dependencies = [ - "async-io 2.4.0", + "async-io 2.3.4", "core-foundation", "fnv", "futures", @@ -4190,7 +4189,7 @@ dependencies = [ "multiaddr", "pin-project", "rw-stream-sink", - "thiserror 1.0.69", + "thiserror 1.0.68", ] [[package]] @@ -4260,7 +4259,7 @@ dependencies = [ "rw-stream-sink", "serde", "smallvec", - "thiserror 1.0.69", + "thiserror 1.0.68", "tracing", "unsigned-varint 0.8.0", "void", @@ -4333,7 +4332,7 @@ dependencies = [ "quick-protobuf", "quick-protobuf-codec 0.3.1", "smallvec", - "thiserror 1.0.69", + "thiserror 1.0.68", "tracing", "void", ] @@ -4354,7 +4353,7 @@ dependencies = [ "rand 0.8.5", "serde", "sha2 0.10.8", - "thiserror 1.0.69", + "thiserror 1.0.68", "tracing", "zeroize", ] @@ -4383,7 +4382,7 @@ dependencies = [ "serde", "sha2 0.10.8", "smallvec", - "thiserror 1.0.69", + "thiserror 1.0.68", "tracing", "uint", "void", @@ -4473,7 +4472,7 @@ dependencies = [ "ring 0.17.8", "rustls 0.23.16", "socket2 0.5.7", - "thiserror 1.0.69", + "thiserror 1.0.68", "tokio", "tracing", ] @@ -4567,7 +4566,7 @@ dependencies = [ "ring 0.17.8", "rustls 0.23.16", "rustls-webpki 0.101.7", - "thiserror 1.0.69", + "thiserror 1.0.68", "x509-parser", "yasna", ] @@ -4689,7 +4688,7 @@ checksum = "3669cf5561f8d27e8fc84cc15e58350e70f557d4d65f70e3154e54cd2f8e1782" dependencies = [ "libc", "neli", - "thiserror 1.0.69", + "thiserror 1.0.68", "windows-sys 0.59.0", ] @@ -5026,7 +5025,7 @@ dependencies = [ "anyhow", "byteorder", "paste", - "thiserror 1.0.69", + "thiserror 1.0.68", ] [[package]] @@ -5040,7 +5039,7 @@ dependencies = [ "log", "netlink-packet-core", "netlink-sys", - "thiserror 1.0.69", + "thiserror 1.0.68", "tokio", ] @@ -5351,7 +5350,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" dependencies = [ "memchr", - "thiserror 1.0.69", + "thiserror 1.0.68", "ucd-trie", ] @@ -5440,7 +5439,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" dependencies = [ "atomic-waker", - "fastrand 2.2.0", + "fastrand 2.1.1", "futures-io", ] @@ -5497,7 +5496,7 @@ dependencies = [ "concurrent-queue", "hermit-abi 0.4.0", "pin-project-lite 0.2.15", - "rustix 0.38.40", + "rustix 0.38.39", "tracing", "windows-sys 0.59.0", ] @@ -5617,7 +5616,7 @@ dependencies = [ "memchr", "parking_lot", "protobuf", - "thiserror 1.0.69", + "thiserror 1.0.68", ] [[package]] @@ -5725,7 +5724,7 @@ dependencies = [ "asynchronous-codec 0.6.2", "bytes", "quick-protobuf", - "thiserror 1.0.69", + "thiserror 1.0.68", "unsigned-varint 0.7.2", ] @@ -5738,15 +5737,15 @@ dependencies = [ "asynchronous-codec 0.7.0", "bytes", "quick-protobuf", - "thiserror 1.0.69", + "thiserror 1.0.68", "unsigned-varint 0.8.0", ] [[package]] name = "quinn" -version = "0.11.6" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" dependencies = [ "bytes", "futures-io", @@ -5756,29 +5755,26 @@ dependencies = [ "rustc-hash 2.0.0", "rustls 0.23.16", "socket2 0.5.7", - "thiserror 2.0.3", + "thiserror 1.0.68", "tokio", "tracing", ] [[package]] name = "quinn-proto" -version = "0.11.9" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" dependencies = [ "bytes", - "getrandom 0.2.15", "rand 0.8.5", "ring 0.17.8", "rustc-hash 2.0.0", "rustls 0.23.16", - "rustls-pki-types", "slab", - "thiserror 2.0.3", + "thiserror 1.0.68", "tinyvec", "tracing", - "web-time", ] [[package]] @@ -5967,7 +5963,7 @@ checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom 0.2.15", "libredox", - "thiserror 1.0.69", + "thiserror 1.0.68", ] [[package]] @@ -5978,7 +5974,7 @@ checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.9", + "regex-automata 0.4.8", "regex-syntax 0.8.5", ] @@ -5993,9 +5989,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.9" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", @@ -6194,7 +6190,7 @@ dependencies = [ "netlink-packet-route", "netlink-proto", "nix", - "thiserror 1.0.69", + "thiserror 1.0.68", "tokio", ] @@ -6275,9 +6271,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.40" +version = "0.38.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0" +checksum = "375116bee2be9ed569afe2154ea6a99dfdffd257f533f187498c2a8f5feaf4ee" dependencies = [ "bitflags 2.6.0", "errno", @@ -6328,9 +6324,6 @@ name = "rustls-pki-types" version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" -dependencies = [ - "web-time", -] [[package]] name = "rustls-webpki" @@ -6428,9 +6421,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.12.1" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" +checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" dependencies = [ "core-foundation-sys", "libc", @@ -6459,9 +6452,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.215" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" +checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" dependencies = [ "serde_derive", ] @@ -6479,9 +6472,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.215" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" +checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" dependencies = [ "proc-macro2", "quote", @@ -6517,7 +6510,7 @@ checksum = "c7715380eec75f029a4ef7de39a9200e0a63823176b759d055b613f5a87df6a6" dependencies = [ "percent-encoding", "serde", - "thiserror 1.0.69", + "thiserror 1.0.68", ] [[package]] @@ -6874,7 +6867,7 @@ dependencies = [ "sha2 0.10.8", "smallvec", "sqlformat", - "thiserror 1.0.69", + "thiserror 1.0.68", "time 0.3.36", "tokio", "tokio-stream", @@ -6958,7 +6951,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror 1.0.69", + "thiserror 1.0.68", "time 0.3.36", "tracing", "whoami", @@ -6997,7 +6990,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror 1.0.69", + "thiserror 1.0.68", "time 0.3.36", "tracing", "whoami", @@ -7372,24 +7365,24 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.14.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if", - "fastrand 2.2.0", + "fastrand 2.1.1", "once_cell", - "rustix 0.38.40", + "rustix 0.38.39", "windows-sys 0.59.0", ] [[package]] name = "thiserror" -version = "1.0.69" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +checksum = "02dd99dc800bbb97186339685293e1cc5d9df1f8fae2d0aecd9ff1c77efea892" dependencies = [ - "thiserror-impl 1.0.69", + "thiserror-impl 1.0.68", ] [[package]] @@ -7403,9 +7396,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "1.0.69" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +checksum = "a7c61ec9a6f64d2793d8a45faba21efbe3ced62a886d44c36a009b2b519b4c7e" dependencies = [ "proc-macro2", "quote", @@ -7955,7 +7948,7 @@ dependencies = [ "native-tls", "rand 0.8.5", "sha-1", - "thiserror 1.0.69", + "thiserror 1.0.68", "url", "utf-8", ] @@ -8700,7 +8693,7 @@ dependencies = [ "oid-registry", "ring 0.17.8", "rusticata-macros", - "thiserror 1.0.69", + "thiserror 1.0.68", "time 0.3.36", ] diff --git a/crates/examples/push-cdn/all.rs b/crates/examples/push-cdn/all.rs index 2e04d2d72b..12599c36a4 100644 --- a/crates/examples/push-cdn/all.rs +++ b/crates/examples/push-cdn/all.rs @@ -14,7 +14,6 @@ use cdn_broker::{ reexports::{crypto::signature::KeyPair, def::hook::NoMessageHook}, Broker, }; - use cdn_marshal::Marshal; use hotshot::{ helpers::initialize_logging, diff --git a/crates/hotshot/Cargo.toml b/crates/hotshot/Cargo.toml index f433e4d78b..0efbb71aa2 100644 --- a/crates/hotshot/Cargo.toml +++ b/crates/hotshot/Cargo.toml @@ -41,6 +41,7 @@ lru.workspace = true portpicker = "0.1" rand = { workspace = true } serde = { workspace = true, features = ["rc"] } +sha2 = { workspace = true } time = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true } diff --git a/crates/hotshot/src/tasks/mod.rs b/crates/hotshot/src/tasks/mod.rs index 6ddd00b252..bb9f7ed630 100644 --- a/crates/hotshot/src/tasks/mod.rs +++ b/crates/hotshot/src/tasks/mod.rs @@ -10,11 +10,6 @@ pub mod task_state; use std::{collections::BTreeMap, fmt::Debug, num::NonZeroUsize, sync::Arc, time::Duration}; -use crate::{ - tasks::task_state::CreateTaskState, types::SystemContextHandle, ConsensusApi, - ConsensusMetricsValue, ConsensusTaskRegistry, HotShotConfig, HotShotInitializer, - MarketplaceConfig, Memberships, NetworkTaskRegistry, SignatureKey, SystemContext, Versions, -}; use async_broadcast::{broadcast, RecvError}; use async_lock::RwLock; use async_trait::async_trait; @@ -48,6 +43,12 @@ use hotshot_types::{ use tokio::{spawn, time::sleep}; use vbs::version::StaticVersionType; +use crate::{ + tasks::task_state::CreateTaskState, types::SystemContextHandle, ConsensusApi, + ConsensusMetricsValue, ConsensusTaskRegistry, HotShotConfig, HotShotInitializer, + MarketplaceConfig, Memberships, NetworkTaskRegistry, SignatureKey, SystemContext, Versions, +}; + /// event for global event stream #[derive(Clone, Debug)] pub enum GlobalEvent { diff --git a/crates/task-impls/src/helpers.rs b/crates/task-impls/src/helpers.rs index cce95b6be3..da8df5f660 100644 --- a/crates/task-impls/src/helpers.rs +++ b/crates/task-impls/src/helpers.rs @@ -13,7 +13,6 @@ use async_broadcast::{InactiveReceiver, Receiver, SendError, Sender}; use async_lock::RwLock; use committable::{Commitment, Committable}; use hotshot_task::dependency::{Dependency, EventDependency}; -use hotshot_types::utils::epoch_from_block_number; use hotshot_types::{ consensus::OuterConsensus, data::{Leaf, QuorumProposal, ViewChangeEvidence}, @@ -28,7 +27,7 @@ use hotshot_types::{ signature_key::SignatureKey, BlockPayload, ValidatedState, }, - utils::{Terminator, View, ViewInner}, + utils::{epoch_from_block_number, Terminator, View, ViewInner}, vote::{Certificate, HasViewNumber}, }; use tokio::time::timeout; diff --git a/crates/task-impls/src/quorum_proposal_recv/handlers.rs b/crates/task-impls/src/quorum_proposal_recv/handlers.rs index 24ea89a3c2..579189e198 100644 --- a/crates/task-impls/src/quorum_proposal_recv/handlers.rs +++ b/crates/task-impls/src/quorum_proposal_recv/handlers.rs @@ -11,13 +11,13 @@ use std::sync::Arc; use async_broadcast::{broadcast, Receiver, Sender}; use async_lock::RwLockUpgradableReadGuard; use committable::Committable; -use hotshot_types::traits::block_contents::BlockHeader; use hotshot_types::{ consensus::OuterConsensus, data::{Leaf, QuorumProposal}, message::Proposal, simple_certificate::QuorumCertificate, traits::{ + block_contents::BlockHeader, election::Membership, node_implementation::{ConsensusTime, NodeImplementation, NodeType}, signature_key::SignatureKey, diff --git a/crates/task-impls/src/quorum_proposal_recv/mod.rs b/crates/task-impls/src/quorum_proposal_recv/mod.rs index 8f9d9e3f05..db62d33e5d 100644 --- a/crates/task-impls/src/quorum_proposal_recv/mod.rs +++ b/crates/task-impls/src/quorum_proposal_recv/mod.rs @@ -8,11 +8,6 @@ use std::{collections::BTreeMap, sync::Arc}; -use self::handlers::handle_quorum_proposal_recv; -use crate::{ - events::{HotShotEvent, ProposalMissing}, - helpers::{broadcast_event, fetch_proposal, parent_leaf_and_state}, -}; use async_broadcast::{broadcast, Receiver, Sender}; use async_lock::RwLock; use async_trait::async_trait; @@ -35,6 +30,12 @@ use tokio::task::JoinHandle; use tracing::{debug, error, info, instrument, warn}; use utils::anytrace::{bail, Result}; use vbs::version::Version; + +use self::handlers::handle_quorum_proposal_recv; +use crate::{ + events::{HotShotEvent, ProposalMissing}, + helpers::{broadcast_event, fetch_proposal, parent_leaf_and_state}, +}; /// Event handlers for this task. mod handlers; diff --git a/crates/task-impls/src/quorum_vote/mod.rs b/crates/task-impls/src/quorum_vote/mod.rs index 6ac5fe37dd..0dfc13683c 100644 --- a/crates/task-impls/src/quorum_vote/mod.rs +++ b/crates/task-impls/src/quorum_vote/mod.rs @@ -6,11 +6,6 @@ use std::{collections::BTreeMap, sync::Arc}; -use crate::{ - events::HotShotEvent, - helpers::broadcast_event, - quorum_vote::handlers::{handle_quorum_proposal_validated, submit_vote, update_shared_state}, -}; use async_broadcast::{InactiveReceiver, Receiver, Sender}; use async_lock::RwLock; use async_trait::async_trait; @@ -41,6 +36,12 @@ use tracing::instrument; use utils::anytrace::*; use vbs::version::StaticVersionType; +use crate::{ + events::HotShotEvent, + helpers::broadcast_event, + quorum_vote::handlers::{handle_quorum_proposal_validated, submit_vote, update_shared_state}, +}; + /// Event handlers for `QuorumProposalValidated`. mod handlers; diff --git a/crates/testing/tests/tests_1/quorum_proposal_recv_task.rs b/crates/testing/tests/tests_1/quorum_proposal_recv_task.rs index dc42dfc723..430f589e75 100644 --- a/crates/testing/tests/tests_1/quorum_proposal_recv_task.rs +++ b/crates/testing/tests/tests_1/quorum_proposal_recv_task.rs @@ -27,9 +27,8 @@ use hotshot_testing::{ serial, view_generator::TestViewGenerator, }; -use hotshot_types::data::EpochNumber; use hotshot_types::{ - data::{Leaf, ViewNumber}, + data::{EpochNumber, Leaf, ViewNumber}, request_response::ProposalRequestPayload, traits::{ consensus_api::ConsensusApi, diff --git a/crates/testing/tests/tests_1/view_sync_task.rs b/crates/testing/tests/tests_1/view_sync_task.rs index 85827dbbdb..ec313ec2a7 100644 --- a/crates/testing/tests/tests_1/view_sync_task.rs +++ b/crates/testing/tests/tests_1/view_sync_task.rs @@ -10,9 +10,9 @@ use hotshot_task_impls::{ events::HotShotEvent, harness::run_harness, view_sync::ViewSyncTaskState, }; use hotshot_testing::helpers::build_system_handle; -use hotshot_types::data::EpochNumber; use hotshot_types::{ - data::ViewNumber, simple_vote::ViewSyncPreCommitData, + data::{EpochNumber, ViewNumber}, + simple_vote::ViewSyncPreCommitData, traits::node_implementation::ConsensusTime, };