diff --git a/Cargo.lock b/Cargo.lock index 015645ec1..30cb704ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -535,7 +535,7 @@ checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", "synstructure 0.13.1", ] @@ -547,7 +547,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -664,7 +664,7 @@ checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" dependencies = [ "async-channel 2.3.1", "async-executor", - "async-io 2.3.3", + "async-io 2.3.4", "async-lock 3.4.0", "blocking", "futures-lite 2.3.0", @@ -711,9 +711,9 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.3" +version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" +checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" dependencies = [ "async-lock 3.4.0", "cfg-if", @@ -721,11 +721,11 @@ dependencies = [ "futures-io", "futures-lite 2.3.0", "parking", - "polling 3.7.2", + "polling 3.7.3", "rustix 0.38.34", "slab", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -796,11 +796,11 @@ dependencies = [ [[package]] name = "async-signal" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfb3634b73397aa844481f814fad23bbf07fdb0eabec10f2eb95e58944b1ec32" +checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3" dependencies = [ - "async-io 2.3.3", + "async-io 2.3.4", "async-lock 3.4.0", "atomic-waker", "cfg-if", @@ -809,7 +809,7 @@ dependencies = [ "rustix 0.38.34", "signal-hook-registry", "slab", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -888,7 +888,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -918,7 +918,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -1021,7 +1021,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -1038,7 +1038,7 @@ checksum = "edf3ee19dbc0a46d740f6f0926bde8c50f02bdbc7b536842da28f6ac56513a8b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -1475,12 +1475,13 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.8" +version = "1.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "504bdec147f2cc13c8b57ed9401fd8a147cc66b67ad5cb241394244f2c947549" +checksum = "68064e60dbf1f17005c2fde4d07c16d8baa506fd7ffed8ccab702d93617975c7" dependencies = [ "jobserver", "libc", + "shlex", ] [[package]] @@ -1690,9 +1691,9 @@ checksum = "da987586004ae7c43b7df5e3f7693775068522e1086f8d9b2d74c778a0f43313" [[package]] name = "clap" -version = "4.5.14" +version = "4.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c937d4061031a6d0c8da4b9a4f98a172fc2976dfb1c19213a9cf7d0d3c837e36" +checksum = "11d8838454fda655dafd3accb2b6e2bea645b9e4078abe84a22ceb947235c5cc" dependencies = [ "clap_builder", "clap_derive", @@ -1700,9 +1701,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.14" +version = "4.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85379ba512b21a328adf887e85f7742d12e96eb31f3ef077df4ffc26b506ffed" +checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" dependencies = [ "anstream", "anstyle", @@ -1719,7 +1720,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -2064,9 +2065,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "core2" @@ -2079,9 +2080,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" dependencies = [ "libc", ] @@ -2308,7 +2309,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -2350,7 +2351,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", "synstructure 0.13.1", ] @@ -2375,7 +2376,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -2386,7 +2387,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -2483,7 +2484,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -2504,7 +2505,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -2514,7 +2515,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" dependencies = [ "derive_builder_core", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -2527,7 +2528,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version 0.4.0", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -2547,7 +2548,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -2678,7 +2679,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -2855,7 +2856,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -3112,7 +3113,7 @@ dependencies = [ "reqwest 0.11.27", "serde", "serde_json", - "syn 2.0.72", + "syn 2.0.74", "toml", "walkdir", ] @@ -3130,7 +3131,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -3156,7 +3157,7 @@ dependencies = [ "serde", "serde_json", "strum", - "syn 2.0.72", + "syn 2.0.74", "tempfile", "thiserror", "tiny-keccak", @@ -3603,7 +3604,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -3781,7 +3782,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.3.0", + "indexmap 2.4.0", "slab", "tokio", "tokio-util", @@ -3800,7 +3801,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.1.0", - "indexmap 2.3.0", + "indexmap 2.4.0", "slab", "tokio", "tokio-util", @@ -4063,7 +4064,7 @@ dependencies = [ [[package]] name = "hotshot" version = "0.5.69" -source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.69#b3796d6abea494780f6220845d729cb186a11f6a" +source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.70#3e38cdf852816d73a3b4ffc58c5ccd3a0c6e8028" dependencies = [ "anyhow", "async-broadcast", @@ -4110,7 +4111,7 @@ dependencies = [ [[package]] name = "hotshot-builder-api" version = "0.1.7" -source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.69#b3796d6abea494780f6220845d729cb186a11f6a" +source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.70#3e38cdf852816d73a3b4ffc58c5ccd3a0c6e8028" dependencies = [ "async-trait", "clap", @@ -4129,7 +4130,7 @@ dependencies = [ [[package]] name = "hotshot-builder-core" version = "0.1.39" -source = "git+https://github.com/EspressoSystems/hotshot-builder-core?tag=0.1.40#a052a71980f2b2adac9a32bdf10028a220a1e748" +source = "git+https://github.com/EspressoSystems/hotshot-builder-core?tag=0.1.41#9fdf32825ec363f5783648781b582bb35c319f2e" dependencies = [ "anyhow", "async-broadcast", @@ -4181,7 +4182,7 @@ dependencies = [ [[package]] name = "hotshot-events-service" version = "0.1.38" -source = "git+https://github.com/EspressoSystems/hotshot-events-service.git?tag=0.1.40#9ed690db7a12a4e8a64bb49a0437086232888765" +source = "git+https://github.com/EspressoSystems/hotshot-events-service.git?tag=0.1.41#6812369e20eb2972851690f080a117cae0282a6f" dependencies = [ "async-broadcast", "async-compatibility-layer", @@ -4207,7 +4208,7 @@ dependencies = [ [[package]] name = "hotshot-example-types" version = "0.5.69" -source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.69#b3796d6abea494780f6220845d729cb186a11f6a" +source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.70#3e38cdf852816d73a3b4ffc58c5ccd3a0c6e8028" dependencies = [ "anyhow", "async-broadcast", @@ -4240,7 +4241,7 @@ dependencies = [ [[package]] name = "hotshot-fakeapi" version = "0.5.69" -source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.69#b3796d6abea494780f6220845d729cb186a11f6a" +source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.70#3e38cdf852816d73a3b4ffc58c5ccd3a0c6e8028" dependencies = [ "anyhow", "async-lock 2.8.0", @@ -4259,18 +4260,18 @@ dependencies = [ [[package]] name = "hotshot-macros" version = "0.5.69" -source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.69#b3796d6abea494780f6220845d729cb186a11f6a" +source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.70#3e38cdf852816d73a3b4ffc58c5ccd3a0c6e8028" dependencies = [ "derive_builder", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] name = "hotshot-orchestrator" version = "0.5.69" -source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.69#b3796d6abea494780f6220845d729cb186a11f6a" +source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.70#3e38cdf852816d73a3b4ffc58c5ccd3a0c6e8028" dependencies = [ "anyhow", "async-compatibility-layer", @@ -4300,7 +4301,7 @@ dependencies = [ [[package]] name = "hotshot-query-service" version = "0.1.51" -source = "git+https://github.com/EspressoSystems/hotshot-query-service?tag=0.1.51#8e0ee4e862de99f19b9cbadd029f0d952782a3dd" +source = "git+https://github.com/EspressoSystems/hotshot-query-service?tag=0.1.52#432444e27f2883d69f3563964b7ff01b09d31df6" dependencies = [ "anyhow", "ark-serialize", @@ -4356,7 +4357,7 @@ dependencies = [ [[package]] name = "hotshot-stake-table" version = "0.5.69" -source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.69#b3796d6abea494780f6220845d729cb186a11f6a" +source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.70#3e38cdf852816d73a3b4ffc58c5ccd3a0c6e8028" dependencies = [ "ark-bn254", "ark-ed-on-bn254", @@ -4421,7 +4422,7 @@ dependencies = [ [[package]] name = "hotshot-task" version = "0.5.69" -source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.69#b3796d6abea494780f6220845d729cb186a11f6a" +source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.70#3e38cdf852816d73a3b4ffc58c5ccd3a0c6e8028" dependencies = [ "anyhow", "async-broadcast", @@ -4436,7 +4437,7 @@ dependencies = [ [[package]] name = "hotshot-task-impls" version = "0.5.69" -source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.69#b3796d6abea494780f6220845d729cb186a11f6a" +source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.70#3e38cdf852816d73a3b4ffc58c5ccd3a0c6e8028" dependencies = [ "anyhow", "async-broadcast", @@ -4473,7 +4474,7 @@ dependencies = [ [[package]] name = "hotshot-testing" version = "0.5.69" -source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.69#b3796d6abea494780f6220845d729cb186a11f6a" +source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.70#3e38cdf852816d73a3b4ffc58c5ccd3a0c6e8028" dependencies = [ "anyhow", "async-broadcast", @@ -4519,7 +4520,7 @@ dependencies = [ [[package]] name = "hotshot-types" version = "0.1.11" -source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.69#b3796d6abea494780f6220845d729cb186a11f6a" +source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.70#3e38cdf852816d73a3b4ffc58c5ccd3a0c6e8028" dependencies = [ "anyhow", "ark-bn254", @@ -4867,7 +4868,7 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6b0422c86d7ce0e97169cc42e04ae643caf278874a7a3c87b8150a220dc7e1e" dependencies = [ - "async-io 2.3.3", + "async-io 2.3.4", "core-foundation", "fnv", "futures", @@ -4976,9 +4977,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" +checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" dependencies = [ "equivalent", "hashbrown 0.14.5", @@ -5364,9 +5365,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] @@ -5702,7 +5703,7 @@ dependencies = [ "hex_fmt", "libp2p-core 0.42.0", "libp2p-identity", - "libp2p-swarm 0.45.0", + "libp2p-swarm 0.45.1", "prometheus-client", "quick-protobuf", "quick-protobuf-codec 0.3.1", @@ -5751,7 +5752,7 @@ dependencies = [ "futures-timer", "libp2p-core 0.42.0", "libp2p-identity", - "libp2p-swarm 0.45.0", + "libp2p-swarm 0.45.1", "lru 0.12.4", "quick-protobuf", "quick-protobuf-codec 0.3.1", @@ -5828,7 +5829,7 @@ dependencies = [ "futures-timer", "libp2p-core 0.42.0", "libp2p-identity", - "libp2p-swarm 0.45.0", + "libp2p-swarm 0.45.1", "quick-protobuf", "quick-protobuf-codec 0.3.1", "rand 0.8.5", @@ -5847,7 +5848,7 @@ version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49007d9a339b3e1d7eeebc4d67c05dbf23d300b7d091193ec2d3f26802d7faf2" dependencies = [ - "async-io 2.3.3", + "async-io 2.3.4", "async-std", "data-encoding", "futures", @@ -5876,7 +5877,7 @@ dependencies = [ "libp2p-identify 0.45.0", "libp2p-identity", "libp2p-kad 0.46.0", - "libp2p-swarm 0.45.0", + "libp2p-swarm 0.45.1", "pin-project", "prometheus-client", "web-time", @@ -5885,7 +5886,7 @@ dependencies = [ [[package]] name = "libp2p-networking" version = "0.5.69" -source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.69#b3796d6abea494780f6220845d729cb186a11f6a" +source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.70#3e38cdf852816d73a3b4ffc58c5ccd3a0c6e8028" dependencies = [ "anyhow", "async-compatibility-layer", @@ -5989,9 +5990,9 @@ dependencies = [ [[package]] name = "libp2p-swarm" -version = "0.45.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b931eb2f00da515cec0914ab08a3d4c3694f29bc0e92e9ac66b3eaed5d354a5b" +checksum = "d7dd6741793d2c1fb2088f67f82cf07261f25272ebe3c0b0c311e0c6b50e851a" dependencies = [ "either", "fnv", @@ -6018,7 +6019,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -6145,9 +6146,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.18" +version = "1.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c15da26e5af7e25c90b37a2d75cdbf940cf4a55316de9d84c679c9b8bfabf82e" +checksum = "fdc53a7799a7496ebc9fd29f31f7df80e83c9bda5299768af5f9e59eeea74647" dependencies = [ "cc", "libc", @@ -6303,7 +6304,7 @@ dependencies = [ [[package]] name = "marketplace-builder-core" version = "0.0.2" -source = "git+https://github.com/EspressoSystems/marketplace-builder-core?tag=0.0.3#0e74c008a200532a09a637452b7d8cfcfa9fcc5c" +source = "git+https://github.com/EspressoSystems/marketplace-builder-core?tag=0.0.5#0135f166dc007776a41aecc6d68de1dd6859136d" dependencies = [ "anyhow", "async-broadcast", @@ -6410,7 +6411,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -6497,9 +6498,9 @@ dependencies = [ [[package]] name = "mio" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ "hermit-abi 0.3.9", "libc", @@ -6889,7 +6890,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -6979,7 +6980,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -7199,7 +7200,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -7220,7 +7221,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.3.0", + "indexmap 2.4.0", ] [[package]] @@ -7263,7 +7264,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -7301,7 +7302,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -7330,9 +7331,9 @@ checksum = "d15b6607fa632996eb8a17c9041cb6071cb75ac057abd45dece578723ea8c7c0" [[package]] name = "piper" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" +checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" dependencies = [ "atomic-waker", "fastrand 2.1.0", @@ -7384,9 +7385,9 @@ dependencies = [ [[package]] name = "polling" -version = "3.7.2" +version = "3.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" +checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" dependencies = [ "cfg-if", "concurrent-queue", @@ -7394,7 +7395,7 @@ dependencies = [ "pin-project-lite 0.2.14", "rustix 0.38.34", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -7501,7 +7502,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -7600,7 +7601,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -7651,7 +7652,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -7736,7 +7737,7 @@ version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b22d8e7369034b9a7132bc2008cac12f2013c8132b45e0554e6e20e2617f2156" dependencies = [ - "async-io 2.3.3", + "async-io 2.3.4", "async-std", "bytes 1.7.1", "futures-io", @@ -8025,7 +8026,7 @@ dependencies = [ "quote", "refinery-core", "regex", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -8807,9 +8808,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.205" +version = "1.0.207" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33aedb1a7135da52b7c21791455563facbbcc43d0f0f66165b42c21b3dfb150" +checksum = "5665e14a49a4ea1b91029ba7d3bca9f299e1f7cfa194388ccc20f14743e784f2" dependencies = [ "serde_derive", ] @@ -8836,13 +8837,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.205" +version = "1.0.207" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692d6f5ac90220161d6774db30c662202721e64aed9058d2c394f451261420c1" +checksum = "6aea2634c86b0e8ef2cfdc0c340baede54ec27b1e46febd7f80dffb2aa44a00e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -8856,9 +8857,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.122" +version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da" +checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" dependencies = [ "itoa", "memchr", @@ -8908,7 +8909,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.3.0", + "indexmap 2.4.0", "serde", "serde_derive", "serde_json", @@ -8925,7 +8926,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -9019,6 +9020,12 @@ dependencies = [ "dirs", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook" version = "0.3.17" @@ -9194,7 +9201,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -9318,7 +9325,7 @@ dependencies = [ "futures-util", "hashlink", "hex", - "indexmap 2.3.0", + "indexmap 2.4.0", "log", "memchr", "once_cell", @@ -9595,7 +9602,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -9757,9 +9764,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.72" +version = "2.0.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" +checksum = "1fceb41e3d546d0bd83421d3409b1460cc7444cd389341a4c880fe7a042cb3d7" dependencies = [ "proc-macro2", "quote", @@ -9798,7 +9805,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -9895,7 +9902,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -10142,7 +10149,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -10279,7 +10286,7 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "indexmap 2.3.0", + "indexmap 2.4.0", "toml_datetime", "winnow 0.5.40", ] @@ -10290,7 +10297,7 @@ version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ - "indexmap 2.3.0", + "indexmap 2.4.0", "serde", "serde_spanned", "toml_datetime", @@ -10373,15 +10380,15 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -10403,7 +10410,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -10507,7 +10514,7 @@ checksum = "70977707304198400eb4835a78f6a9f928bf41bba420deb8fdb175cd965d77a7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -10913,11 +10920,12 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "serde", "serde_json", "wasm-bindgen-macro", @@ -10925,24 +10933,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" dependencies = [ "cfg-if", "js-sys", @@ -10952,9 +10960,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -10962,28 +10970,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", @@ -11398,7 +11406,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -11418,7 +11426,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index dec444c89..bbf16820a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,22 +52,22 @@ dotenvy = "0.15" ethers = { version = "2.0", features = ["solc"] } futures = "0.3" -hotshot = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.69" } +hotshot = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.70" } # Hotshot imports -hotshot-builder-api = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.69" } -hotshot-builder-core = { git = "https://github.com/EspressoSystems/hotshot-builder-core", tag = "0.1.40" } -marketplace-builder-core = { git = "https://github.com/EspressoSystems/marketplace-builder-core", tag = "0.0.3" } -hotshot-events-service = { git = "https://github.com/EspressoSystems/hotshot-events-service.git", tag = "0.1.40" } -hotshot-orchestrator = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.69" } -hotshot-query-service = { git = "https://github.com/EspressoSystems/hotshot-query-service", tag = "0.1.51" } -hotshot-stake-table = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.69" } +hotshot-builder-api = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.70" } +hotshot-builder-core = { git = "https://github.com/EspressoSystems/hotshot-builder-core", tag = "0.1.41" } +marketplace-builder-core = { git = "https://github.com/EspressoSystems/marketplace-builder-core", tag = "0.0.5" } +hotshot-events-service = { git = "https://github.com/EspressoSystems/hotshot-events-service.git", tag = "0.1.41" } +hotshot-orchestrator = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.70" } +hotshot-query-service = { git = "https://github.com/EspressoSystems/hotshot-query-service", tag = "0.1.52" } +hotshot-stake-table = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.70" } hotshot-state-prover = { version = "0.1.0", path = "hotshot-state-prover" } -hotshot-task = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.69" } -hotshot-testing = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.69" } -hotshot-types = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.69" } +hotshot-task = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.70" } +hotshot-testing = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.70" } +hotshot-types = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.70" } 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.69" } +hotshot-example-types = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.70" } # Push CDN imports cdn-broker = { git = "https://github.com/EspressoSystems/Push-CDN", features = [ diff --git a/builder/src/lib.rs b/builder/src/lib.rs index bb8e6e958..8d2b9bee2 100755 --- a/builder/src/lib.rs +++ b/builder/src/lib.rs @@ -121,7 +121,7 @@ pub mod testing { use espresso_types::{ mock::MockStateCatchup, v0_3::ChainConfig, Event, FeeAccount, L1Client, NodeState, PrivKey, - PubKey, Transaction, ValidatedState, + PubKey, SequencerVersions, Transaction, ValidatedState, }; use ethers::{ types::spoof::State, @@ -339,7 +339,7 @@ pub mod testing { bind_version: Ver, options: impl PersistenceOptions, ) -> Vec<( - Arc>>, + Arc, SequencerVersions>>, Option>, )> { let num_staked_nodes = self.num_staked_nodes(); @@ -380,7 +380,7 @@ pub mod testing { bind_version: Ver, persistence: P, ) -> ( - SystemContextHandle>, + SystemContextHandle, SequencerVersions>, StateSigner, ) { let mut config = self.config.clone(); @@ -465,7 +465,9 @@ pub mod testing { hotshot_events_api_url: Url, known_nodes_with_stake: Vec>, num_non_staking_nodes: usize, - hotshot_context_handle: Arc>>, + hotshot_context_handle: Arc< + SystemContextHandle, SequencerVersions>, + >, ) { // create a event streamer let events_streamer = Arc::new(RwLock::new(EventsStreamer::new( @@ -602,7 +604,9 @@ pub mod testing { { pub async fn init_permissioned_builder( hotshot_test_config: HotShotTestConfig, - hotshot_handle: Arc>>, + hotshot_handle: Arc< + SystemContextHandle, SequencerVersions>, + >, node_id: u64, state_signer: StateSigner, hotshot_builder_api_url: Url, diff --git a/builder/src/non_permissioned.rs b/builder/src/non_permissioned.rs index c2b35d0bf..dd273e64b 100644 --- a/builder/src/non_permissioned.rs +++ b/builder/src/non_permissioned.rs @@ -11,7 +11,7 @@ use async_compatibility_layer::{ use async_std::sync::{Arc, RwLock}; use espresso_types::{ eth_signature_key::EthKeyPair, v0_3::ChainConfig, FeeAmount, L1Client, NodeState, Payload, - SeqTypes, ValidatedState, + SeqTypes, SequencerVersions, ValidatedState, }; use ethers::{ core::k256::ecdsa::SigningKey, @@ -195,14 +195,18 @@ impl BuilderConfig { let events_url = hotshot_events_api_url.clone(); tracing::info!("Running permissionless builder against hotshot events API at {events_url}",); async_spawn(async move { - let res = run_non_permissioned_standalone_builder_service( - da_sender, - qc_sender, - decide_sender, - tx_sender, - events_url, - ) - .await; + // TODO this is proabably a mistake in builder-core. These + // generic params can be removed and the concrete types + // used instead. + let res = + run_non_permissioned_standalone_builder_service::( + da_sender, + qc_sender, + decide_sender, + tx_sender, + events_url, + ) + .await; tracing::error!(?res, "builder service exited"); if res.is_err() { panic!("Builder should restart."); diff --git a/builder/src/permissioned.rs b/builder/src/permissioned.rs index 76ade2dba..4de00fb89 100644 --- a/builder/src/permissioned.rs +++ b/builder/src/permissioned.rs @@ -26,8 +26,8 @@ use async_std::{ use espresso_types::{ eth_signature_key::EthKeyPair, v0::traits::{PersistenceOptions, SequencerPersistence, StateCatchup}, - FeeAmount, L1Client, NodeState, Payload, PubKey, SeqTypes, SolverAuctionResultsProvider, - ValidatedState, + FeeAmount, L1Client, NodeState, Payload, PubKey, SeqTypes, SequencerVersions, + SolverAuctionResultsProvider, ValidatedState, }; use ethers::{ core::k256::ecdsa::SigningKey, @@ -339,7 +339,10 @@ pub async fn init_hotshot< stake_table_commit: StakeTableCommitmentType, _: Ver, persistence: P, -) -> (SystemContextHandle>, StateSigner) { +) -> ( + SystemContextHandle, SequencerVersions>, + StateSigner, +) { let combined_known_nodes_with_stake = match stake_table_entries_for_non_voting_nodes { Some(stake_table_entries) => { let combined_entries = config diff --git a/hotshot-state-prover/src/bin/state-prover.rs b/hotshot-state-prover/src/bin/state-prover.rs index b6cf5ec8f..2c5a7f169 100644 --- a/hotshot-state-prover/src/bin/state-prover.rs +++ b/hotshot-state-prover/src/bin/state-prover.rs @@ -1,7 +1,7 @@ use std::time::Duration; use clap::Parser; -use espresso_types::{parse_duration, SeqTypes}; +use espresso_types::{parse_duration, SequencerVersions}; use ethers::{ providers::{Http, Middleware, Provider}, signers::{coins_bip39::English, MnemonicBuilder, Signer}, @@ -9,7 +9,7 @@ use ethers::{ }; use hotshot_stake_table::config::STAKE_TABLE_CAPACITY; use hotshot_state_prover::service::{run_prover_once, run_prover_service, StateProverConfig}; -use hotshot_types::traits::node_implementation::NodeType; +use hotshot_types::traits::node_implementation::Versions; use sequencer_utils::logging; use url::Url; use vbs::version::StaticVersionType; @@ -114,13 +114,16 @@ async fn main() { if args.daemon { // Launching the prover service daemon - if let Err(err) = run_prover_service(config, ::Base::instance()).await + if let Err(err) = + run_prover_service(config, ::Base::instance()).await { tracing::error!("Error running prover service: {:?}", err); }; } else { // Run light client state update once - if let Err(err) = run_prover_once(config, ::Base::instance()).await { + if let Err(err) = + run_prover_once(config, ::Base::instance()).await + { tracing::error!("Error running prover once: {:?}", err); }; } diff --git a/marketplace-builder/src/bin/marketplace-builder.rs b/marketplace-builder/src/bin/marketplace-builder.rs index 2adfbdb5f..88772e077 100644 --- a/marketplace-builder/src/bin/marketplace-builder.rs +++ b/marketplace-builder/src/bin/marketplace-builder.rs @@ -3,15 +3,17 @@ use std::{num::NonZeroUsize, path::PathBuf, time::Duration}; use async_compatibility_layer::logging::{setup_backtrace, setup_logging}; use clap::Parser; use espresso_types::{ - eth_signature_key::EthKeyPair, parse_duration, FeeAmount, NamespaceId, SeqTypes, + eth_signature_key::EthKeyPair, parse_duration, FeeAmount, NamespaceId, SequencerVersions, }; use hotshot::traits::ValidatedState; -use hotshot_types::{data::ViewNumber, traits::node_implementation::ConsensusTime}; +use hotshot_types::{ + data::ViewNumber, + traits::node_implementation::{ConsensusTime, Versions}, +}; use marketplace_builder::{ builder::{build_instance_state, BuilderConfig}, hooks::BidConfig, }; -use marketplace_builder_core::testing::basic_test::NodeType; use sequencer::{Genesis, L1Params}; use url::Url; use vbs::version::StaticVersionType; @@ -150,7 +152,7 @@ async fn main() -> anyhow::Result<()> { genesis.chain_config, l1_params, opt.state_peers, - ::Base::instance(), + ::Base::instance(), ) .unwrap(); diff --git a/marketplace-builder/src/builder.rs b/marketplace-builder/src/builder.rs index 1464a9286..2f8448bf1 100644 --- a/marketplace-builder/src/builder.rs +++ b/marketplace-builder/src/builder.rs @@ -12,7 +12,7 @@ use async_lock::RwLock; use async_std::sync::Arc; use espresso_types::{ eth_signature_key::EthKeyPair, v0_3::ChainConfig, FeeAmount, L1Client, NamespaceId, NodeState, - Payload, SeqTypes, ValidatedState, + Payload, SeqTypes, SequencerVersions, ValidatedState, }; use ethers::{ core::k256::ecdsa::SigningKey, @@ -203,9 +203,11 @@ impl BuilderConfig { }; async_spawn(async move { - let res = - run_non_permissioned_standalone_builder_service(hooks, senders, events_url) - .await; + let res = run_non_permissioned_standalone_builder_service::< + SeqTypes, + SequencerVersions, + >(hooks, senders, events_url) + .await; tracing::error!(?res, "Reserve builder service exited"); if res.is_err() { panic!("Reserve builder should restart."); @@ -217,9 +219,11 @@ impl BuilderConfig { let hooks = hooks::EspressoFallbackHooks { solver_api_url }; async_spawn(async move { - let res = - run_non_permissioned_standalone_builder_service(hooks, senders, events_url) - .await; + let res = run_non_permissioned_standalone_builder_service::< + SeqTypes, + SequencerVersions, + >(hooks, senders, events_url) + .await; tracing::error!(?res, "Fallback builder service exited"); if res.is_err() { panic!("Fallback builder should restart."); @@ -249,7 +253,8 @@ mod test { use async_std::{stream::StreamExt, task}; use committable::Commitment; use espresso_types::{ - mock::MockStateCatchup, FeeAccount, NamespaceId, PubKey, SeqTypes, Transaction, + mock::MockStateCatchup, FeeAccount, NamespaceId, PubKey, SeqTypes, SequencerVersions, + Transaction, }; use ethers::utils::Anvil; use hotshot::types::BLSPrivKey; @@ -261,12 +266,11 @@ mod test { use hotshot_query_service::availability::LeafQueryData; use hotshot_types::{ bundle::Bundle, - constants::MarketplaceVersion, light_client::StateKeyPair, signature_key::BLSPubKey, traits::{ block_contents::{BlockPayload, GENESIS_VID_NUM_STORAGE_NODES}, - node_implementation::NodeType, + node_implementation::{NodeType, Versions}, signature_key::{BuilderSignatureKey, SignatureKey}, }, }; @@ -325,7 +329,8 @@ mod test { ) .network_config(network_config) .build(); - let network = TestNetwork::new(config, ::Base::instance()).await; + let network = + TestNetwork::new(config, ::Base::instance()).await; // Start the builder let init = BuilderConfig::init( @@ -352,7 +357,7 @@ mod test { let _builder_config = init.await; // Wait for at least one empty block to be sequenced (after consensus starts VID). - let sequencer_client: Client::Base> = + let sequencer_client: Client::Base> = Client::new(query_api_url); sequencer_client.connect(None).await; sequencer_client @@ -366,12 +371,12 @@ mod test { .unwrap(); // Connect to builder - let builder_client: Client = + let builder_client: Client::Marketplace> = Client::new(builder_api_url.clone()); builder_client.connect(None).await; // TODO(AG): workaround for version mismatch between bundle and submit APIs - let submission_client: Client::Base> = + let submission_client: Client::Base> = Client::new(builder_api_url); submission_client.connect(None).await; diff --git a/marketplace-builder/src/hooks.rs b/marketplace-builder/src/hooks.rs index bea169150..47d26af58 100644 --- a/marketplace-builder/src/hooks.rs +++ b/marketplace-builder/src/hooks.rs @@ -5,10 +5,12 @@ use espresso_types::v0_3::BidTxBody; use espresso_types::v0_3::RollupRegistration; use espresso_types::SeqTypes; +use espresso_types::SequencerVersions; use hotshot::types::EventType; use hotshot::types::Event; +use hotshot_types::traits::node_implementation::Versions; use marketplace_builder_core::service::BuilderHooks; use espresso_types::FeeAmount; @@ -36,8 +38,8 @@ pub struct BidConfig { pub async fn connect_to_solver( solver_api_url: Url, -) -> Option::Base>> { - let client = Client::::Base>::new( +) -> Option::Base>> { + let client = Client::::Base>::new( solver_api_url.join("marketplace-solver/").unwrap(), ); diff --git a/marketplace-builder/src/lib.rs b/marketplace-builder/src/lib.rs index 36ebde5ea..4a2e22d18 100755 --- a/marketplace-builder/src/lib.rs +++ b/marketplace-builder/src/lib.rs @@ -19,7 +19,7 @@ use espresso_types::{ eth_signature_key::EthKeyPair, v0::traits::{PersistenceOptions, SequencerPersistence, StateCatchup}, v0_3::BidTxBody, - SeqTypes, + SeqTypes, SequencerVersions, }; use ethers::{ core::k256::ecdsa::SigningKey, @@ -56,7 +56,7 @@ use hotshot_types::{ }, election::Membership, metrics::Metrics, - node_implementation::{ConsensusTime, NodeType}, + node_implementation::{ConsensusTime, NodeType, Versions}, }, utils::BuilderCommitment, HotShotConfig, PeerConfig, ValidatorConfig, @@ -92,7 +92,7 @@ pub fn run_builder_api_service(url: Url, source: ProxyGlobalState) { let private_mempool_api = hotshot_builder_api::v0_3::builder::submit_api::< ProxyGlobalState, SeqTypes, - ::Base, + ::Base, >(&HotshotBuilderApiOptions::default()) .expect("Failed to construct the builder API for private mempool txns"); @@ -104,5 +104,5 @@ 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())); } diff --git a/marketplace-solver/src/events.rs b/marketplace-solver/src/events.rs index 1d586b523..f94841cd0 100644 --- a/marketplace-solver/src/events.rs +++ b/marketplace-solver/src/events.rs @@ -2,21 +2,22 @@ use std::{pin::Pin, sync::Arc}; use anyhow::Context; use async_std::sync::RwLock; -use espresso_types::SeqTypes; +use espresso_types::{SeqTypes, SequencerVersions}; use futures::{Stream, StreamExt as _}; use hotshot::types::Event; use hotshot_events_service::{events, events_source::StartupInfo}; -use hotshot_types::traits::node_implementation::NodeType; +use hotshot_types::traits::node_implementation::Versions; use surf_disco::Client; use tide_disco::Url; use crate::state::GlobalState; -pub struct EventsServiceClient(Client::Base>); +pub struct EventsServiceClient(Client::Base>); impl EventsServiceClient { pub async fn new(url: Url) -> Self { - let client = Client::::Base>::new(url.clone()); + let client = + Client::::Base>::new(url.clone()); client.connect(None).await; diff --git a/marketplace-solver/src/main.rs b/marketplace-solver/src/main.rs index 60a8c6990..6d5936b38 100644 --- a/marketplace-solver/src/main.rs +++ b/marketplace-solver/src/main.rs @@ -4,8 +4,8 @@ use anyhow::Context; use async_compatibility_layer::logging::{setup_backtrace, setup_logging}; use async_std::{sync::RwLock, task::spawn}; use clap::Parser; -use espresso_types::SeqTypes; -use hotshot_types::traits::node_implementation::NodeType; +use espresso_types::SequencerVersions; +use hotshot_types::traits::node_implementation::Versions; use marketplace_solver::{ define_api, handle_events, state::{GlobalState, SolverState, StakeTable}, @@ -14,7 +14,7 @@ use marketplace_solver::{ use tide_disco::App; use vbs::version::StaticVersionType; -type Version = ::Base; +type Version = ::Base; #[async_std::main] async fn main() -> anyhow::Result<()> { diff --git a/marketplace-solver/src/testing.rs b/marketplace-solver/src/testing.rs old mode 100644 new mode 100755 index 272c34b2a..dda545965 --- a/marketplace-solver/src/testing.rs +++ b/marketplace-solver/src/testing.rs @@ -4,9 +4,9 @@ use std::sync::Arc; use async_compatibility_layer::art::async_spawn; use async_std::{sync::RwLock, task::JoinHandle}; -use espresso_types::SeqTypes; +use espresso_types::SequencerVersions; use hotshot_query_service::data_source::sql::testing::TmpDb; -use hotshot_types::traits::node_implementation::NodeType; +use hotshot_types::traits::node_implementation::Versions; use portpicker::pick_unused_port; use tide_disco::{App, Url}; use vbs::version::StaticVersionType; @@ -81,8 +81,11 @@ impl MockSolver { let mut api = define_api(Default::default()).unwrap(); api.with_version(env!("CARGO_PKG_VERSION").parse().unwrap()); - app.register_module::::Base>("solver_api", api) - .unwrap(); + app.register_module::::Base>( + "solver_api", + api, + ) + .unwrap(); let solver_api_port = pick_unused_port().expect("no free port"); let solver_url: Url = Url::parse(&format!("http://localhost:{solver_api_port}")).unwrap(); @@ -91,7 +94,10 @@ impl MockSolver { let solver_url = solver_url.clone(); async move { let _ = app - .serve(solver_url, ::Base::instance()) + .serve( + solver_url, + ::Base::instance(), + ) .await; } }); @@ -122,10 +128,10 @@ mod test { use committable::Committable; use espresso_types::{ v0_3::{RollupRegistration, RollupRegistrationBody, RollupUpdate, RollupUpdatebody}, - SeqTypes, + SeqTypes, SequencerVersions, }; use hotshot::types::{BLSPubKey, SignatureKey}; - use hotshot_types::traits::node_implementation::NodeType; + use hotshot_types::traits::node_implementation::{NodeType, Versions}; use std::str::FromStr; use tide_disco::Url; @@ -135,8 +141,9 @@ mod test { async fn test_rollup_registration() { let mock_solver = MockSolver::init().await; let solver_api = mock_solver.solver_api(); - let client = - surf_disco::Client::::Base>::new(solver_api); + let client = surf_disco::Client::::Base>::new( + solver_api, + ); // Create a list of signature keys for rollup registration data let mut signature_keys = Vec::new(); @@ -284,8 +291,9 @@ mod test { async fn test_update_rollup_not_registered() { let mock_solver = MockSolver::init().await; let solver_api = mock_solver.solver_api(); - let client = - surf_disco::Client::::Base>::new(solver_api); + let client = surf_disco::Client::::Base>::new( + solver_api, + ); let private_key = ::PrivateKey::generate(&mut rand::thread_rng()); @@ -336,8 +344,9 @@ mod test { let mock_solver = MockSolver::init().await; let solver_api = mock_solver.solver_api(); - let client = - surf_disco::Client::::Base>::new(solver_api); + let client = surf_disco::Client::::Base>::new( + solver_api, + ); // Create a list of signature keys for rollup registration data let mut signature_keys = Vec::new(); @@ -483,8 +492,9 @@ mod test { let solver_api = mock_solver.solver_api(); - let client = - surf_disco::Client::::Base>::new(solver_api); + let client = surf_disco::Client::::Base>::new( + solver_api, + ); let result: String = client.post("submit_bid").send().await.unwrap(); assert_eq!(result, "Bid Submitted".to_string()); diff --git a/node-metrics/src/api/node_validator/v0/cdn/mod.rs b/node-metrics/src/api/node_validator/v0/cdn/mod.rs index 143170c79..6d8a3ce98 100644 --- a/node-metrics/src/api/node_validator/v0/cdn/mod.rs +++ b/node-metrics/src/api/node_validator/v0/cdn/mod.rs @@ -1,13 +1,13 @@ use crate::api::node_validator::v0::create_node_validator_api::ExternalMessage; use async_std::task::JoinHandle; -use espresso_types::{PubKey, SeqTypes}; +use espresso_types::{v0::SequencerVersions, PubKey, SeqTypes}; use futures::{channel::mpsc::SendError, Sink, SinkExt}; use hotshot::{ traits::NetworkError, types::{Message, SignatureKey}, }; use hotshot_types::{ - message::{MessageKind, VersionedMessage}, + message::{MessageKind, UpgradeLock}, traits::{ network::{BroadcastDelay, ConnectedNetwork, Topic}, node_implementation::NodeType, @@ -87,6 +87,7 @@ impl CdnReceiveMessagesTask { { network.wait_for_ready().await; let mut url_sender = url_sender; + let upgrade_lock = UpgradeLock::::new(); loop { let messages_result = network.recv_msgs().await; @@ -100,7 +101,9 @@ impl CdnReceiveMessagesTask { for message in messages { // We want to try and decode this message. - let message_deserialize_result = Message::::deserialize(&message, &None); + let message_deserialize_result = upgrade_lock + .deserialize::>(&message) + .await; let message = match message_deserialize_result { Ok(message) => message, @@ -231,6 +234,7 @@ impl BroadcastRollCallTask { N: ConnectedNetworkPublisher<::SignatureKey> + Send + 'static, { network.wait_for_ready().await; + let upgrade_lock = UpgradeLock::::new(); // We want to send the Roll Call Request let rollcall_request = ExternalMessage::RollCallRequest(public_key); @@ -247,7 +251,7 @@ impl BroadcastRollCallTask { kind: MessageKind::External(rollcall_request_serialized), }; - let hotshot_message_serialized = match hotshot_message.serialize(&None) { + let hotshot_message_serialized = match upgrade_lock.serialize(&hotshot_message).await { Ok(hotshot_message_serialized) => hotshot_message_serialized, Err(err) => { tracing::error!("error serializing hotshot message: {:?}", err); @@ -288,7 +292,7 @@ mod test { use async_std::future::TimeoutError; use async_std::prelude::FutureExt; use core::panic; - use espresso_types::SeqTypes; + use espresso_types::{v0::SequencerVersions, SeqTypes}; use futures::channel::mpsc::Sender; use futures::SinkExt; use futures::{ @@ -300,7 +304,7 @@ mod test { traits::NetworkError, types::{BLSPubKey, Message}, }; - use hotshot_types::message::{DataMessage, MessageKind, VersionedMessage}; + use hotshot_types::message::{DataMessage, MessageKind, UpgradeLock}; use hotshot_types::traits::network::{BroadcastDelay, ResponseMessage}; use std::time::Duration; use url::Url; @@ -340,6 +344,8 @@ mod test { /// url_sender appropriately. #[async_std::test] async fn test_cdn_receive_messages_task() { + let upgrade_lock = UpgradeLock::::new(); + let test_hotshot_message_serialized = { let test_url = Url::parse("http://localhost:8080/").unwrap(); @@ -354,7 +360,7 @@ mod test { kind: MessageKind::External(external_message_encoded), }; - hotshot_types::message::VersionedMessage::serialize(&test_message, &None).unwrap() + upgrade_lock.serialize(&test_message).await.unwrap() }; let (url_sender, url_receiver) = mpsc::channel(1); @@ -431,15 +437,15 @@ mod test { /// This really shouldn't happen in practice. #[async_std::test] async fn test_cdn_receive_messages_task_fails_unexpected_hotshot_message_variant() { + let upgrade_lock = UpgradeLock::::new(); let (url_sender, url_receiver) = mpsc::channel(1); - let bytes = VersionedMessage::serialize( - &Message:: { + let bytes = upgrade_lock + .serialize(&Message:: { sender: BLSPubKey::generated_from_seed_indexed([0; 32], 0).0, kind: MessageKind::Data(DataMessage::DataResponse(ResponseMessage::NotFound)), - }, - &None, - ) - .unwrap(); + }) + .await + .unwrap(); let task = CdnReceiveMessagesTask::new(TestConnectedNetworkConsumer(Ok(vec![bytes])), url_sender); @@ -462,15 +468,15 @@ mod test { /// it encounters an error from the deserialization of the external message. #[async_std::test] async fn test_cdn_receive_messages_task_fails_decoding_external_message() { + let upgrade_lock = UpgradeLock::::new(); let (url_sender, url_receiver) = mpsc::channel(1); - let bytes = VersionedMessage::serialize( - &Message:: { + let bytes = upgrade_lock + .serialize(&Message:: { sender: BLSPubKey::generated_from_seed_indexed([0; 32], 0).0, kind: MessageKind::External(vec![0]), - }, - &None, - ) - .unwrap(); + }) + .await + .unwrap(); let task = CdnReceiveMessagesTask::new(TestConnectedNetworkConsumer(Ok(vec![bytes])), url_sender); @@ -495,6 +501,7 @@ mod test { /// really have a point in existing. #[async_std::test] async fn test_cdn_receive_messages_tasks_exits_when_url_receiver_closed() { + let upgrade_lock = UpgradeLock::::new(); let (url_sender, url_receiver) = mpsc::channel(1); let test_hotshot_message_serialized = { @@ -511,7 +518,7 @@ mod test { kind: MessageKind::External(external_message_encoded), }; - hotshot_types::message::VersionedMessage::serialize(&test_message, &None).unwrap() + upgrade_lock.serialize(&test_message).await.unwrap() }; drop(url_receiver); @@ -554,6 +561,7 @@ mod test { /// beyond it's initial request. #[async_std::test] async fn test_cdn_broadcast_roll_call_task() { + let upgrade_lock = UpgradeLock::::new(); let (message_sender, message_receiver) = mpsc::channel(1); let task = BroadcastRollCallTask::new( @@ -563,9 +571,10 @@ mod test { let mut message_receiver = message_receiver; let next_message = message_receiver.next().await.unwrap(); - let next_message = - as VersionedMessage>::deserialize(&next_message, &None) - .unwrap(); + let next_message = upgrade_lock + .deserialize::>(&next_message) + .await + .unwrap(); let external_message = match next_message.kind { MessageKind::External(external_message) => external_message, diff --git a/node-metrics/src/service/data_state/mod.rs b/node-metrics/src/service/data_state/mod.rs index 3a4dea838..20668150f 100644 --- a/node-metrics/src/service/data_state/mod.rs +++ b/node-metrics/src/service/data_state/mod.rs @@ -774,9 +774,6 @@ mod tests { assert_eq!(data_state.node_identity().last(), Some(&node_identity_2)); } - // We explicitly drop these, as it should make the task clean up. - drop(node_identity_sender_1); - if let Some(process_node_identity_task_handle) = process_node_identity_task_handle.task_handle.take() { diff --git a/sequencer/src/api.rs b/sequencer/src/api.rs index 5f1a2098a..20d6b46d9 100644 --- a/sequencer/src/api.rs +++ b/sequencer/src/api.rs @@ -9,7 +9,7 @@ use data_source::{CatchupDataSource, SubmitDataSource}; use derivative::Derivative; use espresso_types::{ v0::traits::SequencerPersistence, v0_3::ChainConfig, AccountQueryData, BlockMerkleTree, - FeeAccountProof, NodeState, PubKey, Transaction, + FeeAccountProof, NodeState, PubKey, SequencerVersions, Transaction, }; use ethers::prelude::Address; use futures::{ @@ -24,7 +24,9 @@ use hotshot_orchestrator::config::NetworkConfig; 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, traits::network::ConnectedNetwork, + data::ViewNumber, + light_client::StateSignatureRequestBody, + traits::{network::ConnectedNetwork, node_implementation::Versions}, }; use jf_merkle_tree::MerkleTreeScheme; use vbs::version::StaticVersionType; @@ -47,6 +49,8 @@ pub use options::Options; pub type BlocksFrontier = ::MembershipProof; type BoxLazy = Pin>>>; +type HotshotSystemContextHandle = + Arc>>; #[derive(Derivative)] #[derivative(Debug(bound = ""))] @@ -58,7 +62,7 @@ struct ConsensusState, P: SequencerPersistence, Ver: config: NetworkConfig, #[derivative(Debug = "ignore")] - handle: Arc>>>, + handle: HotshotSystemContextHandle>, } impl, P: SequencerPersistence, Ver: StaticVersionType + 'static> @@ -110,7 +114,9 @@ impl, P: SequencerPersistence, Ver: StaticVersionTyp &self.consensus.as_ref().get().await.get_ref().event_streamer } - async fn consensus(&self) -> Arc>>> { + async fn consensus( + &self, + ) -> Arc, SequencerVersions>>> { Arc::clone(&self.consensus.as_ref().get().await.get_ref().handle) } @@ -388,7 +394,7 @@ pub mod test_helpers { use espresso_types::{ mock::MockStateCatchup, v0::traits::{PersistenceOptions, StateCatchup}, - NamespaceId, ValidatedState, + NamespaceId, SequencerVersions, ValidatedState, }; use ethers::{prelude::Address, utils::Anvil}; use futures::{ @@ -397,7 +403,7 @@ pub mod test_helpers { }; use hotshot::types::{Event, EventType}; use hotshot_contract_adapter::light_client::ParsedLightClientState; - use hotshot_types::traits::node_implementation::NodeType; + use hotshot_types::{ event::LeafInfo, traits::{metrics::NoMetrics, node_implementation::ConsensusTime}, @@ -644,7 +650,7 @@ pub mod test_helpers { let port = pick_unused_port().expect("No ports free"); let url = format!("http://localhost:{port}").parse().unwrap(); - let client: Client::Base> = Client::new(url); + let client: Client::Base> = Client::new(url); let options = opt(Options::with_port(port).status(Default::default())); let anvil = Anvil::new().spawn(); @@ -654,7 +660,8 @@ pub mod test_helpers { .api_config(options) .network_config(network_config) .build(); - let _network = TestNetwork::new(config, ::Base::instance()).await; + let _network = + TestNetwork::new(config, ::Base::instance()).await; client.connect(None).await; // The status API is well tested in the query service repo. Here we are just smoke testing @@ -696,7 +703,7 @@ pub mod test_helpers { let port = pick_unused_port().expect("No ports free"); let url = format!("http://localhost:{port}").parse().unwrap(); - let client: Client::Base> = Client::new(url); + let client: Client::Base> = Client::new(url); let options = opt(Options::with_port(port).submit(Default::default())); let anvil = Anvil::new().spawn(); @@ -706,7 +713,8 @@ pub mod test_helpers { .api_config(options) .network_config(network_config) .build(); - let network = TestNetwork::new(config, ::Base::instance()).await; + let network = + TestNetwork::new(config, ::Base::instance()).await; let mut events = network.server.event_stream().await; client.connect(None).await; @@ -731,7 +739,7 @@ pub mod test_helpers { let port = pick_unused_port().expect("No ports free"); let url = format!("http://localhost:{port}").parse().unwrap(); - let client: Client::Base> = Client::new(url); + let client: Client::Base> = Client::new(url); let options = opt(Options::with_port(port)); let anvil = Anvil::new().spawn(); @@ -741,7 +749,8 @@ pub mod test_helpers { .api_config(options) .network_config(network_config) .build(); - let network = TestNetwork::new(config, ::Base::instance()).await; + let network = + TestNetwork::new(config, ::Base::instance()).await; let mut height: u64; // Wait for block >=2 appears @@ -773,7 +782,7 @@ pub mod test_helpers { let port = pick_unused_port().expect("No ports free"); let url = format!("http://localhost:{port}").parse().unwrap(); - let client: Client::Base> = Client::new(url); + let client: Client::Base> = Client::new(url); let options = opt(Options::with_port(port).catchup(Default::default())); let anvil = Anvil::new().spawn(); @@ -783,7 +792,8 @@ pub mod test_helpers { .api_config(options) .network_config(network_config) .build(); - let network = TestNetwork::new(config, ::Base::instance()).await; + let network = + TestNetwork::new(config, ::Base::instance()).await; client.connect(None).await; // Wait for a few blocks to be decided. @@ -864,11 +874,11 @@ mod api_tests { use data_source::testing::TestableSequencerDataSource; use endpoints::NamespaceProofQueryData; - use espresso_types::{Header, NamespaceId}; + use espresso_types::{Header, NamespaceId, SequencerVersions}; use ethers::utils::Anvil; use futures::stream::StreamExt; use hotshot_query_service::availability::{LeafQueryData, VidCommonQueryData}; - use hotshot_types::traits::node_implementation::NodeType; + use portpicker::pick_unused_port; use sequencer_utils::test_utils::setup_test; use surf_disco::Client; @@ -918,11 +928,12 @@ mod api_tests { .api_config(D::options(&storage, Options::with_port(port)).submit(Default::default())) .network_config(network_config) .build(); - let network = TestNetwork::new(config, ::Base::instance()).await; + let network = + TestNetwork::new(config, ::Base::instance()).await; let mut events = network.server.event_stream().await; // Connect client. - let client: Client::Base> = + let client: Client::Base> = Client::new(format!("http://localhost:{port}").parse().unwrap()); client.connect(None).await; @@ -1021,7 +1032,7 @@ mod api_tests { events_service_port: hotshot_event_streaming_port, }; - let client: Client::Base> = Client::new(url); + let client: Client::Base> = Client::new(url); let options = Options::with_port(query_service_port).hotshot_events(hotshot_events); @@ -1032,7 +1043,8 @@ mod api_tests { .api_config(options) .network_config(network_config) .build(); - let _network = TestNetwork::new(config, ::Base::instance()).await; + let _network = + TestNetwork::new(config, ::Base::instance()).await; let mut subscribed_events = client .socket("hotshot-events/events") @@ -1069,8 +1081,8 @@ mod test { use espresso_types::{ mock::MockStateCatchup, v0_1::{UpgradeMode, ViewBasedUpgrade}, - FeeAccount, FeeAmount, Header, TimeBasedUpgrade, Timestamp, Upgrade, UpgradeType, - ValidatedState, + FeeAccount, FeeAmount, Header, SequencerVersions, TimeBasedUpgrade, Timestamp, Upgrade, + UpgradeType, ValidatedState, }; use ethers::utils::Anvil; use futures::{ @@ -1084,10 +1096,7 @@ mod test { }; use hotshot_types::{ event::LeafInfo, - traits::{ - metrics::NoMetrics, - node_implementation::{ConsensusTime, NodeType}, - }, + traits::{metrics::NoMetrics, node_implementation::ConsensusTime}, ValidatorConfig, }; use jf_merkle_tree::prelude::{MerkleProof, Sha3Node}; @@ -1118,7 +1127,7 @@ mod test { let port = pick_unused_port().expect("No ports free"); let url = format!("http://localhost:{port}").parse().unwrap(); - let client: Client::Base> = Client::new(url); + let client: Client::Base> = Client::new(url); let options = Options::with_port(port); let anvil = Anvil::new().spawn(); let l1 = anvil.endpoint().parse().unwrap(); @@ -1127,7 +1136,8 @@ mod test { .api_config(options) .network_config(network_config) .build(); - let _network = TestNetwork::new(config, ::Base::instance()).await; + let _network = + TestNetwork::new(config, ::Base::instance()).await; client.connect(None).await; let health = client.get::("healthcheck").send().await.unwrap(); @@ -1175,9 +1185,10 @@ mod test { .api_config(options) .network_config(network_config) .build(); - let mut network = TestNetwork::new(config, ::Base::instance()).await; + let mut network = + TestNetwork::new(config, ::Base::instance()).await; let url = format!("http://localhost:{port}").parse().unwrap(); - let client: Client::Base> = Client::new(url); + let client: Client::Base> = Client::new(url); client.connect(None).await; @@ -1240,13 +1251,14 @@ mod test { .api_config(Options::with_port(port).catchup(Default::default())) .network_config(TestConfigBuilder::default().l1_url(l1).build()) .catchups(std::array::from_fn(|_| { - StatePeers::<::Base>::from_urls( + StatePeers::<::Base>::from_urls( vec![format!("http://localhost:{port}").parse().unwrap()], Default::default(), ) })) .build(); - let mut network = TestNetwork::new(config, ::Base::instance()).await; + let mut network = + TestNetwork::new(config, ::Base::instance()).await; // Wait for replica 0 to reach a (non-genesis) decide, before disconnecting it. let mut events = network.peers[0].event_stream().await; @@ -1284,13 +1296,13 @@ mod test { 1, ValidatedState::default(), no_storage::Options, - StatePeers::<::Base>::from_urls( + StatePeers::<::Base>::from_urls( vec![format!("http://localhost:{port}").parse().unwrap()], Default::default(), ), &NoMetrics, test_helpers::STAKE_TABLE_CAPACITY_FOR_TEST, - ::Base::instance(), + ::Base::instance(), Default::default(), ) .await; @@ -1347,7 +1359,7 @@ mod test { .api_config(Options::with_port(port).catchup(Default::default())) .states(states) .catchups(std::array::from_fn(|_| { - StatePeers::<::Base>::from_urls( + StatePeers::<::Base>::from_urls( vec![format!("http://localhost:{port}").parse().unwrap()], Default::default(), ) @@ -1355,7 +1367,8 @@ mod test { .network_config(TestConfigBuilder::default().l1_url(l1).build()) .build(); - let mut network = TestNetwork::new(config, ::Base::instance()).await; + let mut network = + TestNetwork::new(config, ::Base::instance()).await; // Wait for few blocks to be decided. network @@ -1424,7 +1437,7 @@ mod test { ) .states(states) .catchups(std::array::from_fn(|_| { - StatePeers::<::Base>::from_urls( + StatePeers::<::Base>::from_urls( vec![format!("http://localhost:{port}").parse().unwrap()], Default::default(), ) @@ -1432,7 +1445,8 @@ mod test { .network_config(TestConfigBuilder::default().l1_url(l1).build()) .build(); - let mut network = TestNetwork::new(config, ::Base::instance()).await; + let mut network = + TestNetwork::new(config, ::Base::instance()).await; // Wait for a few blocks to be decided. network @@ -1494,7 +1508,7 @@ mod test { let mut upgrades = std::collections::BTreeMap::new(); upgrades.insert( - ::Upgrade::VERSION, + ::Upgrade::VERSION, Upgrade { mode, upgrade_type: UpgradeType::Fee { @@ -1516,7 +1530,7 @@ mod test { .status(Default::default()), ) .catchups(std::array::from_fn(|_| { - StatePeers::<::Base>::from_urls( + StatePeers::<::Base>::from_urls( vec![format!("http://localhost:{port}").parse().unwrap()], Default::default(), ) @@ -1529,7 +1543,8 @@ mod test { ) .build(); - let mut network = TestNetwork::new(config, ::Base::instance()).await; + let mut network = + TestNetwork::new(config, ::Base::instance()).await; let mut events = network.server.event_stream().await; loop { @@ -1539,14 +1554,17 @@ mod test { EventType::UpgradeProposal { proposal, .. } => { let upgrade = proposal.data.upgrade_proposal; let new_version = upgrade.new_version; - assert_eq!(new_version, ::Upgrade::VERSION); + assert_eq!( + new_version, + ::Upgrade::VERSION + ); break; } _ => continue, } } - let client: Client::Base> = + let client: Client::Base> = Client::new(format!("http://localhost:{port}").parse().unwrap()); client.connect(None).await; tracing::info!(port, "server running"); @@ -1604,10 +1622,11 @@ mod test { .persistences(persistence) .network_config(TestConfigBuilder::default().l1_url(l1).build()) .build(); - let mut network = TestNetwork::new(config, ::Base::instance()).await; + let mut network = + TestNetwork::new(config, ::Base::instance()).await; // Connect client. - let client: Client::Base> = + let client: Client::Base> = Client::new(format!("http://localhost:{port}").parse().unwrap()); client.connect(None).await; tracing::info!(port, "server running"); @@ -1674,15 +1693,16 @@ mod test { // Catchup using node 0 as a peer. Node 0 was running the archival state service // before the restart, so it should be able to resume without catching up by loading // state from storage. - StatePeers::<::Base>::from_urls( + StatePeers::<::Base>::from_urls( vec![format!("http://localhost:{port}").parse().unwrap()], Default::default(), ) })) .network_config(TestConfigBuilder::default().l1_url(l1).build()) .build(); - let _network = TestNetwork::new(config, ::Base::instance()).await; - let client: Client::Base> = + let _network = + TestNetwork::new(config, ::Base::instance()).await; + let client: Client::Base> = Client::new(format!("http://localhost:{port}").parse().unwrap()); client.connect(None).await; tracing::info!(port, "server running"); @@ -1723,7 +1743,8 @@ mod test { let port = pick_unused_port().expect("No ports free"); let url: surf_disco::Url = format!("http://localhost:{port}").parse().unwrap(); - let client: Client::Base> = Client::new(url.clone()); + let client: Client::Base> = + Client::new(url.clone()); let options = Options::with_port(port).config(Default::default()); let anvil = Anvil::new().spawn(); @@ -1733,12 +1754,13 @@ mod test { .api_config(options) .network_config(network_config) .build(); - let network = TestNetwork::new(config, ::Base::instance()).await; + let network = + TestNetwork::new(config, ::Base::instance()).await; client.connect(None).await; // Fetch a network config from the API server. The first peer URL is bogus, to test the // failure/retry case. - let peers = StatePeers::<::Base>::from_urls( + let peers = StatePeers::<::Base>::from_urls( vec!["https://notarealnode.network".parse().unwrap(), url], Default::default(), ); diff --git a/sequencer/src/api/options.rs b/sequencer/src/api/options.rs index c3bd7da20..7ccaf05be 100644 --- a/sequencer/src/api/options.rs +++ b/sequencer/src/api/options.rs @@ -181,23 +181,11 @@ impl Options { // we handle the two cases differently. let metrics = if let Some(query_opt) = self.query.take() { if let Some(opt) = self.storage_sql.take() { - self.init_with_query_module_sql::( - query_opt, - opt, - state, - &mut tasks, - bind_version, - ) - .await? + self.init_with_query_module_sql(query_opt, opt, state, &mut tasks, bind_version) + .await? } else if let Some(opt) = self.storage_fs.take() { - self.init_with_query_module_fs::( - query_opt, - opt, - state, - &mut tasks, - bind_version, - ) - .await? + self.init_with_query_module_fs(query_opt, opt, state, &mut tasks, bind_version) + .await? } else { bail!("query module requested but not storage provided"); } diff --git a/sequencer/src/bin/commitment-task.rs b/sequencer/src/bin/commitment-task.rs index b62443cf4..3cfd16977 100644 --- a/sequencer/src/bin/commitment-task.rs +++ b/sequencer/src/bin/commitment-task.rs @@ -2,10 +2,10 @@ use std::{io, time::Duration}; use async_std::task::spawn; use clap::Parser; -use espresso_types::{parse_duration, SeqTypes}; +use espresso_types::{parse_duration, SequencerVersions}; use ethers::prelude::*; use futures::FutureExt; -use hotshot_types::traits::node_implementation::NodeType; +use hotshot_types::traits::node_implementation::Versions; use sequencer::hotshot_commitment::{run_hotshot_commitment_task, CommitmentTaskOptions}; use sequencer_utils::logging; use tide_disco::{error::ServerError, Api}; @@ -69,7 +69,7 @@ async fn main() { start_http_server( port, opt.hotshot_address, - ::Base::instance(), + ::Base::instance(), ) .unwrap(); } @@ -85,7 +85,8 @@ async fn main() { query_service_url: Some(opt.sequencer_url), }; tracing::info!("Launching HotShot commitment task.."); - run_hotshot_commitment_task::<::Base>(&hotshot_contract_options).await; + run_hotshot_commitment_task::<::Base>(&hotshot_contract_options) + .await; } fn start_http_server( @@ -114,8 +115,8 @@ fn start_http_server( #[cfg(test)] mod test { - use espresso_types::SeqTypes; - use hotshot_types::traits::node_implementation::NodeType; + use espresso_types::SequencerVersions; + use hotshot_types::traits::node_implementation::Versions; use portpicker::pick_unused_port; use sequencer_utils::test_utils::setup_test; use surf_disco::Client; @@ -134,11 +135,11 @@ mod test { start_http_server( port, expected_addr, - ::Base::instance(), + ::Base::instance(), ) .expect("Failed to start the server"); - let client: Client::Base> = + let client: Client::Base> = Client::new(format!("http://localhost:{port}").parse().unwrap()); client.connect(None).await; diff --git a/sequencer/src/bin/espresso-bridge.rs b/sequencer/src/bin/espresso-bridge.rs index feea5b7b8..2ecdda578 100644 --- a/sequencer/src/bin/espresso-bridge.rs +++ b/sequencer/src/bin/espresso-bridge.rs @@ -5,7 +5,7 @@ use async_std::{sync::Arc, task::sleep}; use clap::{Parser, Subcommand}; use contract_bindings::fee_contract::FeeContract; use espresso_types::{ - eth_signature_key::EthKeyPair, FeeAccount, FeeAmount, FeeMerkleTree, Header, SeqTypes, + eth_signature_key::EthKeyPair, FeeAccount, FeeAmount, FeeMerkleTree, Header, SequencerVersions, }; use ethers::{ middleware::{Middleware, SignerMiddleware}, @@ -13,7 +13,7 @@ use ethers::{ types::{Address, BlockId, U256}, }; use futures::stream::StreamExt; -use hotshot_types::traits::node_implementation::NodeType; +use hotshot_types::traits::node_implementation::Versions; use jf_merkle_tree::{ prelude::{MerkleProof, Sha3Node}, MerkleTreeScheme, @@ -21,7 +21,7 @@ use jf_merkle_tree::{ use sequencer_utils::logging; use surf_disco::{error::ClientError, Url}; -type EspressoClient = surf_disco::Client::Base>; +type EspressoClient = surf_disco::Client::Base>; type FeeMerkleProof = MerkleProof; diff --git a/sequencer/src/bin/espresso-dev-node.rs b/sequencer/src/bin/espresso-dev-node.rs index 3fe2cf927..7a5dee494 100644 --- a/sequencer/src/bin/espresso-dev-node.rs +++ b/sequencer/src/bin/espresso-dev-node.rs @@ -4,7 +4,7 @@ use async_std::task::spawn; use async_trait::async_trait; use clap::Parser; use contract_bindings::light_client_mock::LightClientMock; -use espresso_types::{parse_duration, SeqTypes}; +use espresso_types::{parse_duration, SequencerVersions}; use ethers::{ middleware::{MiddlewareBuilder, SignerMiddleware}, providers::{Http, Middleware, Provider}, @@ -16,7 +16,7 @@ use hotshot_state_prover::service::{ one_honest_threshold, run_prover_service_with_stake_table, StateProverConfig, }; use hotshot_types::traits::{ - node_implementation::NodeType, + node_implementation::Versions, stake_table::{SnapshotVersion, StakeTableScheme}, }; use portpicker::pick_unused_port; @@ -190,7 +190,7 @@ async fn main() -> anyhow::Result<()> { .network_config(network_config) .build(); - let network = TestNetwork::new(config, ::Base::instance()).await; + let network = TestNetwork::new(config, ::Base::instance()).await; let st = network.cfg.stake_table(); let total_stake = st.total_stake(SnapshotVersion::LastEpochStart).unwrap(); let config = network.cfg.hotshot_config(); @@ -288,7 +288,7 @@ async fn main() -> anyhow::Result<()> { let prover_handle = spawn(run_prover_service_with_stake_table( prover_config, - ::Base::instance(), + ::Base::instance(), Arc::new(st.clone()), )); handles.push(prover_handle); @@ -301,7 +301,7 @@ async fn main() -> anyhow::Result<()> { format!("http://0.0.0.0:{relay_server_port}") .parse() .unwrap(), - ::Base::instance(), + ::Base::instance(), ) .await; @@ -340,7 +340,7 @@ async fn main() -> anyhow::Result<()> { dev_node_port, mock_contracts, dev_info, - ::Base::instance(), + ::Base::instance(), )); handles.push(dev_node_handle); @@ -503,14 +503,14 @@ mod tests { use committable::{Commitment, Committable}; use contract_bindings::light_client::LightClient; use escargot::CargoBuild; - use espresso_types::{BlockMerkleTree, Header, SeqTypes, Transaction}; + use espresso_types::{BlockMerkleTree, Header, SeqTypes, SequencerVersions, Transaction}; use ethers::{providers::Middleware, types::U256}; use futures::TryStreamExt; use hotshot_query_service::{ availability::{BlockQueryData, TransactionQueryData, VidCommonQueryData}, data_source::sql::testing::TmpDb, }; - use hotshot_types::traits::node_implementation::NodeType; + use hotshot_types::traits::node_implementation::Versions; use jf_merkle_tree::MerkleTreeScheme; use portpicker::pick_unused_port; use rand::Rng; @@ -581,7 +581,7 @@ mod tests { let process = BackgroundProcess(process); - let api_client: Client::Base> = + let api_client: Client::Base> = Client::new(format!("http://localhost:{api_port}").parse().unwrap()); api_client.connect(None).await; @@ -755,7 +755,7 @@ mod tests { } } - let dev_node_client: Client::Base> = + let dev_node_client: Client::Base> = Client::new(format!("http://localhost:{dev_node_port}").parse().unwrap()); dev_node_client.connect(None).await; @@ -899,7 +899,7 @@ mod tests { let process = BackgroundProcess(process); - let api_client: Client::Base> = + let api_client: Client::Base> = Client::new(format!("http://localhost:{api_port}").parse().unwrap()); api_client.connect(None).await; @@ -914,7 +914,7 @@ mod tests { .await .unwrap(); - let dev_node_client: Client::Base> = + let dev_node_client: Client::Base> = Client::new(format!("http://localhost:{dev_node_port}").parse().unwrap()); dev_node_client.connect(None).await; diff --git a/sequencer/src/bin/nasty-client.rs b/sequencer/src/bin/nasty-client.rs index 5f0f27116..e60decc67 100644 --- a/sequencer/src/bin/nasty-client.rs +++ b/sequencer/src/bin/nasty-client.rs @@ -22,6 +22,7 @@ use committable::Committable; use derivative::Derivative; use espresso_types::{ parse_duration, v0_3::IterableFeeInfo, BlockMerkleTree, FeeMerkleTree, Header, SeqTypes, + SequencerVersions, }; use futures::{ future::{FutureExt, TryFuture, TryFutureExt}, @@ -34,7 +35,7 @@ use hotshot_query_service::{ }; use hotshot_types::traits::{ metrics::{Counter, Gauge, Histogram, Metrics as _}, - node_implementation::NodeType, + node_implementation::Versions, }; use jf_merkle_tree::{ ForgetableMerkleTreeScheme, MerkleCommitment, MerkleTreeScheme, UniversalMerkleTreeScheme, @@ -405,7 +406,7 @@ impl Queryable for PayloadQueryData { } type Connection = - socket::Connection::Base>; + socket::Connection::Base>; #[derive(Derivative)] #[derivative(Debug)] @@ -418,7 +419,7 @@ struct Subscription { #[derive(Debug)] struct ResourceManager { - client: surf_disco::Client::Base>, + client: surf_disco::Client::Base>, open_streams: BTreeMap>, next_stream_id: u64, metrics: Arc, @@ -1263,7 +1264,7 @@ async fn serve(port: u16, metrics: PrometheusMetrics) { METHOD = "METRICS" }; let mut app = App::<_, ServerError>::with_state(RwLock::new(metrics)); - app.module::::Base>("status", api) + app.module::::Base>("status", api) .unwrap() .metrics("metrics", |_req, state| { async move { Ok(Cow::Borrowed(state)) }.boxed() @@ -1272,7 +1273,7 @@ async fn serve(port: u16, metrics: PrometheusMetrics) { if let Err(err) = app .serve( format!("0.0.0.0:{port}"), - ::Base::instance(), + ::Base::instance(), ) .await { diff --git a/sequencer/src/bin/state-relay-server.rs b/sequencer/src/bin/state-relay-server.rs index d5fa61c73..da5ad7ca9 100644 --- a/sequencer/src/bin/state-relay-server.rs +++ b/sequencer/src/bin/state-relay-server.rs @@ -1,8 +1,8 @@ use clap::Parser; -use espresso_types::SeqTypes; +use espresso_types::SequencerVersions; use ethers::types::U256; use hotshot_state_prover::service::one_honest_threshold; -use hotshot_types::traits::node_implementation::NodeType; +use hotshot_types::traits::node_implementation::Versions; use sequencer::state_signature::relay_server::run_relay_server; use sequencer_utils::logging; use vbs::version::StaticVersionType; @@ -47,7 +47,7 @@ async fn main() { None, threshold, format!("http://0.0.0.0:{}", args.port).parse().unwrap(), - ::Base::instance(), + ::Base::instance(), ) .await .unwrap(); diff --git a/sequencer/src/bin/submit-transactions.rs b/sequencer/src/bin/submit-transactions.rs index 0eecb4045..04fb5dae2 100644 --- a/sequencer/src/bin/submit-transactions.rs +++ b/sequencer/src/bin/submit-transactions.rs @@ -8,14 +8,14 @@ use std::{ use async_std::task::{sleep, spawn}; use clap::Parser; use committable::{Commitment, Committable}; -use espresso_types::{parse_duration, parse_size, SeqTypes, Transaction}; +use espresso_types::{parse_duration, parse_size, SeqTypes, SequencerVersions, Transaction}; use futures::{ channel::mpsc::{self, Sender}, sink::SinkExt, stream::StreamExt, }; use hotshot_query_service::{availability::BlockQueryData, types::HeightIndexed, Error}; -use hotshot_types::traits::node_implementation::NodeType; +use hotshot_types::traits::node_implementation::Versions; use rand::{Rng, RngCore, SeedableRng}; use rand_chacha::ChaChaRng; use rand_distr::Distribution; @@ -174,7 +174,7 @@ async fn main() { let mut rng = ChaChaRng::seed_from_u64(seed); // Subscribe to block stream so we can check that our transactions are getting sequenced. - let client = Client::::Base>::new(opt.url.clone()); + let client = Client::::Base>::new(opt.url.clone()); let block_height: usize = client.get("status/block-height").send().await.unwrap(); let mut blocks = client .socket(&format!("availability/stream/blocks/{}", block_height - 1)) @@ -189,13 +189,16 @@ async fn main() { opt.clone(), sender.clone(), ChaChaRng::from_rng(&mut rng).unwrap(), - ::Base::instance(), + ::Base::instance(), )); } // Start healthcheck endpoint once tasks are running. if let Some(port) = opt.port { - spawn(server(port, ::Base::instance())); + spawn(server( + port, + ::Base::instance(), + )); } // Keep track of the results. diff --git a/sequencer/src/bin/verify-headers.rs b/sequencer/src/bin/verify-headers.rs index 98600a2a3..dd06f8605 100644 --- a/sequencer/src/bin/verify-headers.rs +++ b/sequencer/src/bin/verify-headers.rs @@ -4,10 +4,10 @@ use std::{cmp::max, process::exit, time::Duration}; use async_std::{sync::Arc, task::sleep}; use clap::Parser; -use espresso_types::{Header, L1BlockInfo, SeqTypes}; +use espresso_types::{Header, L1BlockInfo, SequencerVersions}; use ethers::prelude::*; use futures::future::join_all; -use hotshot_types::traits::node_implementation::NodeType; +use hotshot_types::traits::node_implementation::Versions; use itertools::Itertools; use sequencer_utils::logging; use surf_disco::Url; @@ -170,9 +170,8 @@ async fn main() { let opt = Arc::new(Options::parse()); opt.logging.init(); - let seq = Arc::new(SequencerClient::<::Base>::new( - opt.url.clone(), - )); + let seq = + Arc::new(SequencerClient::<::Base>::new(opt.url.clone())); let block_height: usize = seq.get("status/latest_block_height").send().await.unwrap(); let from = opt.from.unwrap_or(0); diff --git a/sequencer/src/context.rs b/sequencer/src/context.rs index 0964c25ed..7d353ff48 100644 --- a/sequencer/src/context.rs +++ b/sequencer/src/context.rs @@ -7,7 +7,8 @@ use async_std::{ }; use derivative::Derivative; use espresso_types::{ - v0::traits::SequencerPersistence, NodeState, PubKey, Transaction, ValidatedState, + v0::traits::SequencerPersistence, NodeState, PubKey, SequencerVersions, Transaction, + ValidatedState, }; use futures::{ future::{join_all, Future}, @@ -40,7 +41,7 @@ use crate::{ static_stake_table_commitment, Node, SeqTypes, }; /// The consensus handle -pub type Consensus = SystemContextHandle>; +pub type Consensus = SystemContextHandle, SequencerVersions>; /// The sequencer context contains a consensus handle and other sequencer specific information. #[derive(Derivative)] @@ -166,6 +167,7 @@ impl, P: SequencerPersistence, Ver: StaticVersionTyp // Create the external event handler let external_event_handler = ExternalEventHandler::new(network, roll_call_info, pub_key) + .await .with_context(|| "Failed to create external event handler")?; Ok(Self::new( @@ -350,7 +352,10 @@ async fn handle_events( // Handle external messages if let EventType::ExternalMessageReceived(external_message_bytes) = &event.event { - if let Err(err) = external_event_handler.handle_event(external_message_bytes) { + if let Err(err) = external_event_handler + .handle_event(external_message_bytes) + .await + { tracing::warn!("Failed to handle external message: {:?}", err); }; } diff --git a/sequencer/src/external_event_handler.rs b/sequencer/src/external_event_handler.rs index 5fa177da0..05f707310 100644 --- a/sequencer/src/external_event_handler.rs +++ b/sequencer/src/external_event_handler.rs @@ -3,10 +3,10 @@ use crate::context::TaskList; use anyhow::{Context, Result}; use async_compatibility_layer::channel::{Receiver, Sender}; -use espresso_types::{PubKey, SeqTypes}; +use espresso_types::{PubKey, SeqTypes, SequencerVersions}; use hotshot::types::{BLSPubKey, Message}; use hotshot_types::{ - message::{MessageKind, VersionedMessage}, + message::{MessageKind, UpgradeLock}, traits::network::{BroadcastDelay, ConnectedNetwork, Topic}, }; use serde::{Deserialize, Serialize}; @@ -56,7 +56,7 @@ pub enum OutboundMessage { impl ExternalEventHandler { /// Creates a new `ExternalEventHandler` with the given network and roll call info - pub fn new>( + pub async fn new>( network: Arc, roll_call_info: RollCallInfo, public_key: BLSPubKey, @@ -77,6 +77,7 @@ impl ExternalEventHandler { if roll_call_info.public_api_url.is_some() { let roll_call_message_bytes = Self::create_roll_call_response(&public_key, &roll_call_info) + .await .with_context(|| "Failed to create roll call response for initial broadcast")?; outbound_message_sender @@ -96,7 +97,7 @@ impl ExternalEventHandler { /// /// # Errors /// If the message type is unknown or if there is an error serializing or deserializing the message - pub fn handle_event(&self, external_message_bytes: &[u8]) -> Result<()> { + pub async fn handle_event(&self, external_message_bytes: &[u8]) -> Result<()> { // Deserialize the external message let external_message = bincode::deserialize(external_message_bytes) .with_context(|| "Failed to deserialize external message")?; @@ -111,6 +112,7 @@ impl ExternalEventHandler { let response_bytes = Self::create_roll_call_response(&self.public_key, &self.roll_call_info) + .await .with_context(|| { "Failed to serialize roll call response for RollCallRequest" })?; @@ -129,7 +131,7 @@ impl ExternalEventHandler { } /// Creates a roll call response message - fn create_roll_call_response( + async fn create_roll_call_response( public_key: &BLSPubKey, roll_call_info: &RollCallInfo, ) -> Result> { @@ -144,9 +146,12 @@ impl ExternalEventHandler { kind: MessageKind::::External(response_bytes), }; - let response_bytes = - as VersionedMessage>::serialize(&message, &None) - .with_context(|| "Failed to serialize roll call response")?; + let upgrade_lock = UpgradeLock::::new(); + + let response_bytes = upgrade_lock + .serialize(&message) + .await + .with_context(|| "Failed to serialize roll call response")?; Ok(response_bytes) } diff --git a/sequencer/src/lib.rs b/sequencer/src/lib.rs index 2a3374edf..b62e635ec 100644 --- a/sequencer/src/lib.rs +++ b/sequencer/src/lib.rs @@ -15,8 +15,8 @@ use async_std::sync::RwLock; use catchup::StatePeers; use context::SequencerContext; use espresso_types::{ - BackoffParams, L1Client, NodeState, PubKey, SeqTypes, SolverAuctionResultsProvider, - ValidatedState, + BackoffParams, L1Client, NodeState, PubKey, SeqTypes, SequencerVersions, + SolverAuctionResultsProvider, ValidatedState, }; use ethers::types::U256; #[cfg(feature = "libp2p")] @@ -59,7 +59,7 @@ use hotshot_types::{ traits::{ metrics::Metrics, network::{ConnectedNetwork, Topic}, - node_implementation::{NodeImplementation, NodeType}, + node_implementation::{NodeImplementation, NodeType, Versions}, signature_key::{BuilderSignatureKey, StakeTableEntryType}, }, utils::BuilderCommitment, @@ -274,7 +274,7 @@ pub async fn init_node( if let Some(upgrade) = genesis .upgrades - .get(&::Upgrade::VERSION) + .get(&::Upgrade::VERSION) { upgrade.set_hotshot_config_parameters(&mut config.config); } @@ -519,7 +519,10 @@ pub mod testing { } pub fn build(mut self) -> TestConfig { - if let Some(upgrade) = self.upgrades.get(&::Upgrade::VERSION) { + if let Some(upgrade) = self + .upgrades + .get(&::Upgrade::VERSION) + { upgrade.set_hotshot_config_parameters(&mut self.config) } @@ -830,7 +833,7 @@ mod test { #[async_std::test] async fn test_skeleton_instantiation() { setup_test(); - let ver = ::Base::instance(); + let ver = ::Base::instance(); // Assign `config` so it isn't dropped early. let anvil = AnvilOptions::default().spawn().await; let url = anvil.url(); @@ -872,7 +875,7 @@ mod test { setup_test(); let success_height = 30; - let ver = ::Base::instance(); + let ver = ::Base::instance(); // Assign `config` so it isn't dropped early. let anvil = AnvilOptions::default().spawn().await; let url = anvil.url(); diff --git a/sequencer/src/main.rs b/sequencer/src/main.rs index 0d927f7fb..61317c688 100644 --- a/sequencer/src/main.rs +++ b/sequencer/src/main.rs @@ -1,10 +1,10 @@ use std::{net::ToSocketAddrs, sync::Arc}; use clap::Parser; -use espresso_types::{SeqTypes, SolverAuctionResultsProvider}; +use espresso_types::{SequencerVersions, SolverAuctionResultsProvider}; use futures::future::FutureExt; use hotshot::MarketplaceConfig; -use hotshot_types::traits::{metrics::NoMetrics, node_implementation::NodeType}; +use hotshot_types::traits::{metrics::NoMetrics, node_implementation::Versions}; use sequencer::{ api::{self, data_source::DataSourceOptions}, init_node, @@ -26,7 +26,7 @@ async fn main() -> anyhow::Result<()> { modules, opt, storage, - ::Base::instance(), + ::Base::instance(), ) .await } else if let Some(storage) = modules.storage_sql.take() { @@ -34,7 +34,7 @@ async fn main() -> anyhow::Result<()> { modules, opt, storage, - ::Base::instance(), + ::Base::instance(), ) .await } else { @@ -43,7 +43,7 @@ async fn main() -> anyhow::Result<()> { modules, opt, persistence::fs::Options::default(), - ::Base::instance(), + ::Base::instance(), ) .await } @@ -191,11 +191,8 @@ mod test { use async_std::task::spawn; - use espresso_types::{PubKey, SeqTypes}; - use hotshot_types::{ - light_client::StateKeyPair, - traits::{node_implementation::NodeType, signature_key::SignatureKey}, - }; + use espresso_types::PubKey; + use hotshot_types::{light_client::StateKeyPair, traits::signature_key::SignatureKey}; use portpicker::pick_unused_port; use sequencer::{ api::options::{Http, Status}, @@ -253,7 +250,7 @@ mod test { modules, opt, fs::Options::new(tmp.path().into()), - ::Base::instance(), + ::Base::instance(), ) .await { @@ -265,7 +262,7 @@ mod test { // orchestrator. tracing::info!("waiting for API to start"); let url: Url = format!("http://localhost:{port}").parse().unwrap(); - let client = Client::::Base>::new(url.clone()); + let client = Client::::Base>::new(url.clone()); assert!(client.connect(Some(Duration::from_secs(60))).await); client.get::<()>("healthcheck").send().await.unwrap(); diff --git a/sequencer/src/message_compat_tests.rs b/sequencer/src/message_compat_tests.rs old mode 100644 new mode 100755 index 85cf2e54d..bd0dc2544 --- a/sequencer/src/message_compat_tests.rs +++ b/sequencer/src/message_compat_tests.rs @@ -17,7 +17,7 @@ use std::path::Path; use committable::Committable; -use espresso_types::{Leaf, NodeState, PubKey, SeqTypes, ValidatedState}; +use espresso_types::{Leaf, NodeState, PubKey, SequencerVersions, ValidatedState}; use hotshot::traits::election::static_committee::GeneralStaticCommittee; use hotshot_types::{ data::{ @@ -38,7 +38,7 @@ use hotshot_types::{ ViewSyncFinalizeVote, ViewSyncPreCommitData, ViewSyncPreCommitVote, }, traits::{ - node_implementation::{ConsensusTime, NodeType}, + node_implementation::{ConsensusTime, Versions}, signature_key::SignatureKey, BlockPayload, EncodeBytes, }, @@ -49,7 +49,7 @@ use pretty_assertions::assert_eq; use serde_json::Value; use vbs::{version::Version, BinarySerializer}; -type Serializer = vbs::Serializer<::Base>; +type Serializer = vbs::Serializer<::Base>; #[async_std::test] #[cfg(feature = "testing")] diff --git a/types/src/v0/impls/auction.rs b/types/src/v0/impls/auction.rs index ac6ae11b1..28491a7cc 100644 --- a/types/src/v0/impls/auction.rs +++ b/types/src/v0/impls/auction.rs @@ -2,7 +2,7 @@ use super::state::ValidatedState; use crate::{ eth_signature_key::{EthKeyPair, SigningError}, v0_3::{BidTx, BidTxBody, FullNetworkTx, SolverAuctionResults}, - FeeAccount, FeeAmount, FeeError, FeeInfo, NamespaceId, SeqTypes, + FeeAccount, FeeAmount, FeeError, FeeInfo, NamespaceId, SequencerVersions, }; use anyhow::Context; use async_trait::async_trait; @@ -11,7 +11,7 @@ use hotshot_types::{ data::ViewNumber, traits::{ auction_results_provider::AuctionResultsProvider, - node_implementation::{ConsensusTime, HasUrls, NodeType}, + node_implementation::{ConsensusTime, HasUrls, NodeType, Versions}, signature_key::BuilderSignatureKey, }, }; @@ -279,7 +279,7 @@ impl HasUrls for SolverAuctionResults { } } -type SurfClient = surf_disco::Client::Base>; +type SurfClient = surf_disco::Client::Base>; #[derive(Debug, Clone, Eq, PartialEq, Hash)] /// Auction Results provider holding the Url of the solver in order to fetch auction results. diff --git a/types/src/v0/impls/header.rs b/types/src/v0/impls/header.rs index ad427d6b2..3edb6b270 100644 --- a/types/src/v0/impls/header.rs +++ b/types/src/v0/impls/header.rs @@ -3,10 +3,9 @@ use ark_serialize::CanonicalSerialize; use committable::{Commitment, Committable, RawCommitmentBuilder}; use hotshot_query_service::{availability::QueryableHeader, explorer::ExplorerHeader}; use hotshot_types::{ - constants::MarketplaceVersion, traits::{ block_contents::{BlockHeader, BuilderFee}, - node_implementation::NodeType, + node_implementation::{NodeType, Versions}, signature_key::BuilderSignatureKey, BlockPayload, ValidatedState as _, }, @@ -29,7 +28,8 @@ use crate::{ v0_1, v0_2, v0_3::{self, ChainConfig, IterableFeeInfo, SolverAuctionResults}, BlockMerkleCommitment, BuilderSignature, FeeAccount, FeeAmount, FeeInfo, FeeMerkleCommitment, - Header, L1BlockInfo, L1Snapshot, Leaf, NamespaceId, NsTable, SeqTypes, UpgradeType, + Header, L1BlockInfo, L1Snapshot, Leaf, NamespaceId, NsTable, SeqTypes, SequencerVersions, + UpgradeType, }; use super::{instance_state::NodeState, state::ValidatedState}; @@ -425,7 +425,7 @@ impl Header { fee_amount, } in &builder_fee { - if version < MarketplaceVersion::VERSION { + if version < ::Marketplace::version() { ensure!( fee_account.validate_fee_signature( fee_signature, diff --git a/types/src/v0/impls/instance_state.rs b/types/src/v0/impls/instance_state.rs index 9b121b033..ad66d4a7c 100644 --- a/types/src/v0/impls/instance_state.rs +++ b/types/src/v0/impls/instance_state.rs @@ -1,8 +1,10 @@ +use crate::SequencerVersions; use crate::{ v0::traits::StateCatchup, v0_3::ChainConfig, GenesisHeader, L1BlockInfo, L1Client, PubKey, - SeqTypes, Timestamp, Upgrade, UpgradeMode, + Timestamp, Upgrade, UpgradeMode, }; -use hotshot_types::traits::{node_implementation::NodeType, states::InstanceState}; +use hotshot_types::traits::node_implementation::Versions; +use hotshot_types::traits::states::InstanceState; use hotshot_types::HotShotConfig; use std::{collections::BTreeMap, sync::Arc}; use vbs::version::{StaticVersionType, Version}; @@ -59,7 +61,7 @@ impl NodeState { }, l1_genesis: None, upgrades: Default::default(), - current_version: ::Base::version(), + current_version: ::Base::version(), } } diff --git a/types/src/v0/mod.rs b/types/src/v0/mod.rs index f9218e5e7..57582eeca 100644 --- a/types/src/v0/mod.rs +++ b/types/src/v0/mod.rs @@ -2,7 +2,10 @@ use hotshot::traits::election::static_committee::GeneralStaticCommittee; use hotshot_types::{ data::ViewNumber, signature_key::BLSPubKey, - traits::{node_implementation::NodeType, signature_key::SignatureKey}, + traits::{ + node_implementation::{NodeType, Versions}, + signature_key::SignatureKey, + }, }; use serde::{Deserialize, Serialize}; @@ -130,14 +133,22 @@ impl NodeType for SeqTypes { type ValidatedState = ValidatedState; type Membership = GeneralStaticCommittee; type BuilderSignatureKey = FeeAccount; + type AuctionResult = SolverAuctionResults; +} +#[derive(Clone, Debug, Copy)] +pub struct SequencerVersions {} + +impl Versions for SequencerVersions { type Base = StaticVersion<0, 1>; type Upgrade = StaticVersion<0, 2>; - type AuctionResult = SolverAuctionResults; 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, ]; + + type Marketplace = StaticVersion<0, 3>; } + pub type Leaf = hotshot_types::data::Leaf; pub type Event = hotshot::types::Event;