From c0675720b6a412dfad1ca58e77af7d72e23aff69 Mon Sep 17 00:00:00 2001 From: Abdul Basit Date: Tue, 28 May 2024 10:05:39 +0500 Subject: [PATCH 1/9] add ResolvableChainConfig to ValidatedState --- Cargo.lock | 730 +++++++++++++--------- Cargo.toml | 20 +- builder/src/bin/permissionless-builder.rs | 6 + builder/src/lib.rs | 6 +- builder/src/non_permissioned.rs | 11 +- builder/src/permissioned.rs | 17 +- sequencer/src/block.rs | 20 +- sequencer/src/block/payload.rs | 33 +- sequencer/src/block/queryable.rs | 4 +- sequencer/src/header.rs | 15 +- sequencer/src/hotshot_commitment.rs | 20 +- sequencer/src/lib.rs | 6 +- sequencer/src/message_compat_tests.rs | 24 +- sequencer/src/persistence.rs | 15 +- sequencer/src/reference_tests.rs | 2 +- sequencer/src/state.rs | 34 +- 16 files changed, 580 insertions(+), 383 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 58a9c12f22..a061cb018a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -221,9 +221,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.83" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "arbitrary" @@ -541,8 +541,24 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" dependencies = [ - "asn1-rs-derive", - "asn1-rs-impl", + "asn1-rs-derive 0.4.0", + "asn1-rs-impl 0.1.0", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror", + "time 0.3.36", +] + +[[package]] +name = "asn1-rs" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ad1373757efa0f70ec53939aabc7152e1591cb485208052993070ac8d2429d" +dependencies = [ + "asn1-rs-derive 0.5.0", + "asn1-rs-impl 0.2.0", "displaydoc", "nom", "num-traits", @@ -563,6 +579,18 @@ dependencies = [ "synstructure 0.12.6", ] +[[package]] +name = "asn1-rs-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7378575ff571966e99a744addeff0bff98b8ada0dedf1956d59e634db95eaac1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", + "synstructure 0.13.1", +] + [[package]] name = "asn1-rs-impl" version = "0.1.0" @@ -574,6 +602,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "asn1-rs-impl" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "asn1_der" version = "0.7.6" @@ -615,12 +654,11 @@ dependencies = [ [[package]] name = "async-channel" -version = "2.2.1" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136d4d23bcc79e27423727b36823d86233aad06dfea531837b038394d11e9928" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" dependencies = [ "concurrent-queue", - "event-listener 5.3.0", "event-listener-strategy 0.5.2", "futures-core", "pin-project-lite 0.2.14", @@ -658,9 +696,9 @@ dependencies = [ [[package]] name = "async-executor" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b10202063978b3351199d68f8b22c4e47e4b1b822f8d43fd862d5ea8c006b29a" +checksum = "c8828ec6e544c02b0d6691d21ed9f9218d0384a82542855073c2a3f58304aaf0" dependencies = [ "async-task", "concurrent-queue", @@ -687,7 +725,7 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" dependencies = [ - "async-channel 2.2.1", + "async-channel 2.3.1", "async-executor", "async-io 2.3.2", "async-lock 3.3.0", @@ -913,7 +951,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -943,7 +981,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -1046,7 +1084,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -1063,7 +1101,7 @@ checksum = "edf3ee19dbc0a46d740f6f0926bde8c50f02bdbc7b536842da28f6ac56513a8b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -1281,12 +1319,11 @@ dependencies = [ [[package]] name = "blocking" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "495f7104e962b7356f0aeb34247aca1fe7d2e783b346582db7f2904cb5717e88" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" dependencies = [ - "async-channel 2.2.1", - "async-lock 3.3.0", + "async-channel 2.3.1", "async-task", "futures-io", "futures-lite 2.3.0", @@ -1346,7 +1383,7 @@ dependencies = [ "rand 0.8.5", "sequencer", "serde", - "snafu 0.8.2", + "snafu 0.8.3", "surf", "surf-disco", "tagged-base64", @@ -1440,18 +1477,18 @@ dependencies = [ [[package]] name = "camino" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239" dependencies = [ "serde", ] [[package]] name = "capnp" -version = "0.19.3" +version = "0.19.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b11832e6fb7a695c4a63cc42bd97bd2cda7165cd850caf5aff9a3d0e617720ed" +checksum = "3aed85272154b3c0bfda873c40395f13adcfbc89696bf639a512291077f8cd17" dependencies = [ "embedded-io", ] @@ -1482,7 +1519,7 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver 1.0.22", + "semver 1.0.23", "serde", "serde_json", "thiserror", @@ -1499,9 +1536,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.97" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" dependencies = [ "jobserver", "libc", @@ -1579,7 +1616,7 @@ dependencies = [ "num_enum", "pem 3.0.4", "prometheus", - "quinn", + "quinn 0.10.2", "rand 0.8.5", "rcgen 0.12.1", "redis", @@ -1677,7 +1714,7 @@ dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.1", + "strsim", ] [[package]] @@ -1689,7 +1726,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -1889,9 +1926,9 @@ dependencies = [ [[package]] name = "const-hex" -version = "1.11.3" +version = "1.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ba00838774b4ab0233e355d26710fbfc8327a05c017f6dc4873f876d1f79f78" +checksum = "70ff96486ccc291d36a958107caf2c0af8c78c0af7d31ae2f35ce055130de1a6" dependencies = [ "cfg-if", "cpufeatures", @@ -2047,18 +2084,18 @@ checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] name = "crc32fast" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-channel" -version = "0.5.12" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ "crossbeam-utils", ] @@ -2093,9 +2130,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crunchy" @@ -2252,7 +2289,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -2294,15 +2331,15 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", "synstructure 0.13.1", ] [[package]] name = "darling" -version = "0.20.8" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" +checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" dependencies = [ "darling_core", "darling_macro", @@ -2310,27 +2347,27 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.8" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" +checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim 0.10.0", - "syn 2.0.60", + "strsim", + "syn 2.0.66", ] [[package]] name = "darling_macro" -version = "0.20.8" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" +checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -2389,7 +2426,21 @@ version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" dependencies = [ - "asn1-rs", + "asn1-rs 0.5.2", + "displaydoc", + "nom", + "num-bigint", + "num-traits", + "rusticata-macros", +] + +[[package]] +name = "der-parser" +version = "9.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cd0a5c643689626bec213c4d8bd4d96acc8ffdb4ad4bb6bc16abf27d5f4b553" +dependencies = [ + "asn1-rs 0.6.1", "displaydoc", "nom", "num-bigint", @@ -2426,7 +2477,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -2447,7 +2498,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -2457,7 +2508,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" dependencies = [ "derive_builder_core", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -2607,7 +2658,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -2707,9 +2758,9 @@ checksum = "bbbaaaf38131deb9ca518a274a45bfdb8771f139517b073b16c2d3d32ae5037b" [[package]] name = "either" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" dependencies = [ "serde", ] @@ -2784,7 +2835,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -2795,18 +2846,19 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "erased-serde" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b73807008a3c7f171cc40312f37d95ef0396e048b5848d775f54b1a4dd4a0d3" +checksum = "24e2389d65ab4fab27dc2a5de7b191e1f6617d1f1c8855c0dc569c94a4cbb18d" dependencies = [ "serde", + "typeid", ] [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -2987,7 +3039,7 @@ dependencies = [ "reqwest 0.11.27", "serde", "serde_json", - "syn 2.0.60", + "syn 2.0.66", "toml", "walkdir", ] @@ -3005,7 +3057,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -3031,7 +3083,7 @@ dependencies = [ "serde", "serde_json", "strum", - "syn 2.0.60", + "syn 2.0.66", "tempfile", "thiserror", "tiny-keccak", @@ -3048,7 +3100,7 @@ dependencies = [ "ethers-core", "ethers-solc", "reqwest 0.11.27", - "semver 1.0.22", + "semver 1.0.23", "serde", "serde_json", "thiserror", @@ -3157,7 +3209,7 @@ dependencies = [ "path-slash", "rayon", "regex", - "semver 1.0.22", + "semver 1.0.23", "serde", "serde_json", "solang-parser", @@ -3272,15 +3324,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38793c55593b33412e3ae40c2c9781ffaa6f438f6f8c10f24e71846fbd7ae01e" - -[[package]] -name = "finl_unicode" -version = "1.2.0" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] name = "fixed-hash" @@ -3495,7 +3541,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -3508,6 +3554,17 @@ dependencies = [ "rustls 0.21.12", ] +[[package]] +name = "futures-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f2f12607f92c69b12ed746fabf9ca4f5c482cba46679c1a75b874ed7c26adb" +dependencies = [ + "futures-io", + "rustls 0.23.8", + "rustls-pki-types", +] + [[package]] name = "futures-sink" version = "0.3.30" @@ -3691,15 +3748,15 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "816ec7294445779408f36fe57bc5b7fc1cf59664059096c65f905c1c61f58069" +checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" dependencies = [ + "atomic-waker", "bytes 1.6.0", "fnv", "futures-core", "futures-sink", - "futures-util", "http 1.1.0", "indexmap 2.2.6", "slab", @@ -3958,7 +4015,7 @@ dependencies = [ [[package]] name = "hotshot" version = "0.5.43" -source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.55#81842b54a699a255645ac195354a0feb08fdc9d6" +source = "git+https://github.com/EspressoSystems/hotshot?branch=abdul/pass-validated-state#e15ab38bf381a9687c09699a946a8583fe30c9ca" dependencies = [ "anyhow", "async-broadcast", @@ -3992,7 +4049,7 @@ dependencies = [ "rand 0.8.5", "serde", "sha2 0.10.8", - "snafu 0.8.2", + "snafu 0.8.3", "surf-disco", "time 0.3.36", "tokio", @@ -4003,7 +4060,7 @@ dependencies = [ [[package]] name = "hotshot-builder-api" version = "0.1.7" -source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.55#81842b54a699a255645ac195354a0feb08fdc9d6" +source = "git+https://github.com/EspressoSystems/hotshot?branch=abdul/pass-validated-state#e15ab38bf381a9687c09699a946a8583fe30c9ca" dependencies = [ "async-trait", "clap", @@ -4012,7 +4069,7 @@ dependencies = [ "futures", "hotshot-types", "serde", - "snafu 0.8.2", + "snafu 0.8.3", "tagged-base64", "tide-disco", "toml", @@ -4022,7 +4079,7 @@ dependencies = [ [[package]] name = "hotshot-builder-core" version = "0.1.21" -source = "git+https://github.com/EspressoSystems/hotshot-builder-core?tag=0.1.23#978778b3852d57f0239cdb448a097845e67024a6" +source = "git+https://github.com/EspressoSystems/hotshot-builder-core?branch=abdul/update-hotshot#86db8fad09399489b002c3023d741fa09314f9b3" dependencies = [ "anyhow", "async-broadcast", @@ -4040,7 +4097,7 @@ dependencies = [ "hotshot-types", "serde", "sha2 0.10.8", - "snafu 0.8.2", + "snafu 0.8.3", "surf-disco", "tagged-base64", "tide-disco", @@ -4075,7 +4132,7 @@ dependencies = [ [[package]] name = "hotshot-events-service" version = "0.1.22" -source = "git+https://github.com/EspressoSystems/hotshot-events-service.git?tag=0.1.23#7049c81d8e697894803ea76e7128d0aca7fa47c9" +source = "git+https://github.com/EspressoSystems/hotshot-events-service.git?branch=abdul/update-hotshot#ef524944a9ef7c1b037d907ad9db70411e33936a" dependencies = [ "async-broadcast", "async-compatibility-layer", @@ -4089,7 +4146,7 @@ dependencies = [ "futures", "hotshot-types", "serde", - "snafu 0.8.2", + "snafu 0.8.3", "tagged-base64", "tide-disco", "toml", @@ -4100,7 +4157,7 @@ dependencies = [ [[package]] name = "hotshot-example-types" version = "0.5.43" -source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.55#81842b54a699a255645ac195354a0feb08fdc9d6" +source = "git+https://github.com/EspressoSystems/hotshot?branch=abdul/pass-validated-state#e15ab38bf381a9687c09699a946a8583fe30c9ca" dependencies = [ "anyhow", "async-broadcast", @@ -4121,7 +4178,7 @@ dependencies = [ "serde", "sha2 0.10.8", "sha3", - "snafu 0.8.2", + "snafu 0.8.3", "time 0.3.36", "tokio", "tracing", @@ -4131,18 +4188,18 @@ dependencies = [ [[package]] name = "hotshot-macros" version = "0.5.43" -source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.55#81842b54a699a255645ac195354a0feb08fdc9d6" +source = "git+https://github.com/EspressoSystems/hotshot?branch=abdul/pass-validated-state#e15ab38bf381a9687c09699a946a8583fe30c9ca" dependencies = [ "derive_builder", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] name = "hotshot-orchestrator" version = "0.5.43" -source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.55#81842b54a699a255645ac195354a0feb08fdc9d6" +source = "git+https://github.com/EspressoSystems/hotshot?branch=abdul/pass-validated-state#e15ab38bf381a9687c09699a946a8583fe30c9ca" dependencies = [ "anyhow", "async-compatibility-layer", @@ -4171,7 +4228,7 @@ dependencies = [ [[package]] name = "hotshot-query-service" version = "0.1.23" -source = "git+https://github.com/EspressoSystems/hotshot-query-service?tag=0.1.25#337df31f577acdc5ecf9e628d1bfa1644b8ce6aa" +source = "git+https://github.com/EspressoSystems/hotshot-query-service?branch=abdul/update-hotshot#9e392475b3efaf50c8e6a0f76b98db19acbc583d" dependencies = [ "anyhow", "ark-serialize", @@ -4205,7 +4262,7 @@ dependencies = [ "refinery", "serde", "serde_json", - "snafu 0.8.2", + "snafu 0.8.3", "spin_sleep", "surf-disco", "tagged-base64", @@ -4224,7 +4281,7 @@ dependencies = [ [[package]] name = "hotshot-stake-table" version = "0.5.43" -source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.55#81842b54a699a255645ac195354a0feb08fdc9d6" +source = "git+https://github.com/EspressoSystems/hotshot?branch=abdul/pass-validated-state#e15ab38bf381a9687c09699a946a8583fe30c9ca" dependencies = [ "ark-bn254", "ark-ed-on-bn254", @@ -4281,7 +4338,7 @@ dependencies = [ "rand_chacha 0.3.1", "sequencer-utils", "serde", - "snafu 0.8.2", + "snafu 0.8.3", "surf-disco", "tagged-base64", "tide-disco", @@ -4295,7 +4352,7 @@ dependencies = [ [[package]] name = "hotshot-task" version = "0.5.43" -source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.55#81842b54a699a255645ac195354a0feb08fdc9d6" +source = "git+https://github.com/EspressoSystems/hotshot?branch=abdul/pass-validated-state#e15ab38bf381a9687c09699a946a8583fe30c9ca" dependencies = [ "async-broadcast", "async-compatibility-layer", @@ -4308,7 +4365,7 @@ dependencies = [ [[package]] name = "hotshot-task-impls" version = "0.5.43" -source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.55#81842b54a699a255645ac195354a0feb08fdc9d6" +source = "git+https://github.com/EspressoSystems/hotshot?branch=abdul/pass-validated-state#e15ab38bf381a9687c09699a946a8583fe30c9ca" dependencies = [ "anyhow", "async-broadcast", @@ -4331,7 +4388,7 @@ dependencies = [ "rand 0.8.5", "serde", "sha2 0.10.8", - "snafu 0.8.2", + "snafu 0.8.3", "surf-disco", "tagged-base64", "time 0.3.36", @@ -4343,7 +4400,7 @@ dependencies = [ [[package]] name = "hotshot-testing" version = "0.5.43" -source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.55#81842b54a699a255645ac195354a0feb08fdc9d6" +source = "git+https://github.com/EspressoSystems/hotshot?branch=abdul/pass-validated-state#e15ab38bf381a9687c09699a946a8583fe30c9ca" dependencies = [ "async-broadcast", "async-compatibility-layer", @@ -4372,7 +4429,7 @@ dependencies = [ "serde", "sha2 0.10.8", "sha3", - "snafu 0.8.2", + "snafu 0.8.3", "tagged-base64", "tide-disco", "tokio", @@ -4383,7 +4440,7 @@ dependencies = [ [[package]] name = "hotshot-types" version = "0.1.11" -source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.55#81842b54a699a255645ac195354a0feb08fdc9d6" +source = "git+https://github.com/EspressoSystems/hotshot?branch=abdul/pass-validated-state#e15ab38bf381a9687c09699a946a8583fe30c9ca" dependencies = [ "anyhow", "ark-bls12-381", @@ -4423,7 +4480,7 @@ dependencies = [ "rand_chacha 0.3.1", "serde", "sha2 0.10.8", - "snafu 0.8.2", + "snafu 0.8.3", "tagged-base64", "time 0.3.36", "tokio", @@ -4576,7 +4633,7 @@ dependencies = [ "bytes 1.6.0", "futures-channel", "futures-util", - "h2 0.4.4", + "h2 0.4.5", "http 1.1.0", "http-body 1.0.0", "httparse", @@ -4631,9 +4688,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" +checksum = "3d8d52be92d09acc2e01dddb7fde3ad983fc6489c7db4837e605bc3fca4cb63e" dependencies = [ "bytes 1.6.0", "futures-channel", @@ -4660,7 +4717,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core", + "windows-core 0.52.0", ] [[package]] @@ -4858,9 +4915,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", ] @@ -5317,9 +5374,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.154" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libm" @@ -5646,7 +5703,7 @@ dependencies = [ [[package]] name = "libp2p-networking" version = "0.5.43" -source = "git+https://github.com/EspressoSystems/hotshot?tag=0.5.55#81842b54a699a255645ac195354a0feb08fdc9d6" +source = "git+https://github.com/EspressoSystems/hotshot?branch=abdul/pass-validated-state#e15ab38bf381a9687c09699a946a8583fe30c9ca" dependencies = [ "anyhow", "async-compatibility-layer", @@ -5667,7 +5724,7 @@ dependencies = [ "serde", "serde_bytes", "serde_json", - "snafu 0.8.2", + "snafu 0.8.3", "tokio", "tokio-stream", "tracing", @@ -5751,9 +5808,9 @@ dependencies = [ [[package]] name = "libp2p-quic" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0375cdfee57b47b313ef1f0fdb625b78aed770d33a40cf1c294a371ff5e6666" +checksum = "c67296ad4e092e23f92aea3d2bdb6f24eab79c0929ed816dfb460ea2f4567d2b" dependencies = [ "async-std", "bytes 1.6.0", @@ -5764,10 +5821,10 @@ dependencies = [ "libp2p-identity", "libp2p-tls", "parking_lot", - "quinn", + "quinn 0.11.1", "rand 0.8.5", - "ring 0.16.20", - "rustls 0.21.12", + "ring 0.17.8", + "rustls 0.23.8", "socket2 0.5.7", "thiserror", "tokio", @@ -5879,7 +5936,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -5902,20 +5959,20 @@ dependencies = [ [[package]] name = "libp2p-tls" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ce7e3c2e7569d685d08ec795157981722ff96e9e9f9eae75df3c29d02b07a5" +checksum = "251b17aebdd29df7e8f80e4d94b782fae42e934c49086e1a81ba23b60a8314f2" dependencies = [ "futures", - "futures-rustls", + "futures-rustls 0.26.0", "libp2p-core", "libp2p-identity", "rcgen 0.11.3", - "ring 0.16.20", - "rustls 0.21.12", + "ring 0.17.8", + "rustls 0.23.8", "rustls-webpki 0.101.7", "thiserror", - "x509-parser", + "x509-parser 0.16.0", "yasna", ] @@ -5954,7 +6011,7 @@ checksum = "f4846d51afd08180e164291c3754ba30dd4fbac6fac65571be56403c16431a5e" dependencies = [ "either", "futures", - "futures-rustls", + "futures-rustls 0.24.0", "libp2p-core", "libp2p-identity", "parking_lot", @@ -6052,9 +6109,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.16" +version = "1.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e143b5e666b2695d28f6bca6497720813f699c9602dd7f5cac91008b8ada7f9" +checksum = "c15da26e5af7e25c90b37a2d75cdbf940cf4a55316de9d84c679c9b8bfabf82e" dependencies = [ "cc", "libc", @@ -6076,9 +6133,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "local-ip-address" @@ -6190,7 +6247,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -6268,9 +6325,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ "adler", ] @@ -6358,11 +6415,10 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ - "lazy_static", "libc", "log", "openssl", @@ -6511,11 +6567,10 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" dependencies = [ - "autocfg", "num-integer", "num-traits", ] @@ -6551,7 +6606,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -6609,10 +6664,10 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -6639,7 +6694,16 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" dependencies = [ - "asn1-rs", + "asn1-rs 0.5.2", +] + +[[package]] +name = "oid-registry" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c958dd45046245b9c3c2547369bb634eb461670b2e7e0de552905801a648d1d" +dependencies = [ + "asn1-rs 0.6.1", ] [[package]] @@ -6702,7 +6766,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -6753,9 +6817,9 @@ checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" [[package]] name = "parity-scale-codec" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" +checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" dependencies = [ "arrayvec", "bitvec", @@ -6767,11 +6831,11 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" +checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ - "proc-macro-crate 2.0.0", + "proc-macro-crate", "proc-macro2", "quote", "syn 1.0.109", @@ -6785,9 +6849,9 @@ checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -6819,9 +6883,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "path-slash" @@ -6922,7 +6986,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -6938,9 +7002,9 @@ dependencies = [ [[package]] name = "petgraph" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", "indexmap 2.2.6", @@ -6986,7 +7050,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -7024,7 +7088,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -7053,9 +7117,9 @@ checksum = "d15b6607fa632996eb8a17c9041cb6071cb75ac057abd45dece578723ea8c7c0" [[package]] name = "piper" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +checksum = "464db0c665917b13ebb5d453ccdec4add5658ee1adc7affc7677615356a8afaf" dependencies = [ "atomic-waker", "fastrand 2.1.0", @@ -7245,12 +7309,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.19" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ac2cf0f2e4f42b49f5ffd07dae8d746508ef7526c13940e5f524012ae6c6550" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -7267,25 +7331,6 @@ dependencies = [ "uint", ] -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit 0.19.15", -] - -[[package]] -name = "proc-macro-crate" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" -dependencies = [ - "toml_edit 0.20.7", -] - [[package]] name = "proc-macro-crate" version = "3.1.0" @@ -7326,9 +7371,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.81" +version = "1.0.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" +checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" dependencies = [ "unicode-ident", ] @@ -7368,7 +7413,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -7389,9 +7434,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.12.4" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0f5d036824e4761737860779c906171497f6d55681139d8312388f8fe398922" +checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" dependencies = [ "bytes 1.6.0", "prost-derive", @@ -7399,22 +7444,22 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.12.4" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19de2de2a00075bf566bee3bd4db014b11587e84184d3f7a791bc17f1a8e9e48" +checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", - "itertools 0.12.1", + "itertools 0.11.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] name = "prost-types" -version = "0.12.4" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3235c33eb02c1f1e212abdbe34c78b264b038fb58ca612664343271e36e55ffe" +checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" dependencies = [ "prost", ] @@ -7492,15 +7537,32 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" dependencies = [ - "async-io 1.13.0", + "bytes 1.6.0", + "pin-project-lite 0.2.14", + "quinn-proto 0.10.6", + "quinn-udp 0.4.1", + "rustc-hash", + "rustls 0.21.12", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904e3d3ba178131798c6d9375db2b13b34337d489b089fc5ba0825a2ff1bee73" +dependencies = [ + "async-io 2.3.2", "async-std", "bytes 1.6.0", "futures-io", "pin-project-lite 0.2.14", - "quinn-proto", - "quinn-udp", + "quinn-proto 0.11.2", + "quinn-udp 0.5.1", "rustc-hash", - "rustls 0.21.12", + "rustls 0.23.8", "thiserror", "tokio", "tracing", @@ -7523,6 +7585,23 @@ dependencies = [ "tracing", ] +[[package]] +name = "quinn-proto" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e974563a4b1c2206bbc61191ca4da9c22e4308b4c455e8906751cc7828393f08" +dependencies = [ + "bytes 1.6.0", + "rand 0.8.5", + "ring 0.17.8", + "rustc-hash", + "rustls 0.23.8", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + [[package]] name = "quinn-udp" version = "0.4.1" @@ -7536,6 +7615,19 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "quinn-udp" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4f0def2590301f4f667db5a77f9694fb004f82796dc1a8b1508fafa3d0e8b72" +dependencies = [ + "libc", + "once_cell", + "socket2 0.5.7", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -7682,7 +7774,7 @@ dependencies = [ "pem 3.0.4", "ring 0.17.8", "time 0.3.36", - "x509-parser", + "x509-parser 0.15.1", "yasna", ] @@ -7779,7 +7871,7 @@ dependencies = [ "quote", "refinery-core", "regex", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -7887,7 +7979,7 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "h2 0.4.4", + "h2 0.4.5", "http 1.1.0", "http-body 1.0.0", "http-body-util", @@ -8104,9 +8196,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -8135,7 +8227,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.22", + "semver 1.0.23", ] [[package]] @@ -8170,7 +8262,7 @@ dependencies = [ "bitflags 2.5.0", "errno", "libc", - "linux-raw-sys 0.4.13", + "linux-raw-sys 0.4.14", "windows-sys 0.52.0", ] @@ -8208,7 +8300,21 @@ dependencies = [ "log", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.3", + "rustls-webpki 0.102.4", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls" +version = "0.23.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79adb16721f56eb2d843e67676896a61ce7a0fa622dc18d3e372477a029d2740" +dependencies = [ + "once_cell", + "ring 0.17.8", + "rustls-pki-types", + "rustls-webpki 0.102.4", "subtle", "zeroize", ] @@ -8234,9 +8340,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.5.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beb461507cee2c2ff151784c52762cf4d9ff6a61f3e80968600ed24fa837fa54" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" [[package]] name = "rustls-webpki" @@ -8250,9 +8356,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.3" +version = "0.102.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3bce581c0dd41bce533ce695a1437fa16a7ab5ac3ccfa99fe1a620a7885eabf" +checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" dependencies = [ "ring 0.17.8", "rustls-pki-types", @@ -8261,9 +8367,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.15" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "rw-stream-sink" @@ -8278,9 +8384,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "salsa20" @@ -8302,9 +8408,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.11.2" +version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c453e59a955f81fb62ee5d596b450383d699f152d350e9d23a0db2adb78e4c0" +checksum = "eca070c12893629e2cc820a9761bedf6ce1dcddc9852984d1dc734b8bd9bd024" dependencies = [ "cfg-if", "derive_more", @@ -8314,11 +8420,11 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.11.2" +version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18cf6c6447f813ef19eb450e985bcce6705f9ce7660db221b59093d15c79c4b7" +checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate", "proc-macro2", "quote", "syn 1.0.109", @@ -8431,9 +8537,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ "serde", ] @@ -8518,7 +8624,7 @@ dependencies = [ "serde", "serde_json", "sha2 0.10.8", - "snafu 0.8.2", + "snafu 0.8.3", "strum", "surf-disco", "tagged-base64", @@ -8561,9 +8667,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.200" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddc6f9cc94d67c0e21aaf7eda3a010fd3af78ebf6e096aa6e2e13c79749cce4f" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] @@ -8590,13 +8696,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.200" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "856f046b9400cee3c8c94ed572ecdb752444c24528c035cd35882aad6f492bcb" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -8610,9 +8716,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.116" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", @@ -8632,9 +8738,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" dependencies = [ "serde", ] @@ -8678,7 +8784,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -8919,11 +9025,11 @@ dependencies = [ [[package]] name = "snafu" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75976f4748ab44f6e5332102be424e7c2dc18daeaf7e725f2040c3ebb133512e" +checksum = "418b8136fec49956eba89be7da2847ec1909df92a9ae4178b5ff0ff092c8d95e" dependencies = [ - "snafu-derive 0.8.2", + "snafu-derive 0.8.3", ] [[package]] @@ -8940,14 +9046,14 @@ dependencies = [ [[package]] name = "snafu-derive" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b19911debfb8c2fb1107bc6cb2d61868aaf53a988449213959bb1b5b1ed95f" +checksum = "1a4812a669da00d17d8266a0439eddcacbc88b17f732f927e52eeb9d196f7fb5" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -9347,21 +9453,15 @@ dependencies = [ [[package]] name = "stringprep" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb41d74e231a107a1b4ee36bd1214b11285b77768d2e3824aedafa988fd36ee6" +checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" dependencies = [ - "finl_unicode", "unicode-bidi", "unicode-normalization", + "unicode-properties", ] -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - [[package]] name = "strsim" version = "0.11.1" @@ -9387,7 +9487,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -9527,7 +9627,7 @@ dependencies = [ "hex", "once_cell", "reqwest 0.11.27", - "semver 1.0.22", + "semver 1.0.23", "serde", "serde_json", "sha2 0.10.8", @@ -9549,9 +9649,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.60" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ "proc-macro2", "quote", @@ -9584,7 +9684,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -9619,7 +9719,7 @@ dependencies = [ "base64 0.22.1", "crc-any", "serde", - "snafu 0.8.2", + "snafu 0.8.3", "tagged-base64-macros", "wasm-bindgen", ] @@ -9665,22 +9765,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.59" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.59" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -9753,14 +9853,14 @@ dependencies = [ "prometheus", "reqwest 0.12.4", "routefinder", - "semver 1.0.22", + "semver 1.0.23", "serde", "serde_json", "serde_with", "shellexpand", "signal-hook", "signal-hook-async-std", - "snafu 0.8.2", + "snafu 0.8.3", "strum", "strum_macros", "tagged-base64", @@ -9927,7 +10027,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -10028,47 +10128,25 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.12" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +checksum = "a4e43f8cc456c9704c851ae29c67e17ef65d2c30017c17a9765b89c382dc8bba" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.12", + "toml_edit 0.22.13", ] [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" dependencies = [ "serde", ] -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap 2.2.6", - "toml_datetime", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.20.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" -dependencies = [ - "indexmap 2.2.6", - "toml_datetime", - "winnow 0.5.40", -] - [[package]] name = "toml_edit" version = "0.21.1" @@ -10082,9 +10160,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.12" +version = "0.22.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef" +checksum = "c127785850e8c20836d49732ae6abfa47616e60bf9d9f57c43c250361a9db96c" dependencies = [ "indexmap 2.2.6", "serde", @@ -10172,7 +10250,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -10287,7 +10365,7 @@ checksum = "70977707304198400eb4835a78f6a9f928bf41bba420deb8fdb175cd965d77a7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -10337,6 +10415,12 @@ dependencies = [ "utf-8", ] +[[package]] +name = "typeid" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "059d83cc991e7a42fc37bd50941885db0888e34209f8cfd9aab07ddec03bc9cf" + [[package]] name = "typenum" version = "1.17.0" @@ -10397,6 +10481,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-properties" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4259d9d4425d9f0661581b804cb85fe66a4c631cadd8f490d1c13a35d5d9291" + [[package]] name = "unicode-segmentation" version = "1.11.0" @@ -10475,7 +10565,7 @@ dependencies = [ "once_cell", "rustls 0.22.4", "rustls-pki-types", - "rustls-webpki 0.102.3", + "rustls-webpki 0.102.4", "url", "webpki-roots 0.26.1", ] @@ -10613,9 +10703,9 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] name = "waker-fn" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" +checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" [[package]] name = "walkdir" @@ -10704,7 +10794,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", "wasm-bindgen-shared", ] @@ -10738,7 +10828,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -10857,7 +10947,7 @@ version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" dependencies = [ - "windows-core", + "windows-core 0.51.1", "windows-targets 0.48.5", ] @@ -10870,6 +10960,15 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.5", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -11093,18 +11192,35 @@ version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7069fba5b66b9193bd2c5d3d4ff12b839118f6bcbef5328efafafb5395cf63da" dependencies = [ - "asn1-rs", + "asn1-rs 0.5.2", "data-encoding", - "der-parser", + "der-parser 8.2.0", "lazy_static", "nom", - "oid-registry", + "oid-registry 0.6.1", "ring 0.16.20", "rusticata-macros", "thiserror", "time 0.3.36", ] +[[package]] +name = "x509-parser" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcbc162f30700d6f3f82a24bf7cc62ffe7caea42c0b2cba8bf7f3ae50cf51f69" +dependencies = [ + "asn1-rs 0.6.1", + "data-encoding", + "der-parser 9.0.0", + "lazy_static", + "nom", + "oid-registry 0.7.0", + "rusticata-macros", + "thiserror", + "time 0.3.36", +] + [[package]] name = "xml-rs" version = "0.8.20" @@ -11177,29 +11293,29 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.33" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "087eca3c1eaf8c47b94d02790dd086cd594b912d2043d4de4bfdd466b3befb7c" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.33" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f4b6c273f496d8fd4eaf18853e6b448760225dc030ff2c485a786859aea6393" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" dependencies = [ "zeroize_derive", ] @@ -11212,7 +11328,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 51d92963ed..8393963142 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,18 +46,18 @@ dotenvy = "0.15" ethers = { version = "2.0", features = ["solc"] } futures = "0.3" -hotshot = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.55" } +hotshot = { git = "https://github.com/EspressoSystems/hotshot", branch = "abdul/pass-validated-state" } # Hotshot imports -hotshot-builder-api = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.55" } -hotshot-builder-core = { git = "https://github.com/EspressoSystems/hotshot-builder-core", tag = "0.1.23" } -hotshot-events-service = { git = "https://github.com/EspressoSystems/hotshot-events-service.git", tag = "0.1.23" } -hotshot-orchestrator = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.55" } -hotshot-query-service = { git = "https://github.com/EspressoSystems/hotshot-query-service", tag = "0.1.25" } -hotshot-stake-table = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.55" } +hotshot-builder-api = { git = "https://github.com/EspressoSystems/HotShot.git", branch = "abdul/pass-validated-state" } +hotshot-builder-core = { git = "https://github.com/EspressoSystems/hotshot-builder-core", branch = "abdul/update-hotshot" } +hotshot-events-service = { git = "https://github.com/EspressoSystems/hotshot-events-service.git", branch = "abdul/update-hotshot" } +hotshot-orchestrator = { git = "https://github.com/EspressoSystems/hotshot", branch = "abdul/pass-validated-state" } +hotshot-query-service = { git = "https://github.com/EspressoSystems/hotshot-query-service", branch = "abdul/update-hotshot" } +hotshot-stake-table = { git = "https://github.com/EspressoSystems/hotshot", branch = "abdul/pass-validated-state" } hotshot-state-prover = { version = "0.1.0", path = "hotshot-state-prover" } -hotshot-task = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.55" } -hotshot-testing = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.55" } -hotshot-types = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.55" } +hotshot-task = { git = "https://github.com/EspressoSystems/hotshot", branch = "abdul/pass-validated-state" } +hotshot-testing = { git = "https://github.com/EspressoSystems/hotshot", branch = "abdul/pass-validated-state" } +hotshot-types = { git = "https://github.com/EspressoSystems/hotshot", branch = "abdul/pass-validated-state" } # Push CDN imports cdn-broker = { git = "https://github.com/EspressoSystems/Push-CDN", features = [ diff --git a/builder/src/bin/permissionless-builder.rs b/builder/src/bin/permissionless-builder.rs index 19c4a1e30b..45448f71af 100644 --- a/builder/src/bin/permissionless-builder.rs +++ b/builder/src/bin/permissionless-builder.rs @@ -4,6 +4,7 @@ use clap::Parser; use cld::ClDuration; use es_version::SEQUENCER_VERSION; use ethers::types::U256; +use hotshot::traits::ValidatedState; use hotshot_types::data::ViewNumber; use hotshot_types::traits::node_implementation::ConsensusTime; use sequencer::{eth_signature_key::EthKeyPair, options::parse_size, ChainConfig, L1Params}; @@ -131,6 +132,10 @@ async fn main() -> anyhow::Result<()> { let instance_state = build_instance_state(l1_params, opt.state_peers, chain_config, sequencer_version).unwrap(); + // ?? + + let validated_state = ValidatedState::genesis(&instance_state).0; + let api_response_timeout_duration = opt.max_api_timeout_duration; // make the txn timeout as 1/4 of the api_response_timeout_duration @@ -144,6 +149,7 @@ async fn main() -> anyhow::Result<()> { opt.channel_capacity, opt.node_count, instance_state, + validated_state, opt.hotshot_event_streaming_url, builder_server_url, api_response_timeout_duration, diff --git a/builder/src/lib.rs b/builder/src/lib.rs index 6263e4e736..c61a635b2d 100644 --- a/builder/src/lib.rs +++ b/builder/src/lib.rs @@ -555,6 +555,7 @@ pub mod testing { channel_capacity, node_count, node_state, + ValidatedState::default(), hotshot_events_streaming_api_url, hotshot_builder_api_url, Duration::from_millis(2000), @@ -619,6 +620,7 @@ pub mod testing { bootstrapped_view, channel_capacity, node_state, + ValidatedState::default(), hotshot_builder_api_url, Duration::from_millis(2000), 15, @@ -701,10 +703,12 @@ mod test { } let genesis_state = NodeState::mock(); + let validated_state = ValidatedState::default(); let mut parent = { // TODO refactor repeated code from other tests let (genesis_payload, genesis_ns_table) = - Payload::from_transactions([], &genesis_state) + Payload::from_transactions([], &validated_state, &genesis_state) + .await .expect("unable to create genesis payload"); let builder_commitment = genesis_payload.builder_commitment(&genesis_ns_table); let genesis_commitment = { diff --git a/builder/src/non_permissioned.rs b/builder/src/non_permissioned.rs index 86b3877f70..05bbea8cef 100644 --- a/builder/src/non_permissioned.rs +++ b/builder/src/non_permissioned.rs @@ -37,6 +37,7 @@ use hotshot_types::{ use sequencer::{ catchup::StatePeers, eth_signature_key::EthKeyPair, l1_client::L1Client, BuilderParams, ChainConfig, L1Params, NetworkParams, NodeState, Payload, PrivKey, PubKey, SeqTypes, + ValidatedState, }; use hotshot_events_service::{ @@ -82,6 +83,7 @@ impl BuilderConfig { channel_capacity: NonZeroUsize, node_count: NonZeroUsize, instance_state: NodeState, + validated_state: ValidatedState, hotshot_events_api_url: Url, hotshot_builder_apis_url: Url, max_api_timeout_duration: Duration, @@ -114,8 +116,10 @@ impl BuilderConfig { // builder api request channel let (req_sender, req_receiver) = broadcast::>(channel_capacity.get()); - let (genesis_payload, genesis_ns_table) = Payload::from_transactions([], &instance_state) - .expect("genesis payload construction failed"); + let (genesis_payload, genesis_ns_table) = + Payload::from_transactions([], &validated_state, &instance_state) + .await + .expect("genesis payload construction failed"); let builder_commitment = genesis_payload.builder_commitment(&genesis_ns_table); @@ -159,6 +163,9 @@ impl BuilderConfig { .as_u64() .context("the base fee exceeds the maximum amount that a builder can pay (defined by u64::MAX)")?, Arc::new(instance_state), + Arc::new(validated_state), + //???? + Duration::from_secs(60), ); // spawn the builder event loop diff --git a/builder/src/permissioned.rs b/builder/src/permissioned.rs index 5bcd7717a3..dc044508c5 100644 --- a/builder/src/permissioned.rs +++ b/builder/src/permissioned.rs @@ -187,7 +187,7 @@ pub async fn init_node>(channel_capacity.get()); - let (genesis_payload, genesis_ns_table) = Payload::from_transactions([], &instance_state) - .expect("genesis payload construction failed"); + let (genesis_payload, genesis_ns_table) = + Payload::from_transactions([], &validated_state, &instance_state) + .await + .expect("genesis payload construction failed"); let builder_commitment = genesis_payload.builder_commitment(&genesis_ns_table); @@ -446,6 +452,9 @@ impl { Arc::from(self.raw_payload.clone()) } } -impl BlockPayload for Payload { + +#[async_trait] +impl BlockPayload for Payload { type Error = crate::Error; type Transaction = Transaction; type Instance = NodeState; + type ValidatedState = ValidatedState; type Metadata = NsTable; /// Returns (Self, metadata). @@ -50,8 +54,9 @@ impl BlockPayload for Payload { /// https://github.com/EspressoSystems/espresso-sequencer/issues/757 /// /// TODO(746) refactor and make pretty "table" code for tx, namespace tables? - fn from_transactions( - txs: impl IntoIterator, + async fn from_transactions( + txs: impl IntoIterator + Send, + _validated_state: &Self::ValidatedState, instance_state: &Self::Instance, ) -> Result<(Self, Self::Metadata), Self::Error> { let payload = Payload::from_txs(txs, &instance_state.chain_config)?; @@ -66,14 +71,15 @@ impl BlockPayload for Payload { } } - // TODO remove - fn genesis() -> (Self, Self::Metadata) { + fn empty() -> (Self, Self::Metadata) { // this is only called from `Leaf::genesis`. Since we are // passing empty list, max_block_size is irrelevant so we can // use the mock NodeState. A future update to HotShot should // make a change there to remove the need for this workaround. - Self::from_transactions([], &NodeState::mock()).unwrap() + let payload = Payload::from_txs(vec![], &ChainConfig::default()).unwrap(); + let ns_table = payload.get_ns_table().clone(); + (payload, ns_table) } fn transaction_commitments(&self, meta: &Self::Metadata) -> Vec> { diff --git a/sequencer/src/block/payload.rs b/sequencer/src/block/payload.rs index 023c9399c4..aabfd62709 100644 --- a/sequencer/src/block/payload.rs +++ b/sequencer/src/block/payload.rs @@ -2,6 +2,7 @@ use crate::block::entry::{TxTableEntry, TxTableEntryWord}; use crate::block::payload; use crate::block::tables::NameSpaceTable; use crate::block::tables::TxTable; +use crate::SeqTypes; use crate::{BlockBuildingSnafu, ChainConfig, Error, NamespaceId, Transaction}; use ark_serialize::{CanonicalDeserialize, CanonicalSerialize}; use derivative::Derivative; @@ -152,7 +153,9 @@ impl Payload { } pub fn from_txs( - txs: impl IntoIterator as BlockPayload>::Transaction>, + txs: impl IntoIterator< + Item = as BlockPayload>::Transaction, + >, chain_config: &ChainConfig, ) -> Result { let mut namespaces: HashMap = Default::default(); @@ -183,7 +186,7 @@ impl Payload { fn update_namespace_with_tx( namespaces: &mut HashMap, - tx: as BlockPayload>::Transaction, + tx: as BlockPayload>::Transaction, ) { let tx_bytes_len: TxTableEntry = tx.payload().len().try_into().unwrap(); // TODO (Philippe) error handling @@ -317,13 +320,11 @@ pub fn parse_ns_payload(ns_bytes: &[u8], ns_id: NamespaceId) -> Vec } #[cfg(any(test, feature = "testing"))] -impl hotshot_types::traits::block_contents::TestableBlock +impl hotshot_types::traits::block_contents::TestableBlock for Payload { fn genesis() -> Self { - BlockPayload::from_transactions([], &Default::default()) - .unwrap() - .0 + BlockPayload::empty().0 } fn txn_count(&self) -> u64 { @@ -344,8 +345,9 @@ mod test { tx_iterator::TxIndex, }, transaction::NamespaceId, - ChainConfig, NodeState, Transaction, + ChainConfig, NodeState, Transaction, ValidatedState, }; + use async_compatibility_layer::art::async_test; use async_compatibility_layer::logging::{setup_backtrace, setup_logging}; use helpers::*; use hotshot_query_service::availability::QueryablePayload; @@ -396,12 +398,12 @@ mod test { assert_eq!(payload.txn_count(), txs.len() as u64); } - #[test] - fn basic_correctness() { - check_basic_correctness::() + #[async_test] + async fn basic_correctness() { + check_basic_correctness::().await } - fn check_basic_correctness() { + async fn check_basic_correctness() { // play with this let test_cases = [ // 1 namespace only @@ -515,8 +517,13 @@ mod test { let all_txs_iter = derived_nss .iter() .flat_map(|(_ns_id, ns)| ns.txs.iter().cloned()); - let (block, actual_ns_table) = - Payload::from_transactions(all_txs_iter, &NodeState::mock()).unwrap(); + let (block, actual_ns_table) = Payload::from_transactions( + all_txs_iter, + &ValidatedState::default(), + &NodeState::mock(), + ) + .await + .unwrap(); let disperse_data = vid.disperse(&block.raw_payload).unwrap(); // TEST ACTUAL STUFF AGAINST DERIVED STUFF diff --git a/sequencer/src/block/queryable.rs b/sequencer/src/block/queryable.rs index d8f1025b04..c555596d5e 100644 --- a/sequencer/src/block/queryable.rs +++ b/sequencer/src/block/queryable.rs @@ -1,4 +1,4 @@ -use crate::block::entry::TxTableEntryWord; +use crate::{block::entry::TxTableEntryWord, SeqTypes}; use crate::block::payload::Payload; use crate::block::tables::TxTable; use hotshot_query_service::availability::QueryablePayload; @@ -15,7 +15,7 @@ use super::{ }; // TODO don't hard-code TxTableEntryWord generic param -impl QueryablePayload for Payload { +impl QueryablePayload for Payload { type TransactionIndex = TxIndex; type Iter<'a> = TxIterator<'a, TxTableEntryWord>; type InclusionProof = TxInclusionProof; diff --git a/sequencer/src/header.rs b/sequencer/src/header.rs index cba5423360..7996752741 100644 --- a/sequencer/src/header.rs +++ b/sequencer/src/header.rs @@ -283,7 +283,7 @@ impl BlockHeader for Header { parent_leaf: &Leaf, payload_commitment: VidCommitment, builder_commitment: BuilderCommitment, - metadata: <::BlockPayload as BlockPayload>::Metadata, + metadata: <::BlockPayload as BlockPayload>::Metadata, builder_fee: BuilderFee, _vid_common: VidCommon, _version: Version, @@ -380,11 +380,12 @@ impl BlockHeader for Header { instance_state: &NodeState, payload_commitment: VidCommitment, builder_commitment: BuilderCommitment, - ns_table: <::BlockPayload as BlockPayload>::Metadata, + ns_table: <::BlockPayload as BlockPayload>::Metadata, ) -> Self { let ValidatedState { fee_merkle_tree, block_merkle_tree, + .. } = ValidatedState::genesis(instance_state).0; let block_merkle_tree_root = block_merkle_tree.commitment(); let fee_merkle_tree_root = fee_merkle_tree.commitment(); @@ -415,7 +416,9 @@ impl BlockHeader for Header { self.payload_commitment } - fn metadata(&self) -> &<::BlockPayload as BlockPayload>::Metadata { + fn metadata( + &self, + ) -> &<::BlockPayload as BlockPayload>::Metadata { &self.ns_table } @@ -541,6 +544,7 @@ mod test_headers { let mut validated_state = ValidatedState { block_merkle_tree: block_merkle_tree.clone(), fee_merkle_tree, + chain_config: genesis.instance_state.chain_config.into(), }; let (fee_account, fee_key) = FeeAccount::generated_from_seed_indexed([0; 32], 0); @@ -750,7 +754,10 @@ mod test_headers { fn default() -> Self { let instance_state = NodeState::mock(); let validated_state = ValidatedState::genesis(&instance_state).0; - let leaf = Leaf::genesis(&instance_state); + + //TODO(abdul): Change this + let leaf = async_std::task::block_on(Leaf::genesis(&validated_state, &instance_state)); + let header = leaf.block_header().clone(); let ns_table = leaf.block_payload().unwrap().get_ns_table().clone(); Self { diff --git a/sequencer/src/hotshot_commitment.rs b/sequencer/src/hotshot_commitment.rs index ad205ad64a..1aa8cb93c6 100644 --- a/sequencer/src/hotshot_commitment.rs +++ b/sequencer/src/hotshot_commitment.rs @@ -275,7 +275,7 @@ fn build_sequence_batches_txn( #[cfg(test)] mod test { use super::*; - use crate::{l1_client::L1Client, Leaf, NodeState}; + use crate::{l1_client::L1Client, Leaf, NodeState, ValidatedState}; use async_compatibility_layer::logging::{setup_backtrace, setup_logging}; use async_std::task::spawn; use committable::Committable; @@ -327,9 +327,10 @@ mod test { } } - fn mock_leaf(height: u64, node_state: &NodeState) -> LeafQueryData { - let mut leaf = Leaf::genesis(node_state); - let mut qc = QuorumCertificate::genesis(node_state); + async fn mock_leaf(height: u64, node_state: &NodeState) -> LeafQueryData { + let validated_state = &ValidatedState::default(); + let mut leaf = Leaf::genesis(validated_state, node_state).await; + let mut qc = QuorumCertificate::genesis(validated_state, node_state).await; leaf.block_header_mut().height = height; qc.data.leaf_commit = leaf.commit(); LeafQueryData::new(leaf, qc).unwrap() @@ -379,7 +380,8 @@ mod test { NodeState::mock().with_l1(L1Client::new(anvil.provider().url().clone(), 1)); for i in 0..num_batches { - data.leaves.push(Some(mock_leaf(i as u64, &node_state))); + data.leaves + .push(Some(mock_leaf(i as u64, &node_state).await)); } tracing::info!("sequencing batches: {:?}", data.leaves); @@ -447,7 +449,7 @@ mod test { let node_state = NodeState::mock().with_l1(L1Client::new(anvil.provider().url().clone(), 1)); - data.leaves.push(Some(mock_leaf(0, &node_state))); + data.leaves.push(Some(mock_leaf(0, &node_state).await)); // Connect to the HotShot contract with the expected L1 client. let hotshot = HotShot::new(l1.hotshot.address(), adaptor_l1_signer); @@ -472,7 +474,7 @@ mod test { assert_eq!(l1.hotshot.block_height().call().await.unwrap().as_u64(), 1); // Once a new batch is available, we can sequence it. - data.leaves.push(Some(mock_leaf(1, &node_state))); + data.leaves.push(Some(mock_leaf(1, &node_state).await)); sync_with_l1(1, &data, &hotshot).await.unwrap(); let (event, _) = wait_for_new_batches(&l1, from_block.as_u64()).await; assert_eq!(event.first_block_number.as_u64(), 1); @@ -513,7 +515,7 @@ mod test { // Create a sequence of leaves, some of which are missing. let mut data = MockDataSource::default(); data.leaves - .extend([None, Some(mock_leaf(1, &node_state)), None]); + .extend([None, Some(mock_leaf(1, &node_state).await), None]); // Connect to the HotShot contract with the expected L1 client. let hotshot = HotShot::new(l1.hotshot.address(), adaptor_l1_signer); @@ -524,7 +526,7 @@ mod test { // If the first leaf is present but subsequent leaves are missing, we should sequence the // leaves that are available. - data.leaves[0] = Some(mock_leaf(0, &node_state)); + data.leaves[0] = Some(mock_leaf(0, &node_state).await); sync_with_l1(3, &data, &hotshot).await.unwrap(); // Check the NewBatches event. diff --git a/sequencer/src/lib.rs b/sequencer/src/lib.rs index 5a23a99bad..5523d2edc0 100644 --- a/sequencer/src/lib.rs +++ b/sequencer/src/lib.rs @@ -387,7 +387,7 @@ pub async fn init_node( let topics = { let mut topics = vec![Topic::Global]; if is_da { - topics.push(Topic::DA); + topics.push(Topic::Da); } topics }; @@ -843,7 +843,9 @@ mod test { let mut parent = { // TODO refactor repeated code from other tests let (genesis_payload, genesis_ns_table) = - Payload::from_transactions([], &NodeState::mock()).unwrap(); + Payload::from_transactions([], &ValidatedState::default(), &NodeState::mock()) + .await + .unwrap(); let genesis_commitment = { // TODO we should not need to collect payload bytes just to compute vid_commitment let payload_bytes = genesis_payload.encode(); diff --git a/sequencer/src/message_compat_tests.rs b/sequencer/src/message_compat_tests.rs index d7899bb95e..167fac6a9d 100644 --- a/sequencer/src/message_compat_tests.rs +++ b/sequencer/src/message_compat_tests.rs @@ -14,7 +14,8 @@ //! If this test is failing and you did not intend to change the consensus API, figure out what //! code changed caused the serialization change and revert it. -use crate::{Leaf, NodeState, Payload, PubKey, SeqTypes, Transaction}; +use crate::{Leaf, NodeState, Payload, PubKey, SeqTypes, Transaction, ValidatedState}; +use async_compatibility_layer::art::async_test; use committable::Committable; use es_version::SequencerVersion; use hotshot::traits::election::static_committee::GeneralStaticCommittee; @@ -49,8 +50,8 @@ use vbs::{version::Version, BinarySerializer}; type Serializer = vbs::Serializer; -#[test] -fn test_message_compat() { +#[async_test] +async fn test_message_compat() { let (sender, priv_key) = PubKey::generated_from_seed_indexed(Default::default(), 0); let signature = PubKey::sign(&priv_key, &[]).unwrap(); let membership = GeneralStaticCommittee::new(&[], vec![sender.stake_table_entry(1)], vec![], 0); @@ -62,11 +63,16 @@ fn test_message_compat() { old_version_last_view: ViewNumber::genesis(), new_version_first_view: ViewNumber::genesis(), }; - let leaf = Leaf::genesis(&NodeState::mock()); + let leaf = Leaf::genesis(&ValidatedState::default(), &NodeState::mock()).await; let block_header = leaf.block_header().clone(); let transaction = Transaction::new(1.into(), vec![1, 2, 3]); - let (payload, metadata) = - Payload::from_transactions([transaction.clone()], &NodeState::mock()).unwrap(); + let (payload, metadata) = Payload::from_transactions( + [transaction.clone()], + &ValidatedState::default(), + &NodeState::mock(), + ) + .await + .unwrap(); let view_sync_pre_commit_data = ViewSyncPreCommitData { relay: 0, round: ViewNumber::genesis(), @@ -91,7 +97,11 @@ fn test_message_compat() { data: QuorumProposal { block_header, view_number: ViewNumber::genesis(), - justify_qc: QuorumCertificate::genesis(&NodeState::mock()), + justify_qc: QuorumCertificate::genesis( + &ValidatedState::default(), + &NodeState::mock(), + ) + .await, upgrade_certificate: Some(UpgradeCertificate { data: upgrade_data.clone(), vote_commitment: upgrade_data.commit(), diff --git a/sequencer/src/persistence.rs b/sequencer/src/persistence.rs index b545e1a755..a116bf9777 100644 --- a/sequencer/src/persistence.rs +++ b/sequencer/src/persistence.rs @@ -104,6 +104,8 @@ pub trait SequencerPersistence: Sized + Send + Sync + 'static { &self, state: NodeState, ) -> anyhow::Result> { + let genesis_validated_state = ValidatedState::genesis(&state).0; + let highest_voted_view = match self .load_latest_acted_view() .await @@ -137,12 +139,15 @@ pub trait SequencerPersistence: Sized + Send + Sync + 'static { } None => { tracing::info!("no saved leaf, starting from genesis leaf"); - (Leaf::genesis(&state), QuorumCertificate::genesis(&state)) + ( + Leaf::genesis(&genesis_validated_state, &state).await, + QuorumCertificate::genesis(&genesis_validated_state, &state).await, + ) } }; let validated_state = if leaf.block_header().height == 0 { // If we are starting from genesis, we can provide the full state. - Some(Arc::new(ValidatedState::genesis(&state).0)) + Some(Arc::new(genesis_validated_state)) } else { // Otherwise, we will have to construct a sparse state and fetch missing data during // catchup. @@ -273,8 +278,8 @@ mod persistence_tests { assert_eq!(storage.load_anchor_leaf().await.unwrap(), None); // Store a leaf. - let leaf1 = Leaf::genesis(&NodeState::mock()); - let qc1 = QuorumCertificate::genesis(&NodeState::mock()); + let leaf1 = Leaf::genesis(&ValidatedState::default(), &NodeState::mock()).await; + let qc1 = QuorumCertificate::genesis(&ValidatedState::default(), &NodeState::mock()).await; storage.save_anchor_leaf(&leaf1, &qc1).await.unwrap(); assert_eq!( storage.load_anchor_leaf().await.unwrap().unwrap(), @@ -359,7 +364,7 @@ mod persistence_tests { None ); - let leaf = Leaf::genesis(&NodeState::mock()); + let leaf = Leaf::genesis(&ValidatedState::default(), &NodeState::mock()).await; let payload = leaf.block_payload().unwrap(); let bytes = payload.encode().to_vec(); let disperse = vid_scheme(2).disperse(bytes).unwrap(); diff --git a/sequencer/src/reference_tests.rs b/sequencer/src/reference_tests.rs index f29af5ce5a..3345171a48 100644 --- a/sequencer/src/reference_tests.rs +++ b/sequencer/src/reference_tests.rs @@ -86,7 +86,7 @@ fn reference_header() -> Header { let builder_key = FeeAccount::generated_from_seed_indexed(Default::default(), 0).1; let fee_info = reference_fee_info(); let ns_table = reference_ns_table(); - let payload = as TestableBlock>::genesis(); + let payload = as TestableBlock<_>>::genesis(); let payload_commitment = vid_commitment(&payload.encode(), 1); let builder_commitment = payload.builder_commitment(&ns_table); let builder_signature = FeeAccount::sign_fee( diff --git a/sequencer/src/state.rs b/sequencer/src/state.rs index 378023ee95..44a3df6cae 100644 --- a/sequencer/src/state.rs +++ b/sequencer/src/state.rs @@ -1,6 +1,7 @@ use crate::{ - api::data_source::CatchupDataSource, catchup::SqlStateCatchup, eth_signature_key::EthKeyPair, - ChainConfig, Header, Leaf, NodeState, SeqTypes, + api::data_source::CatchupDataSource, catchup::SqlStateCatchup, + chain_config::ResolvableChainConfig, eth_signature_key::EthKeyPair, ChainConfig, Header, Leaf, + NodeState, SeqTypes, }; use anyhow::{anyhow, bail, ensure, Context}; use ark_serialize::{ @@ -58,9 +59,10 @@ pub struct ValidatedState { pub block_merkle_tree: BlockMerkleTree, /// Fee Merkle Tree pub fee_merkle_tree: FeeMerkleTree, + pub chain_config: ResolvableChainConfig, } -#[derive(Clone, Debug, Default, Deserialize, Serialize)] +#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq, Eq)] pub struct Delta { pub fees_delta: HashSet, } @@ -83,9 +85,13 @@ impl Default for ValidatedState { Vec::<(FeeAccount, FeeAmount)>::new(), ) .unwrap(); + + let chain_config = ResolvableChainConfig::from(ChainConfig::default()); + Self { block_merkle_tree, fee_merkle_tree, + chain_config, } } } @@ -200,6 +206,7 @@ impl ValidatedState { block_merkle_tree: BlockMerkleTree::from_commitment( self.block_merkle_tree.commitment(), ), + chain_config: ResolvableChainConfig::from(self.chain_config.commit()), } } } @@ -255,6 +262,7 @@ pub fn validate_proposal( let ValidatedState { block_merkle_tree, fee_merkle_tree, + .. } = state; let block_merkle_tree_root = block_merkle_tree.commitment(); @@ -351,6 +359,7 @@ async fn store_state_update( let ValidatedState { fee_merkle_tree, block_merkle_tree, + .. } = state; let Delta { fees_delta } = delta; @@ -771,6 +780,7 @@ impl HotShotState for ValidatedState { Self { fee_merkle_tree, block_merkle_tree, + chain_config: block_header.chain_config, } } /// Construct a genesis validated state. @@ -1238,6 +1248,7 @@ impl FeeAccountProof { #[cfg(test)] mod test { use super::*; + use async_compatibility_layer::art::async_test; use async_compatibility_layer::logging::{setup_backtrace, setup_logging}; use hotshot_types::vid::vid_scheme; use jf_vid::VidScheme; @@ -1281,8 +1292,8 @@ mod test { FeeAccountProof::prove(&tree, account2).unwrap(); } - #[test] - fn test_validation_max_block_size() { + #[async_test] + async fn test_validation_max_block_size() { setup_logging(); setup_backtrace(); @@ -1296,7 +1307,9 @@ mod test { base_fee: 0.into(), ..Default::default() }); - let parent = Leaf::genesis(&instance); + + let validated_state = ValidatedState::genesis(&instance).0; + let parent = Leaf::genesis(&validated_state, &instance).await; let header = parent.block_header(); // Validation fails because the proposed block exceeds the maximum block size. @@ -1305,8 +1318,8 @@ mod test { tracing::info!(%err, "task failed successfully"); } - #[test] - fn test_validation_base_fee() { + #[async_test] + async fn test_validation_base_fee() { setup_logging(); setup_backtrace(); @@ -1320,7 +1333,10 @@ mod test { max_block_size, ..Default::default() }); - let parent = Leaf::genesis(&instance); + + let validated_state = ValidatedState::genesis(&instance).0; + + let parent = Leaf::genesis(&validated_state, &instance).await; let header = parent.block_header(); // Validation fails because the genesis fee (0) is too low. From cfd26627d87234fb494813e6c0ae1b1abd1d07be Mon Sep 17 00:00:00 2001 From: Abdul Basit Date: Tue, 28 May 2024 17:28:41 +0500 Subject: [PATCH 2/9] get_chain_config --- sequencer/src/block.rs | 8 ++++++-- sequencer/src/block/queryable.rs | 2 +- sequencer/src/state.rs | 31 ++++++++++++++++++++++++------- 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/sequencer/src/block.rs b/sequencer/src/block.rs index 987a2bf675..5ad007e78a 100644 --- a/sequencer/src/block.rs +++ b/sequencer/src/block.rs @@ -56,10 +56,14 @@ impl BlockPayload for Payload { /// TODO(746) refactor and make pretty "table" code for tx, namespace tables? async fn from_transactions( txs: impl IntoIterator + Send, - _validated_state: &Self::ValidatedState, + validated_state: &Self::ValidatedState, instance_state: &Self::Instance, ) -> Result<(Self, Self::Metadata), Self::Error> { - let payload = Payload::from_txs(txs, &instance_state.chain_config)?; + let cf = validated_state + .get_chain_config(&instance_state, &validated_state.chain_config) + .await; + + let payload = Payload::from_txs(txs, &cf)?; let ns_table = payload.get_ns_table().clone(); // TODO don't clone ns_table Some((payload, ns_table)).context(BlockBuildingSnafu) } diff --git a/sequencer/src/block/queryable.rs b/sequencer/src/block/queryable.rs index c555596d5e..114f0a8269 100644 --- a/sequencer/src/block/queryable.rs +++ b/sequencer/src/block/queryable.rs @@ -1,6 +1,6 @@ -use crate::{block::entry::TxTableEntryWord, SeqTypes}; use crate::block::payload::Payload; use crate::block::tables::TxTable; +use crate::{block::entry::TxTableEntryWord, SeqTypes}; use hotshot_query_service::availability::QueryablePayload; use hotshot_types::vid::{vid_scheme, SmallRangeProofType}; use jf_vid::payload_prover::{PayloadProver, Statement}; diff --git a/sequencer/src/state.rs b/sequencer/src/state.rs index 44a3df6cae..9567b65768 100644 --- a/sequencer/src/state.rs +++ b/sequencer/src/state.rs @@ -559,6 +559,21 @@ impl SequencerStateDataSource for T where } impl ValidatedState { + pub(crate) async fn get_chain_config( + &self, + instance: &NodeState, + cf: &ResolvableChainConfig, + ) -> ChainConfig { + if cf.commit() == instance.chain_config.commit() { + instance.chain_config + } else { + match cf.resolve() { + Some(cf) => cf, + None => ChainConfig::default(), // TODO: DO CATCHUP + } + } + } + pub(crate) async fn apply_header( &self, instance: &NodeState, @@ -571,17 +586,19 @@ impl ValidatedState { let l1_deposits = get_l1_deposits(instance, proposed_header, parent_leaf).await; let mut validated_state = self.clone(); + let chain_config = validated_state + .get_chain_config(instance, &proposed_header.chain_config) + .await; + + validated_state.chain_config = chain_config.into(); // Find missing fee state entries. We will need to use the builder account which is paying a // fee and the recipient account which is receiving it, plus any counts receiving deposits // in this block. let missing_accounts = self.forgotten_accounts( - [ - proposed_header.fee_info.account, - instance.chain_config().fee_recipient, - ] - .into_iter() - .chain(l1_deposits.iter().map(|fee_info| fee_info.account)), + [proposed_header.fee_info.account, chain_config.fee_recipient] + .into_iter() + .chain(l1_deposits.iter().map(|fee_info| fee_info.account)), ); let parent_height = parent_leaf.height(); @@ -643,7 +660,7 @@ impl ValidatedState { &mut validated_state, &mut delta, proposed_header.fee_info, - instance.chain_config().fee_recipient, + chain_config.fee_recipient, )?; Ok((validated_state, delta)) From 6242d2792ce2c2a9a8f944d040e913a7a5ab7621 Mon Sep 17 00:00:00 2001 From: Abdul Basit Date: Wed, 29 May 2024 01:12:57 +0500 Subject: [PATCH 3/9] chain config route --- sequencer/api/catchup.toml | 7 +++ sequencer/src/api.rs | 28 ++++++++- sequencer/src/api/data_source.rs | 12 +++- sequencer/src/api/endpoints.rs | 13 ++++ sequencer/src/block.rs | 19 +++++- sequencer/src/catchup.rs | 103 +++++++++++++++++++++++++++++++ sequencer/src/lib.rs | 2 + sequencer/src/state.rs | 33 +++++++--- 8 files changed, 202 insertions(+), 15 deletions(-) diff --git a/sequencer/api/catchup.toml b/sequencer/api/catchup.toml index 416d034dd5..6eedd2a0b2 100644 --- a/sequencer/api/catchup.toml +++ b/sequencer/api/catchup.toml @@ -44,3 +44,10 @@ decided view. Returns the blocks Merkle tree frontier -- the path to the most recently appended leaf, relative to root node at the requested block height and view. """ + +[route.chainconfig] +PATH = ["/chain-config/:commitment"] +":commitment" = "TaggedBase64" +DOC = """ +TODO: +""" \ No newline at end of file diff --git a/sequencer/src/api.rs b/sequencer/src/api.rs index 9188f4595f..6d9e866b37 100644 --- a/sequencer/src/api.rs +++ b/sequencer/src/api.rs @@ -4,12 +4,13 @@ use crate::{ persistence::SequencerPersistence, state::{BlockMerkleTree, FeeAccountProof}, state_signature::StateSigner, - Node, NodeState, PubKey, SeqTypes, SequencerContext, Transaction, + ChainConfig, Node, NodeState, PubKey, SeqTypes, SequencerContext, Transaction, }; -use anyhow::Context; +use anyhow::{bail, Context}; use async_once_cell::Lazy; use async_std::sync::{Arc, RwLock}; use async_trait::async_trait; +use committable::{Commitment, Committable}; use data_source::{CatchupDataSource, SubmitDataSource}; use derivative::Derivative; use ethers::prelude::{Address, U256}; @@ -239,6 +240,29 @@ impl, + ) -> anyhow::Result { + let node_state = self.node_state().await; + let node_state_cf = node_state.chain_config(); + if node_state_cf.commit() == commitment { + return Ok(*node_state_cf); + } + + let state = self.consensus().await.decided_state().await; + let state_cf = state.chain_config; + + if state_cf.commit() != commitment { + bail!("chain config for commitment={commitment} not found in decided state"); + } + + state_cf.resolve().context(format!( + "cannot resolve to a full chain config for commitment={commitment}" + )) + } } impl diff --git a/sequencer/src/api/data_source.rs b/sequencer/src/api/data_source.rs index 82e1dbc06f..f973be1c1c 100644 --- a/sequencer/src/api/data_source.rs +++ b/sequencer/src/api/data_source.rs @@ -8,10 +8,11 @@ use super::{ use crate::{ network, persistence::{self, SequencerPersistence}, - PubKey, SeqTypes, Transaction, + ChainConfig, PubKey, SeqTypes, Transaction, }; use anyhow::bail; use async_trait::async_trait; +use committable::Commitment; use ethers::prelude::Address; use futures::future::Future; use hotshot_query_service::{ @@ -141,6 +142,15 @@ pub(crate) trait CatchupDataSource { bail!("merklized state catchup is not supported for this data source"); } } + + fn get_chain_config( + &self, + _commitment: Commitment, + ) -> impl Send + Future> { + async { + bail!("chain config catchup is not supported for this data source"); + } + } } impl CatchupDataSource for MetricsDataSource {} diff --git a/sequencer/src/api/endpoints.rs b/sequencer/src/api/endpoints.rs index 78af833208..0a490aa283 100644 --- a/sequencer/src/api/endpoints.rs +++ b/sequencer/src/api/endpoints.rs @@ -279,6 +279,19 @@ where .map_err(|err| Error::catch_all(StatusCode::NotFound, format!("{err:#}"))) } .boxed() + })? + .get("chainconfig", |req, state| { + async move { + let commitment = req + .blob_param("commitment") + .map_err(Error::from_request_error)?; + + state + .get_chain_config(commitment) + .await + .map_err(|err| Error::catch_all(StatusCode::NotFound, format!("{err:#}"))) + } + .boxed() })?; Ok(api) diff --git a/sequencer/src/block.rs b/sequencer/src/block.rs index 5ad007e78a..3e4fc26abd 100644 --- a/sequencer/src/block.rs +++ b/sequencer/src/block.rs @@ -59,9 +59,22 @@ impl BlockPayload for Payload { validated_state: &Self::ValidatedState, instance_state: &Self::Instance, ) -> Result<(Self, Self::Metadata), Self::Error> { - let cf = validated_state - .get_chain_config(&instance_state, &validated_state.chain_config) - .await; + let validated_state_cf = validated_state.chain_config; + let instance_state_cf = instance_state.chain_config; + + let cf = if validated_state_cf.commit() == instance_state_cf.commit() { + instance_state_cf + } else { + match validated_state_cf.resolve() { + Some(cf) => cf, + None => instance_state + .peers + .as_ref() + .fetch_chain_config(validated_state_cf.commit()) + .await + .unwrap(), // TODO: + } + }; let payload = Payload::from_txs(txs, &cf)?; let ns_table = payload.get_ns_table().clone(); // TODO don't clone ns_table diff --git a/sequencer/src/catchup.rs b/sequencer/src/catchup.rs index a310289807..482575e6ac 100644 --- a/sequencer/src/catchup.rs +++ b/sequencer/src/catchup.rs @@ -2,10 +2,12 @@ use crate::{ api::{data_source::CatchupDataSource, AccountQueryData, BlocksFrontier}, persistence::PersistenceOptions, state::{BlockMerkleTree, FeeAccount, FeeMerkleCommitment}, + ChainConfig, }; use anyhow::{bail, Context}; use async_std::sync::RwLock; use async_trait::async_trait; +use committable::Commitment; use derive_more::From; use hotshot_types::{data::ViewNumber, traits::node_implementation::ConsensusTime as _}; use jf_merkle_tree::{prelude::MerkleNode, ForgetableMerkleTreeScheme, MerkleTreeScheme}; @@ -104,6 +106,26 @@ pub trait StateCatchup: Send + Sync + std::fmt::Debug { Ok(()) } + async fn try_fetch_chain_config( + &self, + commitment: Commitment, + ) -> anyhow::Result; + + async fn fetch_chain_config( + &self, + commitment: Commitment, + ) -> anyhow::Result { + loop { + match self.try_fetch_chain_config(commitment).await { + Ok(cf) => return Ok(cf), + Err(err) => { + tracing::warn!("Could not fetch chain config from any peer, retrying: {err:#}"); + async_std::task::sleep(self.retry_interval()).await; + } + } + } + } + fn retry_interval(&self) -> Duration { Duration::from_millis(100) } @@ -210,6 +232,28 @@ impl StateCatchup for StatePeers { bail!("Could not fetch frontier from any peer"); } + async fn try_fetch_chain_config( + &self, + commitment: Commitment, + ) -> anyhow::Result { + for client in self.clients.iter() { + tracing::info!("Fetching chain config from {}", client.url); + match client + .get::(&format!("catchup/chain-config/{}", commitment)) + .send() + .await + { + Ok(cf) => { + return Ok(cf); + } + Err(err) => { + tracing::warn!("Error fetching chain config from peer: {}", err); + } + } + } + bail!("Could not fetch chain config from any peer"); + } + fn retry_interval(&self) -> Duration { self.interval } @@ -263,6 +307,13 @@ where _ => bail!("invalid proof"), } } + + async fn try_fetch_chain_config( + &self, + _commitment: Commitment, + ) -> anyhow::Result { + bail!("not supported"); + } } #[async_trait] @@ -310,6 +361,20 @@ impl StateCatchup for Box { ) -> anyhow::Result<()> { (**self).remember_blocks_merkle_tree(height, view, mt).await } + + async fn try_fetch_chain_config( + &self, + commitment: Commitment, + ) -> anyhow::Result { + (**self).try_fetch_chain_config(commitment).await + } + + async fn fetch_chain_config( + &self, + commitment: Commitment, + ) -> anyhow::Result { + (**self).fetch_chain_config(commitment).await + } } #[async_trait] @@ -357,6 +422,20 @@ impl StateCatchup for Arc { ) -> anyhow::Result<()> { (**self).remember_blocks_merkle_tree(height, view, mt).await } + + async fn try_fetch_chain_config( + &self, + commitment: Commitment, + ) -> anyhow::Result { + (**self).try_fetch_chain_config(commitment).await + } + + async fn fetch_chain_config( + &self, + commitment: Commitment, + ) -> anyhow::Result { + (**self).fetch_chain_config(commitment).await + } } /// Catchup from multiple providers tries each provider in a round robin fashion until it succeeds. @@ -406,6 +485,22 @@ impl StateCatchup for Vec { bail!("could not fetch account from any provider"); } + + async fn try_fetch_chain_config( + &self, + commitment: Commitment, + ) -> anyhow::Result { + for provider in self { + match provider.try_fetch_chain_config(commitment).await { + Ok(cf) => return Ok(cf), + Err(err) => { + tracing::warn!(?provider, "failed to fetch chain config: {err:#}"); + } + } + } + + bail!("could not fetch chain config from any provider"); + } } #[cfg(any(test, feature = "testing"))] @@ -468,5 +563,13 @@ pub mod mock { Ok(()) } + + //TODO : ??? + async fn try_fetch_chain_config( + &self, + _commitment: Commitment, + ) -> anyhow::Result { + Ok(ChainConfig::default()) + } } } diff --git a/sequencer/src/lib.rs b/sequencer/src/lib.rs index 5523d2edc0..05d5616ea9 100644 --- a/sequencer/src/lib.rs +++ b/sequencer/src/lib.rs @@ -270,6 +270,8 @@ pub enum Error { MerkleTreeError { error: String }, BlockBuilding, + + ChainConfigNotFound, } #[derive(Clone, Debug)] diff --git a/sequencer/src/state.rs b/sequencer/src/state.rs index c7a0bb07e9..c9072bfd2c 100644 --- a/sequencer/src/state.rs +++ b/sequencer/src/state.rs @@ -562,14 +562,29 @@ impl ValidatedState { pub(crate) async fn get_chain_config( &self, instance: &NodeState, - cf: &ResolvableChainConfig, - ) -> ChainConfig { - if cf.commit() == instance.chain_config.commit() { - instance.chain_config - } else { - match cf.resolve() { - Some(cf) => cf, - None => ChainConfig::default(), // TODO: DO CATCHUP + header_cf: &ResolvableChainConfig, + ) -> anyhow::Result { + if header_cf.commit() != self.chain_config.commit() { + bail!( + "Proposed header chain config commit={} expected={}", + header_cf.commit(), + self.chain_config.commit() + ); + } + + if self.chain_config.commit() == instance.chain_config.commit() { + return Ok(instance.chain_config); + } + + match (self.chain_config.resolve(), header_cf.resolve()) { + (Some(cf), _) => Ok(cf), + (_, Some(cf)) => Ok(cf), + (None, None) => { + instance + .peers + .as_ref() + .fetch_chain_config(self.chain_config.commit()) + .await } } } @@ -588,7 +603,7 @@ impl ValidatedState { let mut validated_state = self.clone(); let chain_config = validated_state .get_chain_config(instance, &proposed_header.chain_config) - .await; + .await?; validated_state.chain_config = chain_config.into(); From e9bde5a726d6209694d0ff4f533c9d0d3dd50cc8 Mon Sep 17 00:00:00 2001 From: Abdul Basit Date: Wed, 29 May 2024 04:34:57 +0500 Subject: [PATCH 4/9] add test --- sequencer/api/catchup.toml | 7 +++++- sequencer/src/api.rs | 50 ++++++++++++++++++++++++++++++++++++++ sequencer/src/block.rs | 3 +++ sequencer/src/catchup.rs | 3 +-- sequencer/src/state.rs | 7 ++++++ 5 files changed, 67 insertions(+), 3 deletions(-) diff --git a/sequencer/api/catchup.toml b/sequencer/api/catchup.toml index 6eedd2a0b2..af7d942bae 100644 --- a/sequencer/api/catchup.toml +++ b/sequencer/api/catchup.toml @@ -49,5 +49,10 @@ root node at the requested block height and view. PATH = ["/chain-config/:commitment"] ":commitment" = "TaggedBase64" DOC = """ -TODO: + +This endpoint retrieves the chain config from a peer that matches the specified `:commitment`. +This is only called when the state does not have full chain config which is different from the genesis one. +This can happen if the node missed a protocol upgrade. + +Returns the chain config -- this includes parameters such as `max_block_size`, `chain_id`, `base_fee`, and `fee_recipient`. """ \ No newline at end of file diff --git a/sequencer/src/api.rs b/sequencer/src/api.rs index bb28ee0615..119b5476c2 100644 --- a/sequencer/src/api.rs +++ b/sequencer/src/api.rs @@ -828,6 +828,7 @@ mod test { use super::*; use crate::{ catchup::{mock::MockStateCatchup, StatePeers}, + chain_config::ResolvableChainConfig, persistence::no_storage, state::{FeeAccount, FeeAmount, ValidatedState}, testing::TestConfig, @@ -1056,6 +1057,55 @@ mod test { } } + #[async_std::test] + async fn test_validated_state_chain_config() { + setup_logging(); + setup_backtrace(); + + let mut state = ValidatedState::default(); + // ValidatedState only has the default chain config commitment. + // NodeState also has the default ChainConfig. + // Therefore, both commitments would match. + // This would update the ValidatedState's chain config to NodeState's ChainConfig. + state.chain_config = ChainConfig::default().commit().into(); + + // Start a sequencer network without catchup module + let port = pick_unused_port().expect("No ports free"); + let mut network = TestNetwork::with_state( + Options::from(options::Http { port }), + std::array::from_fn(|_| state.clone()), + [no_storage::Options; TestConfig::NUM_NODES], + std::array::from_fn(|_| MockStateCatchup::default()), + ) + .await; + + network + .server + .event_stream() + .filter(|event| future::ready(matches!(event.event, EventType::Decide { .. }))) + .take(4) + .collect::>() + .await; + + let decided_state = network.server.consensus().decided_state().await; + assert_eq!( + decided_state.chain_config, + ResolvableChainConfig::from(ChainConfig::default()) + ); + + for peer in &network.peers { + let state = peer.consensus().decided_state().await; + assert_eq!( + state.chain_config, + ResolvableChainConfig::from(ChainConfig::default()) + ); + } + + network.stop_consensus().await; + + drop(network); + } + #[async_std::test] pub(crate) async fn test_restart() { setup_logging(); diff --git a/sequencer/src/block.rs b/sequencer/src/block.rs index 3e4fc26abd..0c14ddd371 100644 --- a/sequencer/src/block.rs +++ b/sequencer/src/block.rs @@ -54,6 +54,9 @@ impl BlockPayload for Payload { /// https://github.com/EspressoSystems/espresso-sequencer/issues/757 /// /// TODO(746) refactor and make pretty "table" code for tx, namespace tables? + /// + /// This function also performs catchup from peers + /// when the ValidatedState's chain config commitment differs from the NodeState's chain config, and the ValidatedState does not have full chain config. async fn from_transactions( txs: impl IntoIterator + Send, validated_state: &Self::ValidatedState, diff --git a/sequencer/src/catchup.rs b/sequencer/src/catchup.rs index 482575e6ac..f740cf0745 100644 --- a/sequencer/src/catchup.rs +++ b/sequencer/src/catchup.rs @@ -312,7 +312,7 @@ where &self, _commitment: Commitment, ) -> anyhow::Result { - bail!("not supported"); + bail!("chain config catchup is not supported for SQL data source"); } } @@ -564,7 +564,6 @@ pub mod mock { Ok(()) } - //TODO : ??? async fn try_fetch_chain_config( &self, _commitment: Commitment, diff --git a/sequencer/src/state.rs b/sequencer/src/state.rs index 4ead582e66..b60f046466 100644 --- a/sequencer/src/state.rs +++ b/sequencer/src/state.rs @@ -565,6 +565,13 @@ impl SequencerStateDataSource for T where } impl ValidatedState { + /// Retrieves the `ChainConfig`. + /// + /// Returns the `NodeState` `ChainConfig` if the `ValidatedState` `ChainConfig` commitment matches the `NodeState` `ChainConfig`` commitment. + /// If the commitments do not match, it returns the `ChainConfig` available in either `ValidatedState` or proposed header. + /// If neither has the `ChainConfig`, it fetches the config from the peers. + /// + /// Returns an error if the proposed header's `ChainConfig` commitment does not match the `ValidatedState` `ChainConfig` commitment, pub(crate) async fn get_chain_config( &self, instance: &NodeState, From 1f8d73fb202cc085205903add7481b72cd4aca65 Mon Sep 17 00:00:00 2001 From: Abdul Basit Date: Wed, 29 May 2024 08:09:29 +0500 Subject: [PATCH 5/9] clippy --- sequencer/src/api.rs | 6 ++++-- sequencer/src/state.rs | 16 +++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/sequencer/src/api.rs b/sequencer/src/api.rs index 119b5476c2..dccdd7f18c 100644 --- a/sequencer/src/api.rs +++ b/sequencer/src/api.rs @@ -1062,12 +1062,14 @@ mod test { setup_logging(); setup_backtrace(); - let mut state = ValidatedState::default(); // ValidatedState only has the default chain config commitment. // NodeState also has the default ChainConfig. // Therefore, both commitments would match. // This would update the ValidatedState's chain config to NodeState's ChainConfig. - state.chain_config = ChainConfig::default().commit().into(); + let state = ValidatedState { + chain_config: ChainConfig::default().commit().into(), + ..Default::default() + }; // Start a sequencer network without catchup module let port = pick_unused_port().expect("No ports free"); diff --git a/sequencer/src/state.rs b/sequencer/src/state.rs index b60f046466..885d9562dc 100644 --- a/sequencer/src/state.rs +++ b/sequencer/src/state.rs @@ -577,13 +577,15 @@ impl ValidatedState { instance: &NodeState, header_cf: &ResolvableChainConfig, ) -> anyhow::Result { - if header_cf.commit() != self.chain_config.commit() { - bail!( - "Proposed header chain config commit={} expected={}", - header_cf.commit(), - self.chain_config.commit() - ); - } + // TODO(abdul) : to be uncommented after we have upgrade mechanism + + // if header_cf.commit() != self.chain_config.commit() { + // bail!( + // "Proposed header chain config commit={} expected={}", + // header_cf.commit(), + // self.chain_config.commit() + // ); + // } if self.chain_config.commit() == instance.chain_config.commit() { return Ok(instance.chain_config); From 35680985a99b81c88759129cdee46f03f726e608 Mon Sep 17 00:00:00 2001 From: Abdul Basit Date: Fri, 31 May 2024 00:39:19 +0500 Subject: [PATCH 6/9] point hotshot to main and others to daily-build --- .vscode/settings.json | 1 + Cargo.lock | 45 +++++----- Cargo.toml | 25 +++--- builder/src/permissioned.rs | 8 +- sequencer/src/api.rs | 169 +++++++++++++++--------------------- sequencer/src/catchup.rs | 19 ++-- sequencer/src/context.rs | 23 ++--- 7 files changed, 131 insertions(+), 159 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 00c38dbdec..1e2618a81e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,4 +3,5 @@ "CARGO_TARGET_DIR": "target/vscode_rust_analyzer", "RUSTFLAGS": " --cfg async_executor_impl=\"async-std\" --cfg async_channel_impl=\"async-std\"" }, + "rust-analyzer.cargo.features": "all", } \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 84713ad34a..fe67f522ae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4027,7 +4027,7 @@ dependencies = [ [[package]] name = "hotshot" version = "0.5.43" -source = "git+https://github.com/EspressoSystems/hotshot?branch=abdul/pass-validated-state#e15ab38bf381a9687c09699a946a8583fe30c9ca" +source = "git+https://github.com/EspressoSystems/hotshot?branch=main#95dc95f6ecd5bb2085c0b3588b70d08fe2397fae" dependencies = [ "anyhow", "async-broadcast", @@ -4072,7 +4072,7 @@ dependencies = [ [[package]] name = "hotshot-builder-api" version = "0.1.7" -source = "git+https://github.com/EspressoSystems/hotshot?branch=abdul/pass-validated-state#e15ab38bf381a9687c09699a946a8583fe30c9ca" +source = "git+https://github.com/EspressoSystems/hotshot?branch=main#95dc95f6ecd5bb2085c0b3588b70d08fe2397fae" dependencies = [ "async-trait", "clap", @@ -4091,7 +4091,7 @@ dependencies = [ [[package]] name = "hotshot-builder-core" version = "0.1.21" -source = "git+https://github.com/EspressoSystems/hotshot-builder-core?branch=abdul/update-hotshot#86db8fad09399489b002c3023d741fa09314f9b3" +source = "git+https://github.com/EspressoSystems/hotshot-builder-core?branch=daily-build#6b1f25f3660229fb220fd23c6ab1a6a73a3b8348" dependencies = [ "anyhow", "async-broadcast", @@ -4143,8 +4143,8 @@ dependencies = [ [[package]] name = "hotshot-events-service" -version = "0.1.22" -source = "git+https://github.com/EspressoSystems/hotshot-events-service.git?branch=abdul/update-hotshot#ef524944a9ef7c1b037d907ad9db70411e33936a" +version = "0.1.23" +source = "git+https://github.com/EspressoSystems/hotshot-events-service.git?branch=daily-build#9b5891dd85b98baf42058131219d425514447325" dependencies = [ "async-broadcast", "async-compatibility-layer", @@ -4169,7 +4169,7 @@ dependencies = [ [[package]] name = "hotshot-example-types" version = "0.5.43" -source = "git+https://github.com/EspressoSystems/hotshot?branch=abdul/pass-validated-state#e15ab38bf381a9687c09699a946a8583fe30c9ca" +source = "git+https://github.com/EspressoSystems/hotshot?branch=main#95dc95f6ecd5bb2085c0b3588b70d08fe2397fae" dependencies = [ "anyhow", "async-broadcast", @@ -4200,7 +4200,7 @@ dependencies = [ [[package]] name = "hotshot-macros" version = "0.5.43" -source = "git+https://github.com/EspressoSystems/hotshot?branch=abdul/pass-validated-state#e15ab38bf381a9687c09699a946a8583fe30c9ca" +source = "git+https://github.com/EspressoSystems/hotshot?branch=main#95dc95f6ecd5bb2085c0b3588b70d08fe2397fae" dependencies = [ "derive_builder", "proc-macro2", @@ -4211,7 +4211,7 @@ dependencies = [ [[package]] name = "hotshot-orchestrator" version = "0.5.43" -source = "git+https://github.com/EspressoSystems/hotshot?branch=abdul/pass-validated-state#e15ab38bf381a9687c09699a946a8583fe30c9ca" +source = "git+https://github.com/EspressoSystems/hotshot?branch=main#95dc95f6ecd5bb2085c0b3588b70d08fe2397fae" dependencies = [ "anyhow", "async-compatibility-layer", @@ -4239,8 +4239,8 @@ dependencies = [ [[package]] name = "hotshot-query-service" -version = "0.1.23" -source = "git+https://github.com/EspressoSystems/hotshot-query-service?branch=abdul/update-hotshot#9e392475b3efaf50c8e6a0f76b98db19acbc583d" +version = "0.1.27" +source = "git+https://github.com/EspressoSystems/hotshot-query-service?branch=daily-build#2f2aa3adf38c344b63e380d3375086341f4be3c9" dependencies = [ "anyhow", "ark-serialize", @@ -4294,7 +4294,7 @@ dependencies = [ [[package]] name = "hotshot-stake-table" version = "0.5.43" -source = "git+https://github.com/EspressoSystems/hotshot?branch=abdul/pass-validated-state#e15ab38bf381a9687c09699a946a8583fe30c9ca" +source = "git+https://github.com/EspressoSystems/hotshot?branch=main#95dc95f6ecd5bb2085c0b3588b70d08fe2397fae" dependencies = [ "ark-bn254", "ark-ed-on-bn254", @@ -4365,11 +4365,13 @@ dependencies = [ [[package]] name = "hotshot-task" version = "0.5.43" -source = "git+https://github.com/EspressoSystems/hotshot?branch=abdul/pass-validated-state#e15ab38bf381a9687c09699a946a8583fe30c9ca" +source = "git+https://github.com/EspressoSystems/hotshot?branch=main#95dc95f6ecd5bb2085c0b3588b70d08fe2397fae" dependencies = [ + "anyhow", "async-broadcast", "async-compatibility-layer", "async-std", + "async-trait", "futures", "tokio", "tracing", @@ -4378,7 +4380,7 @@ dependencies = [ [[package]] name = "hotshot-task-impls" version = "0.5.43" -source = "git+https://github.com/EspressoSystems/hotshot?branch=abdul/pass-validated-state#e15ab38bf381a9687c09699a946a8583fe30c9ca" +source = "git+https://github.com/EspressoSystems/hotshot?branch=main#95dc95f6ecd5bb2085c0b3588b70d08fe2397fae" dependencies = [ "anyhow", "async-broadcast", @@ -4413,8 +4415,9 @@ dependencies = [ [[package]] name = "hotshot-testing" version = "0.5.43" -source = "git+https://github.com/EspressoSystems/hotshot?branch=abdul/pass-validated-state#e15ab38bf381a9687c09699a946a8583fe30c9ca" +source = "git+https://github.com/EspressoSystems/hotshot?branch=main#95dc95f6ecd5bb2085c0b3588b70d08fe2397fae" dependencies = [ + "anyhow", "async-broadcast", "async-compatibility-layer", "async-lock 2.8.0", @@ -4453,7 +4456,7 @@ dependencies = [ [[package]] name = "hotshot-types" version = "0.1.11" -source = "git+https://github.com/EspressoSystems/hotshot?branch=abdul/pass-validated-state#e15ab38bf381a9687c09699a946a8583fe30c9ca" +source = "git+https://github.com/EspressoSystems/hotshot?branch=main#95dc95f6ecd5bb2085c0b3588b70d08fe2397fae" dependencies = [ "anyhow", "ark-bls12-381", @@ -5716,7 +5719,7 @@ dependencies = [ [[package]] name = "libp2p-networking" version = "0.5.43" -source = "git+https://github.com/EspressoSystems/hotshot?branch=abdul/pass-validated-state#e15ab38bf381a9687c09699a946a8583fe30c9ca" +source = "git+https://github.com/EspressoSystems/hotshot?branch=main#95dc95f6ecd5bb2085c0b3588b70d08fe2397fae" dependencies = [ "anyhow", "async-compatibility-layer", @@ -9537,9 +9540,9 @@ dependencies = [ [[package]] name = "surf-disco" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b649b5919e809b105a8ae833154430f7069b0e3a392fff26a672211c6b8e30d" +checksum = "2e4318abbbbc4d640c6cb45d29cd3c70cf517c751fae9b68f2f76a6ff1950da7" dependencies = [ "async-std", "async-tungstenite", @@ -9841,11 +9844,13 @@ dependencies = [ [[package]] name = "tide-disco" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf3579d6f1362fffc7d1686ed061537afe8a187fd0b18e0f5694ad17e977ff3" +checksum = "44c9d803bc734a5cced767b36bb1caab87e9eb7eb144cffcab38160b084a8cef" dependencies = [ "anyhow", + "async-h1", + "async-lock 3.3.0", "async-std", "async-trait", "clap", diff --git a/Cargo.toml b/Cargo.toml index 5a99050d4c..d22f52f267 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,18 +47,19 @@ dotenvy = "0.15" ethers = { version = "2.0", features = ["solc"] } futures = "0.3" -hotshot = { git = "https://github.com/EspressoSystems/hotshot", branch = "abdul/pass-validated-state" } +hotshot = { git = "https://github.com/EspressoSystems/hotshot", branch = "main" } # Hotshot imports -hotshot-builder-api = { git = "https://github.com/EspressoSystems/HotShot.git", branch = "abdul/pass-validated-state" } -hotshot-builder-core = { git = "https://github.com/EspressoSystems/hotshot-builder-core", branch = "abdul/update-hotshot" } -hotshot-events-service = { git = "https://github.com/EspressoSystems/hotshot-events-service.git", branch = "abdul/update-hotshot" } -hotshot-orchestrator = { git = "https://github.com/EspressoSystems/hotshot", branch = "abdul/pass-validated-state" } -hotshot-query-service = { git = "https://github.com/EspressoSystems/hotshot-query-service", branch = "abdul/update-hotshot" } -hotshot-stake-table = { git = "https://github.com/EspressoSystems/hotshot", branch = "abdul/pass-validated-state" } +hotshot-builder-api = { git = "https://github.com/EspressoSystems/HotShot.git", branch = "main" } +hotshot-builder-core = { git = "https://github.com/EspressoSystems/hotshot-builder-core", branch = "daily-build" } +hotshot-contract-adapter = { version = "0.1.0", path = "contracts/rust/adapter" } +hotshot-events-service = { git = "https://github.com/EspressoSystems/hotshot-events-service.git", branch = "daily-build" } +hotshot-orchestrator = { git = "https://github.com/EspressoSystems/hotshot", branch = "main" } +hotshot-query-service = { git = "https://github.com/EspressoSystems/hotshot-query-service", branch = "daily-build" } +hotshot-stake-table = { git = "https://github.com/EspressoSystems/hotshot", branch = "main" } hotshot-state-prover = { version = "0.1.0", path = "hotshot-state-prover" } -hotshot-task = { git = "https://github.com/EspressoSystems/hotshot", branch = "abdul/pass-validated-state" } -hotshot-testing = { git = "https://github.com/EspressoSystems/hotshot", branch = "abdul/pass-validated-state" } -hotshot-types = { git = "https://github.com/EspressoSystems/hotshot", branch = "abdul/pass-validated-state" } +hotshot-task = { git = "https://github.com/EspressoSystems/hotshot", branch = "main" } +hotshot-testing = { git = "https://github.com/EspressoSystems/hotshot", branch = "main" } +hotshot-types = { git = "https://github.com/EspressoSystems/hotshot", branch = "main" } # Push CDN imports cdn-broker = { git = "https://github.com/EspressoSystems/Push-CDN", features = [ @@ -98,9 +99,9 @@ jf-relation = { git = "https://github.com/EspressoSystems/jellyfish", tag = "0.4 jf-utils = { git = "https://github.com/EspressoSystems/jellyfish", tag = "0.4.5" } snafu = "0.8" strum = { version = "0.26", features = ["derive"] } -surf-disco = "0.6" +surf-disco = "0.7" tagged-base64 = "0.4" -tide-disco = "0.6" +tide-disco = "0.7" time = "0.3" tracing = "0.1" bytesize = "1.3" diff --git a/builder/src/permissioned.rs b/builder/src/permissioned.rs index 1add88b1d4..21459ac1e6 100644 --- a/builder/src/permissioned.rs +++ b/builder/src/permissioned.rs @@ -108,7 +108,7 @@ pub struct BuilderContext< Ver: StaticVersionType + 'static, > { /// The consensus handle - pub hotshot_handle: Consensus, + pub hotshot_handle: Arc>, /// Index of this sequencer node pub node_index: u64, @@ -283,7 +283,7 @@ pub async fn init_node>, + handle: Arc>>>, } impl @@ -72,7 +71,7 @@ impl impl Stream> + Unpin { let state = self.clone(); - async move { state.consensus().await.event_stream() } + async move { state.consensus().await.read().await.event_stream() } .boxed() .flatten_stream() } @@ -112,8 +111,8 @@ impl &SystemContextHandle> { - &self.consensus.as_ref().get().await.get_ref().handle + async fn consensus(&self) -> Arc>>> { + Arc::clone(&self.consensus.as_ref().get().await.get_ref().handle) } async fn node_state(&self) -> &NodeState { @@ -127,6 +126,8 @@ impl for ApiState { async fn submit(&self, tx: Transaction) -> anyhow::Result<()> { - self.consensus().await.submit_transaction(tx).await?; + self.consensus() + .await + .read() + .await + .submit_transaction(tx) + .await?; Ok(()) } } @@ -223,9 +229,16 @@ impl anyhow::Result { - let state = self.consensus().await.state(view).await.context(format!( - "state not available for height {height}, view {view:?}" - ))?; + let state = self + .consensus() + .await + .read() + .await + .state(view) + .await + .context(format!( + "state not available for height {height}, view {view:?}" + ))?; let (proof, balance) = FeeAccountProof::prove(&state.fee_merkle_tree, account).context( format!("account {account} not available for height {height}, view {view:?}"), )?; @@ -234,36 +247,20 @@ impl anyhow::Result { - let state = self.consensus().await.state(view).await.context(format!( - "state not available for height {height}, view {view:?}" - ))?; + let state = self + .consensus() + .await + .read() + .await + .state(view) + .await + .context(format!( + "state not available for height {height}, view {view:?}" + ))?; let tree = &state.block_merkle_tree; let frontier = tree.lookup(tree.num_leaves() - 1).expect_ok()?.1; Ok(frontier) } - - #[tracing::instrument(skip(self))] - async fn get_chain_config( - &self, - commitment: Commitment, - ) -> anyhow::Result { - let node_state = self.node_state().await; - let node_state_cf = node_state.chain_config; - if node_state_cf.commit() == commitment { - return Ok(node_state_cf); - } - - let state = self.consensus().await.decided_state().await; - let state_cf = state.chain_config; - - if state_cf.commit() != commitment { - bail!("chain config for commitment={commitment} not found in decided state"); - } - - state_cf.resolve().context(format!( - "cannot resolve to a full chain config for commitment={commitment}" - )) - } } impl @@ -403,7 +400,7 @@ pub mod test_helpers { // Hook the builder up to the event stream from the first node if let Some(builder_task) = builder_task { - builder_task.start(Box::new(handle_0.event_stream())); + builder_task.start(Box::new(handle_0.event_stream().await)); } for ctx in &nodes { @@ -437,9 +434,15 @@ pub mod test_helpers { } pub async fn stop_consensus(&mut self) { - self.server.consensus_mut().shut_down().await; + let consensus = self.server.consensus(); + let mut consensus_writer = consensus.write().await; + consensus_writer.shut_down().await; + drop(consensus_writer); + for ctx in &mut self.peers { - ctx.consensus_mut().shut_down().await; + let consensus = ctx.consensus(); + let mut consensus_writer = consensus.write().await; + consensus_writer.shut_down().await; } } } @@ -513,7 +516,7 @@ pub mod test_helpers { let l1 = anvil.endpoint().parse().unwrap(); let network = TestNetwork::new(options, [no_storage::Options; TestConfig::NUM_NODES], l1).await; - let mut events = network.server.event_stream(); + let mut events = network.server.event_stream().await; client.connect(None).await; @@ -550,7 +553,14 @@ pub mod test_helpers { // Wait for block >=2 appears // It's waiting for an extra second to make sure that the signature is generated loop { - height = network.server.consensus().decided_leaf().await.height(); + height = network + .server + .consensus() + .read() + .await + .decided_leaf() + .await + .height(); sleep(std::time::Duration::from_secs(1)).await; if height >= 2 { break; @@ -582,12 +592,12 @@ pub mod test_helpers { let options = opt(Options::from(options::Http { port }).catchup(Default::default())); let anvil = Anvil::new().spawn(); let l1 = anvil.endpoint().parse().unwrap(); - let mut network = + let network = TestNetwork::new(options, [no_storage::Options; TestConfig::NUM_NODES], l1).await; client.connect(None).await; // Wait for a few blocks to be decided. - let mut events = network.server.event_stream(); + let mut events = network.server.event_stream().await; loop { if let Event { event: EventType::Decide { leaf_chain, .. }, @@ -604,10 +614,19 @@ pub mod test_helpers { } // Stop consensus running on the node so we freeze the decided and undecided states. - network.server.consensus_mut().shut_down().await; + // We'll let it go out of scope here since it's a write lock. + { + let consensus = network.server.consensus(); + let mut consensus_writer = consensus.write().await; + consensus_writer.shut_down().await; + } + + // Re-acquire a read lock to the consensus state. + let consensus = network.server.consensus(); + let consensus_reader = consensus.read().await; // Undecided fee state: absent account. - let leaf = network.server.consensus().decided_leaf().await; + let leaf = consensus_reader.decided_leaf().await; let height = leaf.height() + 1; let view = leaf.view_number() + 1; let res = client @@ -626,6 +645,8 @@ pub mod test_helpers { &network .server .consensus() + .read() + .await .state(view) .await .unwrap() @@ -645,6 +666,8 @@ pub mod test_helpers { let root = &network .server .consensus() + .read() + .await .state(view) .await .unwrap() @@ -855,7 +878,6 @@ mod test { use super::*; use crate::{ catchup::{mock::MockStateCatchup, StatePeers}, - chain_config::ResolvableChainConfig, persistence::no_storage, state::{FeeAccount, FeeAmount, ValidatedState}, testing::TestConfig, @@ -1090,57 +1112,6 @@ mod test { } } - #[async_std::test] - async fn test_validated_state_chain_config() { - setup_logging(); - setup_backtrace(); - - // ValidatedState only has the default chain config commitment. - // NodeState also has the default ChainConfig. - // Therefore, both commitments would match. - // This would update the ValidatedState's chain config to NodeState's ChainConfig. - let state = ValidatedState { - chain_config: ChainConfig::default().commit().into(), - ..Default::default() - }; - - // Start a sequencer network without catchup module - let port = pick_unused_port().expect("No ports free"); - let mut network = TestNetwork::with_state( - Options::from(options::Http { port }), - std::array::from_fn(|_| state.clone()), - [no_storage::Options; TestConfig::NUM_NODES], - std::array::from_fn(|_| MockStateCatchup::default()), - ) - .await; - - network - .server - .event_stream() - .filter(|event| future::ready(matches!(event.event, EventType::Decide { .. }))) - .take(4) - .collect::>() - .await; - - let decided_state = network.server.consensus().decided_state().await; - assert_eq!( - decided_state.chain_config, - ResolvableChainConfig::from(ChainConfig::default()) - ); - - for peer in &network.peers { - let state = peer.consensus().decided_state().await; - assert_eq!( - state.chain_config, - ResolvableChainConfig::from(ChainConfig::default()) - ); - } - - network.stop_consensus().await; - - drop(network); - } - #[async_std::test] pub(crate) async fn test_restart() { setup_logging(); diff --git a/sequencer/src/catchup.rs b/sequencer/src/catchup.rs index 189bf101be..50f3ce1e2f 100644 --- a/sequencer/src/catchup.rs +++ b/sequencer/src/catchup.rs @@ -153,20 +153,23 @@ pub trait StateCatchup: Send + Sync + std::fmt::Debug { &self, commitment: Commitment, ) -> anyhow::Result { + // Retry until we succeed. + let mut delay = MIN_RETRY_DELAY; + loop { match self.try_fetch_chain_config(commitment).await { Ok(cf) => return Ok(cf), Err(err) => { - tracing::warn!("Could not fetch chain config from any peer, retrying: {err:#}"); - async_std::task::sleep(self.retry_interval()).await; + tracing::warn!( + ?delay, + "Could not fetch chain config from any peer, retrying: {err:#}" + ); + sleep(delay).await; + delay = backoff(delay); } } } } - - fn retry_interval(&self) -> Duration { - Duration::from_millis(100) - } } /// A catchup implementation that falls back to a remote provider, but prefers a local provider when @@ -289,10 +292,6 @@ impl StateCatchup for StatePeers { } bail!("Could not fetch chain config from any peer"); } - - fn retry_interval(&self) -> Duration { - self.interval - } } #[derive(Debug, From)] diff --git a/sequencer/src/context.rs b/sequencer/src/context.rs index b0fbefc7b8..781f0b15ce 100644 --- a/sequencer/src/context.rs +++ b/sequencer/src/context.rs @@ -41,7 +41,7 @@ pub struct SequencerContext< > { /// The consensus handle #[derivative(Debug = "ignore")] - handle: Consensus, + handle: Arc>>, /// Context for generating state signatures. state_signer: Arc>, @@ -162,7 +162,7 @@ impl impl Stream> { - self.handle.event_stream() + pub async fn event_stream(&self) -> impl Stream> { + self.handle.read().await.event_stream() } pub async fn submit_transaction(&self, tx: Transaction) -> anyhow::Result<()> { - self.handle.submit_transaction(tx).await?; + self.handle.read().await.submit_transaction(tx).await?; Ok(()) } @@ -216,19 +216,14 @@ impl &Consensus { - &self.handle + pub fn consensus(&self) -> Arc>> { + Arc::clone(&self.handle) } pub fn node_state(&self) -> NodeState { self.node_state.clone() } - /// Return a mutable reference to the underlying consensus handle. - pub fn consensus_mut(&mut self) -> &mut Consensus { - &mut self.handle - } - /// Start participating in consensus. pub async fn start_consensus(&self) { if let Some(orchestrator_client) = &self.wait_for_orchestrator { @@ -238,7 +233,7 @@ impl Date: Fri, 31 May 2024 00:50:05 +0500 Subject: [PATCH 7/9] pass simple builder config --- builder/src/non_permissioned.rs | 5 +++-- builder/src/permissioned.rs | 10 +++++----- sequencer/src/api.rs | 2 +- sequencer/src/lib.rs | 11 +++++++---- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/builder/src/non_permissioned.rs b/builder/src/non_permissioned.rs index d2269553a4..2cfabe6cb8 100644 --- a/builder/src/non_permissioned.rs +++ b/builder/src/non_permissioned.rs @@ -162,9 +162,10 @@ impl BuilderConfig { .as_u64() .context("the base fee exceeds the maximum amount that a builder can pay (defined by u64::MAX)")?, Arc::new(instance_state), + //???? + Duration::from_secs(60), Arc::new(validated_state), - //???? - Duration::from_secs(60), + ); // spawn the builder event loop diff --git a/builder/src/permissioned.rs b/builder/src/permissioned.rs index 21459ac1e6..ef2781e5da 100644 --- a/builder/src/permissioned.rs +++ b/builder/src/permissioned.rs @@ -381,7 +381,7 @@ impl, + hotshot_handle: Arc>, state_signer: StateSigner, node_index: u64, eth_key_pair: EthKeyPair, @@ -457,10 +457,10 @@ impl Self { let mut cfg = TestConfig::default_with_l1(l1); - let (builder_task, builder_url) = run_test_builder().await; + let (builder_task, builder_url) = run_test_builder(None).await; cfg.set_builder_url(builder_url); diff --git a/sequencer/src/lib.rs b/sequencer/src/lib.rs index e9cc116959..0c85ae3ab4 100644 --- a/sequencer/src/lib.rs +++ b/sequencer/src/lib.rs @@ -514,6 +514,7 @@ pub mod testing { }; use hotshot::types::{EventType::Decide, Message}; use hotshot_stake_table::vec_based::StakeTable; + use hotshot_testing::block_builder::SimpleBuilderConfig; use hotshot_testing::block_builder::{ BuilderTask, SimpleBuilderImplementation, TestBuilderImplementation, }; @@ -528,10 +529,12 @@ pub mod testing { const STAKE_TABLE_CAPACITY_FOR_TEST: u64 = 10; - pub async fn run_test_builder() -> (Option>>, Url) { + pub async fn run_test_builder( + _port: Option, + ) -> (Option>>, Url) { >::start( TestConfig::NUM_NODES, - (), + SimpleBuilderConfig::default(), ) .await } @@ -806,7 +809,7 @@ mod test { let url = anvil.url(); let mut config = TestConfig::default_with_l1(url); - let (builder_task, builder_url) = run_test_builder().await; + let (builder_task, builder_url) = run_test_builder(None).await; config.set_builder_url(builder_url); @@ -848,7 +851,7 @@ mod test { let url = anvil.url(); let mut config = TestConfig::default_with_l1(url); - let (builder_task, builder_url) = run_test_builder().await; + let (builder_task, builder_url) = run_test_builder(None).await; config.set_builder_url(builder_url); let handles = config.init_nodes(ver).await; From 8f5df887ef6a941b7ea8ee64abba9b7168b8e4c1 Mon Sep 17 00:00:00 2001 From: Abdul Basit Date: Fri, 31 May 2024 01:38:20 +0500 Subject: [PATCH 8/9] make clippy happy --- builder/src/non_permissioned.rs | 1 - builder/src/permissioned.rs | 1 - 2 files changed, 2 deletions(-) diff --git a/builder/src/non_permissioned.rs b/builder/src/non_permissioned.rs index 2cfabe6cb8..56f143d5e9 100644 --- a/builder/src/non_permissioned.rs +++ b/builder/src/non_permissioned.rs @@ -165,7 +165,6 @@ impl BuilderConfig { //???? Duration::from_secs(60), Arc::new(validated_state), - ); // spawn the builder event loop diff --git a/builder/src/permissioned.rs b/builder/src/permissioned.rs index ef2781e5da..9bbc448539 100644 --- a/builder/src/permissioned.rs +++ b/builder/src/permissioned.rs @@ -460,7 +460,6 @@ impl Date: Fri, 31 May 2024 02:01:40 +0500 Subject: [PATCH 9/9] update lockfile to point to specific hotshot commit --- Cargo.lock | 22 +++++++++++----------- sequencer/src/lib.rs | 3 +-- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fe67f522ae..dc452f6df1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4027,7 +4027,7 @@ dependencies = [ [[package]] name = "hotshot" version = "0.5.43" -source = "git+https://github.com/EspressoSystems/hotshot?branch=main#95dc95f6ecd5bb2085c0b3588b70d08fe2397fae" +source = "git+https://github.com/EspressoSystems/hotshot?branch=main#74ee1daf26e5df8883a4dd6d77881886e087bf31" dependencies = [ "anyhow", "async-broadcast", @@ -4072,7 +4072,7 @@ dependencies = [ [[package]] name = "hotshot-builder-api" version = "0.1.7" -source = "git+https://github.com/EspressoSystems/hotshot?branch=main#95dc95f6ecd5bb2085c0b3588b70d08fe2397fae" +source = "git+https://github.com/EspressoSystems/hotshot?branch=main#74ee1daf26e5df8883a4dd6d77881886e087bf31" dependencies = [ "async-trait", "clap", @@ -4169,7 +4169,7 @@ dependencies = [ [[package]] name = "hotshot-example-types" version = "0.5.43" -source = "git+https://github.com/EspressoSystems/hotshot?branch=main#95dc95f6ecd5bb2085c0b3588b70d08fe2397fae" +source = "git+https://github.com/EspressoSystems/hotshot?branch=main#74ee1daf26e5df8883a4dd6d77881886e087bf31" dependencies = [ "anyhow", "async-broadcast", @@ -4200,7 +4200,7 @@ dependencies = [ [[package]] name = "hotshot-macros" version = "0.5.43" -source = "git+https://github.com/EspressoSystems/hotshot?branch=main#95dc95f6ecd5bb2085c0b3588b70d08fe2397fae" +source = "git+https://github.com/EspressoSystems/hotshot?branch=main#74ee1daf26e5df8883a4dd6d77881886e087bf31" dependencies = [ "derive_builder", "proc-macro2", @@ -4211,7 +4211,7 @@ dependencies = [ [[package]] name = "hotshot-orchestrator" version = "0.5.43" -source = "git+https://github.com/EspressoSystems/hotshot?branch=main#95dc95f6ecd5bb2085c0b3588b70d08fe2397fae" +source = "git+https://github.com/EspressoSystems/hotshot?branch=main#74ee1daf26e5df8883a4dd6d77881886e087bf31" dependencies = [ "anyhow", "async-compatibility-layer", @@ -4294,7 +4294,7 @@ dependencies = [ [[package]] name = "hotshot-stake-table" version = "0.5.43" -source = "git+https://github.com/EspressoSystems/hotshot?branch=main#95dc95f6ecd5bb2085c0b3588b70d08fe2397fae" +source = "git+https://github.com/EspressoSystems/hotshot?branch=main#74ee1daf26e5df8883a4dd6d77881886e087bf31" dependencies = [ "ark-bn254", "ark-ed-on-bn254", @@ -4365,7 +4365,7 @@ dependencies = [ [[package]] name = "hotshot-task" version = "0.5.43" -source = "git+https://github.com/EspressoSystems/hotshot?branch=main#95dc95f6ecd5bb2085c0b3588b70d08fe2397fae" +source = "git+https://github.com/EspressoSystems/hotshot?branch=main#74ee1daf26e5df8883a4dd6d77881886e087bf31" dependencies = [ "anyhow", "async-broadcast", @@ -4380,7 +4380,7 @@ dependencies = [ [[package]] name = "hotshot-task-impls" version = "0.5.43" -source = "git+https://github.com/EspressoSystems/hotshot?branch=main#95dc95f6ecd5bb2085c0b3588b70d08fe2397fae" +source = "git+https://github.com/EspressoSystems/hotshot?branch=main#74ee1daf26e5df8883a4dd6d77881886e087bf31" dependencies = [ "anyhow", "async-broadcast", @@ -4415,7 +4415,7 @@ dependencies = [ [[package]] name = "hotshot-testing" version = "0.5.43" -source = "git+https://github.com/EspressoSystems/hotshot?branch=main#95dc95f6ecd5bb2085c0b3588b70d08fe2397fae" +source = "git+https://github.com/EspressoSystems/hotshot?branch=main#74ee1daf26e5df8883a4dd6d77881886e087bf31" dependencies = [ "anyhow", "async-broadcast", @@ -4456,7 +4456,7 @@ dependencies = [ [[package]] name = "hotshot-types" version = "0.1.11" -source = "git+https://github.com/EspressoSystems/hotshot?branch=main#95dc95f6ecd5bb2085c0b3588b70d08fe2397fae" +source = "git+https://github.com/EspressoSystems/hotshot?branch=main#74ee1daf26e5df8883a4dd6d77881886e087bf31" dependencies = [ "anyhow", "ark-bls12-381", @@ -5719,7 +5719,7 @@ dependencies = [ [[package]] name = "libp2p-networking" version = "0.5.43" -source = "git+https://github.com/EspressoSystems/hotshot?branch=main#95dc95f6ecd5bb2085c0b3588b70d08fe2397fae" +source = "git+https://github.com/EspressoSystems/hotshot?branch=main#74ee1daf26e5df8883a4dd6d77881886e087bf31" dependencies = [ "anyhow", "async-compatibility-layer", diff --git a/sequencer/src/lib.rs b/sequencer/src/lib.rs index 0c85ae3ab4..087c24b023 100644 --- a/sequencer/src/lib.rs +++ b/sequencer/src/lib.rs @@ -514,7 +514,6 @@ pub mod testing { }; use hotshot::types::{EventType::Decide, Message}; use hotshot_stake_table::vec_based::StakeTable; - use hotshot_testing::block_builder::SimpleBuilderConfig; use hotshot_testing::block_builder::{ BuilderTask, SimpleBuilderImplementation, TestBuilderImplementation, }; @@ -534,7 +533,7 @@ pub mod testing { ) -> (Option>>, Url) { >::start( TestConfig::NUM_NODES, - SimpleBuilderConfig::default(), + (), ) .await }