diff --git a/Cargo.lock b/Cargo.lock index 16bc39a7..b2b6aed1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -517,7 +517,7 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.87", - "synstructure 0.13.1", + "synstructure", ] [[package]] @@ -582,26 +582,6 @@ dependencies = [ "pin-project-lite 0.2.15", ] -[[package]] -name = "async-compatibility-layer" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32dd1dfd4a05a197583e51036d9615f04a4d851089dc119ee965d440d0bcaa39" -dependencies = [ - "async-lock 3.4.0", - "async-std", - "async-trait", - "color-eyre", - "console-subscriber 0.2.0", - "flume", - "futures", - "tokio", - "tokio-stream", - "tracing", - "tracing-error", - "tracing-subscriber 0.3.18", -] - [[package]] name = "async-dup" version = "1.2.4" @@ -1158,6 +1138,12 @@ version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +[[package]] +name = "byte-slice-cast" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" + [[package]] name = "bytecheck" version = "0.6.12" @@ -1197,18 +1183,18 @@ dependencies = [ [[package]] name = "capnp" -version = "0.19.8" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e985a566bdaae9a428a957d12b10c318d41b2afddb54cfbb764878059df636e" +checksum = "bce4e2d41c16cf9188f47ca4d59fdcdca1f33705af211bdb41f0afbd3442f8b5" dependencies = [ "embedded-io", ] [[package]] name = "capnpc" -version = "0.19.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ba30e0f08582d53c2f3710cf4bb65ff562614b1ba86906d7391adffe189ec" +checksum = "1aa3d5f01e69ed11656d2c7c47bf34327ea9bfb5c85c7de787fcd7b6c5e45b61" dependencies = [ "capnp", ] @@ -1234,14 +1220,14 @@ dependencies = [ [[package]] name = "cdn-broker" version = "0.4.0" -source = "git+https://github.com/EspressoSystems/Push-CDN?tag=0.4.7#5406fde54e61058428a7b55e1a98b699f0f606f1" +source = "git+https://github.com/EspressoSystems/Push-CDN?tag=0.5.6#9409763dbcb726e43218c3c4cfde91c7d5de6a52" dependencies = [ "cdn-proto", "clap", - "console-subscriber 0.3.0", + "console-subscriber", "dashmap", "derivative", - "jf-signature 0.1.0", + "jf-signature", "lazy_static", "local-ip-address", "parking_lot", @@ -1257,11 +1243,12 @@ dependencies = [ [[package]] name = "cdn-client" version = "0.4.0" -source = "git+https://github.com/EspressoSystems/Push-CDN?tag=0.4.7#5406fde54e61058428a7b55e1a98b699f0f606f1" +source = "git+https://github.com/EspressoSystems/Push-CDN?tag=0.5.6#9409763dbcb726e43218c3c4cfde91c7d5de6a52" dependencies = [ "cdn-proto", "clap", - "jf-signature 0.1.0", + "derive_more 1.0.0", + "jf-signature", "parking_lot", "rand 0.8.5", "tokio", @@ -1272,11 +1259,11 @@ dependencies = [ [[package]] name = "cdn-marshal" version = "0.4.0" -source = "git+https://github.com/EspressoSystems/Push-CDN?tag=0.4.7#5406fde54e61058428a7b55e1a98b699f0f606f1" +source = "git+https://github.com/EspressoSystems/Push-CDN?tag=0.5.6#9409763dbcb726e43218c3c4cfde91c7d5de6a52" dependencies = [ "cdn-proto", "clap", - "jf-signature 0.1.0", + "jf-signature", "tokio", "tracing", "tracing-subscriber 0.3.18", @@ -1285,7 +1272,7 @@ dependencies = [ [[package]] name = "cdn-proto" version = "0.4.0" -source = "git+https://github.com/EspressoSystems/Push-CDN?tag=0.4.7#5406fde54e61058428a7b55e1a98b699f0f606f1" +source = "git+https://github.com/EspressoSystems/Push-CDN?tag=0.5.6#9409763dbcb726e43218c3c4cfde91c7d5de6a52" dependencies = [ "anyhow", "ark-serialize", @@ -1293,7 +1280,8 @@ dependencies = [ "capnp", "capnpc", "derivative", - "jf-signature 0.1.0", + "derive_more 1.0.0", + "jf-signature", "kanal", "lazy_static", "mnemonic", @@ -1305,7 +1293,7 @@ dependencies = [ "rcgen 0.13.1", "redis", "rkyv", - "rustls 0.23.16", + "rustls 0.23.19", "rustls-pki-types", "sqlx", "thiserror 1.0.68", @@ -1392,33 +1380,6 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" -[[package]] -name = "color-eyre" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55146f5e46f237f7423d74111267d4597b59b0dad0ffaf7303bce9945d843ad5" -dependencies = [ - "backtrace", - "color-spantrace", - "eyre", - "indenter", - "once_cell", - "owo-colors", - "tracing-error", -] - -[[package]] -name = "color-spantrace" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd6be1b2a7e382e2b98b43b2adcca6bb0e465af0bdd38123873ae61eb17a72c2" -dependencies = [ - "once_cell", - "owo-colors", - "tracing-core", - "tracing-error", -] - [[package]] name = "colorchoice" version = "1.0.3" @@ -1485,19 +1446,6 @@ dependencies = [ "yaml-rust2", ] -[[package]] -name = "console-api" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd326812b3fd01da5bb1af7d340d0d555fd3d4b641e7f1dfcf5962a902952787" -dependencies = [ - "futures-core", - "prost", - "prost-types", - "tonic 0.10.2", - "tracing-core", -] - [[package]] name = "console-api" version = "0.7.0" @@ -1507,41 +1455,17 @@ dependencies = [ "futures-core", "prost", "prost-types", - "tonic 0.11.0", + "tonic", "tracing-core", ] -[[package]] -name = "console-subscriber" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7481d4c57092cd1c19dd541b92bdce883de840df30aa5d03fd48a3935c01842e" -dependencies = [ - "console-api 0.6.0", - "crossbeam-channel", - "crossbeam-utils", - "futures-task", - "hdrhistogram", - "humantime", - "prost-types", - "serde", - "serde_json", - "thread_local", - "tokio", - "tokio-stream", - "tonic 0.10.2", - "tracing", - "tracing-core", - "tracing-subscriber 0.3.18", -] - [[package]] name = "console-subscriber" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31c4cc54bae66f7d9188996404abdf7fdfa23034ef8e43478c8810828abad758" dependencies = [ - "console-api 0.7.0", + "console-api", "crossbeam-channel", "crossbeam-utils", "futures-task", @@ -1554,7 +1478,7 @@ dependencies = [ "thread_local", "tokio", "tokio-stream", - "tonic 0.11.0", + "tonic", "tracing", "tracing-core", "tracing-subscriber 0.3.18", @@ -1780,27 +1704,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "csv" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe" -dependencies = [ - "csv-core", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "csv-core" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5efa2b3d7902f4b634a20cae3c9c4e6209dc4779feb6863329607560143efa70" -dependencies = [ - "memchr", -] - [[package]] name = "ctr" version = "0.6.0" @@ -1837,26 +1740,6 @@ dependencies = [ "syn 2.0.87", ] -[[package]] -name = "custom_debug" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89e0ae2c2a42be29595d05c50e3ce6096c0698a97e021c3289790f0750cc8e2" -dependencies = [ - "custom_debug_derive", -] - -[[package]] -name = "custom_debug_derive" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08a9f3941234c9f62ceaa2782974827749de9b0a8a6487275a278da068e1baf7" -dependencies = [ - "proc-macro2", - "syn 1.0.109", - "synstructure 0.12.6", -] - [[package]] name = "darling" version = "0.20.10" @@ -2259,11 +2142,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "espresso-systems-common" -version = "0.4.1" -source = "git+https://github.com/espressosystems/espresso-systems-common?tag=0.4.1#2e889e878866c2a5cce1daaab947f7c93d5811ae" - [[package]] name = "etcetera" version = "0.8.0" @@ -2275,31 +2153,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "ethbloom" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" -dependencies = [ - "crunchy", - "fixed-hash", - "impl-serde", - "tiny-keccak", -] - -[[package]] -name = "ethereum-types" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" -dependencies = [ - "ethbloom", - "fixed-hash", - "impl-serde", - "primitive-types", - "uint", -] - [[package]] name = "event-listener" version = "2.5.3" @@ -2327,16 +2180,6 @@ dependencies = [ "pin-project-lite 0.2.15", ] -[[package]] -name = "eyre" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" -dependencies = [ - "indenter", - "once_cell", -] - [[package]] name = "fastrand" version = "1.9.0" @@ -2365,6 +2208,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "byteorder", + "rand 0.8.5", "rustc-hex", "static_assertions", ] @@ -2387,7 +2231,6 @@ checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095" dependencies = [ "futures-core", "futures-sink", - "nanorand", "spin 0.9.8", ] @@ -2549,7 +2392,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f2f12607f92c69b12ed746fabf9ca4f5c482cba46679c1a75b874ed7c26adb" dependencies = [ "futures-io", - "rustls 0.23.16", + "rustls 0.23.19", "rustls-pki-types", ] @@ -2629,10 +2472,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]] @@ -2965,7 +2806,7 @@ dependencies = [ [[package]] name = "hotshot" version = "0.5.79" -source = "git+https://github.com/EspressoSystems/HotShot.git?rev=f62b557#f62b5574b1d96d34803c3de0bc6c7e1a3e2533fe" +source = "git+https://github.com/EspressoSystems/HotShot.git?tag=0.5.82#ecfd22a4b3d20b7cf89282b172f178ab2ebf81a4" dependencies = [ "anyhow", "async-broadcast", @@ -2979,27 +2820,23 @@ dependencies = [ "cdn-marshal", "chrono", "committable", - "custom_debug", "dashmap", "derive_more 1.0.0", "either", - "ethereum-types", "futures", "hotshot-task", "hotshot-task-impls", "hotshot-types", - "jf-signature 0.2.0", "libp2p-identity", "libp2p-networking", "lru 0.12.5", "num_enum", "parking_lot", "portpicker", + "primitive-types", "rand 0.8.5", "serde", "sha2 0.10.8", - "surf-disco", - "thiserror 2.0.3", "time 0.3.36", "tokio", "tracing", @@ -3012,7 +2849,7 @@ dependencies = [ [[package]] name = "hotshot-builder-api" version = "0.1.7" -source = "git+https://github.com/EspressoSystems/HotShot.git?rev=f62b557#f62b5574b1d96d34803c3de0bc6c7e1a3e2533fe" +source = "git+https://github.com/EspressoSystems/HotShot.git?tag=0.5.82#ecfd22a4b3d20b7cf89282b172f178ab2ebf81a4" dependencies = [ "async-trait", "clap", @@ -3030,7 +2867,7 @@ dependencies = [ [[package]] name = "hotshot-builder-core" -version = "0.1.56" +version = "0.1.57" dependencies = [ "anyhow", "async-broadcast", @@ -3058,13 +2895,11 @@ dependencies = [ [[package]] name = "hotshot-events-service" -version = "0.1.49" -source = "git+https://github.com/EspressoSystems/hotshot-events-service.git?branch=sishan/tx_status_api#4ea38d4b068e416ec5e950881463c7ee095d947a" +version = "0.1.56" +source = "git+https://github.com/EspressoSystems/hotshot-events-service.git?tag=0.1.56#c8046e6debb533c6abf431866ccf1d3787338982" dependencies = [ "async-broadcast", - "async-compatibility-layer", "async-lock 2.8.0", - "async-std", "async-trait", "clap", "derivative", @@ -3072,33 +2907,29 @@ dependencies = [ "either", "futures", "hotshot-types", + "libp2p-identity", "rand 0.8.5", "serde", "snafu", "tagged-base64", "tide-disco", + "tokio", "toml", "tracing", + "tracing-test", "vbs", ] [[package]] name = "hotshot-example-types" version = "0.5.79" -source = "git+https://github.com/EspressoSystems/HotShot.git?rev=f62b557#f62b5574b1d96d34803c3de0bc6c7e1a3e2533fe" +source = "git+https://github.com/EspressoSystems/HotShot.git?tag=0.5.82#ecfd22a4b3d20b7cf89282b172f178ab2ebf81a4" dependencies = [ "anyhow", - "async-broadcast", "async-lock 3.4.0", "async-trait", - "bitvec", "committable", - "either", - "ethereum-types", - "futures", "hotshot", - "hotshot-builder-api", - "hotshot-task", "hotshot-task-impls", "hotshot-types", "jf-vid", @@ -3110,7 +2941,6 @@ dependencies = [ "thiserror 2.0.3", "time 0.3.36", "tokio", - "tracing", "url", "vbs", ] @@ -3118,7 +2948,7 @@ dependencies = [ [[package]] name = "hotshot-fakeapi" version = "0.5.79" -source = "git+https://github.com/EspressoSystems/HotShot.git?rev=f62b557#f62b5574b1d96d34803c3de0bc6c7e1a3e2533fe" +source = "git+https://github.com/EspressoSystems/HotShot.git?tag=0.5.82#ecfd22a4b3d20b7cf89282b172f178ab2ebf81a4" dependencies = [ "anyhow", "async-lock 3.4.0", @@ -3127,18 +2957,16 @@ dependencies = [ "hotshot-example-types", "hotshot-types", "rand 0.8.5", - "serde", "tide-disco", "tokio", "toml", - "tracing", "vbs", ] [[package]] name = "hotshot-macros" version = "0.5.79" -source = "git+https://github.com/EspressoSystems/HotShot.git?rev=f62b557#f62b5574b1d96d34803c3de0bc6c7e1a3e2533fe" +source = "git+https://github.com/EspressoSystems/HotShot.git?tag=0.5.82#ecfd22a4b3d20b7cf89282b172f178ab2ebf81a4" dependencies = [ "derive_builder", "proc-macro2", @@ -3146,39 +2974,11 @@ dependencies = [ "syn 2.0.87", ] -[[package]] -name = "hotshot-orchestrator" -version = "0.5.79" -source = "git+https://github.com/EspressoSystems/HotShot.git?rev=f62b557#f62b5574b1d96d34803c3de0bc6c7e1a3e2533fe" -dependencies = [ - "anyhow", - "async-lock 3.4.0", - "bincode", - "blake3", - "clap", - "csv", - "futures", - "hotshot-types", - "libp2p", - "multiaddr", - "serde", - "serde_json", - "surf-disco", - "thiserror 2.0.3", - "tide-disco", - "tokio", - "toml", - "tracing", - "vbs", - "vec1", -] - [[package]] name = "hotshot-task" version = "0.5.79" -source = "git+https://github.com/EspressoSystems/HotShot.git?rev=f62b557#f62b5574b1d96d34803c3de0bc6c7e1a3e2533fe" +source = "git+https://github.com/EspressoSystems/HotShot.git?tag=0.5.82#ecfd22a4b3d20b7cf89282b172f178ab2ebf81a4" dependencies = [ - "anyhow", "async-broadcast", "async-trait", "futures", @@ -3190,15 +2990,13 @@ dependencies = [ [[package]] name = "hotshot-task-impls" version = "0.5.79" -source = "git+https://github.com/EspressoSystems/HotShot.git?rev=f62b557#f62b5574b1d96d34803c3de0bc6c7e1a3e2533fe" +source = "git+https://github.com/EspressoSystems/HotShot.git?tag=0.5.82#ecfd22a4b3d20b7cf89282b172f178ab2ebf81a4" dependencies = [ "anyhow", "async-broadcast", "async-lock 3.4.0", "async-trait", "bincode", - "bitvec", - "cdn-proto", "chrono", "committable", "either", @@ -3206,7 +3004,6 @@ dependencies = [ "hotshot-builder-api", "hotshot-task", "hotshot-types", - "jf-signature 0.2.0", "jf-vid", "lru 0.12.5", "rand 0.8.5", @@ -3227,7 +3024,7 @@ dependencies = [ [[package]] name = "hotshot-testing" version = "0.5.79" -source = "git+https://github.com/EspressoSystems/HotShot.git?rev=f62b557#f62b5574b1d96d34803c3de0bc6c7e1a3e2533fe" +source = "git+https://github.com/EspressoSystems/HotShot.git?tag=0.5.82#ecfd22a4b3d20b7cf89282b172f178ab2ebf81a4" dependencies = [ "anyhow", "async-broadcast", @@ -3237,27 +3034,24 @@ dependencies = [ "bitvec", "committable", "either", - "ethereum-types", "futures", "hotshot", "hotshot-builder-api", "hotshot-example-types", "hotshot-fakeapi", "hotshot-macros", - "hotshot-orchestrator", "hotshot-task", "hotshot-task-impls", "hotshot-types", "itertools 0.13.0", - "jf-signature 0.2.0", "jf-vid", "lru 0.12.5", "portpicker", + "primitive-types", "rand 0.8.5", "reqwest", "serde", "sha2 0.10.8", - "sha3", "tagged-base64", "thiserror 2.0.3", "tide-disco", @@ -3271,7 +3065,7 @@ dependencies = [ [[package]] name = "hotshot-types" version = "0.1.11" -source = "git+https://github.com/EspressoSystems/HotShot.git?rev=f62b557#f62b5574b1d96d34803c3de0bc6c7e1a3e2533fe" +source = "git+https://github.com/EspressoSystems/HotShot.git?tag=0.5.82#ecfd22a4b3d20b7cf89282b172f178ab2ebf81a4" dependencies = [ "anyhow", "ark-bn254", @@ -3285,34 +3079,31 @@ dependencies = [ "bincode", "bitvec", "blake3", - "cdn-proto", "clap", "committable", - "custom_debug", - "derivative", + "derive_more 1.0.0", "digest 0.10.7", "displaydoc", "dyn-clone", "either", - "espresso-systems-common", - "ethereum-types", "futures", "jf-pcs", - "jf-signature 0.2.0", + "jf-signature", "jf-utils", "jf-vid", "lazy_static", - "libp2p", + "libp2p-identity", "memoize", + "mnemonic", + "multiaddr", + "primitive-types", "rand 0.8.5", "rand_chacha 0.3.1", - "reqwest", "serde", "serde-inline-default", "serde_bytes", "serde_json", "sha2 0.10.8", - "surf-disco", "tagged-base64", "thiserror 2.0.3", "time 0.3.36", @@ -3488,7 +3279,7 @@ dependencies = [ "http 1.1.0", "hyper 1.5.0", "hyper-util", - "rustls 0.23.16", + "rustls 0.23.19", "rustls-pki-types", "tokio", "tokio-rustls", @@ -3553,7 +3344,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core 0.52.0", + "windows-core", ] [[package]] @@ -3768,6 +3559,15 @@ dependencies = [ "xmltree", ] +[[package]] +name = "impl-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +dependencies = [ + "parity-scale-codec", +] + [[package]] name = "impl-serde" version = "0.4.0" @@ -3777,6 +3577,17 @@ dependencies = [ "serde", ] +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "include_dir" version = "0.7.4" @@ -3796,12 +3607,6 @@ dependencies = [ "quote", ] -[[package]] -name = "indenter" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" - [[package]] name = "indexmap" version = "1.9.3" @@ -4045,35 +3850,6 @@ dependencies = [ "jf-utils", ] -[[package]] -name = "jf-signature" -version = "0.1.0" -source = "git+https://github.com/EspressoSystems/jellyfish?tag=0.4.5#7d71dbeff14f1a501b0b0dc391f1dffa1b8374fb" -dependencies = [ - "ark-bls12-381", - "ark-bn254", - "ark-ec", - "ark-ff", - "ark-serialize", - "ark-std", - "blst", - "derivative", - "digest 0.10.7", - "displaydoc", - "hashbrown 0.14.5", - "itertools 0.12.1", - "jf-crhf", - "jf-relation", - "jf-rescue", - "jf-utils", - "num-bigint", - "num-traits", - "serde", - "sha3", - "tagged-base64", - "zeroize", -] - [[package]] name = "jf-signature" version = "0.2.0" @@ -4489,18 +4265,16 @@ dependencies = [ [[package]] name = "libp2p-networking" version = "0.5.79" -source = "git+https://github.com/EspressoSystems/HotShot.git?rev=f62b557#f62b5574b1d96d34803c3de0bc6c7e1a3e2533fe" +source = "git+https://github.com/EspressoSystems/HotShot.git?tag=0.5.82#ecfd22a4b3d20b7cf89282b172f178ab2ebf81a4" dependencies = [ "anyhow", - "async-lock 3.4.0", "async-trait", "bincode", "blake3", "cbor4ii", - "custom_debug", "delegate", "derive_builder", - "either", + "derive_more 1.0.0", "futures", "hotshot-types", "lazy_static", @@ -4508,17 +4282,11 @@ dependencies = [ "libp2p-identity", "libp2p-swarm-derive", "pin-project", - "portpicker", "rand 0.8.5", "serde", - "serde_bytes", - "serde_json", - "thiserror 2.0.3", "tokio", - "tokio-stream", "tracing", "tracing-subscriber 0.3.18", - "void", ] [[package]] @@ -4538,7 +4306,7 @@ dependencies = [ "quinn", "rand 0.8.5", "ring 0.17.8", - "rustls 0.23.16", + "rustls 0.23.19", "socket2 0.5.7", "thiserror 1.0.68", "tokio", @@ -4632,7 +4400,7 @@ dependencies = [ "libp2p-identity", "rcgen 0.11.3", "ring 0.17.8", - "rustls 0.23.16", + "rustls 0.23.19", "rustls-webpki 0.101.7", "thiserror 1.0.68", "x509-parser", @@ -4819,7 +4587,7 @@ dependencies = [ [[package]] name = "marketplace-builder-core" -version = "0.1.56" +version = "0.1.57" dependencies = [ "anyhow", "async-broadcast", @@ -4849,7 +4617,7 @@ dependencies = [ [[package]] name = "marketplace-builder-shared" -version = "0.1.56" +version = "0.1.57" dependencies = [ "anyhow", "async-broadcast", @@ -5092,15 +4860,6 @@ dependencies = [ "unsigned-varint 0.7.2", ] -[[package]] -name = "nanorand" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" -dependencies = [ - "getrandom 0.2.15", -] - [[package]] name = "native-tls" version = "0.2.12" @@ -5437,10 +5196,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] -name = "owo-colors" -version = "3.5.0" +name = "parity-scale-codec" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8be4817d39f3272f69c59fe05d0535ae6456c2dc2fa1ba02910296c7e0a5c590" +dependencies = [ + "arrayvec", + "bitvec", + "byte-slice-cast", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "rustversion", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" +checksum = "8781a75c6205af67215f382092b6e0a4ff3734798523e69073d4bcd294ec767b" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.87", +] [[package]] name = "parking" @@ -5708,6 +5488,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", + "impl-codec", "impl-serde", "uint", ] @@ -5908,7 +5689,7 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.23.16", + "rustls 0.23.19", "socket2 0.5.7", "thiserror 1.0.68", "tokio", @@ -5925,7 +5706,7 @@ dependencies = [ "rand 0.8.5", "ring 0.17.8", "rustc-hash", - "rustls 0.23.16", + "rustls 0.23.19", "slab", "thiserror 1.0.68", "tinyvec", @@ -5943,7 +5724,7 @@ dependencies = [ "once_cell", "socket2 0.5.7", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -6080,9 +5861,9 @@ dependencies = [ [[package]] name = "redis" -version = "0.26.1" +version = "0.27.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e902a69d09078829137b4a5d9d082e0490393537badd7c91a3d69d14639e115f" +checksum = "81cccf17a692ce51b86564334614d72dcae1def0fd5ecebc9f02956da74352b5" dependencies = [ "arc-swap", "async-trait", @@ -6096,7 +5877,7 @@ dependencies = [ "pin-project-lite 0.2.15", "ryu", "tokio", - "tokio-retry", + "tokio-retry2", "tokio-util", "url", ] @@ -6446,9 +6227,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.16" +version = "0.23.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eee87ff5d9b36712a58574e12e9f0ea80f915a5b0ac518d322b24a465617925e" +checksum = "934b404430bb06b3fae2cba809eb45a1ab1aecd64491213d7c3301b88393f8d1" dependencies = [ "log", "once_cell", @@ -7424,18 +7205,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "synstructure" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "unicode-xid", -] - [[package]] name = "synstructure" version = "0.13.1" @@ -7531,7 +7300,7 @@ dependencies = [ "fastrand 2.2.0", "once_cell", "rustix 0.38.39", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -7802,7 +7571,6 @@ dependencies = [ "mio", "parking_lot", "pin-project-lite 0.2.15", - "signal-hook-registry", "socket2 0.5.7", "tokio-macros", "tracing", @@ -7841,10 +7609,10 @@ dependencies = [ ] [[package]] -name = "tokio-retry" -version = "0.3.0" +name = "tokio-retry2" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f57eb36ecbe0fc510036adff84824dd3c24bb781e21bfa67b69d556aa85214f" +checksum = "903934dba1c4c2f2e9cb460ef10b5695e0b0ecad3bf9ee7c8675e540c5e8b2d1" dependencies = [ "pin-project", "rand 0.8.5", @@ -7857,7 +7625,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.16", + "rustls 0.23.19", "rustls-pki-types", "tokio", ] @@ -7920,33 +7688,6 @@ dependencies = [ "winnow", ] -[[package]] -name = "tonic" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d560933a0de61cf715926b9cac824d4c883c2c43142f787595e48280c40a1d0e" -dependencies = [ - "async-stream", - "async-trait", - "axum", - "base64 0.21.7", - "bytes", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.31", - "hyper-timeout", - "percent-encoding", - "pin-project", - "prost", - "tokio", - "tokio-stream", - "tower", - "tower-layer", - "tower-service", - "tracing", -] - [[package]] name = "tonic" version = "0.11.0" @@ -8051,16 +7792,6 @@ dependencies = [ "tracing-subscriber 0.3.18", ] -[[package]] -name = "tracing-error" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d686ec1c0f384b1277f097b2f279a2ecc11afe8c133c1aabf036a27cb4cd206e" -dependencies = [ - "tracing", - "tracing-subscriber 0.3.18", -] - [[package]] name = "tracing-futures" version = "0.2.5" @@ -8122,6 +7853,27 @@ dependencies = [ "tracing-serde", ] +[[package]] +name = "tracing-test" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "557b891436fe0d5e0e363427fc7f217abf9ccd510d5136549847bdcbcd011d68" +dependencies = [ + "tracing-core", + "tracing-subscriber 0.3.18", + "tracing-test-macro", +] + +[[package]] +name = "tracing-test-macro" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" +dependencies = [ + "quote", + "syn 2.0.87", +] + [[package]] name = "try-lock" version = "0.2.5" @@ -8278,7 +8030,7 @@ dependencies = [ "flate2", "log", "once_cell", - "rustls 0.23.16", + "rustls 0.23.19", "rustls-pki-types", "url", "webpki-roots 0.26.6", @@ -8323,7 +8075,7 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "utils" version = "0.5.79" -source = "git+https://github.com/EspressoSystems/HotShot.git?rev=f62b557#f62b5574b1d96d34803c3de0bc6c7e1a3e2533fe" +source = "git+https://github.com/EspressoSystems/HotShot.git?tag=0.5.82#ecfd22a4b3d20b7cf89282b172f178ab2ebf81a4" dependencies = [ "tracing", ] @@ -8636,7 +8388,7 @@ version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" dependencies = [ - "windows-core 0.51.1", + "windows-core", "windows-targets 0.48.5", ] @@ -8649,15 +8401,6 @@ dependencies = [ "windows-targets 0.48.5", ] -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-registry" version = "0.2.0" @@ -8950,7 +8693,7 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.87", - "synstructure 0.13.1", + "synstructure", ] [[package]] @@ -8992,7 +8735,7 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.87", - "synstructure 0.13.1", + "synstructure", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 0970d4ee..85569fd1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,15 +2,19 @@ resolver = "2" members = ["crates/*"] +[workspace.package] +version = "0.1.57" +edition = "2021" + [workspace.dependencies] -hotshot = { git = "https://github.com/EspressoSystems/HotShot.git", rev = "f62b557" } -hotshot-builder-api = { git = "https://github.com/EspressoSystems/HotShot.git", rev = "f62b557" } -hotshot-events-service = { git = "https://github.com/EspressoSystems/hotshot-events-service.git", branch = "sishan/tx_status_api" } -hotshot-macros = { git = "https://github.com/EspressoSystems/HotShot.git", rev = "f62b557" } -hotshot-task-impls = { git = "https://github.com/EspressoSystems/HotShot.git", rev = "f62b557" } -hotshot-testing = { git = "https://github.com/EspressoSystems/HotShot.git", rev = "f62b557" } -hotshot-types = { git = "https://github.com/EspressoSystems/HotShot.git", rev = "f62b557" } -hotshot-example-types = { git = "https://github.com/EspressoSystems/HotShot.git", rev = "f62b557" } +hotshot = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.82" } +hotshot-builder-api = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.82" } +hotshot-events-service = { git = "https://github.com/EspressoSystems/hotshot-events-service.git", tag = "0.1.56" } +hotshot-macros = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.82" } +hotshot-task-impls = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.82" } +hotshot-testing = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.82" } +hotshot-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.82" } +hotshot-example-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.82" } anyhow = "1" async-broadcast = "0.7" @@ -47,10 +51,6 @@ vbs = "0.1" vec1 = "1.12" tracing-subscriber = "0.3" -[workspace.package] -version = "0.1.56" -edition = "2021" - [workspace.lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] } diff --git a/crates/legacy/Cargo.toml b/crates/legacy/Cargo.toml index d152c708..e96b790e 100644 --- a/crates/legacy/Cargo.toml +++ b/crates/legacy/Cargo.toml @@ -12,6 +12,7 @@ async-lock = { workspace = true } async-trait = { workspace = true } bincode = { workspace = true } committable = { workspace = true } +derive_more = { workspace = true, features = ["deref", "deref_mut"] } futures = { workspace = true } hotshot = { workspace = true } hotshot-builder-api = { workspace = true } @@ -23,9 +24,8 @@ tagged-base64 = { workspace = true } tide-disco = { workspace = true } tokio = { workspace = true } tracing = { workspace = true } -vbs = { workspace = true } tracing-subscriber = { workspace = true } -derive_more = { workspace = true, features = ["deref", "deref_mut"] } +vbs = { workspace = true } [dev-dependencies] hotshot-example-types = { workspace = true } diff --git a/crates/legacy/src/builder_state.rs b/crates/legacy/src/builder_state.rs index 3617b7f4..9c0c0415 100644 --- a/crates/legacy/src/builder_state.rs +++ b/crates/legacy/src/builder_state.rs @@ -1,9 +1,8 @@ use hotshot_types::{ - data::{DaProposal, Leaf, QuorumProposal}, + data::{DaProposal, Leaf2, QuorumProposal2}, message::Proposal, - traits::block_contents::{BlockHeader, BlockPayload}, traits::{ - block_contents::precompute_vid_commitment, + block_contents::{precompute_vid_commitment, BlockHeader, BlockPayload}, node_implementation::{ConsensusTime, NodeType}, EncodeBytes, }, @@ -12,12 +11,9 @@ use hotshot_types::{ }; use marketplace_builder_shared::block::{BlockId, BuilderStateId, ParentBlockReferences}; -use committable::Commitment; +use committable::{Commitment, Committable}; -use crate::{ - service::{GlobalState, ReceivedTransaction}, - LegacyCommit, -}; +use crate::service::{GlobalState, ReceivedTransaction}; use async_broadcast::broadcast; use async_broadcast::Receiver as BroadcastReceiver; use async_broadcast::Sender as BroadcastSender; @@ -65,7 +61,7 @@ pub struct DaProposalMessage { /// Quorum proposal message to be put on the quorum proposal channel #[derive(Clone, Debug, PartialEq)] pub struct QuorumProposalMessage { - pub proposal: Arc>>, + pub proposal: Arc>>, pub sender: Types::SignatureKey, } /// Request Message to be put on the request channel @@ -148,7 +144,7 @@ pub struct BuilderState { /// `quorum_proposal_payload_commit` to `quorum_proposal` #[allow(clippy::type_complexity)] pub quorum_proposal_payload_commit_to_quorum_proposal: - HashMap<(BuilderCommitment, Types::View), Arc>>>, + HashMap<(BuilderCommitment, Types::View), Arc>>>, /// Spawned-from references to the parent block. pub parent_block_references: ParentBlockReferences, @@ -214,9 +210,9 @@ pub struct BuilderState { /// itself. /// /// In an ideal circumstance the best [`BuilderState`] to extend from is going to -/// be the one that is immediately preceding the [`QuorumProposal`] that we are +/// be the one that is immediately preceding the [`QuorumProposal2`] that we are /// attempting to extend from. However, if all we know is the view number of -/// the [`QuorumProposal`] that we are attempting to extend from, then we may end +/// the [`QuorumProposal2`] that we are attempting to extend from, then we may end /// up in a scenario where we have multiple [`BuilderState`]s that are all equally /// valid to extend from. When this happens, we have the potential for a data /// race. @@ -225,7 +221,7 @@ pub struct BuilderState { /// [`ProxyGlobalState`](crate::service::ProxyGlobalState)'s API. In general, /// we want to be able to retrieve a [`BuilderState`] via the [`BuilderStateId`]. /// The [`BuilderStateId`] only references a [`ViewNumber`](hotshot_types::data::ViewNumber) -/// and a [`VidCommitment`] While this information is available in the [`QuorumProposal`], +/// and a [`VidCommitment`] While this information is available in the [`QuorumProposal2`], /// it only helps us to rule out [`BuilderState`]s that already exist. /// It does **NOT** help us to pick a [`BuilderState`] that is the best fit to extend from. /// @@ -239,7 +235,7 @@ pub struct BuilderState { /// This function determines the best [`BuilderState`] in the following steps: /// /// 1. If we have a [`BuilderState`] that is already spawned for the current -/// [`QuorumProposal`], then we should should return no states, as one already +/// [`QuorumProposal2`], then we should should return no states, as one already /// exists. This will prevent us from attempting to spawn duplicate /// [`BuilderState`]s. /// 2. Attempt to find all [`BuilderState`]s that are recorded within @@ -247,7 +243,7 @@ pub struct BuilderState { /// *should* only be one of these. But all would be valid extension points. /// 3. If we can't find any [`BuilderState`]s that match the view number /// and leaf commitment, then we should return for the maximum stored view -/// number that is smaller than the current [`QuorumProposal`]. +/// number that is smaller than the current [`QuorumProposal2`]. /// 4. If there is is only one [`BuilderState`] stored in the [`GlobalState`], then /// we should return that [`BuilderState`] as the best fit. /// 5. If none of the other criteria match, we return an empty result as it is @@ -260,7 +256,7 @@ pub struct BuilderState { /// > entries in the resulting [HashSet], but this is not done here in order /// > to allow us to highlight the possibility of the race. async fn best_builder_states_to_extend( - quorum_proposal: Arc>>, + quorum_proposal: Arc>>, global_state: Arc>>, ) -> HashSet> { let current_view_number = quorum_proposal.data.view_number; @@ -371,7 +367,7 @@ impl BuilderState { /// we are among the best [`BuilderState`]s to extend from. async fn am_i_the_best_builder_state_to_extend( &self, - quorum_proposal: Arc>>, + quorum_proposal: Arc>>, ) -> bool { let best_builder_states_to_extend = best_builder_states_to_extend(quorum_proposal.clone(), self.global_state.clone()).await; @@ -547,11 +543,11 @@ impl BuilderState { /// /// This helper function also adds additional checks in order to ensure /// that the [`BuilderState`] that is being spawned is the best fit for the - /// [`QuorumProposal`] that is being extended from. + /// [`QuorumProposal2`] that is being extended from. async fn spawn_clone_that_extends_self( &mut self, da_proposal_info: DAProposalInfo, - quorum_proposal: Arc>>, + quorum_proposal: Arc>>, ) { if !self .am_i_the_best_builder_state_to_extend(quorum_proposal.clone()) @@ -619,10 +615,10 @@ impl BuilderState { async fn spawn_clone( mut self, da_proposal_info: DAProposalInfo, - quorum_proposal: Arc>>, + quorum_proposal: Arc>>, req_sender: BroadcastSender>, ) { - let leaf = Leaf::from_quorum_proposal(&quorum_proposal.data); + let leaf = Leaf2::from_quorum_proposal(&quorum_proposal.data); // We replace our parent_block_references with information from the // quorum proposal. This is identifying the block that this specific @@ -630,7 +626,7 @@ impl BuilderState { self.parent_block_references = ParentBlockReferences { view_number: quorum_proposal.data.view_number, vid_commitment: quorum_proposal.data.block_header.payload_commitment(), - leaf_commit: leaf.legacy_commit(), + leaf_commit: leaf.commit(), builder_commitment: quorum_proposal.data.block_header.builder_commitment(), }; @@ -1145,8 +1141,8 @@ mod test { use committable::RawCommitmentBuilder; use hotshot_example_types::block_types::TestTransaction; use hotshot_example_types::node_types::TestTypes; - use hotshot_types::data::ViewNumber; - use hotshot_types::data::{Leaf, QuorumProposal}; + use hotshot_types::data::Leaf2; + use hotshot_types::data::{QuorumProposal2, ViewNumber}; use hotshot_types::traits::node_implementation::{ConsensusTime, NodeType}; use hotshot_types::utils::BuilderCommitment; use marketplace_builder_shared::testing::constants::TEST_NUM_NODES_IN_VID_COMPUTATION; @@ -1413,7 +1409,7 @@ mod test { .collect::>() }) .collect::>(); - let mut prev_quorum_proposal: Option> = None; + let mut prev_quorum_proposal: Option> = None; // register some builder states for later decide event #[allow(clippy::needless_range_loop)] for round in 0..NUM_ROUNDS { @@ -1423,7 +1419,7 @@ mod test { .await; prev_quorum_proposal = Some(quorum_proposal.clone()); let (req_sender, _req_receiver) = broadcast(CHANNEL_CAPACITY); - let leaf: Leaf = Leaf::from_quorum_proposal(&quorum_proposal); + let leaf: Leaf2 = Leaf2::from_quorum_proposal(&quorum_proposal); let leaf_commit = RawCommitmentBuilder::new("leaf commitment") .u64_field("view number", leaf.view_number().u64()) .u64_field("block number", leaf.height()) diff --git a/crates/legacy/src/lib.rs b/crates/legacy/src/lib.rs index 09cf17a1..820e2153 100644 --- a/crates/legacy/src/lib.rs +++ b/crates/legacy/src/lib.rs @@ -22,7 +22,6 @@ pub mod service; pub mod testing; use hotshot_builder_api::v0_1::builder::BuildError; -use hotshot_types::traits::node_implementation::NodeType; use tokio::sync::mpsc::UnboundedReceiver; /// `WaitAndKeep` is a helper enum that allows for the lazy polling of a single @@ -74,15 +73,3 @@ impl WaitAndKeep { } } } - -// TODO: Update commitment calculation with the new `commit`. -// -trait LegacyCommit { - fn legacy_commit(&self) -> committable::Commitment>; -} - -impl LegacyCommit for hotshot_types::data::Leaf { - fn legacy_commit(&self) -> committable::Commitment> { - as committable::Committable>::commit(self) - } -} diff --git a/crates/legacy/src/service.rs b/crates/legacy/src/service.rs index 8ac8defe..ba2bc695 100644 --- a/crates/legacy/src/service.rs +++ b/crates/legacy/src/service.rs @@ -8,7 +8,7 @@ use hotshot_builder_api::{ v0_2::builder::TransactionStatus, }; use hotshot_types::{ - data::{DaProposal, Leaf, QuorumProposal}, + data::{DaProposal, Leaf2, QuorumProposal2}, event::EventType, message::Proposal, traits::{ @@ -24,14 +24,11 @@ use vbs::version::StaticVersionType; use marketplace_builder_shared::block::{BlockId, BuilderStateId, ParentBlockReferences}; -use crate::builder_state::{MessageType, RequestMessage, ResponseMessage}; -use crate::{ - builder_state::{ - BuildBlockInfo, DaProposalMessage, DecideMessage, QuorumProposalMessage, TransactionSource, - TriggerStatus, - }, - LegacyCommit as _, +use crate::builder_state::{ + BuildBlockInfo, DaProposalMessage, DecideMessage, QuorumProposalMessage, TransactionSource, + TriggerStatus, }; +use crate::builder_state::{MessageType, RequestMessage, ResponseMessage}; use crate::{WaitAndKeep, WaitAndKeepGetError}; pub use async_broadcast::{broadcast, RecvError, TryRecvError}; use async_broadcast::{Sender as BroadcastSender, TrySendError}; @@ -1376,7 +1373,7 @@ enum HandleQuorumEventError { /// still open. async fn handle_quorum_event( quorum_channel_sender: &BroadcastSender>, - quorum_proposal: Arc>>, + quorum_proposal: Arc>>, sender: ::SignatureKey, ) { // We're explicitly not inspecting this error, as this function is not @@ -1398,7 +1395,7 @@ async fn handle_quorum_event( /// This function is the implementation for [`handle_quorum_event`]. async fn handle_quorum_event_implementation( quorum_channel_sender: &BroadcastSender>, - quorum_proposal: Arc>>, + quorum_proposal: Arc>>, sender: ::SignatureKey, ) -> Result<(), HandleQuorumEventError> { tracing::debug!( @@ -1407,9 +1404,9 @@ async fn handle_quorum_event_implementation( quorum_proposal.data.view_number ); - let leaf = Leaf::from_quorum_proposal(&quorum_proposal.data); + let leaf = Leaf2::from_quorum_proposal(&quorum_proposal.data); - if !sender.validate(&quorum_proposal.signature, leaf.legacy_commit().as_ref()) { + if !sender.validate(&quorum_proposal.signature, leaf.commit().as_ref()) { tracing::error!( "Validation Failure on QuorumProposal for view {:?}: Leader for the current view: {:?}", quorum_proposal.data.view_number, @@ -1645,9 +1642,13 @@ mod test { node_types::{TestTypes, TestVersions}, state_types::{TestInstanceState, TestValidatedState}, }; + use hotshot_types::data::Leaf2; + use hotshot_types::data::QuorumProposal2; + use hotshot_types::drb::INITIAL_DRB_RESULT; + use hotshot_types::drb::INITIAL_DRB_SEED_INPUT; use hotshot_types::traits::block_contents::Transaction; use hotshot_types::{ - data::{DaProposal, Leaf, QuorumProposal, ViewNumber}, + data::{DaProposal, Leaf, ViewNumber}, message::Proposal, simple_certificate::QuorumCertificate, traits::{ @@ -1680,7 +1681,6 @@ mod test { process_available_blocks_round, progress_round_with_available_block_info, progress_round_without_available_block_info, setup_builder_for_test, }, - LegacyCommit, }; use super::{ @@ -4271,30 +4271,33 @@ mod test { let view_number = ViewNumber::new(10); let quorum_proposal = { - let leaf = Leaf::::genesis( + let leaf: Leaf2<_> = Leaf::::genesis( &TestValidatedState::default(), &TestInstanceState::default(), ) - .await; + .await + .into(); - QuorumProposal:: { + QuorumProposal2:: { block_header: leaf.block_header().clone(), view_number, justify_qc: QuorumCertificate::genesis::( &TestValidatedState::default(), &TestInstanceState::default(), ) - .await, + .await + .to_qc2(), upgrade_certificate: None, - proposal_certificate: None, + view_change_evidence: None, + drb_seed: INITIAL_DRB_SEED_INPUT, + drb_result: INITIAL_DRB_RESULT, } }; - let leaf = Leaf::from_quorum_proposal(&quorum_proposal); + let leaf = Leaf2::from_quorum_proposal(&quorum_proposal); let signature = - ::sign(&leader_private_key, leaf.legacy_commit().as_ref()) - .unwrap(); + ::sign(&leader_private_key, leaf.commit().as_ref()).unwrap(); let signed_quorum_proposal = Arc::new(Proposal { data: quorum_proposal, @@ -4341,30 +4344,33 @@ mod test { let view_number = ViewNumber::new(10); let quorum_proposal = { - let leaf = Leaf::::genesis( + let leaf: Leaf2<_> = Leaf::::genesis( &TestValidatedState::default(), &TestInstanceState::default(), ) - .await; + .await + .into(); - QuorumProposal:: { + QuorumProposal2:: { block_header: leaf.block_header().clone(), view_number, justify_qc: QuorumCertificate::genesis::( &TestValidatedState::default(), &TestInstanceState::default(), ) - .await, + .await + .to_qc2(), upgrade_certificate: None, - proposal_certificate: None, + view_change_evidence: None, + drb_seed: INITIAL_DRB_SEED_INPUT, + drb_result: INITIAL_DRB_RESULT, } }; - let leaf = Leaf::from_quorum_proposal(&quorum_proposal); + let leaf = Leaf2::from_quorum_proposal(&quorum_proposal); let signature = - ::sign(&sender_private_key, leaf.legacy_commit().as_ref()) - .unwrap(); + ::sign(&sender_private_key, leaf.commit().as_ref()).unwrap(); let signed_quorum_proposal = Arc::new(Proposal { data: quorum_proposal, @@ -4402,30 +4408,33 @@ mod test { let view_number = ViewNumber::new(10); let quorum_proposal = { - let leaf = Leaf::::genesis( + let leaf: Leaf2<_> = Leaf::::genesis( &TestValidatedState::default(), &TestInstanceState::default(), ) - .await; + .await + .into(); - QuorumProposal:: { + QuorumProposal2:: { block_header: leaf.block_header().clone(), view_number, justify_qc: QuorumCertificate::genesis::( &TestValidatedState::default(), &TestInstanceState::default(), ) - .await, + .await + .to_qc2(), upgrade_certificate: None, - proposal_certificate: None, + view_change_evidence: None, + drb_seed: INITIAL_DRB_SEED_INPUT, + drb_result: INITIAL_DRB_RESULT, } }; - let leaf = Leaf::from_quorum_proposal(&quorum_proposal); + let leaf = Leaf2::from_quorum_proposal(&quorum_proposal); let signature = - ::sign(&sender_private_key, leaf.legacy_commit().as_ref()) - .unwrap(); + ::sign(&sender_private_key, leaf.commit().as_ref()).unwrap(); let signed_quorum_proposal = Arc::new(Proposal { data: quorum_proposal, diff --git a/crates/legacy/src/testing/basic_test.rs b/crates/legacy/src/testing/basic_test.rs index ad880b00..7a61e7a0 100644 --- a/crates/legacy/src/testing/basic_test.rs +++ b/crates/legacy/src/testing/basic_test.rs @@ -1,6 +1,6 @@ pub use hotshot::traits::election::static_committee::StaticCommittee; pub use hotshot_types::{ - data::{DaProposal, EpochNumber, Leaf, QuorumProposal, ViewNumber}, + data::{DaProposal, EpochNumber, Leaf, ViewNumber}, message::Proposal, signature_key::BLSPubKey, simple_certificate::{QuorumCertificate, SimpleCertificate, SuccessThreshold}, @@ -23,9 +23,11 @@ mod tests { use hotshot_builder_api::v0_2::data_source::BuilderDataSource; use hotshot_example_types::auction_results_provider_types::TestAuctionResult; use hotshot_example_types::node_types::TestVersions; + use hotshot_types::data::{Leaf2, QuorumProposal2}; + use hotshot_types::drb::{INITIAL_DRB_RESULT, INITIAL_DRB_SEED_INPUT}; + use hotshot_types::simple_vote::QuorumData2; use hotshot_types::{ signature_key::BuilderKey, - simple_vote::QuorumData, traits::block_contents::{vid_commitment, BlockHeader}, utils::BuilderCommitment, }; @@ -49,7 +51,7 @@ mod tests { use crate::service::{ handle_received_txns, GlobalState, ProxyGlobalState, ReceivedTransaction, }; - use crate::LegacyCommit; + use async_lock::RwLock; use committable::{Commitment, CommitmentBoundsArkless, Committable}; use sha2::{Digest, Sha256}; @@ -133,7 +135,7 @@ mod tests { ParentBlockReferences { view_number: ViewNumber::new(0), vid_commitment: initial_commitment, - leaf_commit: Commitment::>::default_commitment_no_preimage(), + leaf_commit: Commitment::>::default_commitment_no_preimage(), builder_commitment: BuilderCommitment::from_bytes([]), }, decide_receiver.clone(), @@ -168,9 +170,10 @@ mod tests { &TestValidatedState::default(), &TestInstanceState::default(), ) - .await; + .await + .to_qc2(); - QuorumProposal:: { + QuorumProposal2:: { block_header: TestBlockHeader { block_number: 0, payload_commitment: previous_commitment, @@ -184,7 +187,9 @@ mod tests { view_number: ViewNumber::new(0), justify_qc: previous_jc.clone(), upgrade_certificate: None, - proposal_certificate: None, + view_change_evidence: None, + drb_seed: INITIAL_DRB_SEED_INPUT, + drb_result: INITIAL_DRB_RESULT, } }; @@ -352,10 +357,10 @@ mod tests { let _metadata = >::metadata( &previous_quorum_proposal.block_header, ); - let leaf = Leaf::from_quorum_proposal(&previous_quorum_proposal); + let leaf = Leaf2::from_quorum_proposal(&previous_quorum_proposal); - let q_data = QuorumData:: { - leaf_commit: leaf.legacy_commit(), + let q_data = QuorumData2:: { + leaf_commit: leaf.commit(), }; let previous_quorum_view_number = @@ -368,7 +373,7 @@ mod tests { ViewNumber::new(1 + previous_justify_qc.view_number.u64()) }; // form a justify qc - SimpleCertificate::, SuccessThreshold>::new( + SimpleCertificate::, SuccessThreshold>::new( q_data.clone(), q_data.commit(), view_number, @@ -379,12 +384,14 @@ mod tests { tracing::debug!("Iteration: {} justify_qc: {:?}", round, justify_qc); - let quorum_proposal = QuorumProposal:: { + let quorum_proposal = QuorumProposal2:: { block_header, view_number: ViewNumber::new(round as u64), justify_qc: justify_qc.clone(), upgrade_certificate: None, - proposal_certificate: None, + view_change_evidence: None, + drb_seed: INITIAL_DRB_SEED_INPUT, + drb_result: INITIAL_DRB_RESULT, }; let payload_vid_commitment = @@ -413,13 +420,12 @@ mod tests { // This may not be necessary for this test let decide_message = { let leaf = match round { - 0 => { - Leaf::genesis( - &TestValidatedState::default(), - &TestInstanceState::default(), - ) - .await - } + 0 => Leaf::genesis( + &TestValidatedState::default(), + &TestInstanceState::default(), + ) + .await + .into(), _ => { let block_payload = BlockPayload::::from_bytes( &encoded_transactions, @@ -427,7 +433,7 @@ mod tests { &quorum_certificate_message.proposal.data.block_header, ), ); - let mut current_leaf = Leaf::from_quorum_proposal( + let mut current_leaf = Leaf2::from_quorum_proposal( &quorum_certificate_message.proposal.data, ); current_leaf diff --git a/crates/legacy/src/testing/finalization_test.rs b/crates/legacy/src/testing/finalization_test.rs index adfaf120..fedacddf 100644 --- a/crates/legacy/src/testing/finalization_test.rs +++ b/crates/legacy/src/testing/finalization_test.rs @@ -13,8 +13,8 @@ use hotshot::{ types::{BLSPubKey, SignatureKey}, }; use hotshot_builder_api::{ - v0_2::{block_info::AvailableBlockInfo, data_source::BuilderDataSource}, - v0_3::{builder::BuildError, data_source::AcceptsTxnSubmits}, + v0_1::{block_info::AvailableBlockInfo, data_source::BuilderDataSource}, + v0_1::{builder::BuildError, data_source::AcceptsTxnSubmits}, }; use hotshot_example_types::{ block_types::{TestBlockHeader, TestBlockPayload, TestMetadata, TestTransaction}, @@ -22,7 +22,8 @@ use hotshot_example_types::{ state_types::{TestInstanceState, TestValidatedState}, }; use hotshot_types::{ - data::{DaProposal, QuorumProposal, ViewNumber}, + data::{DaProposal, QuorumProposal2, ViewNumber}, + drb::{INITIAL_DRB_RESULT, INITIAL_DRB_SEED_INPUT}, message::Proposal, simple_certificate::QuorumCertificate, traits::{ @@ -313,16 +314,19 @@ async fn progress_round_with_transactions( random: 0, }; - let qc_proposal = QuorumProposal:: { + let qc_proposal = QuorumProposal2:: { block_header, view_number: next_view, justify_qc: QuorumCertificate::::genesis::( &TestValidatedState::default(), &TestInstanceState::default(), ) - .await, + .await + .to_qc2(), upgrade_certificate: None, - proposal_certificate: None, + view_change_evidence: None, + drb_seed: INITIAL_DRB_SEED_INPUT, + drb_result: INITIAL_DRB_RESULT, }; let payload_vid_commitment = diff --git a/crates/legacy/src/testing/mod.rs b/crates/legacy/src/testing/mod.rs index fb351cd1..a0ae1284 100644 --- a/crates/legacy/src/testing/mod.rs +++ b/crates/legacy/src/testing/mod.rs @@ -5,7 +5,6 @@ use crate::{ BuilderState, DAProposalInfo, DaProposalMessage, MessageType, QuorumProposalMessage, }, service::ReceivedTransaction, - LegacyCommit, }; use async_broadcast::broadcast; use async_broadcast::Sender as BroadcastSender; @@ -14,10 +13,11 @@ use hotshot::{ types::{BLSPubKey, SignatureKey}, }; use hotshot_types::{ - data::{DaProposal, Leaf, QuorumProposal, ViewNumber}, + data::{DaProposal, Leaf2, QuorumProposal2, ViewNumber}, + drb::{INITIAL_DRB_RESULT, INITIAL_DRB_SEED_INPUT}, message::Proposal, simple_certificate::{QuorumCertificate, SimpleCertificate, SuccessThreshold}, - simple_vote::QuorumData, + simple_vote::QuorumData2, traits::{block_contents::vid_commitment, node_implementation::ConsensusTime}, utils::BuilderCommitment, }; @@ -84,7 +84,7 @@ pub async fn create_builder_state( ParentBlockReferences { view_number: ViewNumber::new(0), vid_commitment: genesis_vid_commitment, - leaf_commit: Commitment::>::default_commitment_no_preimage(), + leaf_commit: Commitment::>::default_commitment_no_preimage(), builder_commitment: genesis_builder_commitment, }, decide_receiver.clone(), @@ -109,10 +109,10 @@ pub async fn create_builder_state( pub async fn calc_proposal_msg( num_storage_nodes: usize, round: usize, - prev_quorum_proposal: Option>, + prev_quorum_proposal: Option>, transactions: Vec, ) -> ( - QuorumProposal, + QuorumProposal2, QuorumProposalMessage, DaProposalMessage, BuilderStateId, @@ -171,21 +171,20 @@ pub async fn calc_proposal_msg( }; let justify_qc = match prev_quorum_proposal.as_ref() { - None => { - QuorumCertificate::::genesis::( - &TestValidatedState::default(), - &TestInstanceState::default(), - ) - .await - } + None => QuorumCertificate::::genesis::( + &TestValidatedState::default(), + &TestInstanceState::default(), + ) + .await + .to_qc2(), Some(prev_proposal) => { let prev_justify_qc = &prev_proposal.justify_qc; - let quorum_data = QuorumData:: { - leaf_commit: Leaf::from_quorum_proposal(prev_proposal).legacy_commit(), + let quorum_data = QuorumData2:: { + leaf_commit: Leaf2::from_quorum_proposal(prev_proposal).commit(), }; // form a justify qc - SimpleCertificate::, SuccessThreshold>::new( + SimpleCertificate::, SuccessThreshold>::new( quorum_data.clone(), quorum_data.commit(), prev_proposal.view_number, @@ -197,12 +196,14 @@ pub async fn calc_proposal_msg( tracing::debug!("Iteration: {} justify_qc: {:?}", round, justify_qc); - let quorum_proposal = QuorumProposal:: { + let quorum_proposal = QuorumProposal2:: { block_header, view_number: ViewNumber::new(round as u64), justify_qc: justify_qc.clone(), upgrade_certificate: None, - proposal_certificate: None, + view_change_evidence: None, + drb_seed: INITIAL_DRB_SEED_INPUT, + drb_result: INITIAL_DRB_RESULT, }; let quorum_signature = diff --git a/crates/marketplace/src/builder_state.rs b/crates/marketplace/src/builder_state.rs index 4b852213..2ffd5bb8 100644 --- a/crates/marketplace/src/builder_state.rs +++ b/crates/marketplace/src/builder_state.rs @@ -180,9 +180,9 @@ pub struct BuilderState { /// itself. /// /// In an ideal circumstance the best [`BuilderState`] to extend from is going to -/// be the one that is immediately preceding the [`QuorumProposal`] that we are +/// be the one that is immediately preceding the [`QuorumProposal2`] that we are /// attempting to extend from. However, if all we know is the view number of -/// the [`QuorumProposal`] that we are attempting to extend from, then we may end +/// the [`QuorumProposal2`] that we are attempting to extend from, then we may end /// up in a scenario where we have multiple [`BuilderState`]s that are all equally /// valid to extend from. When this happens, we have the potential for a data /// race. @@ -193,7 +193,7 @@ pub struct BuilderState { /// [`BuilderState`] via the [`BuilderStateId`]. The [`BuilderStateId`] only /// references a [`ViewNumber`](hotshot_types::data::ViewNumber) and a /// [`VidCommitment`](hotshot_types::vid::VidCommitment). While this information -/// is available in the [`QuorumProposal`], it only helps us to rule out +/// is available in the [`QuorumProposal2`], it only helps us to rule out /// [`BuilderState`]s that already exist. It does **NOT** help us to pick a /// [`BuilderState`] that is the best fit to extend from. /// @@ -207,7 +207,7 @@ pub struct BuilderState { /// This function determines the best [`BuilderState`] in the following steps: /// /// 1. If we have a [`BuilderState`] that is already spawned for the current -/// [`QuorumProposal`], then we should should return no states, as one already +/// [`QuorumProposal2`], then we should should return no states, as one already /// exists. This will prevent us from attempting to spawn duplicate /// [`BuilderState`]s. /// 2. Attempt to find all [`BuilderState`]s that are recorded within @@ -215,7 +215,7 @@ pub struct BuilderState { /// *should* only be one of these. But all would be valid extension points. /// 3. If we can't find any [`BuilderState`]s that match the view number /// and leaf commitment, then we should return for the maximum stored view -/// number that is smaller than the current [`QuorumProposal`]. +/// number that is smaller than the current [`QuorumProposal2`]. /// 4. If there is is only one [`BuilderState`] stored in the [`GlobalState`], then /// we should return that [`BuilderState`] as the best fit. /// 5. If none of the other criteria match, we return an empty result as it is @@ -521,7 +521,7 @@ impl BuilderState { /// /// This helper function also adds additional checks in order to ensure /// that the [`BuilderState`] that is being spawned is the best fit for the - /// [`QuorumProposal`] that is being extended from. + /// [`QuorumProposal2`] that is being extended from. async fn spawn_clone_that_extends_self( &mut self, da_proposal_info: Arc>, diff --git a/crates/marketplace/src/service.rs b/crates/marketplace/src/service.rs index b2dbe35a..46608bc5 100644 --- a/crates/marketplace/src/service.rs +++ b/crates/marketplace/src/service.rs @@ -17,7 +17,7 @@ use futures::{ use hotshot::types::Event; use hotshot_builder_api::{ v0_2::builder::TransactionStatus, - v0_3::{ + v0_99::{ builder::{define_api, submit_api, BuildError, Error as BuilderApiError}, data_source::{AcceptsTxnSubmits, BuilderDataSource}, }, diff --git a/crates/marketplace/src/testing/basic_test.rs b/crates/marketplace/src/testing/basic_test.rs index c0a94547..223d2d08 100644 --- a/crates/marketplace/src/testing/basic_test.rs +++ b/crates/marketplace/src/testing/basic_test.rs @@ -1,6 +1,6 @@ use async_broadcast::broadcast; use hotshot::types::{BLSPubKey, SignatureKey}; -use hotshot_builder_api::v0_3::data_source::{AcceptsTxnSubmits, BuilderDataSource}; +use hotshot_builder_api::v0_99::data_source::{AcceptsTxnSubmits, BuilderDataSource}; use hotshot_example_types::block_types::TestTransaction; use marketplace_builder_shared::testing::constants::{ diff --git a/crates/marketplace/src/testing/mod.rs b/crates/marketplace/src/testing/mod.rs index 3cfab4e5..ad983627 100644 --- a/crates/marketplace/src/testing/mod.rs +++ b/crates/marketplace/src/testing/mod.rs @@ -13,10 +13,11 @@ use hotshot_example_types::{ state_types::{TestInstanceState, TestValidatedState}, }; use hotshot_types::{ - data::{DaProposal, Leaf, QuorumProposal, ViewNumber}, + data::{DaProposal, Leaf2, QuorumProposal2, ViewNumber}, + drb::{INITIAL_DRB_RESULT, INITIAL_DRB_SEED_INPUT}, message::Proposal, simple_certificate::{QuorumCertificate, SimpleCertificate, SuccessThreshold}, - simple_vote::QuorumData, + simple_vote::QuorumData2, traits::{block_contents::vid_commitment, node_implementation::ConsensusTime}, }; use marketplace_builder_shared::block::BuilderStateId; @@ -29,7 +30,7 @@ pub mod order_test; pub(crate) struct SimulatedChainState { round: ViewNumber, - previous_quorum_proposal: Option>, + previous_quorum_proposal: Option>, event_stream_sender: Sender>, } @@ -92,21 +93,20 @@ impl SimulatedChainState { }; let justify_qc = match self.previous_quorum_proposal.as_ref() { - None => { - QuorumCertificate::::genesis::( - &TestValidatedState::default(), - &TestInstanceState::default(), - ) - .await - } + None => QuorumCertificate::::genesis::( + &TestValidatedState::default(), + &TestInstanceState::default(), + ) + .await + .to_qc2(), Some(prev_proposal) => { let prev_justify_qc = &prev_proposal.justify_qc; - let quorum_data = QuorumData:: { - leaf_commit: Committable::commit(&Leaf::from_quorum_proposal(prev_proposal)), + let quorum_data = QuorumData2:: { + leaf_commit: Committable::commit(&Leaf2::from_quorum_proposal(prev_proposal)), }; // form a justify qc - SimpleCertificate::, SuccessThreshold>::new( + SimpleCertificate::, SuccessThreshold>::new( quorum_data.clone(), quorum_data.commit(), prev_proposal.view_number, @@ -118,12 +118,14 @@ impl SimulatedChainState { tracing::debug!("Iteration: {} justify_qc: {:?}", self.round, justify_qc); - let quorum_proposal = QuorumProposal:: { + let quorum_proposal = QuorumProposal2:: { block_header, view_number: self.round, justify_qc: justify_qc.clone(), upgrade_certificate: None, - proposal_certificate: None, + view_change_evidence: None, + drb_seed: INITIAL_DRB_SEED_INPUT, + drb_result: INITIAL_DRB_RESULT, }; let quorum_proposal_event = EventType::QuorumProposal { diff --git a/crates/marketplace/src/testing/order_test.rs b/crates/marketplace/src/testing/order_test.rs index a4a78682..000ef5b4 100644 --- a/crates/marketplace/src/testing/order_test.rs +++ b/crates/marketplace/src/testing/order_test.rs @@ -1,5 +1,5 @@ use async_broadcast::broadcast; -use hotshot_builder_api::v0_3::data_source::{AcceptsTxnSubmits, BuilderDataSource}; +use hotshot_builder_api::v0_99::data_source::{AcceptsTxnSubmits, BuilderDataSource}; use hotshot_types::{bundle::Bundle, traits::node_implementation::ConsensusTime}; use marketplace_builder_shared::{ block::BuilderStateId, diff --git a/crates/shared/Cargo.toml b/crates/shared/Cargo.toml index 532c2fb2..df04a163 100644 --- a/crates/shared/Cargo.toml +++ b/crates/shared/Cargo.toml @@ -29,10 +29,10 @@ serde = { workspace = true } surf-disco = { workspace = true } tokio = { workspace = true } tracing = { workspace = true } +tracing-subscriber = { workspace = true } url = { workspace = true } vbs = { workspace = true } vec1 = { workspace = true } -tracing-subscriber = { workspace = true } [dev-dependencies] portpicker = "0.1.1" diff --git a/crates/shared/src/block.rs b/crates/shared/src/block.rs index 04fe6598..e3b509b0 100644 --- a/crates/shared/src/block.rs +++ b/crates/shared/src/block.rs @@ -3,10 +3,9 @@ use std::time::Instant; use committable::{Commitment, Committable}; -use hotshot_types::data::fake_commitment; +use hotshot_types::data::{fake_commitment, Leaf2}; use hotshot_types::traits::node_implementation::ConsensusTime; use hotshot_types::{ - data::Leaf, traits::{block_contents::Transaction, node_implementation::NodeType}, utils::BuilderCommitment, vid::VidCommitment, @@ -98,7 +97,7 @@ impl std::fmt::Display for BuilderStateId { pub struct ParentBlockReferences { pub view_number: Types::View, pub vid_commitment: VidCommitment, - pub leaf_commit: Commitment>, + pub leaf_commit: Commitment>, pub builder_commitment: BuilderCommitment, } diff --git a/crates/shared/src/coordinator/mod.rs b/crates/shared/src/coordinator/mod.rs index 7039463e..92c1d0a1 100644 --- a/crates/shared/src/coordinator/mod.rs +++ b/crates/shared/src/coordinator/mod.rs @@ -9,9 +9,9 @@ use async_broadcast::Sender; use async_lock::{Mutex, RwLock}; use builder_state_map::BuilderStateMap; use either::Either; -use hotshot_builder_api::v0_3::builder::BuildError; +use hotshot_builder_api::v0_99::builder::BuildError; use hotshot_types::{ - data::{DaProposal, QuorumProposal}, + data::{DaProposal, QuorumProposal2}, event::LeafInfo, traits::{ block_contents::BlockHeader, @@ -29,7 +29,7 @@ use crate::{ pub mod builder_state_map; type ProposalMap = - HashMap, Either, DaProposal>>; + HashMap, Either, DaProposal>>; /// Result of looking up a builder state by ID. /// @@ -167,7 +167,7 @@ where /// This function should be called whenever new Quorum Proposal is recieved from HotShot. /// Coordinator uses matching Quorum and DA proposals to track creation of new blocks /// and spawning corresponding builder states for those. - pub async fn handle_quorum_proposal(&self, quorum_proposal: QuorumProposal) { + pub async fn handle_quorum_proposal(&self, quorum_proposal: QuorumProposal2) { let proposal_id = ProposalId::from_quorum_proposal(&quorum_proposal); self.handle_proposal(proposal_id, Either::Left(quorum_proposal)) .await; @@ -183,7 +183,7 @@ where async fn handle_proposal( &self, proposal_id: ProposalId, - proposal: Either, DaProposal>, + proposal: Either, DaProposal>, ) { match self.proposals.lock().await.entry(proposal_id) { Entry::Occupied(entry) => { @@ -252,7 +252,7 @@ where /// Spawn a new builder state off of matching pair of Quorum and DA proposals, store it in [`Self::builder_states`] async fn spawn_builder_state( &self, - quorum_proposal: QuorumProposal, + quorum_proposal: QuorumProposal2, da_proposal: DaProposal, ) { assert_eq!(quorum_proposal.view_number, da_proposal.view_number); @@ -287,12 +287,12 @@ where } /// This is an utility function that is used to determine which [`BuilderState`]s - /// are the best fit to extend from for given [`QuorumProposal`] + /// are the best fit to extend from for given [`QuorumProposal2`] /// /// In an ideal circumstance the best [`BuilderState`] to extend from is going to - /// be the one that is immediately preceding the [`QuorumProposal`] that we are + /// be the one that is immediately preceding the [`QuorumProposal2`] that we are /// attempting to extend from. However, if all we know is the view number of - /// the [`QuorumProposal`] that we are attempting to extend from, then we may end + /// the [`QuorumProposal2`] that we are attempting to extend from, then we may end /// up in a scenario where we have multiple [`BuilderState`]s that are all equally /// valid to extend from. When this happens, we have the potential for a data /// race. @@ -301,7 +301,7 @@ where /// [`BuilderStateCoordinator`]'s API. In general, we want to be able to retrieve /// a [`BuilderState`] via the [`BuilderStateId`]. The [`BuilderStateId`] only references /// a [`ViewNumber`](hotshot_types::data::ViewNumber) and a [`VidCommitment`](`hotshot_types::vid::VidCommitment`). - /// While this information is available in the [`QuorumProposal`], + /// While this information is available in the [`QuorumProposal2`], /// it only helps us to rule out [`BuilderState`]s that already exist. /// It does **NOT** help us to pick a [`BuilderState`] that is the best fit to extend from. /// @@ -316,7 +316,7 @@ where /// This function determines the best [`BuilderState`] in the following steps: /// /// 1. If we have a [`BuilderState`] that is already spawned for the current - /// [`QuorumProposal`], then we should should return no states, as one already + /// [`QuorumProposal2`], then we should should return no states, as one already /// exists. This will prevent us from attempting to spawn duplicate /// [`BuilderState`]s. /// 2. Attempt to find all [`BuilderState`]s that are recorded within @@ -324,7 +324,7 @@ where /// *should* only be one of these. But all would be valid extension points. /// 3. If we can't find any [`BuilderState`]s that match the view number /// and leaf commitment, then we should return for the maximum stored view - /// number that is smaller than the current [`QuorumProposal`]. + /// number that is smaller than the current [`QuorumProposal2`]. /// 4. If there is is only one [`BuilderState`] stored in the coordinator, then /// we should return that [`BuilderState`] as the best fit. /// 5. If none of the other criteria match, we return an empty result as it is @@ -343,7 +343,7 @@ where #[must_use] async fn find_builder_states_to_extend( &self, - quorum_proposal: &QuorumProposal, + quorum_proposal: &QuorumProposal2, ) -> Vec>> { // This is ID of the state we want to spawn let current_builder_state_id = BuilderStateId { diff --git a/crates/shared/src/state.rs b/crates/shared/src/state.rs index ec40721c..971f6a1f 100644 --- a/crates/shared/src/state.rs +++ b/crates/shared/src/state.rs @@ -13,7 +13,7 @@ use async_lock::{Mutex, RwLock}; use committable::{Commitment, Committable}; use hotshot::traits::{BlockPayload, ValidatedState}; use hotshot_types::{ - data::{DaProposal, Leaf, QuorumProposal}, + data::{DaProposal, Leaf2, QuorumProposal2}, traits::{block_contents::BlockHeader, node_implementation::NodeType}, }; @@ -142,10 +142,10 @@ where pub(crate) async fn new_child( self: Arc, - quorum_proposal: QuorumProposal, + quorum_proposal: QuorumProposal2, da_proposal: DaProposal, ) -> Arc { - let leaf = Leaf::from_quorum_proposal(&quorum_proposal); + let leaf = Leaf2::from_quorum_proposal(&quorum_proposal); let validated_state = Types::ValidatedState::from_header(leaf.block_header()); diff --git a/crates/shared/src/testing/mock.rs b/crates/shared/src/testing/mock.rs index 13158d66..7c60602e 100644 --- a/crates/shared/src/testing/mock.rs +++ b/crates/shared/src/testing/mock.rs @@ -8,14 +8,19 @@ use hotshot_example_types::{ node_types::{TestTypes, TestVersions}, state_types::{TestInstanceState, TestValidatedState}, }; +use hotshot_types::data::QuorumProposal2; use hotshot_types::data::ViewNumber; +use hotshot_types::drb::INITIAL_DRB_RESULT; +use hotshot_types::drb::INITIAL_DRB_SEED_INPUT; use hotshot_types::event::LeafInfo; +use hotshot_types::simple_certificate::QuorumCertificate2; +use hotshot_types::simple_vote::QuorumData2; use hotshot_types::traits::block_contents::{vid_commitment, GENESIS_VID_NUM_STORAGE_NODES}; use hotshot_types::{ - data::{random_commitment, DaProposal, Leaf, QuorumProposal}, + data::{random_commitment, DaProposal, Leaf, Leaf2}, message::UpgradeLock, simple_certificate::QuorumCertificate, - simple_vote::{QuorumData, VersionedVoteData}, + simple_vote::VersionedVoteData, traits::node_implementation::{ConsensusTime, NodeType}, traits::BlockPayload, utils::BuilderCommitment, @@ -40,7 +45,7 @@ pub fn transaction() -> TestTransaction { pub async fn decide_leaf_chain(decided_view: u64) -> Arc>> { let (_, quorum_proposal) = proposals(decided_view).await; - let leaf = Leaf::from_quorum_proposal(&quorum_proposal); + let leaf = Leaf2::from_quorum_proposal(&quorum_proposal); Arc::new(vec![LeafInfo { leaf, state: Default::default(), @@ -50,7 +55,7 @@ pub async fn decide_leaf_chain(decided_view: u64) -> Arc } /// Create mock pair of DA and Quorum proposals -pub async fn proposals(view: u64) -> (DaProposal, QuorumProposal) { +pub async fn proposals(view: u64) -> (DaProposal, QuorumProposal2) { let view_number = ::View::new(view); let upgrade_lock = UpgradeLock::::new(); let validated_state = TestValidatedState::default(); @@ -67,7 +72,9 @@ pub async fn proposals(view: u64) -> (DaProposal, QuorumProposal::genesis(&Default::default(), &Default::default()).await, + &Leaf::::genesis(&Default::default(), &Default::default()) + .await + .into(), vid_commitment(&encoded_transactions, GENESIS_VID_NUM_STORAGE_NODES), >::builder_commitment(&payload, &metadata), metadata, @@ -77,18 +84,21 @@ pub async fn proposals(view: u64) -> (DaProposal, QuorumProposal::new_infallible( @@ -101,7 +111,7 @@ pub async fn proposals(view: u64) -> (DaProposal, QuorumProposal (DaProposal, QuorumProposal ProposalId where Types: NodeType, { - pub fn from_quorum_proposal(proposal: &QuorumProposal) -> Self { + pub fn from_quorum_proposal(proposal: &QuorumProposal2) -> Self { Self { builder_commitment: proposal.block_header.builder_commitment(), view_number: proposal.view_number,