From 0144f075de57cb215556eb2ca52fc5cab8d37ef6 Mon Sep 17 00:00:00 2001 From: Artemii Gerasimovich Date: Thu, 28 Nov 2024 02:06:57 +0100 Subject: [PATCH] Bump HotShot --- Cargo.lock | 531 +++++-------------- Cargo.toml | 16 +- crates/legacy/src/block_store.rs | 2 +- crates/legacy/src/testing/basic.rs | 14 +- crates/marketplace/src/builder_state.rs | 12 +- crates/marketplace/src/service.rs | 2 +- crates/marketplace/src/testing/basic_test.rs | 2 +- crates/marketplace/src/testing/order_test.rs | 2 +- crates/shared/src/block.rs | 5 +- crates/shared/src/coordinator/mod.rs | 24 +- crates/shared/src/error.rs | 2 +- crates/shared/src/state.rs | 6 +- crates/shared/src/testing/consensus.rs | 32 +- crates/shared/src/testing/mock.rs | 40 +- crates/shared/src/utils/mod.rs | 4 +- 15 files changed, 236 insertions(+), 458 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c264eb91..b1ed88de 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -527,7 +527,7 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.87", - "synstructure 0.13.1", + "synstructure", ] [[package]] @@ -592,26 +592,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" @@ -1177,6 +1157,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" @@ -1236,18 +1222,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", ] @@ -1273,14 +1259,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", @@ -1296,11 +1282,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", @@ -1311,11 +1298,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", @@ -1324,7 +1311,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", @@ -1332,7 +1319,8 @@ dependencies = [ "capnp", "capnpc", "derivative", - "jf-signature 0.1.0", + "derive_more 1.0.0", + "jf-signature", "kanal", "lazy_static", "mnemonic", @@ -1442,33 +1430,6 @@ dependencies = [ "wasm-bindgen", ] -[[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" @@ -1535,19 +1496,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" @@ -1557,41 +1505,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", @@ -1604,7 +1528,7 @@ dependencies = [ "thread_local", "tokio", "tokio-stream", - "tonic 0.11.0", + "tonic", "tracing", "tracing-core", "tracing-subscriber 0.3.18", @@ -1830,27 +1754,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" @@ -1887,26 +1790,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" @@ -2309,11 +2192,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" @@ -2325,31 +2203,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" @@ -2377,16 +2230,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" @@ -2415,6 +2258,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "byteorder", + "rand 0.8.5", "rustc-hex", "static_assertions", ] @@ -2437,7 +2281,6 @@ checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095" dependencies = [ "futures-core", "futures-sink", - "nanorand", "spin 0.9.8", ] @@ -2679,10 +2522,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]] @@ -3015,7 +2856,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=rc-0.5.82#8485af8e3b182c84c4725060e4ad875276bc3e1d" dependencies = [ "anyhow", "async-broadcast", @@ -3029,27 +2870,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", @@ -3062,7 +2899,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=rc-0.5.82#8485af8e3b182c84c4725060e4ad875276bc3e1d" dependencies = [ "async-trait", "clap", @@ -3111,20 +2948,18 @@ dependencies = [ "tokio", "tracing", "tracing-subscriber 0.3.18", - "tracing-test", + "tracing-test 0.1.0", "url", "vbs", ] [[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.50" +source = "git+https://github.com/EspressoSystems/hotshot-events-service.git?branch=hotshot/0.5.82#a12afecabc657e0753ae956b46bbf5e7beed2d25" dependencies = [ "async-broadcast", - "async-compatibility-layer", "async-lock 2.8.0", - "async-std", "async-trait", "clap", "derivative", @@ -3132,33 +2967,29 @@ dependencies = [ "either", "futures", "hotshot-types", + "libp2p-identity", "rand 0.8.5", "serde", "snafu", "tagged-base64", "tide-disco", + "tokio", "toml", "tracing", + "tracing-test 0.2.5", "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=rc-0.5.82#8485af8e3b182c84c4725060e4ad875276bc3e1d" 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", @@ -3170,7 +3001,6 @@ dependencies = [ "thiserror 2.0.3", "time 0.3.36", "tokio", - "tracing", "url", "vbs", ] @@ -3178,7 +3008,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=rc-0.5.82#8485af8e3b182c84c4725060e4ad875276bc3e1d" dependencies = [ "anyhow", "async-lock 3.4.0", @@ -3187,18 +3017,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=rc-0.5.82#8485af8e3b182c84c4725060e4ad875276bc3e1d" dependencies = [ "derive_builder", "proc-macro2", @@ -3206,39 +3034,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=rc-0.5.82#8485af8e3b182c84c4725060e4ad875276bc3e1d" dependencies = [ - "anyhow", "async-broadcast", "async-trait", "futures", @@ -3250,15 +3050,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=rc-0.5.82#8485af8e3b182c84c4725060e4ad875276bc3e1d" dependencies = [ "anyhow", "async-broadcast", "async-lock 3.4.0", "async-trait", "bincode", - "bitvec", - "cdn-proto", "chrono", "committable", "either", @@ -3266,7 +3064,6 @@ dependencies = [ "hotshot-builder-api", "hotshot-task", "hotshot-types", - "jf-signature 0.2.0", "jf-vid", "lru 0.12.5", "rand 0.8.5", @@ -3287,7 +3084,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=rc-0.5.82#8485af8e3b182c84c4725060e4ad875276bc3e1d" dependencies = [ "anyhow", "async-broadcast", @@ -3297,27 +3094,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", @@ -3331,7 +3125,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=rc-0.5.82#8485af8e3b182c84c4725060e4ad875276bc3e1d" dependencies = [ "anyhow", "ark-bn254", @@ -3345,34 +3139,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", @@ -3828,15 +3619,35 @@ dependencies = [ "xmltree", ] +[[package]] +name = "impl-codec" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67aa010c1e3da95bf151bd8b4c059b2ed7e75387cdb969b4f8f2723a43f9941" +dependencies = [ + "parity-scale-codec", +] + [[package]] name = "impl-serde" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" +checksum = "4a143eada6a1ec4aefa5049037a26a6d597bfd64f8c026d07b77133e02b7dd0b" 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" @@ -3856,12 +3667,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" @@ -4105,35 +3910,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" @@ -4503,7 +4279,7 @@ dependencies = [ "smallvec", "thiserror 1.0.68", "tracing", - "uint", + "uint 0.9.5", "void", ] @@ -4549,18 +4325,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=rc-0.5.82#8485af8e3b182c84c4725060e4ad875276bc3e1d" 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", @@ -4568,17 +4342,10 @@ 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]] @@ -4902,7 +4669,7 @@ dependencies = [ "tokio", "tracing", "tracing-subscriber 0.3.18", - "tracing-test", + "tracing-test 0.1.0", "url", "vbs", ] @@ -4943,7 +4710,7 @@ dependencies = [ "tokio", "tracing", "tracing-subscriber 0.3.18", - "tracing-test", + "tracing-test 0.1.0", "url", "vbs", "vec1", @@ -5166,15 +4933,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" @@ -5511,10 +5269,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" @@ -5777,13 +5556,14 @@ dependencies = [ [[package]] name = "primitive-types" -version = "0.12.2" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" +checksum = "d15600a7d856470b7d278b3fe0e311fe28c2526348549f8ef2ff7db3299c87f5" dependencies = [ "fixed-hash", + "impl-codec", "impl-serde", - "uint", + "uint 0.10.0", ] [[package]] @@ -6166,9 +5946,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", @@ -6182,7 +5962,7 @@ dependencies = [ "pin-project-lite 0.2.15", "ryu", "tokio", - "tokio-retry", + "tokio-retry2", "tokio-util", "url", ] @@ -7510,18 +7290,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" @@ -7888,7 +7656,6 @@ dependencies = [ "mio", "parking_lot", "pin-project-lite 0.2.15", - "signal-hook-registry", "socket2 0.5.7", "tokio-macros", "tracing", @@ -7927,10 +7694,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", @@ -8006,33 +7773,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" @@ -8137,16 +7877,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" @@ -8241,7 +7971,18 @@ dependencies = [ "lazy_static", "tracing-core", "tracing-subscriber 0.2.25", - "tracing-test-macro", + "tracing-test-macro 0.1.0", +] + +[[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 0.2.5", ] [[package]] @@ -8255,6 +7996,16 @@ dependencies = [ "syn 1.0.109", ] +[[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" @@ -8312,6 +8063,18 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "uint" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "909988d098b2f738727b161a106cfc7cab00c539c2687a8836f8e565976fb53e" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + [[package]] name = "unicase" version = "2.8.0" @@ -8456,7 +8219,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=rc-0.5.82#8485af8e3b182c84c4725060e4ad875276bc3e1d" dependencies = [ "tracing", ] @@ -9092,7 +8855,7 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.87", - "synstructure 0.13.1", + "synstructure", ] [[package]] @@ -9134,7 +8897,7 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.87", - "synstructure 0.13.1", + "synstructure", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 1a0a619d..f61449dd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,14 +3,14 @@ resolver = "2" members = ["crates/*"] [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 = "rc-0.5.82" } +hotshot-builder-api = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.82" } +hotshot-events-service = { git = "https://github.com/EspressoSystems/hotshot-events-service.git", branch = "hotshot/0.5.82" } +hotshot-macros = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.82" } +hotshot-task-impls = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.82" } +hotshot-testing = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.82" } +hotshot-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.82" } +hotshot-example-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.82" } anyhow = "1" async-broadcast = "0.7" diff --git a/crates/legacy/src/block_store.rs b/crates/legacy/src/block_store.rs index 97330d4f..7b0d7639 100644 --- a/crates/legacy/src/block_store.rs +++ b/crates/legacy/src/block_store.rs @@ -1,7 +1,7 @@ use std::marker::PhantomData; use hotshot::traits::BlockPayload; -use hotshot_builder_api::v0_2::block_info::AvailableBlockInfo; +use hotshot_builder_api::v0_1::block_info::AvailableBlockInfo; use hotshot_types::traits::signature_key::BuilderSignatureKey; use hotshot_types::vid::{VidCommitment, VidPrecomputeData}; use marketplace_builder_shared::error::Error; diff --git a/crates/legacy/src/testing/basic.rs b/crates/legacy/src/testing/basic.rs index f8194d82..f1b56e3f 100644 --- a/crates/legacy/src/testing/basic.rs +++ b/crates/legacy/src/testing/basic.rs @@ -5,7 +5,7 @@ use hotshot_builder_api::v0_1::data_source::BuilderDataSource; use hotshot_example_types::block_types::{TestBlockHeader, TestMetadata, TestTransaction}; use hotshot_example_types::node_types::{TestTypes, TestVersions}; use hotshot_example_types::state_types::{TestInstanceState, TestValidatedState}; -use hotshot_types::data::{Leaf, QuorumProposal, ViewNumber}; +use hotshot_types::data::{Leaf2, QuorumProposal2, ViewNumber}; use hotshot_types::event::LeafInfo; use hotshot_types::simple_certificate::QuorumCertificate; use hotshot_types::traits::block_contents::BlockHeader; @@ -186,8 +186,10 @@ async fn test_pruning() { // everything else is boilerplate. let mock_qc = - QuorumCertificate::genesis::(&Default::default(), &Default::default()).await; - let leaf = Leaf::from_quorum_proposal(&QuorumProposal { + QuorumCertificate::genesis::(&Default::default(), &Default::default()) + .await + .to_qc2(); + let leaf = Leaf2::from_quorum_proposal(&QuorumProposal2 { block_header: >::genesis( &Default::default(), Default::default(), @@ -196,10 +198,12 @@ async fn test_pruning() { num_transactions: 0, }, ), - view_number: ViewNumber::new(DECIDE_VIEW), // <- This is the only thing we're interested in + view_number: ViewNumber::new(DECIDE_VIEW), justify_qc: mock_qc.clone(), upgrade_certificate: None, - proposal_certificate: None, + view_change_evidence: None, + drb_seed: [0; 96], + drb_result: [0; 32], }); event_stream_sender .broadcast(hotshot::types::Event { 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 33bc1cd6..9fd2c954 100644 --- a/crates/marketplace/src/service.rs +++ b/crates/marketplace/src/service.rs @@ -18,7 +18,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 432a074b..1d4cf42c 100644 --- a/crates/marketplace/src/testing/basic_test.rs +++ b/crates/marketplace/src/testing/basic_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_example_types::block_types::TestTransaction; use tracing_test::traced_test; diff --git a/crates/marketplace/src/testing/order_test.rs b/crates/marketplace/src/testing/order_test.rs index 33c79ca0..9de02971 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, testing::consensus::SimulatedChainState}; use tracing_test::traced_test; diff --git a/crates/shared/src/block.rs b/crates/shared/src/block.rs index 6625f37f..2554a371 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, @@ -101,7 +100,7 @@ pub struct ParentBlockReferences { /// VID commitment of the parent block payload pub vid_commitment: VidCommitment, /// Leaf commitment of the parent leaf - pub leaf_commit: Commitment>, + pub leaf_commit: Commitment>, /// Builder commitment of the parent block payload pub builder_commitment: BuilderCommitment, /// Number of transactions included in the parent block diff --git a/crates/shared/src/coordinator/mod.rs b/crates/shared/src/coordinator/mod.rs index b704adeb..c7f0974a 100644 --- a/crates/shared/src/coordinator/mod.rs +++ b/crates/shared/src/coordinator/mod.rs @@ -12,7 +12,7 @@ use either::Either; use hotshot::traits::BlockPayload; use hotshot_builder_api::v0_1::builder::TransactionStatus; use hotshot_types::{ - data::{DaProposal, QuorumProposal}, + data::{DaProposal, QuorumProposal2}, event::LeafInfo, traits::{ block_contents::BlockHeader, @@ -33,7 +33,7 @@ use crate::{ pub mod tiered_view_map; type ProposalMap = - HashMap, Either, DaProposal>>; + HashMap, Either, DaProposal>>; type BuilderStateMap = TieredViewMap, Arc>>; @@ -222,7 +222,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; @@ -238,7 +238,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) => { @@ -307,7 +307,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); @@ -345,12 +345,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. @@ -359,7 +359,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. /// @@ -374,7 +374,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 @@ -382,7 +382,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 @@ -401,7 +401,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/error.rs b/crates/shared/src/error.rs index 92eb36de..ac2d3b15 100644 --- a/crates/shared/src/error.rs +++ b/crates/shared/src/error.rs @@ -2,7 +2,7 @@ use std::sync::Arc; use async_broadcast::TrySendError; use hotshot::traits::BlockPayload; -use hotshot_builder_api::v0_3::builder::BuildError; +use hotshot_builder_api::v0_99::builder::BuildError; use hotshot_types::traits::{node_implementation::NodeType, signature_key::BuilderSignatureKey}; use thiserror::Error; diff --git a/crates/shared/src/state.rs b/crates/shared/src/state.rs index 13182b62..0f3fcf64 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/consensus.rs b/crates/shared/src/testing/consensus.rs index bd11cd9c..9acf9779 100644 --- a/crates/shared/src/testing/consensus.rs +++ b/crates/shared/src/testing/consensus.rs @@ -17,17 +17,17 @@ use hotshot_example_types::{ state_types::{TestInstanceState, TestValidatedState}, }; use hotshot_types::{ - data::{DaProposal, Leaf, QuorumProposal, ViewNumber}, + data::{DaProposal, Leaf2, QuorumProposal2, ViewNumber}, message::Proposal, simple_certificate::{QuorumCertificate, SimpleCertificate, SuccessThreshold}, - simple_vote::QuorumData, + simple_vote::QuorumData2, traits::{block_contents::vid_commitment, node_implementation::ConsensusTime}, }; use sha2::{Digest, Sha256}; pub struct SimulatedChainState { round: ViewNumber, - previous_quorum_proposal: Option>, + previous_quorum_proposal: Option>, event_stream_sender: Sender>, } @@ -90,21 +90,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, @@ -116,12 +115,15 @@ 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: [0; 96], + + drb_result: [0; 32], }; let quorum_proposal_event = EventType::QuorumProposal { diff --git a/crates/shared/src/testing/mock.rs b/crates/shared/src/testing/mock.rs index 20f614c8..11738a38 100644 --- a/crates/shared/src/testing/mock.rs +++ b/crates/shared/src/testing/mock.rs @@ -9,14 +9,17 @@ 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::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, @@ -49,7 +52,7 @@ pub async fn decide_leaf_chain_with_transactions( ) -> Arc>> { let (da_proposal, quorum_proposal) = proposals_with_transactions(decided_view, transactions).await; - let mut leaf = Leaf::from_quorum_proposal(&quorum_proposal); + let mut leaf = Leaf2::from_quorum_proposal(&quorum_proposal); let payload = >::from_bytes( &da_proposal.encoded_transactions, &da_proposal.metadata, @@ -64,7 +67,7 @@ pub async fn decide_leaf_chain_with_transactions( } /// 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 transaction = transaction(); proposals_with_transactions(view, vec![transaction]).await } @@ -73,7 +76,7 @@ pub async fn proposals(view: u64) -> (DaProposal, QuorumProposal, -) -> (DaProposal, QuorumProposal) { +) -> (DaProposal, QuorumProposal2) { let view_number = ::View::new(view); let upgrade_lock = UpgradeLock::::new(); let validated_state = TestValidatedState::default(); @@ -89,7 +92,9 @@ pub async fn proposals_with_transactions( let encoded_transactions = TestTransaction::encode(&transactions); let header = TestBlockHeader::new( - &Leaf::::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, @@ -99,18 +104,21 @@ pub async fn proposals_with_transactions( &TestValidatedState::default(), &TestInstanceState::default(), ) - .await; - let parent_proposal = QuorumProposal { + .await + .to_qc2(); + let parent_proposal = QuorumProposal2 { block_header: header, view_number: ViewNumber::new(view_number.saturating_sub(1)), justify_qc: genesis_qc, upgrade_certificate: None, - proposal_certificate: None, + view_change_evidence: None, + drb_seed: [0; 96], + drb_result: [0; 32], }; - let leaf = Leaf::from_quorum_proposal(&parent_proposal); + let leaf = Leaf2::from_quorum_proposal(&parent_proposal); - let quorum_data = QuorumData { - leaf_commit: leaf.commit(&upgrade_lock).await, + let quorum_data = QuorumData2 { + leaf_commit: leaf.commit(), }; let versioned_data = VersionedVoteData::<_, _, _>::new_infallible( @@ -123,7 +131,7 @@ pub async fn proposals_with_transactions( let commitment = Commitment::from_raw(versioned_data.commit().into()); let justify_qc = - QuorumCertificate::new(quorum_data, commitment, view_number, None, PhantomData); + QuorumCertificate2::new(quorum_data, commitment, view_number, None, PhantomData); ( DaProposal { @@ -131,12 +139,14 @@ pub async fn proposals_with_transactions( metadata, view_number, }, - QuorumProposal { + QuorumProposal2 { block_header: leaf.block_header().clone(), view_number, justify_qc, upgrade_certificate: None, - proposal_certificate: None, + view_change_evidence: None, + drb_seed: [0; 96], + drb_result: [0; 32], }, ) } diff --git a/crates/shared/src/utils/mod.rs b/crates/shared/src/utils/mod.rs index cbd78dfe..e826a4ab 100644 --- a/crates/shared/src/utils/mod.rs +++ b/crates/shared/src/utils/mod.rs @@ -6,7 +6,7 @@ use futures::{ }; use hotshot::traits::BlockPayload; use hotshot_types::{ - data::{DaProposal, QuorumProposal}, + data::{DaProposal, QuorumProposal2}, traits::{ block_contents::BlockHeader, node_implementation::NodeType, signature_key::BuilderSignatureKey, @@ -41,7 +41,7 @@ impl 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,