diff --git a/Cargo.lock b/Cargo.lock index d70fcbf9d..eeb0b2592 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -559,7 +559,7 @@ checksum = "7378575ff571966e99a744addeff0bff98b8ada0dedf1956d59e634db95eaac1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", "synstructure 0.13.1", ] @@ -571,7 +571,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -912,7 +912,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -942,7 +942,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -1045,7 +1045,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -1062,7 +1062,7 @@ checksum = "edf3ee19dbc0a46d740f6f0926bde8c50f02bdbc7b536842da28f6ac56513a8b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -1218,9 +1218,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" dependencies = [ "serde", ] @@ -1334,6 +1334,7 @@ dependencies = [ "hotshot-builder-api", "hotshot-builder-core", "hotshot-events-service", + "hotshot-example-types", "hotshot-orchestrator", "hotshot-stake-table", "hotshot-state-prover", @@ -1499,9 +1500,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.99" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" +checksum = "74b6a57f98764a267ff415d50a25e6e166f3831a5071af4995296ea97d210490" dependencies = [ "jobserver", "libc", @@ -1510,14 +1511,14 @@ dependencies = [ [[package]] name = "cdn-broker" -version = "0.1.0" -source = "git+https://github.com/EspressoSystems/Push-CDN?tag=0.3.12#7bf490b34fb5b996d7e98d3d4be6d88028a076ac" +version = "0.4.0" +source = "git+https://github.com/EspressoSystems/Push-CDN?tag=0.4.0#fdcf88863147173fb270e830abbbb24308268087" dependencies = [ "async-std", - "cdn-proto 0.1.0", + "cdn-proto 0.4.0 (git+https://github.com/EspressoSystems/Push-CDN?tag=0.4.0)", "clap", "console-subscriber 0.3.0", - "dashmap", + "dashmap 5.5.3", "derivative", "jf-signature", "lazy_static", @@ -1538,10 +1539,10 @@ version = "0.4.0" source = "git+https://github.com/EspressoSystems/Push-CDN?tag=0.4.2#09389360284c51dd44a3dae1f1c3b395125abe82" dependencies = [ "async-std", - "cdn-proto 0.4.0", + "cdn-proto 0.4.0 (git+https://github.com/EspressoSystems/Push-CDN?tag=0.4.2)", "clap", "console-subscriber 0.3.0", - "dashmap", + "dashmap 5.5.3", "derivative", "jf-signature", "lazy_static", @@ -1558,11 +1559,11 @@ dependencies = [ [[package]] name = "cdn-client" -version = "0.1.0" -source = "git+https://github.com/EspressoSystems/Push-CDN?tag=0.3.12#7bf490b34fb5b996d7e98d3d4be6d88028a076ac" +version = "0.4.0" +source = "git+https://github.com/EspressoSystems/Push-CDN?tag=0.4.0#fdcf88863147173fb270e830abbbb24308268087" dependencies = [ "async-std", - "cdn-proto 0.1.0", + "cdn-proto 0.4.0 (git+https://github.com/EspressoSystems/Push-CDN?tag=0.4.0)", "clap", "jf-signature", "rand 0.8.5", @@ -1573,11 +1574,11 @@ dependencies = [ [[package]] name = "cdn-marshal" -version = "0.1.0" -source = "git+https://github.com/EspressoSystems/Push-CDN?tag=0.3.12#7bf490b34fb5b996d7e98d3d4be6d88028a076ac" +version = "0.4.0" +source = "git+https://github.com/EspressoSystems/Push-CDN?tag=0.4.0#fdcf88863147173fb270e830abbbb24308268087" dependencies = [ "async-std", - "cdn-proto 0.1.0", + "cdn-proto 0.4.0 (git+https://github.com/EspressoSystems/Push-CDN?tag=0.4.0)", "clap", "jf-signature", "tokio", @@ -1591,7 +1592,7 @@ version = "0.4.0" source = "git+https://github.com/EspressoSystems/Push-CDN?tag=0.4.2#09389360284c51dd44a3dae1f1c3b395125abe82" dependencies = [ "async-std", - "cdn-proto 0.4.0", + "cdn-proto 0.4.0 (git+https://github.com/EspressoSystems/Push-CDN?tag=0.4.2)", "clap", "jf-signature", "tokio", @@ -1601,8 +1602,8 @@ dependencies = [ [[package]] name = "cdn-proto" -version = "0.1.0" -source = "git+https://github.com/EspressoSystems/Push-CDN?tag=0.3.12#7bf490b34fb5b996d7e98d3d4be6d88028a076ac" +version = "0.4.0" +source = "git+https://github.com/EspressoSystems/Push-CDN?tag=0.4.0#fdcf88863147173fb270e830abbbb24308268087" dependencies = [ "anyhow", "ark-serialize", @@ -1734,9 +1735,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.7" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" +checksum = "84b3edb18336f4df585bc9aa31dd99c036dfa5dc5e9a2939a722a188f3a8970d" dependencies = [ "clap_builder", "clap_derive", @@ -1744,9 +1745,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.7" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" +checksum = "c1c09dd5ada6c6c78075d6fd0da3f90d8080651e2d6cc8eb2f1aaa4034ced708" dependencies = [ "anstream", "anstyle", @@ -1756,14 +1757,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.5" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" +checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -2325,9 +2326,9 @@ dependencies = [ [[package]] name = "curl-sys" -version = "0.4.72+curl-8.6.0" +version = "0.4.73+curl-8.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29cbdc8314c447d11e8fd156dcdd031d9e02a7a976163e396b548c03153bc9ea" +checksum = "450ab250ecf17227c39afb9a2dd9261dc0035cb80f2612472fc0c4aac2dcb84d" dependencies = [ "cc", "libc", @@ -2363,7 +2364,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -2405,7 +2406,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", "synstructure 0.13.1", ] @@ -2430,7 +2431,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -2441,7 +2442,7 @@ checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -2457,6 +2458,20 @@ dependencies = [ "parking_lot_core", ] +[[package]] +name = "dashmap" +version = "6.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", +] + [[package]] name = "data-encoding" version = "2.6.0" @@ -2537,7 +2552,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -2558,7 +2573,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -2568,7 +2583,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" dependencies = [ "derive_builder_core", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -2581,7 +2596,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version 0.4.0", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -2718,7 +2733,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -2812,9 +2827,9 @@ dependencies = [ [[package]] name = "edit-distance" -version = "2.1.0" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbbaaaf38131deb9ca518a274a45bfdb8771f139517b073b16c2d3d32ae5037b" +checksum = "853fc7035888bd1c9320f3a05bfe7f344f49b8766a4bb4209b1ac5f0503d9577" [[package]] name = "either" @@ -2895,7 +2910,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -3111,7 +3126,7 @@ dependencies = [ "reqwest 0.11.27", "serde", "serde_json", - "syn 2.0.67", + "syn 2.0.68", "toml", "walkdir", ] @@ -3129,7 +3144,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -3155,7 +3170,7 @@ dependencies = [ "serde", "serde_json", "strum", - "syn 2.0.67", + "syn 2.0.68", "tempfile", "thiserror", "tiny-keccak", @@ -3602,7 +3617,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -4081,8 +4096,8 @@ dependencies = [ [[package]] name = "hotshot" -version = "0.5.58" -source = "git+https://github.com/EspressoSystems/hotshot?tag=rc-0.5.59#b9329c30b25dcbda5018a36ee06ee4294111778f" +version = "0.5.60" +source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.60#24597f75f7ddb439959e4aff584ec934dcdc1388" dependencies = [ "anyhow", "async-broadcast", @@ -4093,13 +4108,13 @@ dependencies = [ "bimap", "bincode", "blake3", - "cdn-broker 0.1.0", + "cdn-broker 0.4.0 (git+https://github.com/EspressoSystems/Push-CDN?tag=0.4.0)", "cdn-client", - "cdn-marshal 0.1.0", + "cdn-marshal 0.4.0 (git+https://github.com/EspressoSystems/Push-CDN?tag=0.4.0)", "chrono", "committable", "custom_debug 0.5.1", - "dashmap", + "dashmap 6.0.1", "derive_more", "either", "ethereum-types", @@ -4128,7 +4143,7 @@ dependencies = [ [[package]] name = "hotshot-builder-api" version = "0.1.7" -source = "git+https://github.com/EspressoSystems/hotshot?tag=rc-0.5.59#b9329c30b25dcbda5018a36ee06ee4294111778f" +source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.60#24597f75f7ddb439959e4aff584ec934dcdc1388" dependencies = [ "async-trait", "clap", @@ -4147,7 +4162,7 @@ dependencies = [ [[package]] name = "hotshot-builder-core" version = "0.1.26" -source = "git+https://github.com/EspressoSystems/hotshot-builder-core?tag=rc-0.1.32#778fc0550357d64d29b98b511e024913e64c3887" +source = "git+https://github.com/EspressoSystems/hotshot-builder-core?tag=rc-0.1.31-patch-1#b0bdbd6fac8c969ac52d56c1a1c17a0cc5d1d441" dependencies = [ "anyhow", "async-broadcast", @@ -4200,7 +4215,7 @@ dependencies = [ [[package]] name = "hotshot-events-service" version = "0.1.27" -source = "git+https://github.com/EspressoSystems/hotshot-events-service.git?tag=rc-0.1.29#0aa74a42b4bae9dc11011684e7a10346590fa068" +source = "git+https://github.com/EspressoSystems/hotshot-events-service.git?tag=rc-0.1.31#2c89a146adf5c3a8e887314f07a013d5d11b6483" dependencies = [ "async-broadcast", "async-compatibility-layer", @@ -4224,8 +4239,8 @@ dependencies = [ [[package]] name = "hotshot-example-types" -version = "0.5.58" -source = "git+https://github.com/EspressoSystems/hotshot?tag=rc-0.5.59#b9329c30b25dcbda5018a36ee06ee4294111778f" +version = "0.5.60" +source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.60#24597f75f7ddb439959e4aff584ec934dcdc1388" dependencies = [ "anyhow", "async-broadcast", @@ -4250,24 +4265,25 @@ dependencies = [ "time 0.3.36", "tokio", "tracing", + "url", "vbs", ] [[package]] name = "hotshot-macros" -version = "0.5.58" -source = "git+https://github.com/EspressoSystems/hotshot?tag=rc-0.5.59#b9329c30b25dcbda5018a36ee06ee4294111778f" +version = "0.5.60" +source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.60#24597f75f7ddb439959e4aff584ec934dcdc1388" dependencies = [ "derive_builder", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] name = "hotshot-orchestrator" -version = "0.5.58" -source = "git+https://github.com/EspressoSystems/hotshot?tag=rc-0.5.59#b9329c30b25dcbda5018a36ee06ee4294111778f" +version = "0.5.60" +source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.60#24597f75f7ddb439959e4aff584ec934dcdc1388" dependencies = [ "anyhow", "async-compatibility-layer", @@ -4297,7 +4313,7 @@ dependencies = [ [[package]] name = "hotshot-query-service" version = "0.1.39" -source = "git+https://github.com/EspressoSystems/hotshot-query-service?tag=rc-0.1.41#bd03a5d909e8705f6038f2066a7633732c653219" +source = "git+https://github.com/EspressoSystems/hotshot-query-service?tag=rc-0.1.43#4206e5c2f52cde19a9b503d2f8e7b4fe26aa9a04" dependencies = [ "anyhow", "ark-serialize", @@ -4345,14 +4361,15 @@ dependencies = [ "tracing", "trait-variant", "typenum", + "url", "vbs", "vec1", ] [[package]] name = "hotshot-stake-table" -version = "0.5.58" -source = "git+https://github.com/EspressoSystems/hotshot?tag=rc-0.5.59#b9329c30b25dcbda5018a36ee06ee4294111778f" +version = "0.5.60" +source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.60#24597f75f7ddb439959e4aff584ec934dcdc1388" dependencies = [ "ark-bn254", "ark-ed-on-bn254", @@ -4423,8 +4440,8 @@ dependencies = [ [[package]] name = "hotshot-task" -version = "0.5.58" -source = "git+https://github.com/EspressoSystems/hotshot?tag=rc-0.5.59#b9329c30b25dcbda5018a36ee06ee4294111778f" +version = "0.5.60" +source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.60#24597f75f7ddb439959e4aff584ec934dcdc1388" dependencies = [ "anyhow", "async-broadcast", @@ -4438,8 +4455,8 @@ dependencies = [ [[package]] name = "hotshot-task-impls" -version = "0.5.58" -source = "git+https://github.com/EspressoSystems/hotshot?tag=rc-0.5.59#b9329c30b25dcbda5018a36ee06ee4294111778f" +version = "0.5.60" +source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.60#24597f75f7ddb439959e4aff584ec934dcdc1388" dependencies = [ "anyhow", "async-broadcast", @@ -4449,7 +4466,7 @@ dependencies = [ "async-trait", "bincode", "bitvec", - "cdn-proto 0.1.0", + "cdn-proto 0.4.0 (git+https://github.com/EspressoSystems/Push-CDN?tag=0.4.0)", "chrono", "committable", "either", @@ -4473,8 +4490,8 @@ dependencies = [ [[package]] name = "hotshot-testing" -version = "0.5.58" -source = "git+https://github.com/EspressoSystems/hotshot?tag=rc-0.5.59#b9329c30b25dcbda5018a36ee06ee4294111778f" +version = "0.5.60" +source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.60#24597f75f7ddb439959e4aff584ec934dcdc1388" dependencies = [ "anyhow", "async-broadcast", @@ -4516,7 +4533,7 @@ dependencies = [ [[package]] name = "hotshot-types" version = "0.1.11" -source = "git+https://github.com/EspressoSystems/hotshot?tag=rc-0.5.59#b9329c30b25dcbda5018a36ee06ee4294111778f" +source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.60#24597f75f7ddb439959e4aff584ec934dcdc1388" dependencies = [ "anyhow", "ark-bls12-381", @@ -4534,7 +4551,7 @@ dependencies = [ "bincode", "bitvec", "blake3", - "cdn-proto 0.1.0", + "cdn-proto 0.4.0 (git+https://github.com/EspressoSystems/Push-CDN?tag=0.4.0)", "committable", "custom_debug 0.5.1", "derivative", @@ -4703,9 +4720,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +checksum = "c4fe55fb7a772d59a5ff1dfbff4fe0258d19b89fec4b233e75d35d5d2316badc" dependencies = [ "bytes 1.6.0", "futures-channel", @@ -4743,7 +4760,7 @@ checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.3.1", + "hyper 1.4.0", "hyper-util", "rustls 0.23.10", "rustls-pki-types", @@ -4772,7 +4789,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes 1.6.0", "http-body-util", - "hyper 1.3.1", + "hyper 1.4.0", "hyper-util", "native-tls", "tokio", @@ -4782,16 +4799,16 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" +checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" dependencies = [ "bytes 1.6.0", "futures-channel", "futures-util", "http 1.1.0", "http-body 1.0.0", - "hyper 1.3.1", + "hyper 1.4.0", "pin-project-lite 0.2.14", "socket2 0.5.7", "tokio", @@ -5459,11 +5476,11 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ - "spin 0.5.2", + "spin 0.9.8", ] [[package]] @@ -5796,8 +5813,8 @@ dependencies = [ [[package]] name = "libp2p-networking" -version = "0.5.58" -source = "git+https://github.com/EspressoSystems/hotshot?tag=rc-0.5.59#b9329c30b25dcbda5018a36ee06ee4294111778f" +version = "0.5.60" +source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.60#24597f75f7ddb439959e4aff584ec934dcdc1388" dependencies = [ "anyhow", "async-compatibility-layer", @@ -6030,7 +6047,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -6138,7 +6155,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", ] @@ -6255,9 +6272,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" dependencies = [ "value-bag", ] @@ -6341,7 +6358,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -6403,9 +6420,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" -version = "2.0.4" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" dependencies = [ "mime", "unicase", @@ -6675,9 +6692,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", "num-traits", @@ -6784,7 +6801,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -6857,7 +6874,7 @@ version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if", "foreign-types", "libc", @@ -6874,7 +6891,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -7065,9 +7082,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.10" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" +checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" dependencies = [ "memchr", "thiserror", @@ -7076,9 +7093,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.10" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26293c9193fbca7b1a3bf9b79dc1e388e927e6cacaa78b4a3ab705a1d3d41459" +checksum = "2a548d2beca6773b1c244554d36fcf8548a8a58e74156968211567250e48e49a" dependencies = [ "pest", "pest_generator", @@ -7086,22 +7103,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.10" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ec22af7d3fb470a85dd2ca96b7c577a1eb4ef6f1683a9fe9a8c16e136c04687" +checksum = "3c93a82e8d145725dcbaf44e5ea887c8a869efdcc28706df2d08c69e17077183" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] name = "pest_meta" -version = "2.7.10" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a240022f37c361ec1878d646fc5b7d7c4d28d5946e1a80ad5a7a4f4ca0bdcd" +checksum = "a941429fea7e08bedec25e4f6785b6ffaacc6b755da98df5ef3e7dcf4a124c4f" dependencies = [ "once_cell", "pest", @@ -7158,7 +7175,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -7196,7 +7213,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -7416,7 +7433,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -7515,16 +7532,16 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] name = "proptest" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" +checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "lazy_static", "num-traits", "rand 0.8.5", @@ -7554,7 +7571,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -7871,7 +7888,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] @@ -7927,7 +7944,7 @@ dependencies = [ "quote", "refinery-core", "regex", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -8039,7 +8056,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.0", "http-body-util", - "hyper 1.3.1", + "hyper 1.4.0", "hyper-rustls 0.27.2", "hyper-tls", "hyper-util", @@ -8141,7 +8158,7 @@ dependencies = [ "rkyv_derive", "seahash", "tinyvec", - "uuid 1.8.0", + "uuid 1.9.1", ] [[package]] @@ -8184,7 +8201,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" dependencies = [ "base64 0.21.7", - "bitflags 2.5.0", + "bitflags 2.6.0", "serde", "serde_derive", ] @@ -8316,7 +8333,7 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys 0.4.14", @@ -8566,7 +8583,7 @@ version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -8639,8 +8656,8 @@ dependencies = [ "bincode", "blake3", "bytesize", - "cdn-broker 0.4.0", - "cdn-marshal 0.4.0", + "cdn-broker 0.4.0 (git+https://github.com/EspressoSystems/Push-CDN?tag=0.4.2)", + "cdn-marshal 0.4.0 (git+https://github.com/EspressoSystems/Push-CDN?tag=0.4.2)", "clap", "cld", "committable", @@ -8658,6 +8675,7 @@ dependencies = [ "hotshot", "hotshot-contract-adapter", "hotshot-events-service", + "hotshot-example-types", "hotshot-orchestrator", "hotshot-query-service", "hotshot-stake-table", @@ -8754,9 +8772,9 @@ dependencies = [ [[package]] name = "serde_bytes" -version = "0.11.14" +version = "0.11.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" dependencies = [ "serde", ] @@ -8769,7 +8787,7 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -8783,9 +8801,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" dependencies = [ "itoa", "ryu", @@ -8826,9 +8844,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.8.1" +version = "3.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" +checksum = "079f3a42cd87588d924ed95b533f8d30a483388c4e400ab736a7058e34f16169" dependencies = [ "base64 0.22.1", "chrono", @@ -8844,14 +8862,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.8.1" +version = "3.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2" +checksum = "bc03aad67c1d26b7de277d51c86892e7d9a0110a2fe44bf6b26cc569fba302d6" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -9120,7 +9138,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -9342,7 +9360,7 @@ checksum = "1ed31390216d20e538e447a7a9b959e06ed9fc51c37b514b46eb758016ecd418" dependencies = [ "atoi", "base64 0.21.7", - "bitflags 2.5.0", + "bitflags 2.6.0", "byteorder", "bytes 1.6.0", "crc", @@ -9385,7 +9403,7 @@ checksum = "7c824eb80b894f926f89a0b9da0c7f435d27cdd35b8c655b114e58223918577e" dependencies = [ "atoi", "base64 0.21.7", - "bitflags 2.5.0", + "bitflags 2.6.0", "byteorder", "crc", "dotenvy", @@ -9536,9 +9554,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.26.2" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ "strum_macros", ] @@ -9553,14 +9571,14 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] name = "subtle" -version = "2.6.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d0208408ba0c3df17ed26eb06992cb1a1268d41b2c0e12e65203fbe3972cee5" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "surf" @@ -9715,9 +9733,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.67" +version = "2.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff8655ed1d86f3af4ee3fd3263786bc14245ad17c4c7e85ba7187fb3ae028c90" +checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" dependencies = [ "proc-macro2", "quote", @@ -9756,7 +9774,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -9852,7 +9870,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -10048,9 +10066,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "c55115c6fbe2d2bef26eb09ad74bde02d8255476fc0c7b515ef09fbb35742d82" dependencies = [ "tinyvec_macros", ] @@ -10099,7 +10117,7 @@ checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -10360,7 +10378,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -10475,7 +10493,7 @@ checksum = "70977707304198400eb4835a78f6a9f928bf41bba420deb8fdb175cd965d77a7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -10722,9 +10740,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.8.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" +checksum = "5de17fd2f7da591098415cff336e12965a28061ddace43b59cb3c430179c9439" [[package]] name = "valuable" @@ -10913,7 +10931,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", "wasm-bindgen-shared", ] @@ -10947,7 +10965,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -11410,7 +11428,7 @@ checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] @@ -11430,7 +11448,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.68", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 2764633e5..81fb8cdab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,19 +47,21 @@ dotenvy = "0.15" ethers = { version = "2.0", features = ["solc"] } futures = "0.3" -hotshot = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.59" } +hotshot = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.60" } # Hotshot imports -hotshot-builder-api = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.59" } -hotshot-builder-core = { git = "https://github.com/EspressoSystems/hotshot-builder-core", tag = "rc-0.1.32" } -hotshot-events-service = { git = "https://github.com/EspressoSystems/hotshot-events-service.git", tag = "rc-0.1.29" } -hotshot-orchestrator = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.59" } -hotshot-query-service = { git = "https://github.com/EspressoSystems/hotshot-query-service", tag = "rc-0.1.41" } -hotshot-stake-table = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.59" } +hotshot-builder-api = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.60" } +hotshot-builder-core = { git = "https://github.com/EspressoSystems/hotshot-builder-core", tag = "rc-0.1.31-patch-1" } +hotshot-events-service = { git = "https://github.com/EspressoSystems/hotshot-events-service.git", tag = "rc-0.1.31" } +hotshot-orchestrator = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.60" } +hotshot-query-service = { git = "https://github.com/EspressoSystems/hotshot-query-service", tag = "rc-0.1.43" } +hotshot-stake-table = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.60" } hotshot-state-prover = { version = "0.1.0", path = "hotshot-state-prover" } -hotshot-task = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.59" } -hotshot-testing = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.59" } -hotshot-types = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.59" } +hotshot-task = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.60" } +hotshot-testing = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.60" } +hotshot-types = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.60" } hotshot-contract-adapter = { version = "0.1.0", path = "contracts/rust/adapter" } +# Temporary, used to pull in the mock auction results provider +hotshot-example-types = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.60" } # Push CDN imports cdn-broker = { git = "https://github.com/EspressoSystems/Push-CDN", features = [ diff --git a/builder/Cargo.toml b/builder/Cargo.toml index ec03d40ec..899870c47 100644 --- a/builder/Cargo.toml +++ b/builder/Cargo.toml @@ -27,6 +27,7 @@ hotshot = { workspace = true } hotshot-builder-api = { workspace = true } hotshot-builder-core = { workspace = true } hotshot-events-service = { workspace = true } +hotshot-example-types = { workspace = true } hotshot-orchestrator = { workspace = true } hotshot-stake-table = { workspace = true } hotshot-state-prover = { path = "../hotshot-state-prover" } diff --git a/builder/src/lib.rs b/builder/src/lib.rs index 28714580a..1ba9b77f4 100644 --- a/builder/src/lib.rs +++ b/builder/src/lib.rs @@ -11,7 +11,7 @@ use futures::{ use hotshot::{ traits::election::static_committee::GeneralStaticCommittee, types::{SignatureKey, SystemContextHandle}, - HotShotInitializer, Memberships, Networks, SystemContext, + HotShotInitializer, Memberships, SystemContext, }; use hotshot_orchestrator::{ client::{OrchestratorClient, ValidatorArgs}, @@ -19,7 +19,6 @@ use hotshot_orchestrator::{ }; use hotshot_types::{ consensus::ConsensusMetricsValue, - constants::Base, event::Event, light_client::StateKeyPair, signature_key::{BLSPrivKey, BLSPubKey}, @@ -37,7 +36,10 @@ use async_compatibility_layer::art::{async_sleep, async_spawn}; use hotshot_builder_api::builder::{ BuildError, Error as BuilderApiError, Options as HotshotBuilderApiOptions, }; -use hotshot_builder_core::service::{GlobalState, ProxyGlobalState}; +use hotshot_builder_core::{ + service::{GlobalState, ProxyGlobalState}, + testing::basic_test::NodeType, +}; use jf_merkle_tree::{namespaced_merkle_tree::NamespacedMerkleTreeScheme, MerkleTreeScheme}; use jf_signature::bls_over_bn254::VerKey; use sequencer::catchup::mock::MockStateCatchup; @@ -65,18 +67,20 @@ pub mod permissioned; // It runs the api service for the builder pub fn run_builder_api_service(url: Url, source: ProxyGlobalState) { // it is to serve hotshot - let builder_api = - hotshot_builder_api::builder::define_api::, SeqTypes, Base>( - &HotshotBuilderApiOptions::default(), - ) - .expect("Failed to construct the builder APIs"); + let builder_api = hotshot_builder_api::builder::define_api::< + ProxyGlobalState, + SeqTypes, + ::Base, + >(&HotshotBuilderApiOptions::default()) + .expect("Failed to construct the builder APIs"); // it enables external clients to submit txn to the builder's private mempool - let private_mempool_api = - hotshot_builder_api::builder::submit_api::, SeqTypes, Base>( - &HotshotBuilderApiOptions::default(), - ) - .expect("Failed to construct the builder API for private mempool txns"); + let private_mempool_api = hotshot_builder_api::builder::submit_api::< + ProxyGlobalState, + SeqTypes, + ::Base, + >(&HotshotBuilderApiOptions::default()) + .expect("Failed to construct the builder API for private mempool txns"); let mut app: App, BuilderApiError> = App::with_state(source); @@ -86,7 +90,7 @@ pub fn run_builder_api_service(url: Url, source: ProxyGlobalState) { app.register_module("txn_submit", private_mempool_api) .expect("Failed to register the private mempool API"); - async_spawn(app.serve(url, Base::instance())); + async_spawn(app.serve(url, ::Base::instance())); } #[cfg(test)] @@ -225,6 +229,10 @@ pub mod testing { stop_proposing_view: 0, start_voting_view: 0, stop_voting_view: 0, + start_proposing_time: 0, + start_voting_time: 0, + stop_proposing_time: 0, + stop_voting_time: 0, }; Self { @@ -380,11 +388,6 @@ pub mod testing { &self.master_map, None, )); - let networks = Networks { - da_network: network.clone(), - quorum_network: network, - _pd: Default::default(), - }; let node_state = NodeState::new( i as u64, @@ -399,7 +402,7 @@ pub mod testing { config, Some(self.non_staking_nodes_stake_entries.clone()), node_state, - networks, + network, metrics, i as u64, None, @@ -434,7 +437,7 @@ pub mod testing { let hotshot_events_api = hotshot_events_service::events::define_api::< Arc>>, SeqTypes, - Base, + ::Base, >(&EventStreamingApiOptions::default()) .expect("Failed to define hotshot eventsAPI"); @@ -443,7 +446,7 @@ pub mod testing { app.register_module("hotshot-events", hotshot_events_api) .expect("Failed to register hotshot events API"); - async_spawn(app.serve(url, Base::instance())); + async_spawn(app.serve(url, ::Base::instance())); } // enable hotshot event streaming pub fn enable_hotshot_node_event_streaming( diff --git a/builder/src/non_permissioned.rs b/builder/src/non_permissioned.rs index 1b5f0dc71..683a695f2 100644 --- a/builder/src/non_permissioned.rs +++ b/builder/src/non_permissioned.rs @@ -244,7 +244,6 @@ mod test { events::{Error as EventStreamApiError, Options as EventStreamingApiOptions}, events_source::{BuilderEvent, EventConsumer, EventsStreamer}, }; - use hotshot_types::constants::Base; use hotshot_types::traits::{ block_contents::{BlockPayload, GENESIS_VID_NUM_STORAGE_NODES}, node_implementation::NodeType, @@ -315,9 +314,10 @@ mod test { let builder_pub_key = builder_config.fee_account; // Start a builder api client - let builder_client = Client::::new( - hotshot_builder_api_url.clone(), - ); + let builder_client = Client::< + hotshot_builder_api::builder::Error, + ::Base, + >::new(hotshot_builder_api_url.clone()); assert!(builder_client.connect(Some(Duration::from_secs(60))).await); let seed = [207_u8; 32]; diff --git a/builder/src/permissioned.rs b/builder/src/permissioned.rs index 75e751270..bcc233f12 100644 --- a/builder/src/permissioned.rs +++ b/builder/src/permissioned.rs @@ -17,8 +17,9 @@ use hotshot::{ }, }, types::{SignatureKey, SystemContextHandle}, - HotShotInitializer, Memberships, Networks, SystemContext, + HotShotInitializer, Memberships, SystemContext, }; +use hotshot_example_types::auction_results_provider_types::TestAuctionResultsProvider; use hotshot_orchestrator::{ client::{OrchestratorClient, ValidatorArgs}, config::NetworkConfig, @@ -28,7 +29,7 @@ use hotshot_types::{ event::Event, light_client::StateKeyPair, signature_key::{BLSPrivKey, BLSPubKey}, - traits::{election::Membership, metrics::Metrics, EncodeBytes}, + traits::{election::Membership, metrics::Metrics, network::ConnectedNetwork, EncodeBytes}, utils::BuilderCommitment, HotShotConfig, PeerConfig, ValidatorConfig, }; @@ -105,7 +106,7 @@ use std::{num::NonZeroUsize, time::Duration}; use surf_disco::Client; pub struct BuilderContext< - N: network::Type, + N: ConnectedNetwork, P: SequencerPersistence, Ver: StaticVersionType + 'static, > { @@ -150,6 +151,7 @@ pub async fn init_node, P: SequencerPersistence, Ver: StaticVersionType + 'static, >( @@ -333,7 +325,7 @@ pub async fn init_hotshot< Vec>, >, instance_state: NodeState, - networks: Networks>, + networks: Arc, metrics: &dyn Metrics, node_id: u64, state_relay_server: Option, @@ -381,6 +373,7 @@ pub async fn init_hotshot< .unwrap(), ConsensusMetricsValue::new(metrics), da_storage, + TestAuctionResultsProvider::default(), ) .await .unwrap() @@ -396,7 +389,7 @@ pub async fn init_hotshot< (hotshot_handle, state_signer) } -impl +impl, P: SequencerPersistence, Ver: StaticVersionType + 'static> BuilderContext { /// Constructor @@ -566,7 +559,6 @@ mod test { events::{Error as EventStreamApiError, Options as EventStreamingApiOptions}, events_source::{BuilderEvent, EventConsumer, EventsStreamer}, }; - use hotshot_types::constants::Base; use hotshot_types::{ signature_key::BLSPubKey, traits::{ @@ -621,9 +613,10 @@ mod test { let builder_pub_key = builder_config.fee_account; // Start a builder api client - let builder_client = Client::::new( - hotshot_builder_api_url.clone(), - ); + let builder_client = Client::< + hotshot_builder_api::builder::Error, + ::Base, + >::new(hotshot_builder_api_url.clone()); assert!(builder_client.connect(Some(Duration::from_secs(60))).await); let seed = [207_u8; 32]; diff --git a/sequencer/Cargo.toml b/sequencer/Cargo.toml index 658cc7de2..4d063acef 100644 --- a/sequencer/Cargo.toml +++ b/sequencer/Cargo.toml @@ -67,6 +67,7 @@ paste = "1.0" hotshot = { workspace = true } hotshot-contract-adapter = { workspace = true } hotshot-events-service = { workspace = true } +hotshot-example-types = { workspace = true } hotshot-orchestrator = { workspace = true } hotshot-query-service = { workspace = true } hotshot-stake-table = { workspace = true } diff --git a/sequencer/src/api.rs b/sequencer/src/api.rs index cb2339528..5cf77ddab 100644 --- a/sequencer/src/api.rs +++ b/sequencer/src/api.rs @@ -22,7 +22,10 @@ use hotshot::types::{Event, SystemContextHandle}; use hotshot_events_service::events_source::{BuilderEvent, EventsSource, EventsStreamer}; use hotshot_query_service::data_source::ExtensibleDataSource; use hotshot_state_prover::service::light_client_genesis_from_stake_table; -use hotshot_types::{data::ViewNumber, light_client::StateSignatureRequestBody, HotShotConfig}; +use hotshot_types::{ + data::ViewNumber, light_client::StateSignatureRequestBody, traits::network::ConnectedNetwork, + HotShotConfig, +}; use jf_merkle_tree::MerkleTreeScheme; use serde::{Deserialize, Serialize}; use std::pin::Pin; @@ -55,7 +58,8 @@ type BoxLazy = Pin>>>; #[derive(Derivative)] #[derivative(Debug(bound = ""))] -struct ConsensusState { +struct ConsensusState, P: SequencerPersistence, Ver: StaticVersionType> +{ state_signer: Arc>, event_streamer: Arc>>, node_state: NodeState, @@ -64,7 +68,7 @@ struct ConsensusState>>>, } -impl +impl, P: SequencerPersistence, Ver: StaticVersionType + 'static> From<&SequencerContext> for ConsensusState { fn from(ctx: &SequencerContext) -> Self { @@ -79,7 +83,7 @@ impl { +struct ApiState, P: SequencerPersistence, Ver: StaticVersionType> { // The consensus state is initialized lazily so we can start the API (and healthcheck endpoints) // before consensus has started. Any endpoint that uses consensus state will wait for // initialization to finish, but endpoints that do not require a consensus handle can proceed @@ -88,7 +92,7 @@ struct ApiState>, } -impl +impl, P: SequencerPersistence, Ver: StaticVersionType + 'static> ApiState { fn new(init: impl Future> + Send + 'static) -> Self { @@ -138,7 +142,7 @@ impl = ExtensibleDataSource>; #[async_trait] -impl +impl, Ver: StaticVersionType + 'static, P: SequencerPersistence> EventsSource for ApiState { type EventStream = BoxStream<'static, Arc>>; @@ -154,7 +158,7 @@ impl, D: Send + Sync, Ver: StaticVersionType + 'static, P: SequencerPersistence, @@ -165,7 +169,7 @@ impl< } } -impl +impl, Ver: StaticVersionType + 'static, P: SequencerPersistence> SubmitDataSource for ApiState { async fn submit(&self, tx: Transaction) -> anyhow::Result<()> { @@ -180,7 +184,7 @@ impl, Ver: StaticVersionType + 'static, P: SequencerPersistence, D: CatchupDataSource + Send + Sync, @@ -238,7 +242,7 @@ impl< #[async_trait] impl< - N: network::Type, + N: ConnectedNetwork, Ver: StaticVersionType + 'static, P: SequencerPersistence, D: ChainConfigPersistence + Send + Sync, @@ -255,8 +259,8 @@ impl< } } -impl CatchupDataSource - for ApiState +impl, Ver: StaticVersionType + 'static, P: SequencerPersistence> + CatchupDataSource for ApiState { #[tracing::instrument(skip(self))] async fn get_account( @@ -313,15 +317,19 @@ impl - HotShotConfigDataSource for StorageState +impl< + N: ConnectedNetwork, + D: Sync, + Ver: StaticVersionType + 'static, + P: SequencerPersistence, + > HotShotConfigDataSource for StorageState { async fn get_config(&self) -> PublicHotShotConfig { self.as_ref().hotshot_config().await.into() } } -impl +impl, Ver: StaticVersionType + 'static, P: SequencerPersistence> HotShotConfigDataSource for ApiState { async fn get_config(&self) -> PublicHotShotConfig { @@ -330,8 +338,12 @@ impl - StateSignatureDataSource for StorageState +impl< + N: ConnectedNetwork, + D: Sync, + Ver: StaticVersionType + 'static, + P: SequencerPersistence, + > StateSignatureDataSource for StorageState { async fn get_state_signature(&self, height: u64) -> Option { self.as_ref().get_state_signature(height).await @@ -339,7 +351,7 @@ impl +impl, Ver: StaticVersionType + 'static, P: SequencerPersistence> StateSignatureDataSource for ApiState { async fn get_state_signature(&self, height: u64) -> Option { diff --git a/sequencer/src/api/data_source.rs b/sequencer/src/api/data_source.rs index 392f55417..4bc71a2cc 100644 --- a/sequencer/src/api/data_source.rs +++ b/sequencer/src/api/data_source.rs @@ -6,7 +6,6 @@ use super::{ sql, AccountQueryData, BlocksFrontier, }; use crate::{ - network, persistence::{self, SequencerPersistence}, ChainConfig, PubKey, SeqTypes, Transaction, }; @@ -23,8 +22,8 @@ use hotshot_query_service::{ status::StatusDataSource, }; use hotshot_types::{ - data::ViewNumber, light_client::StateSignatureRequestBody, ExecutionType, HotShotConfig, - PeerConfig, ValidatorConfig, + data::ViewNumber, light_client::StateSignatureRequestBody, traits::network::ConnectedNetwork, + ExecutionType, HotShotConfig, PeerConfig, ValidatorConfig, }; use serde::Serialize; @@ -89,7 +88,7 @@ pub fn provider( provider } -pub(crate) trait SubmitDataSource { +pub(crate) trait SubmitDataSource, P: SequencerPersistence> { fn submit(&self, tx: Transaction) -> impl Send + Future>; } @@ -98,7 +97,7 @@ pub(crate) trait HotShotConfigDataSource { } #[async_trait] -pub(crate) trait StateSignatureDataSource { +pub(crate) trait StateSignatureDataSource> { async fn get_state_signature(&self, height: u64) -> Option; } @@ -221,6 +220,10 @@ pub struct PublicHotShotConfig { pub stop_proposing_view: u64, pub start_voting_view: u64, pub stop_voting_view: u64, + pub start_proposing_time: u64, + pub stop_proposing_time: u64, + pub start_voting_time: u64, + pub stop_voting_time: u64, } impl From> for PublicHotShotConfig { @@ -253,6 +256,10 @@ impl From> for PublicHotShotConfig { stop_proposing_view, start_voting_view, stop_voting_view, + start_proposing_time, + stop_proposing_time, + start_voting_time, + stop_voting_time, } = v; Self { @@ -280,6 +287,10 @@ impl From> for PublicHotShotConfig { stop_proposing_view, start_voting_view, stop_voting_view, + start_proposing_time, + stop_proposing_time, + start_voting_time, + stop_voting_time, } } } diff --git a/sequencer/src/api/endpoints.rs b/sequencer/src/api/endpoints.rs index 685e4ba61..5c28f56f1 100644 --- a/sequencer/src/api/endpoints.rs +++ b/sequencer/src/api/endpoints.rs @@ -14,7 +14,7 @@ use super::{ StorageState, }; use crate::{ - block::NsProof, network, persistence::SequencerPersistence, NamespaceId, SeqTypes, Transaction, + block::NsProof, persistence::SequencerPersistence, NamespaceId, PubKey, SeqTypes, Transaction, }; use anyhow::Result; use async_std::sync::{Arc, RwLock}; @@ -29,7 +29,10 @@ use hotshot_query_service::{ }, node, Error, }; -use hotshot_types::{data::ViewNumber, traits::node_implementation::ConsensusTime}; +use hotshot_types::{ + data::ViewNumber, + traits::{network::ConnectedNetwork, node_implementation::ConsensusTime}, +}; use serde::{Deserialize, Serialize}; use snafu::OptionExt; use tagged_base64::TaggedBase64; @@ -54,7 +57,7 @@ pub(super) fn availability( bind_version: Ver, ) -> Result> where - N: network::Type, + N: ConnectedNetwork, D: SequencerDataSource + Send + Sync + 'static, P: SequencerPersistence, { @@ -127,7 +130,7 @@ pub(super) fn explorer( bind_version: Ver, ) -> Result> where - N: network::Type, + N: ConnectedNetwork, D: ExplorerStorage + Send + Sync + 'static, P: SequencerPersistence, { @@ -141,7 +144,7 @@ pub(super) fn node( bind_version: Ver, ) -> Result> where - N: network::Type, + N: ConnectedNetwork, D: SequencerDataSource + Send + Sync + 'static, P: SequencerPersistence, { @@ -153,7 +156,7 @@ where } pub(super) fn submit() -> Result> where - N: network::Type, + N: ConnectedNetwork, S: 'static + Send + Sync + WriteState, P: SequencerPersistence, S::State: Send + Sync + SubmitDataSource, @@ -184,7 +187,7 @@ pub(super) fn state_signature( _: Ver, ) -> Result> where - N: network::Type, + N: ConnectedNetwork, S: 'static + Send + Sync + ReadState, S::State: Send + Sync + StateSignatureDataSource, { @@ -281,7 +284,7 @@ pub(super) fn merklized_state Result> where - N: network::Type, + N: ConnectedNetwork, D: MerklizedStateDataSource + Send + Sync diff --git a/sequencer/src/api/options.rs b/sequencer/src/api/options.rs index 3a99b5c86..f74547555 100644 --- a/sequencer/src/api/options.rs +++ b/sequencer/src/api/options.rs @@ -11,9 +11,9 @@ use super::{ }; use crate::{ context::{SequencerContext, TaskList}, - network, persistence::{self, SequencerPersistence}, state::{update_state_storage_loop, BlockMerkleTree, FeeMerkleTree}, + PubKey, }; use anyhow::bail; use async_std::sync::{Arc, RwLock}; @@ -27,7 +27,10 @@ use hotshot_query_service::{ status::{self, UpdateStatusData}, Error, }; -use hotshot_types::traits::metrics::{Metrics, NoMetrics}; +use hotshot_types::traits::{ + metrics::{Metrics, NoMetrics}, + network::ConnectedNetwork, +}; use tide_disco::{ listener::RateLimitListener, method::{ReadState, WriteState}, @@ -148,7 +151,7 @@ impl Options { bind_version: Ver, ) -> anyhow::Result> where - N: network::Type, + N: ConnectedNetwork, P: SequencerPersistence, F: FnOnce(Box) -> BoxFuture<'static, SequencerContext>, { @@ -263,7 +266,7 @@ impl Options { App>>, Error>, )> where - N: network::Type, + N: ConnectedNetwork, P: SequencerPersistence, D: SequencerDataSource + CatchupDataSource + Send + Sync + 'static, { @@ -304,7 +307,7 @@ impl Options { bind_version: Ver, ) -> anyhow::Result> where - N: network::Type, + N: ConnectedNetwork, P: SequencerPersistence, { let ds = ::create( @@ -338,7 +341,7 @@ impl Options { bind_version: Ver, ) -> anyhow::Result> where - N: network::Type, + N: ConnectedNetwork, P: SequencerPersistence, { let ds = sql::DataSource::create( @@ -404,7 +407,7 @@ impl Options { + StateSignatureDataSource + CatchupDataSource + HotShotConfigDataSource, - N: network::Type, + N: ConnectedNetwork, { let bind_version = Ver::instance(); // Initialize submit API @@ -442,7 +445,7 @@ impl Options { bind_version: Ver, ) -> anyhow::Result<()> where - N: network::Type, + N: ConnectedNetwork, { // Start the event streaming API server if it is enabled. // It runs to different port and app because State and Extensible Data source needs to support required diff --git a/sequencer/src/api/update.rs b/sequencer/src/api/update.rs index 6febae5a3..a1e3936ca 100644 --- a/sequencer/src/api/update.rs +++ b/sequencer/src/api/update.rs @@ -1,18 +1,19 @@ //! Update loop for query API state. use super::{data_source::SequencerDataSource, StorageState}; -use crate::{network, persistence::SequencerPersistence, SeqTypes}; +use crate::{persistence::SequencerPersistence, PubKey, SeqTypes}; use async_std::sync::{Arc, RwLock}; use futures::stream::{Stream, StreamExt}; use hotshot::types::Event; use hotshot_query_service::data_source::{UpdateDataSource, VersionedDataSource}; +use hotshot_types::traits::network::ConnectedNetwork; use vbs::version::StaticVersionType; pub(super) async fn update_loop( state: Arc>>, mut events: impl Stream> + Unpin, ) where - N: network::Type, + N: ConnectedNetwork, P: SequencerPersistence, D: SequencerDataSource + Send + Sync, { @@ -40,7 +41,7 @@ async fn update_state( event: &Event, ) -> anyhow::Result<()> where - N: network::Type, + N: ConnectedNetwork, P: SequencerPersistence, D: SequencerDataSource + Send + Sync, { diff --git a/sequencer/src/bin/cdn-whitelist.rs b/sequencer/src/bin/cdn-whitelist.rs index cf04a537e..4281a0ee6 100644 --- a/sequencer/src/bin/cdn-whitelist.rs +++ b/sequencer/src/bin/cdn-whitelist.rs @@ -47,6 +47,7 @@ async fn main() -> Result<()> { let orchestrator_client = OrchestratorClient::new(ValidatorArgs { url: Url::from_str(&args.orchestrator_url).with_context(|| "Invalid URL")?, advertise_address: None, + builder_address: None, network_config_file: None, }); diff --git a/sequencer/src/context.rs b/sequencer/src/context.rs index ab239c751..e399d821c 100644 --- a/sequencer/src/context.rs +++ b/sequencer/src/context.rs @@ -11,14 +11,15 @@ use futures::{ use hotshot::{ traits::election::static_committee::GeneralStaticCommittee, types::{Event, SystemContextHandle}, - Memberships, Networks, SystemContext, + Memberships, SystemContext, }; +use hotshot_example_types::auction_results_provider_types::TestAuctionResultsProvider; use hotshot_orchestrator::client::OrchestratorClient; use hotshot_query_service::Leaf; use hotshot_types::{ consensus::ConsensusMetricsValue, data::ViewNumber, - traits::{election::Membership, metrics::Metrics}, + traits::{election::Membership, metrics::Metrics, network::ConnectedNetwork}, HotShotConfig, }; use std::fmt::Display; @@ -26,8 +27,8 @@ use url::Url; use vbs::version::StaticVersionType; use crate::{ - network, persistence::SequencerPersistence, state_signature::StateSigner, - static_stake_table_commitment, Node, NodeState, PubKey, SeqTypes, Transaction, ValidatedState, + persistence::SequencerPersistence, state_signature::StateSigner, static_stake_table_commitment, + Node, NodeState, PubKey, SeqTypes, Transaction, ValidatedState, }; use hotshot_events_service::events_source::{EventConsumer, EventsStreamer}; /// The consensus handle @@ -37,7 +38,7 @@ pub type Consensus = SystemContextHandle>; #[derive(Derivative)] #[derivative(Debug(bound = ""))] pub struct SequencerContext< - N: network::Type, + N: ConnectedNetwork, P: SequencerPersistence, Ver: StaticVersionType + 'static, > { @@ -63,7 +64,7 @@ pub struct SequencerContext< node_state: NodeState, } -impl +impl, P: SequencerPersistence, Ver: StaticVersionType + 'static> SequencerContext { #[tracing::instrument(skip_all, fields(node_id = instance_state.node_id))] @@ -72,7 +73,7 @@ impl, instance_state: NodeState, persistence: P, - networks: Networks>, + network: Arc, state_relay_server: Option, metrics: &dyn Metrics, stake_table_capacity: u64, @@ -131,10 +132,11 @@ impl Drop +impl, P: SequencerPersistence, Ver: StaticVersionType + 'static> Drop for SequencerContext { fn drop(&mut self) { diff --git a/sequencer/src/header.rs b/sequencer/src/header.rs index 1ebb25b54..8b89f215c 100644 --- a/sequencer/src/header.rs +++ b/sequencer/src/header.rs @@ -964,7 +964,7 @@ mod test_headers { ns_table, builder_fee, vid_common.clone(), - hotshot_types::constants::Base::VERSION, + ::Base::version(), ) .await .unwrap(); diff --git a/sequencer/src/lib.rs b/sequencer/src/lib.rs index 9f22065ab..b617fbaef 100644 --- a/sequencer/src/lib.rs +++ b/sequencer/src/lib.rs @@ -13,6 +13,7 @@ pub mod state_signature; mod message_compat_tests; mod reference_tests; +use crate::catchup::BackoffParams; use anyhow::Context; use async_std::sync::RwLock; use async_trait::async_trait; @@ -25,7 +26,7 @@ use genesis::{GenesisHeader, L1Finalized, Upgrade}; // Should move `STAKE_TABLE_CAPACITY` in the sequencer repo when we have variate stake table support -use catchup::BackoffParams; +use hotshot_example_types::auction_results_provider_types::TestAuctionResultsProvider; use l1_client::L1Client; use libp2p::Multiaddr; @@ -48,7 +49,6 @@ use hotshot::{ }, }, types::SignatureKey, - Networks, }; use hotshot_orchestrator::{ client::{OrchestratorClient, ValidatorArgs}, @@ -56,7 +56,6 @@ use hotshot_orchestrator::{ }; use hotshot_types::{ consensus::CommitmentMap, - constants::Base, data::{DaProposal, QuorumProposal, VidDisperseShare, ViewNumber}, event::HotShotAction, light_client::{StateKeyPair, StateSignKey}, @@ -78,7 +77,7 @@ use persistence::{PersistenceOptions, SequencerPersistence}; use serde::{Deserialize, Serialize}; use snafu::Snafu; use std::{collections::BTreeMap, fmt::Debug, marker::PhantomData, net::SocketAddr, sync::Arc}; -use vbs::version::{StaticVersionType, Version}; +use vbs::version::{StaticVersion, StaticVersionType, Version}; #[cfg(feature = "libp2p")] use std::time::Duration; @@ -106,11 +105,11 @@ pub mod network; Eq(bound = ""), Hash(bound = "") )] -pub struct Node(PhantomData); +pub struct Node, P: SequencerPersistence>(PhantomData); // Using derivative to derive Clone triggers the clippy lint // https://rust-lang.github.io/rust-clippy/master/index.html#/incorrect_clone_impl_on_copy_type -impl Clone for Node { +impl, P: SequencerPersistence> Clone for Node { fn clone(&self) -> Self { *self } @@ -127,10 +126,12 @@ pub type Event = hotshot::types::Event; pub type PubKey = BLSPubKey; pub type PrivKey = ::PrivateKey; -impl NodeImplementation for Node { - type QuorumNetwork = N::QuorumChannel; - type DaNetwork = N::DAChannel; +impl, P: SequencerPersistence> NodeImplementation + for Node +{ + type Network = N; type Storage = Arc>; + type AuctionResultsProvider = TestAuctionResultsProvider; } #[async_trait] @@ -206,7 +207,7 @@ impl NodeState { }, l1_genesis: None, upgrades: Default::default(), - current_version: Base::VERSION, + current_version: ::Base::version(), } } @@ -267,6 +268,12 @@ impl NodeType for SeqTypes { type ValidatedState = ValidatedState; type Membership = GeneralStaticCommittee; type BuilderSignatureKey = FeeAccount; + type Base = StaticVersion<0, 1>; + type Upgrade = StaticVersion<0, 2>; + const UPGRADE_HASH: [u8; 32] = [ + 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, + ]; } #[derive(Clone, Debug, Snafu, Deserialize, Serialize)] @@ -350,6 +357,7 @@ pub async fn init_node( let validator_args = ValidatorArgs { url: network_params.orchestrator_url, advertise_address: Some(network_params.libp2p_advertise_address), + builder_address: None, network_config_file: None, }; let orchestrator_client = OrchestratorClient::new(validator_args); @@ -453,7 +461,7 @@ pub async fn init_node( // Initialize the Libp2p network (if enabled) #[cfg(feature = "libp2p")] - let (da_network, quorum_network) = { + let network = { let p2p_network = Libp2pNetwork::from_config::( config.clone(), network_params.libp2p_bind_address, @@ -477,28 +485,20 @@ pub async fn init_node( }; // Combine the CDN and P2P networks - let network = Arc::from(CombinedNetworks::new( + Arc::from(CombinedNetworks::new( cdn_network, p2p_network, Duration::from_secs(1), - )); - (Arc::clone(&network), network) + )) }; // Wait for the CDN network to be ready if we're not using the P2P network #[cfg(not(feature = "libp2p"))] - let (da_network, quorum_network) = { + let network = { tracing::warn!("Waiting for the CDN connection to be initialized"); cdn_network.wait_for_ready().await; tracing::warn!("CDN connection initialized"); - (Arc::from(cdn_network.clone()), Arc::from(cdn_network)) - }; - - // Convert to the sequencer-compatible type - let networks = Networks { - da_network, - quorum_network, - _pd: Default::default(), + Arc::from(cdn_network) }; let mut genesis_state = ValidatedState { @@ -541,7 +541,7 @@ pub async fn init_node( config.config, instance_state, persistence, - networks, + network, Some(network_params.state_relay_server_url), metrics, genesis.stake_table.capacity, @@ -580,7 +580,7 @@ pub mod testing { use hotshot::types::EventType::Decide; use hotshot_stake_table::vec_based::StakeTable; use hotshot_testing::block_builder::{ - BuilderTask, SimpleBuilderConfig, SimpleBuilderImplementation, TestBuilderImplementation, + BuilderTask, SimpleBuilderImplementation, TestBuilderImplementation, }; use hotshot_types::{ event::LeafInfo, @@ -589,6 +589,7 @@ pub mod testing { ExecutionType, HotShotConfig, PeerConfig, }; use portpicker::pick_unused_port; + use std::collections::HashMap; use std::time::Duration; use vbs::version::Version; @@ -597,17 +598,23 @@ pub mod testing { pub async fn run_test_builder( port: Option, ) -> (Box>, Url) { - let builder_config = if let Some(port) = port { - SimpleBuilderConfig { port } - } else { - SimpleBuilderConfig::default() - }; - >::start( - NUM_NODES, - builder_config, - Default::default(), + let port = port.unwrap_or_else(|| pick_unused_port().expect("No ports available")); + + // This should never fail. + let url: Url = format!("http://localhost:{port}") + .parse() + .expect("Failed to parse builder URL"); + + ( + >::start( + NUM_NODES, + url.clone(), + (), + HashMap::new(), + ) + .await, + url, ) - .await } pub struct TestConfigBuilder { @@ -615,7 +622,7 @@ pub mod testing { priv_keys: Vec, state_key_pairs: Vec, master_map: Arc>, - url: Url, + l1_url: Url, state_relay_url: Option, builder_port: Option, upgrades: Option, @@ -632,8 +639,8 @@ pub mod testing { self } - pub fn l1_url(mut self, l1: Url) -> Self { - self.url = l1; + pub fn l1_url(mut self, l1_url: Url) -> Self { + self.l1_url = l1_url; self } @@ -648,6 +655,10 @@ pub mod testing { self.config.stop_proposing_view = upgrades.stop_proposing_view; self.config.start_voting_view = upgrades.start_voting_view; self.config.stop_voting_view = upgrades.stop_voting_view; + self.config.start_proposing_time = 0; + self.config.stop_proposing_time = u64::MAX; + self.config.start_voting_time = 0; + self.config.stop_voting_time = u64::MAX; } TestConfig { @@ -655,7 +666,7 @@ pub mod testing { priv_keys: self.priv_keys, state_key_pairs: self.state_key_pairs, master_map: self.master_map, - url: self.url, + l1_url: self.l1_url, state_relay_url: self.state_relay_url, builder_port: self.builder_port, upgrades: self.upgrades, @@ -718,6 +729,10 @@ pub mod testing { stop_proposing_view: 0, start_voting_view: 0, stop_voting_view: 0, + start_proposing_time: 0, + start_voting_time: 0, + stop_proposing_time: 0, + stop_voting_time: 0, }; Self { @@ -725,7 +740,7 @@ pub mod testing { priv_keys, state_key_pairs, master_map, - url: "http://localhost:8545".parse().unwrap(), + l1_url: "http://localhost:8545".parse().unwrap(), state_relay_url: None, builder_port: None, upgrades: None, @@ -739,7 +754,7 @@ pub mod testing { priv_keys: Vec, state_key_pairs: Vec, master_map: Arc>, - url: Url, + l1_url: Url, state_relay_url: Option, builder_port: Option, upgrades: Option, @@ -762,6 +777,10 @@ pub mod testing { self.builder_port } + pub fn l1_url(&self) -> Url { + self.l1_url.clone() + } + pub fn upgrades(&self) -> Option { self.upgrades.clone() } @@ -833,11 +852,6 @@ pub mod testing { &self.master_map, None, )); - let networks = Networks { - da_network: network.clone(), - quorum_network: network, - _pd: Default::default(), - }; // Make sure the builder account is funded. let builder_account = Self::builder_key().fee_account(); @@ -846,7 +860,7 @@ pub mod testing { let node_state = NodeState::new( i as u64, ChainConfig::default(), - L1Client::new(self.url.clone(), 1000), + L1Client::new(self.l1_url.clone(), 1000), catchup::local_and_remote(persistence_opt.clone(), catchup).await, ) .with_genesis(state) @@ -862,7 +876,7 @@ pub mod testing { config, node_state, persistence_opt.create().await.unwrap(), - networks, + network, self.state_relay_url.clone(), metrics, stake_table_capacity, diff --git a/sequencer/src/network/mod.rs b/sequencer/src/network/mod.rs index 0edf3e634..5ce9e2dfb 100644 --- a/sequencer/src/network/mod.rs +++ b/sequencer/src/network/mod.rs @@ -3,30 +3,10 @@ use super::*; pub mod cdn; pub mod libp2p; -pub trait Type: 'static { - type DAChannel: ConnectedNetwork; - type QuorumChannel: ConnectedNetwork; -} - -#[derive(Clone, Copy, Default)] -pub struct Production; - #[cfg(feature = "libp2p")] -impl Type for Production { - type DAChannel = CombinedNetworks; - type QuorumChannel = CombinedNetworks; -} +pub type Production = CombinedNetworks; #[cfg(not(feature = "libp2p"))] -impl Type for Production { - type DAChannel = PushCdnNetwork; - type QuorumChannel = PushCdnNetwork; -} - -#[derive(Clone, Copy, Debug, Default)] -pub struct Memory; +pub type Production = PushCdnNetwork; -impl Type for Memory { - type DAChannel = MemoryNetwork; - type QuorumChannel = MemoryNetwork; -} +pub type Memory = MemoryNetwork;